code stringlengths 4 1.01M | language stringclasses 2 values |
|---|---|
<?php
$hostname = "localhost";
$user = "root";
$password = "admin";
$database = "employees";
mysql_connect($hostname, $user, $password);
mysql_set_charset('utf8');
@mysql_select_db($database) or die( "Unable to select database");
mysql_query("SET NAMES 'utf8'");
$mysqli = new mysqli($hostname, $user, $password, $database);
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: " . $mysqli->connect_error;
exit;
}
if (!$mysqli->set_charset("utf8")) {
printf("Error loading character set utf8: %s\n", $mysqli->error);
exit;
} | Java |
---
title: The Little Eye Blog
# View.
# 1 = List
# 2 = Compact
# 3 = Card
view: 3
aliases: ["/the-little-eye/"]
# Optional header image (relative to `static/img/` folder).
header:
caption: ""
image: ""
---
### A Point of View on Microscopy Research, the History of the Microscope and a hint of Interdisciplinary Academia
My aim with this blog is to share with others some of my interests, mainly in microscopy and bioimaging. You can expect to see a few different styles of posts as detailed in [Welcome to The Little Eye]({{< relref "20170619_intro" >}}).
### Why “The Little Eye”?
I’ve taken the name The Little Eye from Galileo Galilei who coined his early compound microscopes: "Occhiolino", Italian for "little eye". The term "microscope" was coined by Giovanni Faber, a contempory of Galileo, and comes from the Greek words for "small" and "to look at", intended to be analogous to "telescope" (see [Welcome to The Little Eye]({{< relref "20170619_intro" >}})).
| Java |
.root {
display: inline-block;
position: relative;
z-index: 1;
cursor: var(--cursor-pointer);
height: var(--navbar-height);
line-height: var(--navbar-height);
border: none;
padding: var(--navbar-dropdown-padding);
font-size: var(--font-size-large);
}
.root:not(:last-child) {
margin-right: var(--navbar-item-space);
}
.root::after {
position: absolute;
icon-font: url('../../i-icon.vue/assets/arrow-down.svg');
font-size: var(--navbar-dropdown-popper-font-size);
right: 10px;
top: 0;
line-height: var(--navbar-height);
}
.popper {
background: white;
font-size: var(--navbar-dropdown-popper-font-size);
width: 100%;
line-height: var(--navbar-dropdown-popper-line-height);
}
.root[disabled] {
cursor: var(--cursor-not-allowed);
color: var(--navbar-dropdown-color-disabled);
}
| Java |
/**
* Get a number suffix
* e.g. 1 -> st
* @param {int} i number to get suffix
* @return suffix
*/
var getSuffix = function (i) {
var j = i % 10,
k = i % 100;
if (j == 1 && k != 11) {
return i + "st";
}
if (j == 2 && k != 12) {
return i + "nd";
}
if (j == 3 && k != 13) {
return i + "rd";
}
return i + "th";
}
module.exports = {
getSuffix: getSuffix,
};
| Java |
# Minitest::Mock::Easily
use MiniTest::Mock with easier API
## Installation
Add this line to your application's Gemfile:
gem 'minitest-mock-easily'
And then execute:
$ bundle
Or install it yourself as:
$ gem install minitest-mock-easily
## Usage
```
include MockEasily
m = mock do
expect :hello, 'hello'
expect :world, 'world'
end
assert_equal 'hello', m.hello
assert_equal 'world', m.world
```
## Contributing
1. Fork it ( http://github.com/<my-github-username>/minitest-mock-easily/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
| Java |
---
redirect_to:
- http://tech.hbc.com/2013-10-04-welcome-jonathan-leibiusky.html
layout:: post
title: Welcome Jonathan Leibiusky!
date: '2013-10-04T15:24:00-04:00'
tags:
- Jonathan Leibiusky
- Infrastructure Engineering
- people
- gilt tech
- nyc
- immutable deployment
- xetorthio
tumblr_url: http://tech.gilt.com/post/63102481375/welcome-jonathan-leibiusky
---
<p><img alt="image" height="597" src="http://media.tumblr.com/14b68c54234532e9417fbcc363475bea/tumblr_inline_mu5s8oA9b61s17bu5.jpg" width="800"/></p>
<p>We’re excited to have Jonathan Leibiusky join Gilt’s Infrastructure Engineering team! Jon will work from NYC and help us to drive <a href="http://tech.gilt.com/2013/06/07/virtualization-at-gilt-a-lightning-talk-for-nyc-devops" target="_blank">Galactica</a> forward and realize <a href="http://tech.gilt.com/2013/08/09/meet-a-gilt-technologist-roland-tritsch-vp" target="_blank">our vision of an immutable deployment infrastructure</a>.</p>
<p>More about Jon:</p>
<ul><li>He’s originally from Argentina, but spent some of his childhood in Israel</li>
<li>Previous job: Head of Research & Development for <a href="http://www.mercadolibre.com/" target="_blank">MercadoLibre</a></li>
<li>He’s a fan of Node.js and Go</li>
<li>Preferred IDE: vim</li>
<li>Preferred OS: Ubuntu + xfce</li>
<li>Plays some ukelele (and guitar)</li>
<li><a href="https://twitter.com/xetorthio" target="_blank">Twitter</a> & <a href="https://github.com/xetorthio" target="_blank">GitHub</a> nickname: xetorthio</li>
</ul>
| Java |
namespace CSharpGL
{
partial class FormPropertyGrid
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.SuspendLayout();
//
// propertyGrid1
//
this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.propertyGrid1.Font = new System.Drawing.Font("宋体", 12F);
this.propertyGrid1.Location = new System.Drawing.Point(0, 0);
this.propertyGrid1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.Size = new System.Drawing.Size(534, 545);
this.propertyGrid1.TabIndex = 0;
//
// FormProperyGrid
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(534, 545);
this.Controls.Add(this.propertyGrid1);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "FormProperyGrid";
this.Text = "FormPropertyGrid";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PropertyGrid propertyGrid1;
}
} | Java |
package net.pinemz.hm.gui;
import net.pinemz.hm.R;
import net.pinemz.hm.api.HmApi;
import net.pinemz.hm.api.Prefecture;
import net.pinemz.hm.api.PrefectureCollection;
import net.pinemz.hm.storage.CommonSettings;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.google.common.base.Optional;
public class SettingsActivity
extends BasicActivity
{
public static final String TAG = "SettingsActivity";
private RequestQueue requestQueue;
private HmApi hmApi;
private PrefectureCollection prefectures;
private CommonSettings settings;
private ListView listViewPrefectures;
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate");
super.onCreate(savedInstanceState);
this.setContentView(R.layout.activity_settings);
this.requestQueue = Volley.newRequestQueue(this.getApplicationContext());
this.hmApi = new HmApi(this.getApplicationContext(), this.requestQueue);
this.listViewPrefectures = (ListView)this.findViewById(R.id.listViewPrefectures);
assert this.listViewPrefectures != null;
// ÝèNXðõ
this.settings = new CommonSettings(this.getApplicationContext());
}
@Override
protected void onResume() {
Log.d(TAG, "onResume");
super.onResume();
// s¹{§ðÇÝÞ
this.loadPrefectures();
}
@Override
protected void onPause() {
Log.d(TAG, "onPause");
super.onPause();
}
@Override
protected void onDestroy() {
Log.d(TAG, "onDestroy");
super.onDestroy();
this.requestQueue = null;
this.hmApi = null;
// ÝèNXððú
this.settings = null;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
Log.d(TAG, "onCreateOptionsMenu");
super.onCreateOptionsMenu(menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Log.d(TAG, "onOptionsItemSelected");
return super.onOptionsItemSelected(item);
}
public void okButtonClicked(View view) {
Log.d(TAG, "okButtonClicked");
assert view instanceof Button;
// »ÝIð³êÄ¢éÚðæ¾
int checkedPosition = this.listViewPrefectures.getCheckedItemPosition();
Log.v(TAG, "onButtonClicked>getCheckedItemPosition = " + checkedPosition);
if (checkedPosition == ListView.INVALID_POSITION) { return; }
// Ið³êÄ¢és¹{§¼ðæ¾
String checkedPrefectureName =
(String)this.listViewPrefectures.getItemAtPosition(checkedPosition);
assert checkedPrefectureName != null;
// s¹{§Ìf[^ðæ¾
Optional<Prefecture> prefecture =
this.prefectures.getByName(checkedPrefectureName);
// f[^ª³íɶݷéê
if (prefecture.isPresent()) {
Log.i(TAG, "Prefecture.id = " + prefecture.get().getId());
Log.i(TAG, "Prefecture.name = " + prefecture.get().getName());
this.saveSettings(prefecture.get());
}
}
public void cancelButtonClicked(View view) {
Log.d(TAG, "cancelButtonClicked");
assert view instanceof Button;
this.cancelSettings();
}
private void setPrefectures(PrefectureCollection prefectures) {
Log.d(TAG, "setPrefectures");
this.prefectures = prefectures;
assert prefectures != null;
ArrayAdapter<String> adapter = new ArrayAdapter<>(
this.getApplicationContext(),
android.R.layout.simple_list_item_single_choice,
prefectures.getNames()
);
this.listViewPrefectures.setAdapter(adapter);
this.listViewPrefectures.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
// æªðúóÔÅIð
if (adapter.getCount() > 0) {
int prefectureId = this.settings.loadPrefectureId();
// f[^ªÛ¶³êÄÈ¢êÍAÅÌs¹{§ðIð
if (prefectureId < 0) {
prefectureId = prefectures.getIds()[0];
}
// s¹{§ ID Ìêðæ¾
Integer[] ids = prefectures.getIds();
// êvµ½êAIð
for (int i = 0; i < ids.length; ++i) {
if (ids[i] == prefectureId) {
this.listViewPrefectures.setItemChecked(i, true);
break;
}
}
}
}
/**
* ÝèðÛ¶·é
* @param prefecture Û¶·és¹{§
*/
private void saveSettings(Prefecture prefecture) {
Log.d(TAG, "saveSettings");
assert prefecture != null;
// lðÛ¶
this.settings.savePrefectureId(prefecture.getId());
// bZ[Wð\¦
Toast.makeText(
this.getApplicationContext(),
R.string.setting_save_toast,
Toast.LENGTH_SHORT
).show();
this.finish();
}
/**
* ÝèÌÛ¶ðLZ·é
*/
private void cancelSettings() {
Toast.makeText(
this.getApplicationContext(),
R.string.setting_cancel_toast,
Toast.LENGTH_SHORT
).show();
this.finish();
}
private void loadPrefectures() {
// [fBObZ[Wð\¦
this.showProgressDialog(R.string.loading_msg_prefectures);
// f[^ðÇÝÞ
this.hmApi.getPrefectures(new HmApi.Listener<PrefectureCollection>() {
@Override
public void onSuccess(HmApi api, PrefectureCollection data) {
Log.d(TAG, "HmApi.Listener#onSuccess");
SettingsActivity.this.closeDialog();
SettingsActivity.this.setPrefectures(data);
}
@Override
public void onFailure() {
Log.e(TAG, "HmApi.Listener#onFailure");
SettingsActivity.this.showFinishAlertDialog(
R.string.network_failed_title,
R.string.network_failed_msg_prefectures
);
}
@Override
public void onException(Exception exception) {
Log.e(TAG, "HmApi.Listener#onException", exception);
SettingsActivity.this.showFinishAlertDialog(
R.string.network_error_title,
R.string.network_error_msg_prefectures
);
}
});
}
}
| Java |
'use strict';
const chai = require('chai'),
expect = chai.expect,
config = require('../config/config'),
Support = require('./support'),
dialect = Support.getTestDialect(),
Sequelize = Support.Sequelize,
fs = require('fs'),
path = require('path');
if (dialect === 'sqlite') {
var sqlite3 = require('sqlite3'); // eslint-disable-line
}
describe(Support.getTestDialectTeaser('Configuration'), () => {
describe('Connections problems should fail with a nice message', () => {
it('when we don\'t have the correct server details', () => {
const seq = new Sequelize(config[dialect].database, config[dialect].username, config[dialect].password, { storage: '/path/to/no/where/land', logging: false, host: '0.0.0.1', port: config[dialect].port, dialect });
if (dialect === 'sqlite') {
// SQLite doesn't have a breakdown of error codes, so we are unable to discern between the different types of errors.
return expect(seq.query('select 1 as hello')).to.eventually.be.rejectedWith(Sequelize.ConnectionError, 'SQLITE_CANTOPEN: unable to open database file');
}
return expect(seq.query('select 1 as hello')).to.eventually.be.rejectedWith([Sequelize.HostNotReachableError, Sequelize.InvalidConnectionError]);
});
it('when we don\'t have the correct login information', () => {
if (dialect === 'mssql') {
// NOTE: Travis seems to be having trouble with this test against the
// AWS instance. Works perfectly fine on a local setup.
expect(true).to.be.true;
return;
}
const seq = new Sequelize(config[dialect].database, config[dialect].username, 'fakepass123', { logging: false, host: config[dialect].host, port: 1, dialect });
if (dialect === 'sqlite') {
// SQLite doesn't require authentication and `select 1 as hello` is a valid query, so this should be fulfilled not rejected for it.
return expect(seq.query('select 1 as hello')).to.eventually.be.fulfilled;
}
return expect(seq.query('select 1 as hello')).to.eventually.be.rejectedWith(Sequelize.ConnectionRefusedError, 'connect ECONNREFUSED');
});
it('when we don\'t have a valid dialect.', () => {
expect(() => {
new Sequelize(config[dialect].database, config[dialect].username, config[dialect].password, { host: '0.0.0.1', port: config[dialect].port, dialect: 'some-fancy-dialect' });
}).to.throw(Error, 'The dialect some-fancy-dialect is not supported. Supported dialects: mssql, mariadb, mysql, postgres, and sqlite.');
});
});
describe('Instantiation with arguments', () => {
if (dialect === 'sqlite') {
it('should respect READONLY / READWRITE connection modes', () => {
const p = path.join(__dirname, '../tmp', 'foo.sqlite');
const createTableFoo = 'CREATE TABLE foo (faz TEXT);';
const createTableBar = 'CREATE TABLE bar (baz TEXT);';
const testAccess = Sequelize.Promise.method(() => {
return Sequelize.Promise.promisify(fs.access)(p, fs.R_OK | fs.W_OK);
});
return Sequelize.Promise.promisify(fs.unlink)(p)
.catch(err => {
expect(err.code).to.equal('ENOENT');
})
.then(() => {
const sequelizeReadOnly = new Sequelize('sqlite://foo', {
storage: p,
dialectOptions: {
mode: sqlite3.OPEN_READONLY
}
});
const sequelizeReadWrite = new Sequelize('sqlite://foo', {
storage: p,
dialectOptions: {
mode: sqlite3.OPEN_READWRITE
}
});
expect(sequelizeReadOnly.config.dialectOptions.mode).to.equal(sqlite3.OPEN_READONLY);
expect(sequelizeReadWrite.config.dialectOptions.mode).to.equal(sqlite3.OPEN_READWRITE);
return Sequelize.Promise.join(
sequelizeReadOnly.query(createTableFoo)
.should.be.rejectedWith(Error, 'SQLITE_CANTOPEN: unable to open database file'),
sequelizeReadWrite.query(createTableFoo)
.should.be.rejectedWith(Error, 'SQLITE_CANTOPEN: unable to open database file')
);
})
.then(() => {
// By default, sqlite creates a connection that's READWRITE | CREATE
const sequelize = new Sequelize('sqlite://foo', {
storage: p
});
return sequelize.query(createTableFoo);
})
.then(testAccess)
.then(() => {
const sequelizeReadOnly = new Sequelize('sqlite://foo', {
storage: p,
dialectOptions: {
mode: sqlite3.OPEN_READONLY
}
});
const sequelizeReadWrite = new Sequelize('sqlite://foo', {
storage: p,
dialectOptions: {
mode: sqlite3.OPEN_READWRITE
}
});
return Sequelize.Promise.join(
sequelizeReadOnly.query(createTableBar)
.should.be.rejectedWith(Error, 'SQLITE_READONLY: attempt to write a readonly database'),
sequelizeReadWrite.query(createTableBar)
);
})
.finally(() => {
return Sequelize.Promise.promisify(fs.unlink)(p);
});
});
}
});
});
| Java |
/*
* This file is part of Zinc, licensed under the MIT License (MIT).
*
* Copyright (c) 2015-2016, Jamie Mansfield <https://github.com/jamierocks>
*
* 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.
*/
package uk.jamierocks.zinc.example;
import com.google.common.collect.Lists;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.args.CommandArgs;
import org.spongepowered.api.text.Text;
import uk.jamierocks.zinc.Command;
import uk.jamierocks.zinc.TabComplete;
import java.util.List;
public class ExampleCommands {
@Command(name = "example")
public CommandResult exampleCommand(CommandSource source, CommandArgs args) {
source.sendMessage(Text.of("This is the base command."));
return CommandResult.success();
}
@Command(parent = "example",
name = "sub")
public CommandResult exampleSubCommand(CommandSource source, CommandArgs args) {
source.sendMessage(Text.of("This is a sub command."));
return CommandResult.success();
}
@TabComplete(name = "example")
public List<String> tabComplete(CommandSource source, String args) {
return Lists.newArrayList();
}
}
| Java |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as strings from 'vs/base/common/strings';
import { Position } from 'vs/editor/common/core/position';
import { Range } from 'vs/editor/common/core/range';
import { ApplyEditsResult, EndOfLinePreference, FindMatch, IInternalModelContentChange, ISingleEditOperationIdentifier, ITextBuffer, ITextSnapshot, ValidAnnotatedEditOperation, IValidEditOperation } from 'vs/editor/common/model';
import { PieceTreeBase, StringBuffer } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase';
import { SearchData } from 'vs/editor/common/model/textModelSearch';
import { countEOL, StringEOL } from 'vs/editor/common/model/tokensStore';
import { TextChange } from 'vs/editor/common/model/textChange';
export interface IValidatedEditOperation {
sortIndex: number;
identifier: ISingleEditOperationIdentifier | null;
range: Range;
rangeOffset: number;
rangeLength: number;
text: string;
eolCount: number;
firstLineLength: number;
lastLineLength: number;
forceMoveMarkers: boolean;
isAutoWhitespaceEdit: boolean;
}
export interface IReverseSingleEditOperation extends IValidEditOperation {
sortIndex: number;
}
export class PieceTreeTextBuffer implements ITextBuffer {
private readonly _pieceTree: PieceTreeBase;
private readonly _BOM: string;
private _mightContainRTL: boolean;
private _mightContainNonBasicASCII: boolean;
constructor(chunks: StringBuffer[], BOM: string, eol: '\r\n' | '\n', containsRTL: boolean, isBasicASCII: boolean, eolNormalized: boolean) {
this._BOM = BOM;
this._mightContainNonBasicASCII = !isBasicASCII;
this._mightContainRTL = containsRTL;
this._pieceTree = new PieceTreeBase(chunks, eol, eolNormalized);
}
// #region TextBuffer
public equals(other: ITextBuffer): boolean {
if (!(other instanceof PieceTreeTextBuffer)) {
return false;
}
if (this._BOM !== other._BOM) {
return false;
}
if (this.getEOL() !== other.getEOL()) {
return false;
}
return this._pieceTree.equal(other._pieceTree);
}
public mightContainRTL(): boolean {
return this._mightContainRTL;
}
public mightContainNonBasicASCII(): boolean {
return this._mightContainNonBasicASCII;
}
public getBOM(): string {
return this._BOM;
}
public getEOL(): '\r\n' | '\n' {
return this._pieceTree.getEOL();
}
public createSnapshot(preserveBOM: boolean): ITextSnapshot {
return this._pieceTree.createSnapshot(preserveBOM ? this._BOM : '');
}
public getOffsetAt(lineNumber: number, column: number): number {
return this._pieceTree.getOffsetAt(lineNumber, column);
}
public getPositionAt(offset: number): Position {
return this._pieceTree.getPositionAt(offset);
}
public getRangeAt(start: number, length: number): Range {
let end = start + length;
const startPosition = this.getPositionAt(start);
const endPosition = this.getPositionAt(end);
return new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column);
}
public getValueInRange(range: Range, eol: EndOfLinePreference = EndOfLinePreference.TextDefined): string {
if (range.isEmpty()) {
return '';
}
const lineEnding = this._getEndOfLine(eol);
return this._pieceTree.getValueInRange(range, lineEnding);
}
public getValueLengthInRange(range: Range, eol: EndOfLinePreference = EndOfLinePreference.TextDefined): number {
if (range.isEmpty()) {
return 0;
}
if (range.startLineNumber === range.endLineNumber) {
return (range.endColumn - range.startColumn);
}
let startOffset = this.getOffsetAt(range.startLineNumber, range.startColumn);
let endOffset = this.getOffsetAt(range.endLineNumber, range.endColumn);
return endOffset - startOffset;
}
public getCharacterCountInRange(range: Range, eol: EndOfLinePreference = EndOfLinePreference.TextDefined): number {
if (this._mightContainNonBasicASCII) {
// we must count by iterating
let result = 0;
const fromLineNumber = range.startLineNumber;
const toLineNumber = range.endLineNumber;
for (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) {
const lineContent = this.getLineContent(lineNumber);
const fromOffset = (lineNumber === fromLineNumber ? range.startColumn - 1 : 0);
const toOffset = (lineNumber === toLineNumber ? range.endColumn - 1 : lineContent.length);
for (let offset = fromOffset; offset < toOffset; offset++) {
if (strings.isHighSurrogate(lineContent.charCodeAt(offset))) {
result = result + 1;
offset = offset + 1;
} else {
result = result + 1;
}
}
}
result += this._getEndOfLine(eol).length * (toLineNumber - fromLineNumber);
return result;
}
return this.getValueLengthInRange(range, eol);
}
public getLength(): number {
return this._pieceTree.getLength();
}
public getLineCount(): number {
return this._pieceTree.getLineCount();
}
public getLinesContent(): string[] {
return this._pieceTree.getLinesContent();
}
public getLineContent(lineNumber: number): string {
return this._pieceTree.getLineContent(lineNumber);
}
public getLineCharCode(lineNumber: number, index: number): number {
return this._pieceTree.getLineCharCode(lineNumber, index);
}
public getLineLength(lineNumber: number): number {
return this._pieceTree.getLineLength(lineNumber);
}
public getLineMinColumn(lineNumber: number): number {
return 1;
}
public getLineMaxColumn(lineNumber: number): number {
return this.getLineLength(lineNumber) + 1;
}
public getLineFirstNonWhitespaceColumn(lineNumber: number): number {
const result = strings.firstNonWhitespaceIndex(this.getLineContent(lineNumber));
if (result === -1) {
return 0;
}
return result + 1;
}
public getLineLastNonWhitespaceColumn(lineNumber: number): number {
const result = strings.lastNonWhitespaceIndex(this.getLineContent(lineNumber));
if (result === -1) {
return 0;
}
return result + 2;
}
private _getEndOfLine(eol: EndOfLinePreference): string {
switch (eol) {
case EndOfLinePreference.LF:
return '\n';
case EndOfLinePreference.CRLF:
return '\r\n';
case EndOfLinePreference.TextDefined:
return this.getEOL();
}
throw new Error('Unknown EOL preference');
}
public setEOL(newEOL: '\r\n' | '\n'): void {
this._pieceTree.setEOL(newEOL);
}
public applyEdits(rawOperations: ValidAnnotatedEditOperation[], recordTrimAutoWhitespace: boolean, computeUndoEdits: boolean): ApplyEditsResult {
let mightContainRTL = this._mightContainRTL;
let mightContainNonBasicASCII = this._mightContainNonBasicASCII;
let canReduceOperations = true;
let operations: IValidatedEditOperation[] = [];
for (let i = 0; i < rawOperations.length; i++) {
let op = rawOperations[i];
if (canReduceOperations && op._isTracked) {
canReduceOperations = false;
}
let validatedRange = op.range;
if (!mightContainRTL && op.text) {
// check if the new inserted text contains RTL
mightContainRTL = strings.containsRTL(op.text);
}
if (!mightContainNonBasicASCII && op.text) {
mightContainNonBasicASCII = !strings.isBasicASCII(op.text);
}
let validText = '';
let eolCount = 0;
let firstLineLength = 0;
let lastLineLength = 0;
if (op.text) {
let strEOL: StringEOL;
[eolCount, firstLineLength, lastLineLength, strEOL] = countEOL(op.text);
const bufferEOL = this.getEOL();
const expectedStrEOL = (bufferEOL === '\r\n' ? StringEOL.CRLF : StringEOL.LF);
if (strEOL === StringEOL.Unknown || strEOL === expectedStrEOL) {
validText = op.text;
} else {
validText = op.text.replace(/\r\n|\r|\n/g, bufferEOL);
}
}
operations[i] = {
sortIndex: i,
identifier: op.identifier || null,
range: validatedRange,
rangeOffset: this.getOffsetAt(validatedRange.startLineNumber, validatedRange.startColumn),
rangeLength: this.getValueLengthInRange(validatedRange),
text: validText,
eolCount: eolCount,
firstLineLength: firstLineLength,
lastLineLength: lastLineLength,
forceMoveMarkers: Boolean(op.forceMoveMarkers),
isAutoWhitespaceEdit: op.isAutoWhitespaceEdit || false
};
}
// Sort operations ascending
operations.sort(PieceTreeTextBuffer._sortOpsAscending);
let hasTouchingRanges = false;
for (let i = 0, count = operations.length - 1; i < count; i++) {
let rangeEnd = operations[i].range.getEndPosition();
let nextRangeStart = operations[i + 1].range.getStartPosition();
if (nextRangeStart.isBeforeOrEqual(rangeEnd)) {
if (nextRangeStart.isBefore(rangeEnd)) {
// overlapping ranges
throw new Error('Overlapping ranges are not allowed!');
}
hasTouchingRanges = true;
}
}
if (canReduceOperations) {
operations = this._reduceOperations(operations);
}
// Delta encode operations
let reverseRanges = (computeUndoEdits || recordTrimAutoWhitespace ? PieceTreeTextBuffer._getInverseEditRanges(operations) : []);
let newTrimAutoWhitespaceCandidates: { lineNumber: number, oldContent: string }[] = [];
if (recordTrimAutoWhitespace) {
for (let i = 0; i < operations.length; i++) {
let op = operations[i];
let reverseRange = reverseRanges[i];
if (op.isAutoWhitespaceEdit && op.range.isEmpty()) {
// Record already the future line numbers that might be auto whitespace removal candidates on next edit
for (let lineNumber = reverseRange.startLineNumber; lineNumber <= reverseRange.endLineNumber; lineNumber++) {
let currentLineContent = '';
if (lineNumber === reverseRange.startLineNumber) {
currentLineContent = this.getLineContent(op.range.startLineNumber);
if (strings.firstNonWhitespaceIndex(currentLineContent) !== -1) {
continue;
}
}
newTrimAutoWhitespaceCandidates.push({ lineNumber: lineNumber, oldContent: currentLineContent });
}
}
}
}
let reverseOperations: IReverseSingleEditOperation[] | null = null;
if (computeUndoEdits) {
let reverseRangeDeltaOffset = 0;
reverseOperations = [];
for (let i = 0; i < operations.length; i++) {
const op = operations[i];
const reverseRange = reverseRanges[i];
const bufferText = this.getValueInRange(op.range);
const reverseRangeOffset = op.rangeOffset + reverseRangeDeltaOffset;
reverseRangeDeltaOffset += (op.text.length - bufferText.length);
reverseOperations[i] = {
sortIndex: op.sortIndex,
identifier: op.identifier,
range: reverseRange,
text: bufferText,
textChange: new TextChange(op.rangeOffset, bufferText, reverseRangeOffset, op.text)
};
}
// Can only sort reverse operations when the order is not significant
if (!hasTouchingRanges) {
reverseOperations.sort((a, b) => a.sortIndex - b.sortIndex);
}
}
this._mightContainRTL = mightContainRTL;
this._mightContainNonBasicASCII = mightContainNonBasicASCII;
const contentChanges = this._doApplyEdits(operations);
let trimAutoWhitespaceLineNumbers: number[] | null = null;
if (recordTrimAutoWhitespace && newTrimAutoWhitespaceCandidates.length > 0) {
// sort line numbers auto whitespace removal candidates for next edit descending
newTrimAutoWhitespaceCandidates.sort((a, b) => b.lineNumber - a.lineNumber);
trimAutoWhitespaceLineNumbers = [];
for (let i = 0, len = newTrimAutoWhitespaceCandidates.length; i < len; i++) {
let lineNumber = newTrimAutoWhitespaceCandidates[i].lineNumber;
if (i > 0 && newTrimAutoWhitespaceCandidates[i - 1].lineNumber === lineNumber) {
// Do not have the same line number twice
continue;
}
let prevContent = newTrimAutoWhitespaceCandidates[i].oldContent;
let lineContent = this.getLineContent(lineNumber);
if (lineContent.length === 0 || lineContent === prevContent || strings.firstNonWhitespaceIndex(lineContent) !== -1) {
continue;
}
trimAutoWhitespaceLineNumbers.push(lineNumber);
}
}
return new ApplyEditsResult(
reverseOperations,
contentChanges,
trimAutoWhitespaceLineNumbers
);
}
/**
* Transform operations such that they represent the same logic edit,
* but that they also do not cause OOM crashes.
*/
private _reduceOperations(operations: IValidatedEditOperation[]): IValidatedEditOperation[] {
if (operations.length < 1000) {
// We know from empirical testing that a thousand edits work fine regardless of their shape.
return operations;
}
// At one point, due to how events are emitted and how each operation is handled,
// some operations can trigger a high amount of temporary string allocations,
// that will immediately get edited again.
// e.g. a formatter inserting ridiculous ammounts of \n on a model with a single line
// Therefore, the strategy is to collapse all the operations into a huge single edit operation
return [this._toSingleEditOperation(operations)];
}
_toSingleEditOperation(operations: IValidatedEditOperation[]): IValidatedEditOperation {
let forceMoveMarkers = false;
const firstEditRange = operations[0].range;
const lastEditRange = operations[operations.length - 1].range;
const entireEditRange = new Range(firstEditRange.startLineNumber, firstEditRange.startColumn, lastEditRange.endLineNumber, lastEditRange.endColumn);
let lastEndLineNumber = firstEditRange.startLineNumber;
let lastEndColumn = firstEditRange.startColumn;
const result: string[] = [];
for (let i = 0, len = operations.length; i < len; i++) {
const operation = operations[i];
const range = operation.range;
forceMoveMarkers = forceMoveMarkers || operation.forceMoveMarkers;
// (1) -- Push old text
result.push(this.getValueInRange(new Range(lastEndLineNumber, lastEndColumn, range.startLineNumber, range.startColumn)));
// (2) -- Push new text
if (operation.text.length > 0) {
result.push(operation.text);
}
lastEndLineNumber = range.endLineNumber;
lastEndColumn = range.endColumn;
}
const text = result.join('');
const [eolCount, firstLineLength, lastLineLength] = countEOL(text);
return {
sortIndex: 0,
identifier: operations[0].identifier,
range: entireEditRange,
rangeOffset: this.getOffsetAt(entireEditRange.startLineNumber, entireEditRange.startColumn),
rangeLength: this.getValueLengthInRange(entireEditRange, EndOfLinePreference.TextDefined),
text: text,
eolCount: eolCount,
firstLineLength: firstLineLength,
lastLineLength: lastLineLength,
forceMoveMarkers: forceMoveMarkers,
isAutoWhitespaceEdit: false
};
}
private _doApplyEdits(operations: IValidatedEditOperation[]): IInternalModelContentChange[] {
operations.sort(PieceTreeTextBuffer._sortOpsDescending);
let contentChanges: IInternalModelContentChange[] = [];
// operations are from bottom to top
for (let i = 0; i < operations.length; i++) {
let op = operations[i];
const startLineNumber = op.range.startLineNumber;
const startColumn = op.range.startColumn;
const endLineNumber = op.range.endLineNumber;
const endColumn = op.range.endColumn;
if (startLineNumber === endLineNumber && startColumn === endColumn && op.text.length === 0) {
// no-op
continue;
}
if (op.text) {
// replacement
this._pieceTree.delete(op.rangeOffset, op.rangeLength);
this._pieceTree.insert(op.rangeOffset, op.text, true);
} else {
// deletion
this._pieceTree.delete(op.rangeOffset, op.rangeLength);
}
const contentChangeRange = new Range(startLineNumber, startColumn, endLineNumber, endColumn);
contentChanges.push({
range: contentChangeRange,
rangeLength: op.rangeLength,
text: op.text,
rangeOffset: op.rangeOffset,
forceMoveMarkers: op.forceMoveMarkers
});
}
return contentChanges;
}
findMatchesLineByLine(searchRange: Range, searchData: SearchData, captureMatches: boolean, limitResultCount: number): FindMatch[] {
return this._pieceTree.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount);
}
// #endregion
// #region helper
// testing purpose.
public getPieceTree(): PieceTreeBase {
return this._pieceTree;
}
/**
* Assumes `operations` are validated and sorted ascending
*/
public static _getInverseEditRanges(operations: IValidatedEditOperation[]): Range[] {
let result: Range[] = [];
let prevOpEndLineNumber: number = 0;
let prevOpEndColumn: number = 0;
let prevOp: IValidatedEditOperation | null = null;
for (let i = 0, len = operations.length; i < len; i++) {
let op = operations[i];
let startLineNumber: number;
let startColumn: number;
if (prevOp) {
if (prevOp.range.endLineNumber === op.range.startLineNumber) {
startLineNumber = prevOpEndLineNumber;
startColumn = prevOpEndColumn + (op.range.startColumn - prevOp.range.endColumn);
} else {
startLineNumber = prevOpEndLineNumber + (op.range.startLineNumber - prevOp.range.endLineNumber);
startColumn = op.range.startColumn;
}
} else {
startLineNumber = op.range.startLineNumber;
startColumn = op.range.startColumn;
}
let resultRange: Range;
if (op.text.length > 0) {
// the operation inserts something
const lineCount = op.eolCount + 1;
if (lineCount === 1) {
// single line insert
resultRange = new Range(startLineNumber, startColumn, startLineNumber, startColumn + op.firstLineLength);
} else {
// multi line insert
resultRange = new Range(startLineNumber, startColumn, startLineNumber + lineCount - 1, op.lastLineLength + 1);
}
} else {
// There is nothing to insert
resultRange = new Range(startLineNumber, startColumn, startLineNumber, startColumn);
}
prevOpEndLineNumber = resultRange.endLineNumber;
prevOpEndColumn = resultRange.endColumn;
result.push(resultRange);
prevOp = op;
}
return result;
}
private static _sortOpsAscending(a: IValidatedEditOperation, b: IValidatedEditOperation): number {
let r = Range.compareRangesUsingEnds(a.range, b.range);
if (r === 0) {
return a.sortIndex - b.sortIndex;
}
return r;
}
private static _sortOpsDescending(a: IValidatedEditOperation, b: IValidatedEditOperation): number {
let r = Range.compareRangesUsingEnds(a.range, b.range);
if (r === 0) {
return b.sortIndex - a.sortIndex;
}
return -r;
}
// #endregion
}
| Java |
// Template Source: BaseEntityCollectionPage.java.tt
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests;
import com.microsoft.graph.models.TermsAndConditionsAcceptanceStatus;
import com.microsoft.graph.requests.TermsAndConditionsAcceptanceStatusCollectionRequestBuilder;
import javax.annotation.Nullable;
import javax.annotation.Nonnull;
import com.microsoft.graph.requests.TermsAndConditionsAcceptanceStatusCollectionResponse;
import com.microsoft.graph.http.BaseCollectionPage;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Terms And Conditions Acceptance Status Collection Page.
*/
public class TermsAndConditionsAcceptanceStatusCollectionPage extends BaseCollectionPage<TermsAndConditionsAcceptanceStatus, TermsAndConditionsAcceptanceStatusCollectionRequestBuilder> {
/**
* A collection page for TermsAndConditionsAcceptanceStatus
*
* @param response the serialized TermsAndConditionsAcceptanceStatusCollectionResponse from the service
* @param builder the request builder for the next collection page
*/
public TermsAndConditionsAcceptanceStatusCollectionPage(@Nonnull final TermsAndConditionsAcceptanceStatusCollectionResponse response, @Nonnull final TermsAndConditionsAcceptanceStatusCollectionRequestBuilder builder) {
super(response, builder);
}
/**
* Creates the collection page for TermsAndConditionsAcceptanceStatus
*
* @param pageContents the contents of this page
* @param nextRequestBuilder the request builder for the next page
*/
public TermsAndConditionsAcceptanceStatusCollectionPage(@Nonnull final java.util.List<TermsAndConditionsAcceptanceStatus> pageContents, @Nullable final TermsAndConditionsAcceptanceStatusCollectionRequestBuilder nextRequestBuilder) {
super(pageContents, nextRequestBuilder);
}
}
| Java |
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <iWorkImport/TSUProgress.h>
@class NSArray, NSObject<OS_dispatch_queue>;
// Not exported
@interface TSUProgressGroup : TSUProgress
{
NSArray *mChildren;
NSArray *mChildrenProgressObservers;
NSObject<OS_dispatch_queue> *mChildrenProgressObserversQueue;
}
- (void)p_updateChildrenProgressObservers;
- (void)removeProgressObserver:(id)arg1;
- (id)addProgressObserverWithValueInterval:(double)arg1 queue:(id)arg2 handler:(id)arg3;
- (_Bool)isIndeterminate;
- (double)maxValue;
- (double)value;
- (void)dealloc;
- (id)initWithChildren:(id)arg1;
@end
| Java |
Dockermail - Email Core
==========
This image provides a secure, minimal mail server based on 'postfix' and 'dovecot'.
All incoming mail to your domains is accepted.
For outgoing mail, only authenticated (logged in with username and password) clients can send messages via STARTTLS.
## Setup
You will need 2 folder on your host, one to store your configuration and another one to store your email. For example:
* `/opt/dockermail/settings`
* `/opt/dockermail/vmail`
These will be mounted into container and store settings and email on host.
All the configuration is done through a single `config.json` file, extra files (eg. SSL keys) will be stored in the settings directory for backup.
There is an example file in `config/example` to get you started.
#### Remember to restart your container if you update the settings!
---
### config.json
```json
{
"settings": {
"myhostname": "mail.example.com"
},
"domains": {
"example.com" :
[
{
"email": "info@example.com",
"password": "{PLAIN}SuperSecure123",
"aliases": ["@example.com"]
},
{
"email": "admin@example.com",
"password": "{SHA256-CRYPT}$5$ojXGqoxOAygN91er$VQD/8dDyCYOaLl2yLJlRFXgl.NSrB3seZGXBRMdZAr6"
}
]
}
}
```
The hash within *config.json* contains 2 primary keys: `domains` and `settings`.
##### settings
* `myhostname` - should be the fully qualified domain of the server hosting email. Although optional you will have problems with EHLO commands and `amavis` without it.
#### domains
Each domain has an array of account objects, each account has the following keys:
* `email` - email address of the account. Will also be used as the login.
* `password` - password for the account. See below for details.
* `aliases` - (Optional) Array of aliases to redirect to this account. For a catch-all use your domain with no account, eg: `@example.com`.
##### Generating passwords
Passwords have to be in a dovecot format.
A plain-text password looks like this: `{PLAIN}SuperSecure123`.
To get more secure hash values, you need to start the container and run:
```bash
docker exec -it [email_core_container_name] doveadm pw -s [scheme-name]
```
This will attach to a running container, prompt you for a password and provide a hash. For example:
```bash
> docker exec -it dockermail_core_1 doveadm pw -s SHA512-CRYPT
Enter new password:
Retype new password:
{SHA512-CRYPT}$6$OA/BzvLzf7C9uohz$a9B0kCihcHsfnK.x4xJWHs9V7.eR5crVtSUn6hoe6p03oea34.uxkozRUw7RYu13z26xNniY3M1kZu4CgSVaB/
```
See [Dovecot Wiki](http://wiki.dovecot.org/Authentication/PasswordSchemes) for more details on different schemes.
## Run
Using the pre-built image from docker hub, you can start your email by running:
```bash
docker run -name dockermail -d \
-p 25:25 -p 587:587 -p 143:143 -p 993:993 \
-v /opt/dockermail/settings:/mail_settings \
-v /opt/dockermail/vmail:/vmail \
adaline/dockermail-core
```
This will connect SMTP ports 25/587 and IMAP port 143/993 to host and mount the folders as per examples given above.
## SSL
Container will produce own SSL keys and back these up into the settings folder. These files are:
```
ssl-cert-snakeoil.key
ssl-cert-snakeoil.pem
```
On boot it will use these if present. You can replace these backup keys with your own, just restart the container.
| Java |
/** @file safesysstat.h
* @brief #include <sys/stat.h> with portability enhancements
*/
/* Copyright (C) 2007,2012,2017 Olly Betts
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*/
#ifndef XAPIAN_INCLUDED_SAFESYSSTAT_H
#define XAPIAN_INCLUDED_SAFESYSSTAT_H
#include <sys/stat.h>
#include <sys/types.h>
#ifdef __WIN32__
// MSVC lacks these POSIX macros and other compilers may too:
#ifndef S_ISDIR
# define S_ISDIR(ST_MODE) (((ST_MODE) & _S_IFMT) == _S_IFDIR)
#endif
#ifndef S_ISREG
# define S_ISREG(ST_MODE) (((ST_MODE) & _S_IFMT) == _S_IFREG)
#endif
// On UNIX, mkdir() is prototyped in <sys/stat.h> but on Windows it's in
// <direct.h>, so just include that from here to avoid build failures on
// MSVC just because of some new use of mkdir(). This also reduces the
// number of conditionalised #include statements we need in the sources.
#include <direct.h>
// Add overloaded version of mkdir which takes an (ignored) mode argument
// to allow source code to just specify a mode argument unconditionally.
//
// The () around mkdir are in case it's defined as a macro.
inline int (mkdir)(const char *pathname, mode_t /*mode*/) {
return _mkdir(pathname);
}
#else
// These were specified by POSIX.1-1996, so most platforms should have
// these by now:
#ifndef S_ISDIR
# define S_ISDIR(ST_MODE) (((ST_MODE) & S_IFMT) == S_IFDIR)
#endif
#ifndef S_ISREG
# define S_ISREG(ST_MODE) (((ST_MODE) & S_IFMT) == S_IFREG)
#endif
#endif
#endif /* XAPIAN_INCLUDED_SAFESYSSTAT_H */
| Java |
// Script by Bo Tranberg
// http://botranberg.dk
// https://github.com/tranberg/citations
//
// This script requires jQuery and jQuery UI
$(function() {
// Inser html for dialog just before the button to open it
var butt = document.getElementById('citations');
butt.insertAdjacentHTML('beforeBegin',
'\
<div id="dialog" title="Cite this paper" style="text-align:left"> \
<p style="text-align: center;"><b>Copy and paste one of the formatted citations into your bibliography manager.</b></p> \
<table style="border-collapse:separate; border-spacing:2em"> \
<tr style="vertical-align:top;"> \
<td><strong>APA</strong></td> \
<td><span id="APA1"></span><span id="APA2"></span><span id="APA3"></span><span id="APA4" style="font-style: italic"></span></td> \
</tr> \
<tr style="vertical-align:top;"> \
<td><strong>Bibtex</strong></td> \
<td> \
@article{<span id="bibtag"></span>,<br> \
title={<span id="bibtitle"></span>},<br> \
author={<span id="bibauthor"></span>},<br> \
journal={<span id="bibjournal"></span>},<br> \
year={<span id="bibyear"></span>},<br> \
url={<span id="biburl"></span>},<br> \
} \
</td> \
</tr> \
</table> \
</div>');
// Definitions of citations dialog
$("#dialog").dialog({
autoOpen: false,
show: {
effect: "fade",
duration: 200
},
hide: {
effect: "fade",
duration: 200
},
maxWidth:600,
maxHeight: 600,
width: 660,
height: 400,
modal: true,
});
// Open citation dialog on click
$("#citations").click(function() {
$("#dialog").dialog("open");
});
// Find authors
var metas = document.getElementsByTagName('meta');
var author = ''
// Determine number of authors
var numAuthors = 0
for (i=0; i<metas.length; i++) {
if (metas[i].getAttribute("name") == "citation_author") {
numAuthors += 1
};
};
// Build a string of authors for Bibtex
var authorIndex = 0
for (i=0; i<metas.length; i++) {
if (metas[i].getAttribute("name") == "citation_author") {
authorIndex += 1
if (authorIndex>1) {
if (authorIndex<=numAuthors) {
author = author+' and '
};
};
author = author+metas[i].getAttribute("content")
};
};
// Populate formatted citations in Bibtex
var title = $("meta[name='citation_title']").attr('content')
// The following test might seem stupid, but it's needed because some php function at OpenPsych appends two whitespaces to the start of the title in the meta data
if (title[1] == ' ') {
title = title.slice(2)
};
var journal = $("meta[name='citation_journal_title']").attr('content')
var pubyear = $("meta[name='citation_publication_date']").attr('content').substring(0,4)
var puburl = document.URL
// Build a string for the Bibtex tag
if (author.indexOf(',') < author.indexOf(' ')) {
var firstAuthor = author.substr(0,author.indexOf(','));
} else {
var firstAuthor = author.substr(0,author.indexOf(' '));
};
if (title.indexOf(',')<title.indexOf('0')) {
var startTitle = title.substr(0,title.indexOf(','));
} else {
var startTitle = title.substr(0,title.indexOf(' '));
};
$('#bibtag').html(firstAuthor+pubyear)
$('#bibtitle').html(title)
$('#bibauthor').html(author)
$('#bibjournal').html(journal)
$('#bibyear').html(pubyear)
$('#biburl').html(puburl)
//Build a string of authors for APA
var author = ''
var authorIndex = 0
for (i=0; i<metas.length; i++) {
if (metas[i].getAttribute("name") == "citation_author") {
authorIndex += 1
if (authorIndex>1) {
if (authorIndex<numAuthors) {
author = author+', '
};
};
if (authorIndex>1) {
if (authorIndex===numAuthors) {
author = author+', & '
};
};
// Check if author only has a single name
if (metas[i].getAttribute("content").indexOf(', ')>0) {
// Append author string with the surnames and first letter of next author's name
author = author+metas[i].getAttribute("content").substr(0,metas[i].getAttribute("content").indexOf(', ')+3)+'.'
// If the author has several names, append the first letter of these to the string
if (metas[i].getAttribute("content").indexOf(', ') < metas[i].getAttribute("content").lastIndexOf(' ')-1) {
var extraNames = metas[i].getAttribute("content").substr(metas[i].getAttribute("content").indexOf(', ')+2)
var addNames = extraNames.substr(extraNames.indexOf(' '))
author = author+addNames.substr(addNames.indexOf(' '))
};
} else {
author = author+metas[i].getAttribute("content")
};
};
};
// Populate formatted citations in APA
$('#APA1').html(author)
$('#APA2').html(' ('+pubyear+').')
$('#APA3').html(' '+title+'.')
$('#APA4').html(' '+journal+'.')
});
| Java |
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _INIT_INIT_PARSER_H_
#define _INIT_INIT_PARSER_H_
#include <map>
#include <memory>
#include <string>
#include <vector>
class SectionParser {
public:
virtual ~SectionParser() {
}
virtual bool ParseSection(const std::vector<std::string>& args, const std::string& filename,
int line, std::string* err) = 0;
virtual bool ParseLineSection(const std::vector<std::string>& args, int line,
std::string* err) = 0;
virtual void EndSection() = 0;
virtual void EndFile(const std::string& filename) = 0;
};
class Parser {
public:
static Parser& GetInstance();
void DumpState() const;
bool ParseConfig(const std::string& path);
void AddSectionParser(const std::string& name,
std::unique_ptr<SectionParser> parser);
void set_is_system_etc_init_loaded(bool loaded) {
is_system_etc_init_loaded_ = loaded;
}
void set_is_vendor_etc_init_loaded(bool loaded) {
is_vendor_etc_init_loaded_ = loaded;
}
void set_is_odm_etc_init_loaded(bool loaded) {
is_odm_etc_init_loaded_ = loaded;
}
bool is_system_etc_init_loaded() { return is_system_etc_init_loaded_; }
bool is_vendor_etc_init_loaded() { return is_vendor_etc_init_loaded_; }
bool is_odm_etc_init_loaded() { return is_odm_etc_init_loaded_; }
private:
Parser();
void ParseData(const std::string& filename, const std::string& data);
bool ParseConfigFile(const std::string& path);
bool ParseConfigDir(const std::string& path);
std::map<std::string, std::unique_ptr<SectionParser>> section_parsers_;
bool is_system_etc_init_loaded_ = false;
bool is_vendor_etc_init_loaded_ = false;
bool is_odm_etc_init_loaded_ = false;
};
#endif
| Java |
{% extends "base.html" %}
{% block content %}
<h1>{{ question.question_text }}</h1>
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
<form action="{% url 'polls:vote' question.id %}" method="post">
{% csrf_token %}
{% for choice in question.choice_set.all %}
<input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" />
<label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br/>
{% endfor %}
<input type="submit" value="Vote" />
</form>
{% endblock content %}
| Java |
# MyLibSwift | Java |
package io.github.ageofwar.telejam.updates;
import io.github.ageofwar.telejam.Bot;
import io.github.ageofwar.telejam.TelegramException;
import io.github.ageofwar.telejam.methods.GetUpdates;
import java.io.IOException;
import java.util.Collections;
import java.util.Objects;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.function.LongUnaryOperator;
/**
* Utility class that reads new updates received from a bot.
*
* @author Michi Palazzo
*/
public final class UpdateReader implements AutoCloseable {
private final Bot bot;
private final ConcurrentLinkedQueue<Update> updates;
private final LongUnaryOperator backOff;
private long lastUpdateId;
/**
* Constructs an UpdateReader.
*
* @param bot the bot that receive updates
* @param backOff back off to be used when long polling fails
*/
public UpdateReader(Bot bot, LongUnaryOperator backOff) {
this.bot = Objects.requireNonNull(bot);
this.backOff = Objects.requireNonNull(backOff);
updates = new ConcurrentLinkedQueue<>();
lastUpdateId = -1;
}
/**
* Constructs an UpdateReader.
*
* @param bot the bot that receive updates
*/
public UpdateReader(Bot bot) {
this(bot, a -> 500L);
}
/**
* Returns the number of updates that can be read from this update reader without blocking by the
* next invocation read method for this update reader. The next invocation
* might be the same thread or another thread.
* If the available updates are more than {@code Integer.MAX_VALUE}, returns
* {@code Integer.MAX_VALUE}.
*
* @return the number of updates that can be read from this update reader
* without blocking by the next invocation read method
*/
public int available() {
return updates.size();
}
/**
* Tells whether this stream is ready to be read.
*
* @return <code>true</code> if the next read() is guaranteed not to block for input,
* <code>false</code> otherwise. Note that returning false does not guarantee that the
* next read will block.
*/
public boolean ready() {
return !updates.isEmpty();
}
/**
* Reads one update from the stream.
*
* @return the read update
* @throws IOException if an I/O Exception occurs
* @throws InterruptedException if any thread has interrupted the current
* thread while waiting for updates
*/
public Update read() throws IOException, InterruptedException {
if (!ready()) {
for (long attempts = 0; getUpdates() == 0; attempts++) {
Thread.sleep(backOff.applyAsLong(attempts));
}
}
return updates.remove();
}
/**
* Retrieves new updates received from the bot.
*
* @return number of updates received
* @throws IOException if an I/O Exception occurs
*/
public int getUpdates() throws IOException {
try {
Update[] newUpdates = getUpdates(lastUpdateId + 1);
Collections.addAll(updates, newUpdates);
if (newUpdates.length > 0) {
lastUpdateId = newUpdates[newUpdates.length - 1].getId();
}
return newUpdates.length;
} catch (Throwable e) {
if (!(e instanceof TelegramException)) {
lastUpdateId++;
}
throw e;
}
}
/**
* Discards buffered updates and all received updates.
*
* @throws IOException if an I/O Exception occurs
*/
public void discardAll() throws IOException {
Update[] newUpdate = getUpdates(-1);
if (newUpdate.length == 1) {
lastUpdateId = newUpdate[0].getId();
}
updates.clear();
}
private Update[] getUpdates(long offset) throws IOException {
GetUpdates getUpdates = new GetUpdates()
.offset(offset)
.allowedUpdates();
return bot.execute(getUpdates);
}
@Override
public void close() throws IOException {
try {
Update nextUpdate = updates.peek();
getUpdates(nextUpdate != null ? nextUpdate.getId() : lastUpdateId + 1);
lastUpdateId = -1;
updates.clear();
} catch (IOException e) {
throw new IOException("Unable to close update reader", e);
}
}
}
| Java |
@import url("//fonts.googleapis.com/css?family=News+Cycle:400,700");
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden],
template {
display: none;
}
html {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
body {
margin: 0;
}
a {
background: transparent;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
h1 {
margin: 0.67em 0;
font-size: 2em;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
hr {
height: 0;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
mark {
color: #000;
background: #ff0;
}
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
pre {
white-space: pre-wrap;
}
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 0;
}
fieldset {
padding: 0.35em 0.625em 0.75em;
margin: 0 2px;
border: 1px solid #c0c0c0;
}
legend {
padding: 0;
border: 0;
}
button,
input,
select,
textarea {
margin: 0;
font-family: inherit;
font-size: 100%;
}
button,
input {
line-height: normal;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
cursor: pointer;
-webkit-appearance: button;
}
button[disabled],
html input[disabled] {
cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
padding: 0;
box-sizing: border-box;
}
input[type="search"] {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
-webkit-appearance: textfield;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
padding: 0;
border: 0;
}
textarea {
overflow: auto;
vertical-align: top;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
@media print {
* {
color: #000 !important;
text-shadow: none !important;
background: transparent !important;
box-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
a[href^="javascript:"]:after,
a[href^="#"]: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;
}
@page {
margin: 2cm .5cm;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
select {
background: #fff !important;
}
.navbar {
display: none;
}
.table td,
.table th {
background-color: #fff !important;
}
.btn > .caret,
.dropup > .btn > .caret {
border-top-color: #000 !important;
}
.label {
border: 1px solid #000;
}
.table {
border-collapse: collapse !important;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
}
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-size: 62.5%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
/*font-family: Georgia, "Times New Roman", Times, serif;*/
font-size: 15px;
line-height: 1.428571429;
color: #777777;
background-color: #ffffff;
}
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
a {
color: #eb6864;
text-decoration: none;
}
a:hover,
a:focus {
color: #e22620;
text-decoration: underline;
}
a:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
img {
vertical-align: middle;
}
.img-responsive {
display: block;
height: auto;
max-width: 100%;
}
.img-rounded {
border-radius: 6px;
}
.img-thumbnail {
display: inline-block;
height: auto;
max-width: 100%;
padding: 4px;
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.img-circle {
border-radius: 50%;
}
hr {
margin-top: 21px;
margin-bottom: 21px;
border: 0;
border-top: 1px solid #eeeeee;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
p {
margin: 0 0 10.5px;
}
.lead {
margin-bottom: 21px;
font-size: 17px;
font-weight: 200;
line-height: 1.4;
}
@media (min-width: 768px) {
.lead {
font-size: 22.5px;
}
}
small,
.small {
font-size: 85%;
}
cite {
font-style: normal;
}
.text-muted {
color: #999999;
}
.text-primary {
color: #eb6864;
}
.text-primary:hover {
color: #e53c37;
}
.text-warning {
color: #c09853;
}
.text-warning:hover {
color: #a47e3c;
}
.text-danger {
color: #b94a48;
}
.text-danger:hover {
color: #953b39;
}
.text-success {
color: #468847;
}
.text-success:hover {
color: #356635;
}
.text-info {
color: #3a87ad;
}
.text-info:hover {
color: #2d6987;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
font-family: "News Cycle", "Arial Narrow Bold", sans-serif;
font-weight: 700;
line-height: 1.1;
color: #000000;
}
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: #999999;
}
h1,
h2,
h3 {
margin-top: 21px;
margin-bottom: 10.5px;
}
h1 small,
h2 small,
h3 small,
h1 .small,
h2 .small,
h3 .small {
font-size: 65%;
}
h4,
h5,
h6 {
margin-top: 10.5px;
margin-bottom: 10.5px;
}
h4 small,
h5 small,
h6 small,
h4 .small,
h5 .small,
h6 .small {
font-size: 75%;
}
h1,
.h1 {
font-size: 39px;
}
h2,
.h2 {
font-size: 32px;
}
h3,
.h3 {
font-size: 26px;
}
h4,
.h4 {
font-size: 19px;
}
h5,
.h5 {
font-size: 15px;
}
h6,
.h6 {
font-size: 13px;
}
.page-header {
padding-bottom: 9.5px;
margin: 42px 0 21px;
border-bottom: 1px solid #eeeeee;
}
ul,
ol {
margin-top: 0;
margin-bottom: 10.5px;
}
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;
}
.list-inline > li {
display: inline-block;
padding-right: 5px;
padding-left: 5px;
}
.list-inline > li:first-child {
padding-left: 0;
}
dl {
margin-bottom: 21px;
}
dt,
dd {
line-height: 1.428571429;
}
dt {
font-weight: bold;
}
dd {
margin-left: 0;
}
@media (min-width: 768px) {
.dl-horizontal dt {
float: left;
width: 160px;
overflow: hidden;
clear: left;
text-align: right;
text-overflow: ellipsis;
white-space: nowrap;
}
.dl-horizontal dd {
margin-left: 180px;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
display: table;
content: " ";
}
.dl-horizontal dd:after {
clear: both;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
display: table;
content: " ";
}
.dl-horizontal dd:after {
clear: both;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
display: table;
content: " ";
}
.dl-horizontal dd:after {
clear: both;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
display: table;
content: " ";
}
.dl-horizontal dd:after {
clear: both;
}
.dl-horizontal dd:before,
.dl-horizontal dd:after {
display: table;
content: " ";
}
.dl-horizontal dd:after {
clear: both;
}
}
abbr[title],
abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #999999;
}
abbr.initialism {
font-size: 90%;
text-transform: uppercase;
}
blockquote {
padding: 10.5px 21px;
margin: 0 0 21px;
border-left: 5px solid #eeeeee;
}
blockquote p {
font-size: 18.75px;
font-weight: 300;
line-height: 1.25;
}
blockquote p:last-child {
margin-bottom: 0;
}
blockquote small {
display: block;
line-height: 1.428571429;
color: #999999;
}
blockquote small:before {
content: '\2014 \00A0';
}
blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
}
blockquote.pull-right p,
blockquote.pull-right small,
blockquote.pull-right .small {
text-align: right;
}
blockquote.pull-right small:before,
blockquote.pull-right .small:before {
content: '';
}
blockquote.pull-right small:after,
blockquote.pull-right .small:after {
content: '\00A0 \2014';
}
blockquote:before,
blockquote:after {
content: "";
}
address {
margin-bottom: 21px;
font-style: normal;
line-height: 1.428571429;
}
code,
kbd,
pre,
samp {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
white-space: nowrap;
background-color: #f9f2f4;
border-radius: 4px;
}
pre {
display: block;
padding: 10px;
margin: 0 0 10.5px;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
word-break: break-all;
word-wrap: break-word;
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 {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
.container:before,
.container:after {
display: table;
content: " ";
}
.container:after {
clear: both;
}
.container:before,
.container:after {
display: table;
content: " ";
}
.container:after {
clear: both;
}
.container:before,
.container:after {
display: table;
content: " ";
}
.container:after {
clear: both;
}
.container:before,
.container:after {
display: table;
content: " ";
}
.container:after {
clear: both;
}
.container:before,
.container:after {
display: table;
content: " ";
}
.container:after {
clear: both;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
.row:before,
.row:after {
display: table;
content: " ";
}
.row:after {
clear: both;
}
.row:before,
.row:after {
display: table;
content: " ";
}
.row:after {
clear: both;
}
.row:before,
.row:after {
display: table;
content: " ";
}
.row:after {
clear: both;
}
.row:before,
.row:after {
display: table;
content: " ";
}
.row:after {
clear: both;
}
.row:before,
.row:after {
display: table;
content: " ";
}
.row:after {
clear: both;
}
.col-xs-1,
.col-sm-1,
.col-md-1,
.col-lg-1,
.col-xs-2,
.col-sm-2,
.col-md-2,
.col-lg-2,
.col-xs-3,
.col-sm-3,
.col-md-3,
.col-lg-3,
.col-xs-4,
.col-sm-4,
.col-md-4,
.col-lg-4,
.col-xs-5,
.col-sm-5,
.col-md-5,
.col-lg-5,
.col-xs-6,
.col-sm-6,
.col-md-6,
.col-lg-6,
.col-xs-7,
.col-sm-7,
.col-md-7,
.col-lg-7,
.col-xs-8,
.col-sm-8,
.col-md-8,
.col-lg-8,
.col-xs-9,
.col-sm-9,
.col-md-9,
.col-lg-9,
.col-xs-10,
.col-sm-10,
.col-md-10,
.col-lg-10,
.col-xs-11,
.col-sm-11,
.col-md-11,
.col-lg-11,
.col-xs-12,
.col-sm-12,
.col-md-12,
.col-lg-12 {
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
}
.col-xs-1,
.col-xs-2,
.col-xs-3,
.col-xs-4,
.col-xs-5,
.col-xs-6,
.col-xs-7,
.col-xs-8,
.col-xs-9,
.col-xs-10,
.col-xs-11 {
float: left;
}
.col-xs-12 {
width: 100%;
}
.col-xs-11 {
width: 91.66666666666666%;
}
.col-xs-10 {
width: 83.33333333333334%;
}
.col-xs-9 {
width: 75%;
}
.col-xs-8 {
width: 66.66666666666666%;
}
.col-xs-7 {
width: 58.333333333333336%;
}
.col-xs-6 {
width: 50%;
}
.col-xs-5 {
width: 41.66666666666667%;
}
.col-xs-4 {
width: 33.33333333333333%;
}
.col-xs-3 {
width: 25%;
}
.col-xs-2 {
width: 16.666666666666664%;
}
.col-xs-1 {
width: 8.333333333333332%;
}
.col-xs-pull-12 {
right: 100%;
}
.col-xs-pull-11 {
right: 91.66666666666666%;
}
.col-xs-pull-10 {
right: 83.33333333333334%;
}
.col-xs-pull-9 {
right: 75%;
}
.col-xs-pull-8 {
right: 66.66666666666666%;
}
.col-xs-pull-7 {
right: 58.333333333333336%;
}
.col-xs-pull-6 {
right: 50%;
}
.col-xs-pull-5 {
right: 41.66666666666667%;
}
.col-xs-pull-4 {
right: 33.33333333333333%;
}
.col-xs-pull-3 {
right: 25%;
}
.col-xs-pull-2 {
right: 16.666666666666664%;
}
.col-xs-pull-1 {
right: 8.333333333333332%;
}
.col-xs-pull-0 {
right: 0;
}
.col-xs-push-12 {
left: 100%;
}
.col-xs-push-11 {
left: 91.66666666666666%;
}
.col-xs-push-10 {
left: 83.33333333333334%;
}
.col-xs-push-9 {
left: 75%;
}
.col-xs-push-8 {
left: 66.66666666666666%;
}
.col-xs-push-7 {
left: 58.333333333333336%;
}
.col-xs-push-6 {
left: 50%;
}
.col-xs-push-5 {
left: 41.66666666666667%;
}
.col-xs-push-4 {
left: 33.33333333333333%;
}
.col-xs-push-3 {
left: 25%;
}
.col-xs-push-2 {
left: 16.666666666666664%;
}
.col-xs-push-1 {
left: 8.333333333333332%;
}
.col-xs-push-0 {
left: 0;
}
.col-xs-offset-12 {
margin-left: 100%;
}
.col-xs-offset-11 {
margin-left: 91.66666666666666%;
}
.col-xs-offset-10 {
margin-left: 83.33333333333334%;
}
.col-xs-offset-9 {
margin-left: 75%;
}
.col-xs-offset-8 {
margin-left: 66.66666666666666%;
}
.col-xs-offset-7 {
margin-left: 58.333333333333336%;
}
.col-xs-offset-6 {
margin-left: 50%;
}
.col-xs-offset-5 {
margin-left: 41.66666666666667%;
}
.col-xs-offset-4 {
margin-left: 33.33333333333333%;
}
.col-xs-offset-3 {
margin-left: 25%;
}
.col-xs-offset-2 {
margin-left: 16.666666666666664%;
}
.col-xs-offset-1 {
margin-left: 8.333333333333332%;
}
.col-xs-offset-0 {
margin-left: 0;
}
@media (min-width: 768px) {
.container {
width: 750px;
}
.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 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666666666666%;
}
.col-sm-10 {
width: 83.33333333333334%;
}
.col-sm-9 {
width: 75%;
}
.col-sm-8 {
width: 66.66666666666666%;
}
.col-sm-7 {
width: 58.333333333333336%;
}
.col-sm-6 {
width: 50%;
}
.col-sm-5 {
width: 41.66666666666667%;
}
.col-sm-4 {
width: 33.33333333333333%;
}
.col-sm-3 {
width: 25%;
}
.col-sm-2 {
width: 16.666666666666664%;
}
.col-sm-1 {
width: 8.333333333333332%;
}
.col-sm-pull-12 {
right: 100%;
}
.col-sm-pull-11 {
right: 91.66666666666666%;
}
.col-sm-pull-10 {
right: 83.33333333333334%;
}
.col-sm-pull-9 {
right: 75%;
}
.col-sm-pull-8 {
right: 66.66666666666666%;
}
.col-sm-pull-7 {
right: 58.333333333333336%;
}
.col-sm-pull-6 {
right: 50%;
}
.col-sm-pull-5 {
right: 41.66666666666667%;
}
.col-sm-pull-4 {
right: 33.33333333333333%;
}
.col-sm-pull-3 {
right: 25%;
}
.col-sm-pull-2 {
right: 16.666666666666664%;
}
.col-sm-pull-1 {
right: 8.333333333333332%;
}
.col-sm-pull-0 {
right: 0;
}
.col-sm-push-12 {
left: 100%;
}
.col-sm-push-11 {
left: 91.66666666666666%;
}
.col-sm-push-10 {
left: 83.33333333333334%;
}
.col-sm-push-9 {
left: 75%;
}
.col-sm-push-8 {
left: 66.66666666666666%;
}
.col-sm-push-7 {
left: 58.333333333333336%;
}
.col-sm-push-6 {
left: 50%;
}
.col-sm-push-5 {
left: 41.66666666666667%;
}
.col-sm-push-4 {
left: 33.33333333333333%;
}
.col-sm-push-3 {
left: 25%;
}
.col-sm-push-2 {
left: 16.666666666666664%;
}
.col-sm-push-1 {
left: 8.333333333333332%;
}
.col-sm-push-0 {
left: 0;
}
.col-sm-offset-12 {
margin-left: 100%;
}
.col-sm-offset-11 {
margin-left: 91.66666666666666%;
}
.col-sm-offset-10 {
margin-left: 83.33333333333334%;
}
.col-sm-offset-9 {
margin-left: 75%;
}
.col-sm-offset-8 {
margin-left: 66.66666666666666%;
}
.col-sm-offset-7 {
margin-left: 58.333333333333336%;
}
.col-sm-offset-6 {
margin-left: 50%;
}
.col-sm-offset-5 {
margin-left: 41.66666666666667%;
}
.col-sm-offset-4 {
margin-left: 33.33333333333333%;
}
.col-sm-offset-3 {
margin-left: 25%;
}
.col-sm-offset-2 {
margin-left: 16.666666666666664%;
}
.col-sm-offset-1 {
margin-left: 8.333333333333332%;
}
.col-sm-offset-0 {
margin-left: 0;
}
}
@media (min-width: 992px) {
.container {
width: 970px;
}
.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 {
float: left;
}
.col-md-12 {
width: 100%;
}
.col-md-11 {
width: 91.66666666666666%;
}
.col-md-10 {
width: 83.33333333333334%;
}
.col-md-9 {
width: 75%;
}
.col-md-8 {
width: 66.66666666666666%;
}
.col-md-7 {
width: 58.333333333333336%;
}
.col-md-6 {
width: 50%;
}
.col-md-5 {
width: 41.66666666666667%;
}
.col-md-4 {
width: 33.33333333333333%;
}
.col-md-3 {
width: 25%;
}
.col-md-2 {
width: 16.666666666666664%;
}
.col-md-1 {
width: 8.333333333333332%;
}
.col-md-pull-12 {
right: 100%;
}
.col-md-pull-11 {
right: 91.66666666666666%;
}
.col-md-pull-10 {
right: 83.33333333333334%;
}
.col-md-pull-9 {
right: 75%;
}
.col-md-pull-8 {
right: 66.66666666666666%;
}
.col-md-pull-7 {
right: 58.333333333333336%;
}
.col-md-pull-6 {
right: 50%;
}
.col-md-pull-5 {
right: 41.66666666666667%;
}
.col-md-pull-4 {
right: 33.33333333333333%;
}
.col-md-pull-3 {
right: 25%;
}
.col-md-pull-2 {
right: 16.666666666666664%;
}
.col-md-pull-1 {
right: 8.333333333333332%;
}
.col-md-pull-0 {
right: 0;
}
.col-md-push-12 {
left: 100%;
}
.col-md-push-11 {
left: 91.66666666666666%;
}
.col-md-push-10 {
left: 83.33333333333334%;
}
.col-md-push-9 {
left: 75%;
}
.col-md-push-8 {
left: 66.66666666666666%;
}
.col-md-push-7 {
left: 58.333333333333336%;
}
.col-md-push-6 {
left: 50%;
}
.col-md-push-5 {
left: 41.66666666666667%;
}
.col-md-push-4 {
left: 33.33333333333333%;
}
.col-md-push-3 {
left: 25%;
}
.col-md-push-2 {
left: 16.666666666666664%;
}
.col-md-push-1 {
left: 8.333333333333332%;
}
.col-md-push-0 {
left: 0;
}
.col-md-offset-12 {
margin-left: 100%;
}
.col-md-offset-11 {
margin-left: 91.66666666666666%;
}
.col-md-offset-10 {
margin-left: 83.33333333333334%;
}
.col-md-offset-9 {
margin-left: 75%;
}
.col-md-offset-8 {
margin-left: 66.66666666666666%;
}
.col-md-offset-7 {
margin-left: 58.333333333333336%;
}
.col-md-offset-6 {
margin-left: 50%;
}
.col-md-offset-5 {
margin-left: 41.66666666666667%;
}
.col-md-offset-4 {
margin-left: 33.33333333333333%;
}
.col-md-offset-3 {
margin-left: 25%;
}
.col-md-offset-2 {
margin-left: 16.666666666666664%;
}
.col-md-offset-1 {
margin-left: 8.333333333333332%;
}
.col-md-offset-0 {
margin-left: 0;
}
}
@media (min-width: 1200px) {
.container {
width: 1170px;
}
.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 {
float: left;
}
.col-lg-12 {
width: 100%;
}
.col-lg-11 {
width: 91.66666666666666%;
}
.col-lg-10 {
width: 83.33333333333334%;
}
.col-lg-9 {
width: 75%;
}
.col-lg-8 {
width: 66.66666666666666%;
}
.col-lg-7 {
width: 58.333333333333336%;
}
.col-lg-6 {
width: 50%;
}
.col-lg-5 {
width: 41.66666666666667%;
}
.col-lg-4 {
width: 33.33333333333333%;
}
.col-lg-3 {
width: 25%;
}
.col-lg-2 {
width: 16.666666666666664%;
}
.col-lg-1 {
width: 8.333333333333332%;
}
.col-lg-pull-12 {
right: 100%;
}
.col-lg-pull-11 {
right: 91.66666666666666%;
}
.col-lg-pull-10 {
right: 83.33333333333334%;
}
.col-lg-pull-9 {
right: 75%;
}
.col-lg-pull-8 {
right: 66.66666666666666%;
}
.col-lg-pull-7 {
right: 58.333333333333336%;
}
.col-lg-pull-6 {
right: 50%;
}
.col-lg-pull-5 {
right: 41.66666666666667%;
}
.col-lg-pull-4 {
right: 33.33333333333333%;
}
.col-lg-pull-3 {
right: 25%;
}
.col-lg-pull-2 {
right: 16.666666666666664%;
}
.col-lg-pull-1 {
right: 8.333333333333332%;
}
.col-lg-pull-0 {
right: 0;
}
.col-lg-push-12 {
left: 100%;
}
.col-lg-push-11 {
left: 91.66666666666666%;
}
.col-lg-push-10 {
left: 83.33333333333334%;
}
.col-lg-push-9 {
left: 75%;
}
.col-lg-push-8 {
left: 66.66666666666666%;
}
.col-lg-push-7 {
left: 58.333333333333336%;
}
.col-lg-push-6 {
left: 50%;
}
.col-lg-push-5 {
left: 41.66666666666667%;
}
.col-lg-push-4 {
left: 33.33333333333333%;
}
.col-lg-push-3 {
left: 25%;
}
.col-lg-push-2 {
left: 16.666666666666664%;
}
.col-lg-push-1 {
left: 8.333333333333332%;
}
.col-lg-push-0 {
left: 0;
}
.col-lg-offset-12 {
margin-left: 100%;
}
.col-lg-offset-11 {
margin-left: 91.66666666666666%;
}
.col-lg-offset-10 {
margin-left: 83.33333333333334%;
}
.col-lg-offset-9 {
margin-left: 75%;
}
.col-lg-offset-8 {
margin-left: 66.66666666666666%;
}
.col-lg-offset-7 {
margin-left: 58.333333333333336%;
}
.col-lg-offset-6 {
margin-left: 50%;
}
.col-lg-offset-5 {
margin-left: 41.66666666666667%;
}
.col-lg-offset-4 {
margin-left: 33.33333333333333%;
}
.col-lg-offset-3 {
margin-left: 25%;
}
.col-lg-offset-2 {
margin-left: 16.666666666666664%;
}
.col-lg-offset-1 {
margin-left: 8.333333333333332%;
}
.col-lg-offset-0 {
margin-left: 0;
}
}
table {
max-width: 100%;
background-color: transparent;
}
th {
text-align: left;
}
.table {
width: 100%;
margin-bottom: 21px;
}
.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.428571429;
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-child(odd) > td,
.table-striped > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9;
}
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
background-color: #f5f5f5;
}
table col[class*="col-"] {
display: table-column;
float: none;
}
table td[class*="col-"],
table th[class*="col-"] {
display: table-cell;
float: none;
}
.table > thead > tr > td.active,
.table > tbody > tr > td.active,
.table > tfoot > tr > td.active,
.table > thead > tr > th.active,
.table > tbody > tr > th.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > tbody > tr.active > td,
.table > tfoot > tr.active > td,
.table > thead > tr.active > th,
.table > tbody > tr.active > th,
.table > tfoot > tr.active > th {
background-color: #f5f5f5;
}
.table > 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.success:hover > th {
background-color: #d0e9c6;
}
.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.danger:hover > th {
background-color: #ebcccc;
}
.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.warning:hover > th {
background-color: #faf2cc;
}
@media (max-width: 767px) {
.table-responsive {
width: 100%;
margin-bottom: 15.75px;
overflow-x: scroll;
overflow-y: hidden;
border: 1px solid #dddddd;
-ms-overflow-style: -ms-autohiding-scrollbar;
-webkit-overflow-scrolling: touch;
}
.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;
}
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 21px;
font-size: 22.5px;
line-height: inherit;
color: #777777;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
label {
display: inline-block;
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;
/* IE8-9 */
line-height: normal;
}
input[type="file"] {
display: block;
}
select[multiple],
select[size] {
height: auto;
}
select optgroup {
font-family: inherit;
font-size: inherit;
font-style: inherit;
}
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
height: auto;
}
output {
display: block;
padding-top: 9px;
font-size: 15px;
line-height: 1.428571429;
color: #777777;
vertical-align: middle;
}
.form-control {
display: block;
width: 100%;
height: 39px;
padding: 8px 12px;
font-size: 15px;
line-height: 1.428571429;
color: #777777;
vertical-align: middle;
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 0.15s, box-shadow ease-in-out 0.15s;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.form-control:-moz-placeholder {
color: #999999;
}
.form-control::-moz-placeholder {
color: #999999;
}
.form-control:-ms-input-placeholder {
color: #999999;
}
.form-control::-webkit-input-placeholder {
color: #999999;
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
cursor: not-allowed;
background-color: #eeeeee;
}
textarea.form-control {
height: auto;
}
.form-group {
margin-bottom: 15px;
}
.radio,
.checkbox {
display: block;
min-height: 21px;
padding-left: 20px;
margin-top: 10px;
margin-bottom: 10px;
vertical-align: middle;
}
.radio label,
.checkbox label {
display: inline;
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"] {
float: left;
margin-left: -20px;
}
.radio + .radio,
.checkbox + .checkbox {
margin-top: -5px;
}
.radio-inline,
.checkbox-inline {
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
vertical-align: middle;
cursor: pointer;
}
.radio-inline + .radio-inline,
.checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px;
}
input[type="radio"][disabled],
input[type="checkbox"][disabled],
.radio[disabled],
.radio-inline[disabled],
.checkbox[disabled],
.checkbox-inline[disabled],
fieldset[disabled] input[type="radio"],
fieldset[disabled] input[type="checkbox"],
fieldset[disabled] .radio,
fieldset[disabled] .radio-inline,
fieldset[disabled] .checkbox,
fieldset[disabled] .checkbox-inline {
cursor: not-allowed;
}
.input-sm {
height: 31px;
padding: 5px 10px;
font-size: 13px;
line-height: 1.5;
border-radius: 3px;
}
select.input-sm {
height: 31px;
line-height: 31px;
}
textarea.input-sm {
height: auto;
}
.input-lg {
height: 58px;
padding: 14px 16px;
font-size: 19px;
line-height: 1.33;
border-radius: 6px;
}
select.input-lg {
height: 58px;
line-height: 58px;
}
textarea.input-lg {
height: auto;
}
.has-warning .help-block,
.has-warning .control-label,
.has-warning .radio,
.has-warning .checkbox,
.has-warning .radio-inline,
.has-warning .checkbox-inline {
color: #c09853;
}
.has-warning .form-control {
border-color: #c09853;
-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: #a47e3c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
}
.has-warning .input-group-addon {
color: #c09853;
background-color: #fcf8e3;
border-color: #c09853;
}
.has-error .help-block,
.has-error .control-label,
.has-error .radio,
.has-error .checkbox,
.has-error .radio-inline,
.has-error .checkbox-inline {
color: #b94a48;
}
.has-error .form-control {
border-color: #b94a48;
-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: #953b39;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}
.has-error .input-group-addon {
color: #b94a48;
background-color: #f2dede;
border-color: #b94a48;
}
.has-success .help-block,
.has-success .control-label,
.has-success .radio,
.has-success .checkbox,
.has-success .radio-inline,
.has-success .checkbox-inline {
color: #468847;
}
.has-success .form-control {
border-color: #468847;
-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: #356635;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
}
.has-success .input-group-addon {
color: #468847;
background-color: #dff0d8;
border-color: #468847;
}
.form-control-static {
margin-bottom: 0;
}
.help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #b7b7b7;
}
@media (min-width: 768px) {
.form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .form-control {
display: inline-block;
}
.form-inline .radio,
.form-inline .checkbox {
display: inline-block;
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
}
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
.form-horizontal .control-label,
.form-horizontal .radio,
.form-horizontal .checkbox,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
padding-top: 9px;
margin-top: 0;
margin-bottom: 0;
}
.form-horizontal .form-group {
margin-right: -15px;
margin-left: -15px;
}
.form-horizontal .form-group:before,
.form-horizontal .form-group:after {
display: table;
content: " ";
}
.form-horizontal .form-group:after {
clear: both;
}
.form-horizontal .form-group:before,
.form-horizontal .form-group:after {
display: table;
content: " ";
}
.form-horizontal .form-group:after {
clear: both;
}
.form-horizontal .form-group:before,
.form-horizontal .form-group:after {
display: table;
content: " ";
}
.form-horizontal .form-group:after {
clear: both;
}
.form-horizontal .form-group:before,
.form-horizontal .form-group:after {
display: table;
content: " ";
}
.form-horizontal .form-group:after {
clear: both;
}
.form-horizontal .form-group:before,
.form-horizontal .form-group:after {
display: table;
content: " ";
}
.form-horizontal .form-group:after {
clear: both;
}
.form-horizontal .form-control-static {
padding-top: 9px;
}
@media (min-width: 768px) {
.form-horizontal .control-label {
text-align: right;
}
}
.btn {
display: inline-block;
padding: 8px 12px;
margin-bottom: 0;
font-size: 15px;
font-weight: normal;
line-height: 1.428571429;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.btn:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.btn:hover,
.btn:focus {
color: #ffffff;
text-decoration: none;
}
.btn:active,
.btn.active {
background-image: none;
outline: 0;
-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 {
pointer-events: none;
cursor: not-allowed;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-default {
color: #ffffff;
background-color: #999999;
border-color: #999999;
}
.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.active,
.open .dropdown-toggle.btn-default {
color: #ffffff;
background-color: #858585;
border-color: #7a7a7a;
}
.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: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: #999999;
border-color: #999999;
}
.btn-primary {
color: #ffffff;
background-color: #eb6864;
border-color: #eb6864;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
color: #ffffff;
background-color: #e64540;
border-color: #e4332e;
}
.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: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: #eb6864;
border-color: #eb6864;
}
.btn-warning {
color: #ffffff;
background-color: #f5e625;
border-color: #f5e625;
}
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active,
.open .dropdown-toggle.btn-warning {
color: #ffffff;
background-color: #e7d70b;
border-color: #d3c50a;
}
.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: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: #f5e625;
border-color: #f5e625;
}
.btn-danger {
color: #ffffff;
background-color: #f57a00;
border-color: #f57a00;
}
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active,
.open .dropdown-toggle.btn-danger {
color: #ffffff;
background-color: #cc6600;
border-color: #b85c00;
}
.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: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: #f57a00;
border-color: #f57a00;
}
.btn-success {
color: #ffffff;
background-color: #22b24c;
border-color: #22b24c;
}
.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
color: #ffffff;
background-color: #1b903d;
border-color: #187f36;
}
.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: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: #22b24c;
border-color: #22b24c;
}
.btn-info {
color: #ffffff;
background-color: #336699;
border-color: #336699;
}
.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info.active,
.open .dropdown-toggle.btn-info {
color: #ffffff;
background-color: #29527a;
border-color: #24476b;
}
.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: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: #336699;
border-color: #336699;
}
.btn-link {
font-weight: normal;
color: #eb6864;
cursor: pointer;
border-radius: 0;
}
.btn-link,
.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: #e22620;
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: #999999;
text-decoration: none;
}
.btn-lg {
padding: 14px 16px;
font-size: 19px;
line-height: 1.33;
border-radius: 6px;
}
.btn-sm,
.btn-xs {
padding: 5px 10px;
font-size: 13px;
line-height: 1.5;
border-radius: 3px;
}
.btn-xs {
padding: 1px 5px;
}
.btn-block {
display: block;
width: 100%;
padding-right: 0;
padding-left: 0;
}
.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;
transition: opacity 0.15s linear;
}
.fade.in {
opacity: 1;
}
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height 0.35s ease;
transition: height 0.35s ease;
}
@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.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';
-webkit-font-smoothing: antialiased;
font-style: normal;
font-weight: normal;
line-height: 1;
-moz-osx-font-smoothing: grayscale;
}
.glyphicon:empty {
width: 1em;
}
.glyphicon-asterisk:before {
content: "\2a";
}
.glyphicon-plus:before {
content: "\2b";
}
.glyphicon-euro: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";
}
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px solid #000000;
border-right: 4px solid transparent;
border-bottom: 0 dotted;
border-left: 4px solid transparent;
}
.dropdown {
position: relative;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 15px;
list-style: none;
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);
background-clip: padding-box;
}
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
.dropdown-menu .divider {
height: 1px;
margin: 9.5px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
color: #333333;
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
color: #ffffff;
text-decoration: none;
background-color: #eb6864;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #ffffff;
text-decoration: none;
background-color: #eb6864;
outline: 0;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
color: #999999;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
text-decoration: none;
cursor: not-allowed;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
.open > .dropdown-menu {
display: block;
}
.open > a {
outline: 0;
}
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 13px;
line-height: 1.428571429;
color: #999999;
}
.dropdown-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 990;
}
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
border-top: 0 dotted;
border-bottom: 4px solid #000000;
content: "";
}
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 1px;
}
@media (min-width: 768px) {
.navbar-right .dropdown-menu {
right: 0;
left: auto;
}
}
.btn-default .caret {
border-top-color: #ffffff;
}
.btn-primary .caret,
.btn-success .caret,
.btn-warning .caret,
.btn-danger .caret,
.btn-info .caret {
border-top-color: #fff;
}
.dropup .btn-default .caret {
border-bottom-color: #ffffff;
}
.dropup .btn-primary .caret,
.dropup .btn-success .caret,
.dropup .btn-warning .caret,
.dropup .btn-danger .caret,
.dropup .btn-info .caret {
border-bottom-color: #fff;
}
.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:focus,
.btn-group-vertical > .btn:focus {
outline: none;
}
.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:before,
.btn-toolbar:after {
display: table;
content: " ";
}
.btn-toolbar:after {
clear: both;
}
.btn-toolbar:before,
.btn-toolbar:after {
display: table;
content: " ";
}
.btn-toolbar:after {
clear: both;
}
.btn-toolbar:before,
.btn-toolbar:after {
display: table;
content: " ";
}
.btn-toolbar:after {
clear: both;
}
.btn-toolbar:before,
.btn-toolbar:after {
display: table;
content: " ";
}
.btn-toolbar:after {
clear: both;
}
.btn-toolbar:before,
.btn-toolbar:after {
display: table;
content: " ";
}
.btn-toolbar:after {
clear: both;
}
.btn-toolbar .btn-group {
float: left;
}
.btn-toolbar > .btn + .btn,
.btn-toolbar > .btn-group + .btn,
.btn-toolbar > .btn + .btn-group,
.btn-toolbar > .btn-group + .btn-group {
margin-left: 5px;
}
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
.btn-group > .btn:first-child {
margin-left: 0;
}
.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.btn-group > .btn:last-child:not(:first-child),
.btn-group > .dropdown-toggle:not(:first-child) {
border-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 > .btn:last-child,
.btn-group > .btn-group:first-child > .dropdown-toggle {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.btn-group > .btn-group:last-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-xs > .btn {
padding: 5px 10px;
padding: 1px 5px;
font-size: 13px;
line-height: 1.5;
border-radius: 3px;
}
.btn-group-sm > .btn {
padding: 5px 10px;
font-size: 13px;
line-height: 1.5;
border-radius: 3px;
}
.btn-group-lg > .btn {
padding: 14px 16px;
font-size: 19px;
line-height: 1.33;
border-radius: 6px;
}
.btn-group > .btn + .dropdown-toggle {
padding-right: 8px;
padding-left: 8px;
}
.btn-group > .btn-lg + .dropdown-toggle {
padding-right: 12px;
padding-left: 12px;
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 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 {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after {
display: table;
content: " ";
}
.btn-group-vertical > .btn-group:after {
clear: both;
}
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after {
display: table;
content: " ";
}
.btn-group-vertical > .btn-group:after {
clear: both;
}
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after {
display: table;
content: " ";
}
.btn-group-vertical > .btn-group:after {
clear: both;
}
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after {
display: table;
content: " ";
}
.btn-group-vertical > .btn-group:after {
clear: both;
}
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after {
display: table;
content: " ";
}
.btn-group-vertical > .btn-group:after {
clear: both;
}
.btn-group-vertical > .btn-group > .btn {
float: none;
}
.btn-group-vertical > .btn + .btn,
.btn-group-vertical > .btn + .btn-group,
.btn-group-vertical > .btn-group + .btn,
.btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0;
}
.btn-group-vertical > .btn:first-child:not(:last-child) {
border-top-right-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn:last-child:not(:first-child) {
border-top-right-radius: 0;
border-bottom-left-radius: 4px;
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 > .btn:last-child,
.btn-group-vertical > .btn-group:first-child > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn-group:last-child > .btn:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.btn-group-justified {
display: table;
width: 100%;
border-collapse: separate;
table-layout: fixed;
}
.btn-group-justified .btn {
display: table-cell;
float: none;
width: 1%;
}
[data-toggle="buttons"] > .btn > input[type="radio"],
[data-toggle="buttons"] > .btn > input[type="checkbox"] {
display: none;
}
.input-group {
position: relative;
display: table;
border-collapse: separate;
}
.input-group.col {
float: none;
padding-right: 0;
padding-left: 0;
}
.input-group .form-control {
width: 100%;
margin-bottom: 0;
}
.input-group-lg > .form-control,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .btn {
height: 58px;
padding: 14px 16px;
font-size: 19px;
line-height: 1.33;
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: 58px;
line-height: 58px;
}
textarea.input-group-lg > .form-control,
textarea.input-group-lg > .input-group-addon,
textarea.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: 31px;
padding: 5px 10px;
font-size: 13px;
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: 31px;
line-height: 31px;
}
textarea.input-group-sm > .form-control,
textarea.input-group-sm > .input-group-addon,
textarea.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: 8px 12px;
font-size: 15px;
font-weight: normal;
line-height: 1;
color: #777777;
text-align: center;
background-color: #eeeeee;
border: 1px solid #cccccc;
border-radius: 4px;
}
.input-group-addon.input-sm {
padding: 5px 10px;
font-size: 13px;
border-radius: 3px;
}
.input-group-addon.input-lg {
padding: 14px 16px;
font-size: 19px;
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 > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.input-group-addon:first-child {
border-right: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.input-group-addon:last-child {
border-left: 0;
}
.input-group-btn {
position: relative;
white-space: nowrap;
}
.input-group-btn:first-child > .btn {
margin-right: -1px;
}
.input-group-btn:last-child > .btn {
margin-left: -1px;
}
.input-group-btn > .btn {
position: relative;
}
.input-group-btn > .btn + .btn {
margin-left: -4px;
}
.input-group-btn > .btn:hover,
.input-group-btn > .btn:active {
z-index: 2;
}
.nav {
padding-left: 0;
margin-bottom: 0;
list-style: none;
}
.nav:before,
.nav:after {
display: table;
content: " ";
}
.nav:after {
clear: both;
}
.nav:before,
.nav:after {
display: table;
content: " ";
}
.nav:after {
clear: both;
}
.nav:before,
.nav:after {
display: table;
content: " ";
}
.nav:after {
clear: both;
}
.nav:before,
.nav:after {
display: table;
content: " ";
}
.nav:after {
clear: both;
}
.nav:before,
.nav:after {
display: table;
content: " ";
}
.nav:after {
clear: both;
}
.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: #999999;
}
.nav > li.disabled > a:hover,
.nav > li.disabled > a:focus {
color: #999999;
text-decoration: none;
cursor: not-allowed;
background-color: transparent;
}
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus {
background-color: #eeeeee;
border-color: #eb6864;
}
.nav .open > a .caret,
.nav .open > a:hover .caret,
.nav .open > a:focus .caret {
border-top-color: #e22620;
border-bottom-color: #e22620;
}
.nav .nav-divider {
height: 1px;
margin: 9.5px 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.428571429;
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: #777777;
cursor: default;
background-color: #ffffff;
border: 1px solid #dddddd;
border-bottom-color: transparent;
}
.nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.nav-tabs.nav-justified > li {
float: none;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 5px;
text-align: center;
}
.nav-tabs.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs.nav-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border: 1px solid #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: #eb6864;
}
.nav-pills > li.active > a .caret,
.nav-pills > li.active > a:hover .caret,
.nav-pills > li.active > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.nav-stacked > li {
float: none;
}
.nav-stacked > li + li {
margin-top: 2px;
margin-left: 0;
}
.nav-justified {
width: 100%;
}
.nav-justified > li {
float: none;
}
.nav-justified > li > a {
margin-bottom: 5px;
text-align: center;
}
.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs-justified {
border-bottom: 0;
}
.nav-tabs-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border: 1px solid #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 .caret {
border-top-color: #eb6864;
border-bottom-color: #eb6864;
}
.nav a:hover .caret {
border-top-color: #e22620;
border-bottom-color: #e22620;
}
.nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.navbar {
position: relative;
min-height: 60px;
margin-bottom: 21px;
border: 1px solid transparent;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
.navbar:before,
.navbar:after {
display: table;
content: " ";
}
.navbar:after {
clear: both;
}
@media (min-width: 768px) {
.navbar {
border-radius: 4px;
}
}
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-header:after {
clear: both;
}
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-header:after {
clear: both;
}
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-header:after {
clear: both;
}
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-header:after {
clear: both;
}
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-header:after {
clear: both;
}
@media (min-width: 768px) {
.navbar-header {
float: left;
}
}
.navbar-collapse {
max-height: 340px;
padding-right: 15px;
padding-left: 15px;
overflow-x: visible;
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-webkit-overflow-scrolling: touch;
}
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.navbar-collapse:after {
clear: both;
}
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.navbar-collapse:after {
clear: both;
}
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.navbar-collapse:after {
clear: both;
}
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.navbar-collapse:after {
clear: both;
}
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.navbar-collapse:after {
clear: both;
}
.navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
.navbar-collapse {
width: auto;
border-top: 0;
box-shadow: none;
}
.navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.navbar-collapse.in {
overflow-y: auto;
}
.navbar-collapse .navbar-nav.navbar-left:first-child {
margin-left: -15px;
}
.navbar-collapse .navbar-nav.navbar-right:last-child {
margin-right: -15px;
}
.navbar-collapse .navbar-text:last-child {
margin-right: 0;
}
}
.container > .navbar-header,
.container > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.container > .navbar-header,
.container > .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: 19.5px 15px;
font-size: 19px;
line-height: 21px;
}
.navbar-brand:hover,
.navbar-brand:focus {
text-decoration: none;
}
@media (min-width: 768px) {
.navbar > .container .navbar-brand {
margin-left: -15px;
}
}
.navbar-toggle {
position: relative;
float: right;
padding: 9px 10px;
margin-top: 13px;
margin-right: 15px;
margin-bottom: 13px;
background-color: transparent;
border: 1px solid transparent;
border-radius: 4px;
}
.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: 9.75px -15px;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 21px;
}
@media (max-width: 767px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
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: 21px;
}
.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: 19.5px;
padding-bottom: 19.5px;
}
}
@media (min-width: 768px) {
.navbar-left {
float: left !important;
}
.navbar-right {
float: right !important;
}
}
.navbar-form {
padding: 10px 15px;
margin-top: 10.5px;
margin-right: -15px;
margin-bottom: 10.5px;
margin-left: -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);
}
@media (min-width: 768px) {
.navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .form-control {
display: inline-block;
}
.navbar-form .radio,
.navbar-form .checkbox {
display: inline-block;
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
}
.navbar-form .radio input[type="radio"],
.navbar-form .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
@media (max-width: 767px) {
.navbar-form .form-group {
margin-bottom: 5px;
}
}
@media (min-width: 768px) {
.navbar-form {
width: auto;
padding-top: 0;
padding-bottom: 0;
margin-right: 0;
margin-left: 0;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.navbar-nav.pull-right > li > .dropdown-menu,
.navbar-nav > li > .dropdown-menu.pull-right {
right: 0;
left: auto;
}
.navbar-btn {
margin-top: 10.5px;
margin-bottom: 10.5px;
}
.navbar-text {
float: left;
margin-top: 19.5px;
margin-bottom: 19.5px;
}
@media (min-width: 768px) {
.navbar-text {
margin-right: 15px;
margin-left: 15px;
}
}
.navbar-default {
background-color: #ffffff;
border-color: #eeeeee;
}
.navbar-default .navbar-brand {
color: #000000;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #000000;
background-color: #eeeeee;
}
.navbar-default .navbar-text {
color: #000000;
}
.navbar-default .navbar-nav > li > a {
color: #000000;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #000000;
background-color: #eeeeee;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #000000;
background-color: #eeeeee;
}
.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: #cccccc;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #eeeeee;
}
.navbar-default .navbar-nav > .dropdown > a:hover .caret,
.navbar-default .navbar-nav > .dropdown > a:focus .caret {
border-top-color: #000000;
border-bottom-color: #000000;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
color: #000000;
background-color: #eeeeee;
}
.navbar-default .navbar-nav > .open > a .caret,
.navbar-default .navbar-nav > .open > a:hover .caret,
.navbar-default .navbar-nav > .open > a:focus .caret {
border-top-color: #000000;
border-bottom-color: #000000;
}
.navbar-default .navbar-nav > .dropdown > a .caret {
border-top-color: #000000;
border-bottom-color: #000000;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #000000;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #000000;
background-color: #eeeeee;
}
.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: #000000;
background-color: #eeeeee;
}
.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: #000000;
}
.navbar-default .navbar-link:hover {
color: #000000;
}
.navbar-inverse {
background-color: #eb6864;
border-color: #e53c37;
}
.navbar-inverse .navbar-brand {
color: #ffffff;
}
.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus {
color: #ffffff;
background-color: #e74b47;
}
.navbar-inverse .navbar-text {
color: #ffffff;
}
.navbar-inverse .navbar-nav > li > a {
color: #ffffff;
}
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
color: #ffffff;
background-color: #e74b47;
}
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #e74b47;
}
.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: #e53c37;
}
.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
background-color: #e53c37;
}
.navbar-inverse .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
border-color: #e74944;
}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
color: #ffffff;
background-color: #e74b47;
}
.navbar-inverse .navbar-nav > .dropdown > a:hover .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.navbar-inverse .navbar-nav > .dropdown > a .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.navbar-inverse .navbar-nav > .open > a .caret,
.navbar-inverse .navbar-nav > .open > a:hover .caret,
.navbar-inverse .navbar-nav > .open > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
@media (max-width: 767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #e53c37;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #ffffff;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: #e74b47;
}
.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: #e74b47;
}
.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: #ffffff;
}
.navbar-inverse .navbar-link:hover {
color: #ffffff;
}
.breadcrumb {
padding: 8px 15px;
margin-bottom: 21px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;
}
.breadcrumb > li {
display: inline-block;
}
.breadcrumb > li + li:before {
padding: 0 5px;
color: #cccccc;
content: "/\00a0";
}
.breadcrumb > .active {
color: #999999;
}
.pagination {
display: inline-block;
padding-left: 0;
margin: 21px 0;
border-radius: 4px;
}
.pagination > li {
display: inline;
}
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 8px 12px;
margin-left: -1px;
line-height: 1.428571429;
text-decoration: none;
background-color: #ffffff;
border: 1px solid #dddddd;
}
.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-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination > li > a:focus,
.pagination > li > span:focus {
background-color: #eeeeee;
}
.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: #999999;
cursor: default;
background-color: #f5f5f5;
border-color: #f5f5f5;
}
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
color: #999999;
cursor: not-allowed;
background-color: #ffffff;
border-color: #dddddd;
}
.pagination-lg > li > a,
.pagination-lg > li > span {
padding: 14px 16px;
font-size: 19px;
}
.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-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
.pagination-sm > li > a,
.pagination-sm > li > span {
padding: 5px 10px;
font-size: 13px;
}
.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-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.pager {
padding-left: 0;
margin: 21px 0;
text-align: center;
list-style: none;
}
.pager:before,
.pager:after {
display: table;
content: " ";
}
.pager:after {
clear: both;
}
.pager:before,
.pager:after {
display: table;
content: " ";
}
.pager:after {
clear: both;
}
.pager:before,
.pager:after {
display: table;
content: " ";
}
.pager:after {
clear: both;
}
.pager:before,
.pager:after {
display: table;
content: " ";
}
.pager:after {
clear: both;
}
.pager:before,
.pager:after {
display: table;
content: " ";
}
.pager:after {
clear: both;
}
.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: #999999;
cursor: not-allowed;
background-color: #ffffff;
}
.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;
}
.label[href]:hover,
.label[href]:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.label:empty {
display: none;
}
.label-default {
background-color: #999999;
}
.label-default[href]:hover,
.label-default[href]:focus {
background-color: #808080;
}
.label-primary {
background-color: #eb6864;
}
.label-primary[href]:hover,
.label-primary[href]:focus {
background-color: #e53c37;
}
.label-success {
background-color: #22b24c;
}
.label-success[href]:hover,
.label-success[href]:focus {
background-color: #1a873a;
}
.label-info {
background-color: #336699;
}
.label-info[href]:hover,
.label-info[href]:focus {
background-color: #264c73;
}
.label-warning {
background-color: #f5e625;
}
.label-warning[href]:hover,
.label-warning[href]:focus {
background-color: #ddce0a;
}
.label-danger {
background-color: #f57a00;
}
.label-danger[href]:hover,
.label-danger[href]:focus {
background-color: #c26100;
}
.badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 13px;
font-weight: bold;
line-height: 1;
color: #ffffff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
background-color: #999999;
border-radius: 10px;
}
.badge:empty {
display: none;
}
a.badge:hover,
a.badge:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.btn .badge {
position: relative;
top: -1px;
}
a.list-group-item.active > .badge,
.nav-pills > .active > a > .badge {
color: #eb6864;
background-color: #ffffff;
}
.nav-pills > li > a > .badge {
margin-left: 3px;
}
.jumbotron {
padding: 30px;
margin-bottom: 30px;
font-size: 23px;
font-weight: 200;
line-height: 2.1428571435;
color: inherit;
background-color: #eeeeee;
}
.jumbotron h1 {
line-height: 1;
color: inherit;
}
.jumbotron p {
line-height: 1.4;
}
.container .jumbotron {
border-radius: 6px;
}
@media screen and (min-width: 768px) {
.jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .jumbotron {
padding-right: 60px;
padding-left: 60px;
}
.jumbotron h1 {
font-size: 67.5px;
}
}
.thumbnail {
display: inline-block;
display: block;
height: auto;
max-width: 100%;
padding: 4px;
margin-bottom: 21px;
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.thumbnail > img {
display: block;
height: auto;
max-width: 100%;
margin-right: auto;
margin-left: auto;
}
a.thumbnail:hover,
a.thumbnail:focus,
a.thumbnail.active {
border-color: #eb6864;
}
.thumbnail .caption {
padding: 9px;
color: #777777;
}
.alert {
padding: 15px;
margin-bottom: 21px;
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 {
padding-right: 35px;
}
.alert-dismissable .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.alert-success {
color: #468847;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.alert-success hr {
border-top-color: #c9e2b3;
}
.alert-success .alert-link {
color: #356635;
}
.alert-info {
color: #3a87ad;
background-color: #d9edf7;
border-color: #bce8f1;
}
.alert-info hr {
border-top-color: #a6e1ec;
}
.alert-info .alert-link {
color: #2d6987;
}
.alert-warning {
color: #c09853;
background-color: #fcf8e3;
border-color: #fbeed5;
}
.alert-warning hr {
border-top-color: #f8e5be;
}
.alert-warning .alert-link {
color: #a47e3c;
}
.alert-danger {
color: #b94a48;
background-color: #f2dede;
border-color: #eed3d7;
}
.alert-danger hr {
border-top-color: #e6c1c7;
}
.alert-danger .alert-link {
color: #953b39;
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-moz-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-o-keyframes progress-bar-stripes {
from {
background-position: 0 0;
}
to {
background-position: 40px 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.progress {
height: 21px;
margin-bottom: 21px;
overflow: hidden;
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: 13px;
line-height: 21px;
color: #ffffff;
text-align: center;
background-color: #eb6864;
-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;
transition: width 0.6s ease;
}
.progress-striped .progress-bar {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
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: -moz-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);
background-size: 40px 40px;
}
.progress.active .progress-bar {
-webkit-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
.progress-bar-success {
background-color: #22b24c;
}
.progress-striped .progress-bar-success {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
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: -moz-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: #336699;
}
.progress-striped .progress-bar-info {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
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: -moz-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: #f5e625;
}
.progress-striped .progress-bar-warning {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
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: -moz-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: #f57a00;
}
.progress-striped .progress-bar-danger {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
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: -moz-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,
.media-body {
overflow: hidden;
zoom: 1;
}
.media,
.media .media {
margin-top: 15px;
}
.media:first-child {
margin-top: 0;
}
.media-object {
display: block;
}
.media-heading {
margin: 0 0 5px;
}
.media > .pull-left {
margin-right: 10px;
}
.media > .pull-right {
margin-left: 10px;
}
.media-list {
padding-left: 0;
list-style: none;
}
.list-group {
padding-left: 0;
margin-bottom: 20px;
}
.list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #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;
}
.list-group-item > .badge {
float: right;
}
.list-group-item > .badge + .badge {
margin-right: 5px;
}
a.list-group-item {
color: #555555;
}
a.list-group-item .list-group-item-heading {
color: #333333;
}
a.list-group-item:hover,
a.list-group-item:focus {
text-decoration: none;
background-color: #f5f5f5;
}
a.list-group-item.active,
a.list-group-item.active:hover,
a.list-group-item.active:focus {
z-index: 2;
color: #ffffff;
background-color: #eb6864;
border-color: #eb6864;
}
a.list-group-item.active .list-group-item-heading,
a.list-group-item.active:hover .list-group-item-heading,
a.list-group-item.active:focus .list-group-item-heading {
color: inherit;
}
a.list-group-item.active .list-group-item-text,
a.list-group-item.active:hover .list-group-item-text,
a.list-group-item.active:focus .list-group-item-text {
color: #ffffff;
}
.list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}
.panel {
margin-bottom: 21px;
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-body:before,
.panel-body:after {
display: table;
content: " ";
}
.panel-body:after {
clear: both;
}
.panel-body:before,
.panel-body:after {
display: table;
content: " ";
}
.panel-body:after {
clear: both;
}
.panel-body:before,
.panel-body:after {
display: table;
content: " ";
}
.panel-body:after {
clear: both;
}
.panel-body:before,
.panel-body:after {
display: table;
content: " ";
}
.panel-body:after {
clear: both;
}
.panel-body:before,
.panel-body:after {
display: table;
content: " ";
}
.panel-body:after {
clear: both;
}
.panel > .list-group {
margin-bottom: 0;
}
.panel > .list-group .list-group-item {
border-width: 1px 0;
}
.panel > .list-group .list-group-item:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.panel > .list-group .list-group-item:last-child {
border-bottom: 0;
}
.panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0;
}
.panel > .table,
.panel > .table-responsive {
margin-bottom: 0;
}
.panel > .panel-body + .table,
.panel > .panel-body + .table-responsive {
border-top: 1px solid #dddddd;
}
.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:last-child > th,
.panel > .table-responsive > .table-bordered > thead > tr:last-child > th,
.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,
.panel > .table-bordered > thead > tr:last-child > td,
.panel > .table-responsive > .table-bordered > thead > tr:last-child > td,
.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 {
border-bottom: 0;
}
.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: 17px;
}
.panel-title > 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-group .panel {
margin-bottom: 0;
overflow: hidden;
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 {
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: #777777;
background-color: #f5f5f5;
border-color: #dddddd;
}
.panel-default > .panel-heading + .panel-collapse .panel-body {
border-top-color: #dddddd;
}
.panel-default > .panel-heading > .dropdown .caret {
border-color: #777777 transparent;
}
.panel-default > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #dddddd;
}
.panel-primary {
border-color: #eb6864;
}
.panel-primary > .panel-heading {
color: #ffffff;
background-color: #eb6864;
border-color: #eb6864;
}
.panel-primary > .panel-heading + .panel-collapse .panel-body {
border-top-color: #eb6864;
}
.panel-primary > .panel-heading > .dropdown .caret {
border-color: #ffffff transparent;
}
.panel-primary > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #eb6864;
}
.panel-success {
border-color: #22b24c;
}
.panel-success > .panel-heading {
color: #468847;
background-color: #22b24c;
border-color: #22b24c;
}
.panel-success > .panel-heading + .panel-collapse .panel-body {
border-top-color: #22b24c;
}
.panel-success > .panel-heading > .dropdown .caret {
border-color: #468847 transparent;
}
.panel-success > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #22b24c;
}
.panel-warning {
border-color: #f5e625;
}
.panel-warning > .panel-heading {
color: #c09853;
background-color: #f5e625;
border-color: #f5e625;
}
.panel-warning > .panel-heading + .panel-collapse .panel-body {
border-top-color: #f5e625;
}
.panel-warning > .panel-heading > .dropdown .caret {
border-color: #c09853 transparent;
}
.panel-warning > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #f5e625;
}
.panel-danger {
border-color: #f57a00;
}
.panel-danger > .panel-heading {
color: #b94a48;
background-color: #f57a00;
border-color: #f57a00;
}
.panel-danger > .panel-heading + .panel-collapse .panel-body {
border-top-color: #f57a00;
}
.panel-danger > .panel-heading > .dropdown .caret {
border-color: #b94a48 transparent;
}
.panel-danger > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #f57a00;
}
.panel-info {
border-color: #336699;
}
.panel-info > .panel-heading {
color: #3a87ad;
background-color: #336699;
border-color: #336699;
}
.panel-info > .panel-heading + .panel-collapse .panel-body {
border-top-color: #336699;
}
.panel-info > .panel-heading > .dropdown .caret {
border-color: #3a87ad transparent;
}
.panel-info > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #336699;
}
.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: 22.5px;
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 {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
display: none;
overflow: auto;
overflow-y: scroll;
}
.modal.fade .modal-dialog {
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
transform: translate(0, -25%);
-webkit-transition: -webkit-transform 0.3s ease-out;
-moz-transition: -moz-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);
transform: translate(0, 0);
}
.modal-dialog {
position: relative;
z-index: 1050;
width: auto;
padding: 10px;
margin-right: auto;
margin-left: auto;
}
.modal-content {
position: relative;
background-color: #ffffff;
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
outline: none;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
background-clip: padding-box;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1030;
background-color: #000000;
}
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0);
}
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50);
}
.modal-header {
min-height: 16.428571429px;
padding: 15px;
border-bottom: 1px solid #e5e5e5;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.428571429;
}
.modal-body {
position: relative;
padding: 20px;
}
.modal-footer {
padding: 19px 20px 20px;
margin-top: 15px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.modal-footer:after {
clear: both;
}
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.modal-footer:after {
clear: both;
}
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.modal-footer:after {
clear: both;
}
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.modal-footer:after {
clear: both;
}
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.modal-footer:after {
clear: both;
}
.modal-footer .btn + .btn {
margin-bottom: 0;
margin-left: 5px;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
@media screen and (min-width: 768px) {
.modal-dialog {
width: 600px;
padding-top: 30px;
padding-bottom: 30px;
}
.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);
}
}
.tooltip {
position: absolute;
z-index: 1030;
display: block;
font-size: 13px;
line-height: 1.4;
opacity: 0;
filter: alpha(opacity=0);
visibility: visible;
}
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90);
}
.tooltip.top {
padding: 5px 0;
margin-top: -3px;
}
.tooltip.right {
padding: 0 5px;
margin-left: 3px;
}
.tooltip.bottom {
padding: 5px 0;
margin-top: 3px;
}
.tooltip.left {
padding: 0 5px;
margin-left: -3px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
text-decoration: none;
background-color: rgba(0, 0, 0, 0.9);
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-top-color: rgba(0, 0, 0, 0.9);
border-width: 5px 5px 0;
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
left: 5px;
border-top-color: rgba(0, 0, 0, 0.9);
border-width: 5px 5px 0;
}
.tooltip.top-right .tooltip-arrow {
right: 5px;
bottom: 0;
border-top-color: rgba(0, 0, 0, 0.9);
border-width: 5px 5px 0;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-right-color: rgba(0, 0, 0, 0.9);
border-width: 5px 5px 5px 0;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-left-color: rgba(0, 0, 0, 0.9);
border-width: 5px 0 5px 5px;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-bottom-color: rgba(0, 0, 0, 0.9);
border-width: 0 5px 5px;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
left: 5px;
border-bottom-color: rgba(0, 0, 0, 0.9);
border-width: 0 5px 5px;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
right: 5px;
border-bottom-color: rgba(0, 0, 0, 0.9);
border-width: 0 5px 5px;
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
max-width: 276px;
padding: 1px;
text-align: left;
white-space: normal;
background-color: #ffffff;
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);
background-clip: padding-box;
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
padding: 8px 14px;
margin: 0;
font-size: 15px;
font-weight: normal;
line-height: 18px;
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 {
bottom: -11px;
left: 50%;
margin-left: -11px;
border-top-color: #999999;
border-top-color: rgba(0, 0, 0, 0.25);
border-bottom-width: 0;
}
.popover.top .arrow:after {
bottom: 1px;
margin-left: -10px;
border-top-color: #ffffff;
border-bottom-width: 0;
content: " ";
}
.popover.right .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-right-color: #999999;
border-right-color: rgba(0, 0, 0, 0.25);
border-left-width: 0;
}
.popover.right .arrow:after {
bottom: -10px;
left: 1px;
border-right-color: #ffffff;
border-left-width: 0;
content: " ";
}
.popover.bottom .arrow {
top: -11px;
left: 50%;
margin-left: -11px;
border-bottom-color: #999999;
border-bottom-color: rgba(0, 0, 0, 0.25);
border-top-width: 0;
}
.popover.bottom .arrow:after {
top: 1px;
margin-left: -10px;
border-bottom-color: #ffffff;
border-top-width: 0;
content: " ";
}
.popover.left .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-left-color: #999999;
border-left-color: rgba(0, 0, 0, 0.25);
border-right-width: 0;
}
.popover.left .arrow:after {
right: 1px;
bottom: -10px;
border-left-color: #ffffff;
border-right-width: 0;
content: " ";
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
width: 100%;
overflow: hidden;
}
.carousel-inner > .item {
position: relative;
display: none;
-webkit-transition: 0.6s ease-in-out left;
transition: 0.6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
height: auto;
max-width: 100%;
line-height: 1;
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 15%;
font-size: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
opacity: 0.5;
filter: alpha(opacity=50);
}
.carousel-control.left {
background-image: -webkit-gradient(linear, 0 top, 100% top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001)));
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0), color-stop(rgba(0, 0, 0, 0.0001) 100%));
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);
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 {
right: 0;
left: auto;
background-image: -webkit-gradient(linear, 0 top, 100% top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5)));
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0), color-stop(rgba(0, 0, 0, 0.5) 100%));
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);
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 {
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%;
z-index: 5;
display: inline-block;
}
.carousel-control .icon-prev,
.carousel-control .glyphicon-chevron-left {
left: 50%;
}
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-right {
right: 50%;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
margin-top: -10px;
margin-left: -10px;
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%;
padding-left: 0;
margin-left: -30%;
text-align: center;
list-style: none;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
cursor: pointer;
background-color: #000 \9;
background-color: rgba(0, 0, 0, 0);
border: 1px solid #ffffff;
border-radius: 10px;
}
.carousel-indicators .active {
width: 12px;
height: 12px;
margin: 0;
background-color: #ffffff;
}
.carousel-caption {
position: absolute;
right: 15%;
bottom: 20px;
left: 15%;
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 .glyphicons-chevron-left,
.carousel-control .glyphicons-chevron-right,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -15px;
margin-left: -15px;
font-size: 30px;
}
.carousel-caption {
right: 20%;
left: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}
}
.clearfix:before,
.clearfix:after {
display: table;
content: " ";
}
.clearfix:after {
clear: both;
}
.clearfix:before,
.clearfix:after {
display: table;
content: " ";
}
.clearfix:after {
clear: both;
}
.center-block {
display: block;
margin-right: auto;
margin-left: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
visibility: hidden !important;
}
.affix {
position: fixed;
}
@-ms-viewport {
width: device-width;
}
.visible-xs,
tr.visible-xs,
th.visible-xs,
td.visible-xs {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-xs.visible-sm {
display: block !important;
}
tr.visible-xs.visible-sm {
display: table-row !important;
}
th.visible-xs.visible-sm,
td.visible-xs.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-xs.visible-md {
display: block !important;
}
tr.visible-xs.visible-md {
display: table-row !important;
}
th.visible-xs.visible-md,
td.visible-xs.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-xs.visible-lg {
display: block !important;
}
tr.visible-xs.visible-lg {
display: table-row !important;
}
th.visible-xs.visible-lg,
td.visible-xs.visible-lg {
display: table-cell !important;
}
}
.visible-sm,
tr.visible-sm,
th.visible-sm,
td.visible-sm {
display: none !important;
}
@media (max-width: 767px) {
.visible-sm.visible-xs {
display: block !important;
}
tr.visible-sm.visible-xs {
display: table-row !important;
}
th.visible-sm.visible-xs,
td.visible-sm.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-sm.visible-md {
display: block !important;
}
tr.visible-sm.visible-md {
display: table-row !important;
}
th.visible-sm.visible-md,
td.visible-sm.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-sm.visible-lg {
display: block !important;
}
tr.visible-sm.visible-lg {
display: table-row !important;
}
th.visible-sm.visible-lg,
td.visible-sm.visible-lg {
display: table-cell !important;
}
}
.visible-md,
tr.visible-md,
th.visible-md,
td.visible-md {
display: none !important;
}
@media (max-width: 767px) {
.visible-md.visible-xs {
display: block !important;
}
tr.visible-md.visible-xs {
display: table-row !important;
}
th.visible-md.visible-xs,
td.visible-md.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-md.visible-sm {
display: block !important;
}
tr.visible-md.visible-sm {
display: table-row !important;
}
th.visible-md.visible-sm,
td.visible-md.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-md.visible-lg {
display: block !important;
}
tr.visible-md.visible-lg {
display: table-row !important;
}
th.visible-md.visible-lg,
td.visible-md.visible-lg {
display: table-cell !important;
}
}
.visible-lg,
tr.visible-lg,
th.visible-lg,
td.visible-lg {
display: none !important;
}
@media (max-width: 767px) {
.visible-lg.visible-xs {
display: block !important;
}
tr.visible-lg.visible-xs {
display: table-row !important;
}
th.visible-lg.visible-xs,
td.visible-lg.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-lg.visible-sm {
display: block !important;
}
tr.visible-lg.visible-sm {
display: table-row !important;
}
th.visible-lg.visible-sm,
td.visible-lg.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-lg.visible-md {
display: block !important;
}
tr.visible-lg.visible-md {
display: table-row !important;
}
th.visible-lg.visible-md,
td.visible-lg.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
.hidden-xs {
display: block !important;
}
tr.hidden-xs {
display: table-row !important;
}
th.hidden-xs,
td.hidden-xs {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-xs,
tr.hidden-xs,
th.hidden-xs,
td.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-xs.hidden-sm,
tr.hidden-xs.hidden-sm,
th.hidden-xs.hidden-sm,
td.hidden-xs.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-xs.hidden-md,
tr.hidden-xs.hidden-md,
th.hidden-xs.hidden-md,
td.hidden-xs.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-xs.hidden-lg,
tr.hidden-xs.hidden-lg,
th.hidden-xs.hidden-lg,
td.hidden-xs.hidden-lg {
display: none !important;
}
}
.hidden-sm {
display: block !important;
}
tr.hidden-sm {
display: table-row !important;
}
th.hidden-sm,
td.hidden-sm {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-sm.hidden-xs,
tr.hidden-sm.hidden-xs,
th.hidden-sm.hidden-xs,
td.hidden-sm.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm,
tr.hidden-sm,
th.hidden-sm,
td.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-sm.hidden-md,
tr.hidden-sm.hidden-md,
th.hidden-sm.hidden-md,
td.hidden-sm.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-sm.hidden-lg,
tr.hidden-sm.hidden-lg,
th.hidden-sm.hidden-lg,
td.hidden-sm.hidden-lg {
display: none !important;
}
}
.hidden-md {
display: block !important;
}
tr.hidden-md {
display: table-row !important;
}
th.hidden-md,
td.hidden-md {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-md.hidden-xs,
tr.hidden-md.hidden-xs,
th.hidden-md.hidden-xs,
td.hidden-md.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-md.hidden-sm,
tr.hidden-md.hidden-sm,
th.hidden-md.hidden-sm,
td.hidden-md.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md,
tr.hidden-md,
th.hidden-md,
td.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-md.hidden-lg,
tr.hidden-md.hidden-lg,
th.hidden-md.hidden-lg,
td.hidden-md.hidden-lg {
display: none !important;
}
}
.hidden-lg {
display: block !important;
}
tr.hidden-lg {
display: table-row !important;
}
th.hidden-lg,
td.hidden-lg {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-lg.hidden-xs,
tr.hidden-lg.hidden-xs,
th.hidden-lg.hidden-xs,
td.hidden-lg.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-lg.hidden-sm,
tr.hidden-lg.hidden-sm,
th.hidden-lg.hidden-sm,
td.hidden-lg.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-lg.hidden-md,
tr.hidden-lg.hidden-md,
th.hidden-lg.hidden-md,
td.hidden-lg.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-lg,
tr.hidden-lg,
th.hidden-lg,
td.hidden-lg {
display: none !important;
}
}
.visible-print,
tr.visible-print,
th.visible-print,
td.visible-print {
display: none !important;
}
@media print {
.visible-print {
display: block !important;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
.hidden-print,
tr.hidden-print,
th.hidden-print,
td.hidden-print {
display: none !important;
}
}
.navbar {
font-family: "News Cycle", "Arial Narrow Bold", sans-serif;
font-size: 18px;
font-weight: 700;
}
.navbar-brand {
font-size: 18px;
font-weight: 700;
text-transform: uppercase;
}
.has-warning .help-block,
.has-warning .control-label {
color: #f57a00;
}
.has-warning .form-control,
.has-warning .form-control:focus {
border-color: #f57a00;
}
.has-error .help-block,
.has-error .control-label {
color: #eb6864;
}
.has-error .form-control,
.has-error .form-control:focus {
border-color: #eb6864;
}
.has-success .help-block,
.has-success .control-label {
color: #22b24c;
}
.has-success .form-control,
.has-success .form-control:focus {
border-color: #22b24c;
}
.pagination .active > a,
.pagination .active > a:hover {
border-color: #ddd;
}
.jumbotron h1,
.jumbotron h2,
.jumbotron h3,
.jumbotron h4,
.jumbotron h5,
.jumbotron h6 {
font-family: "News Cycle", "Arial Narrow Bold", sans-serif;
font-weight: 700;
color: #000;
}
.panel-primary .panel-title,
.panel-success .panel-title,
.panel-warning .panel-title,
.panel-danger .panel-title,
.panel-info .panel-title {
color: #fff;
}
.clearfix:before,
.clearfix:after {
display: table;
content: " ";
}
.clearfix:after {
clear: both;
}
.clearfix:before,
.clearfix:after {
display: table;
content: " ";
}
.clearfix:after {
clear: both;
}
.center-block {
display: block;
margin-right: auto;
margin-left: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
visibility: hidden !important;
}
.affix {
position: fixed;
}
.top-space {
margin-top: 45px;
}
| Java |
Copyright 2013 Romens Team
http://romens.ru/
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. | Java |
#include <gtest/gtest.h>
#include "loquat/misc/binary_search.hpp"
TEST(BinarySearchTest, Integer){
for(int l = -16; l <= 16; ++l){
for(int r = l; r <= 16; ++r){
for(int expect = l; expect <= r; ++expect){
const auto actual = loquat::binary_search(
l, r, [=](int x){ return x < expect; });
EXPECT_EQ(expect, actual);
}
}
}
}
TEST(BinarySearchTest, Floating){
for(int li = -16; li <= 16; ++li){
for(int ri = li; ri <= li; ++ri){
const double l = li * 1.1, r = ri * 1.1;
for(double expect = l; expect < r; expect += 0.2){
const auto actual = loquat::binary_search(
l, r, [=](double x){ return x < expect; });
EXPECT_DOUBLE_EQ(expect, actual);
}
const auto min_actual = loquat::binary_search(
l, r, [=](double){ return true; });
EXPECT_DOUBLE_EQ(l, min_actual);
const auto max_actual = loquat::binary_search(
l, r, [=](double){ return false; });
EXPECT_DOUBLE_EQ(r, max_actual);
}
}
}
| Java |
"""
``editquality generate_make -h``
::
Code-generate Makefile from template and configuration
:Usage:
generate_make -h | --help
generate_make
[--config=<path>]
[--main=<filename>]
[--output=<path>]
[--templates=<path>]
[--debug]
:Options:
--config=<path> Directory to search for configuration files
[default: config/]
--main=<filename> Override to use a main template other than the
default [default: Makefile.j2]
--output=<path> Where to write the Makefile output.
[default: <stdout>]
--templates=<path> Directory to search for input templates.
[default: templates/]
--debug Print debug logging
"""
# TODO:
# * make API calls to learn things
# * ores/config has dict merge
# * survey dependency solvers
# https://github.com/ninja-build/ninja/wiki/List-of-generators-producing-ninja-build-files
# ** Still considering: scons, doit, drake, ninja, meson
# ** Don't like so far: waf
# * Where can we store information about samples?
# Original population rates; how we've distorted them.
import logging
import os.path
import sys
import docopt
from .. import config
from ..codegen import generate
logger = logging.getLogger(__name__)
def main(argv=None):
args = docopt.docopt(__doc__, argv=argv)
logging.basicConfig(
level=logging.DEBUG if args['--debug'] else logging.WARNING,
format='%(asctime)s %(levelname)s:%(name)s -- %(message)s'
)
config_path = args["--config"]
output_f = sys.stdout \
if args["--output"] == "<stdout>" \
else open(args["--output"], "w")
templates_path = args["--templates"]
main_template_path = args["--main"]
if not os.path.isabs(main_template_path):
# Join a filename to the default templates dir.
main_template_path = os.path.join(templates_path, main_template_path)
with open(main_template_path, "r") as f:
main_template = f.read()
variables = config.load_config(config_path)
output = generate.generate(variables, templates_path, main_template)
output_f.write(output)
| Java |
/**
* Reverb for the OpenAL cross platform audio library
* Copyright (C) 2008-2009 by Christopher Fitzgerald.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Or go to http://www.gnu.org/copyleft/lgpl.html
*/
#include "config.h"
#include <math.h>
#include <stdlib.h>
#include "AL/al.h"
#include "AL/alc.h"
#include "alMain.h"
#include "alAuxEffectSlot.h"
#include "alEffect.h"
#include "alError.h"
#include "alu.h"
typedef struct DelayLine
{
// The delay lines use sample lengths that are powers of 2 to allow
// bitmasking instead of modulus wrapping.
ALuint Mask;
ALfloat *Line;
} DelayLine;
typedef struct ALverbState {
// Must be first in all effects!
ALeffectState state;
// All delay lines are allocated as a single buffer to reduce memory
// fragmentation and management code.
ALfloat *SampleBuffer;
// Master effect low-pass filter (2 chained 1-pole filters).
FILTER LpFilter;
ALfloat LpHistory[2];
// Initial effect delay and decorrelation.
DelayLine Delay;
// The tap points for the initial delay. First tap goes to early
// reflections, the last four decorrelate to late reverb.
ALuint Tap[5];
struct {
// Total gain for early reflections.
ALfloat Gain;
// Early reflections are done with 4 delay lines.
ALfloat Coeff[4];
DelayLine Delay[4];
ALuint Offset[4];
// The gain for each output channel based on 3D panning.
ALfloat PanGain[OUTPUTCHANNELS];
} Early;
struct {
// Total gain for late reverb.
ALfloat Gain;
// Attenuation to compensate for modal density and decay rate.
ALfloat DensityGain;
// The feed-back and feed-forward all-pass coefficient.
ALfloat ApFeedCoeff;
// Mixing matrix coefficient.
ALfloat MixCoeff;
// Late reverb has 4 parallel all-pass filters.
ALfloat ApCoeff[4];
DelayLine ApDelay[4];
ALuint ApOffset[4];
// In addition to 4 cyclical delay lines.
ALfloat Coeff[4];
DelayLine Delay[4];
ALuint Offset[4];
// The cyclical delay lines are 1-pole low-pass filtered.
ALfloat LpCoeff[4];
ALfloat LpSample[4];
// The gain for each output channel based on 3D panning.
ALfloat PanGain[OUTPUTCHANNELS];
} Late;
// The current read offset for all delay lines.
ALuint Offset;
} ALverbState;
// All delay line lengths are specified in seconds.
// The lengths of the early delay lines.
static const ALfloat EARLY_LINE_LENGTH[4] =
{
0.0015f, 0.0045f, 0.0135f, 0.0405f
};
// The lengths of the late all-pass delay lines.
static const ALfloat ALLPASS_LINE_LENGTH[4] =
{
0.0151f, 0.0167f, 0.0183f, 0.0200f,
};
// The lengths of the late cyclical delay lines.
static const ALfloat LATE_LINE_LENGTH[4] =
{
0.0211f, 0.0311f, 0.0461f, 0.0680f
};
// The late cyclical delay lines have a variable length dependent on the
// effect's density parameter (inverted for some reason) and this multiplier.
static const ALfloat LATE_LINE_MULTIPLIER = 4.0f;
// Input into the late reverb is decorrelated between four channels. Their
// timings are dependent on a fraction and multiplier. See VerbUpdate() for
// the calculations involved.
static const ALfloat DECO_FRACTION = 1.0f / 32.0f;
static const ALfloat DECO_MULTIPLIER = 2.0f;
// The maximum length of initial delay for the master delay line (a sum of
// the maximum early reflection and late reverb delays).
static const ALfloat MASTER_LINE_LENGTH = 0.3f + 0.1f;
// Find the next power of 2. Actually, this will return the input value if
// it is already a power of 2.
static ALuint NextPowerOf2(ALuint value)
{
ALuint powerOf2 = 1;
if(value)
{
value--;
while(value)
{
value >>= 1;
powerOf2 <<= 1;
}
}
return powerOf2;
}
// Basic delay line input/output routines.
static __inline ALfloat DelayLineOut(DelayLine *Delay, ALuint offset)
{
return Delay->Line[offset&Delay->Mask];
}
static __inline ALvoid DelayLineIn(DelayLine *Delay, ALuint offset, ALfloat in)
{
Delay->Line[offset&Delay->Mask] = in;
}
// Delay line output routine for early reflections.
static __inline ALfloat EarlyDelayLineOut(ALverbState *State, ALuint index)
{
return State->Early.Coeff[index] *
DelayLineOut(&State->Early.Delay[index],
State->Offset - State->Early.Offset[index]);
}
// Given an input sample, this function produces stereo output for early
// reflections.
static __inline ALvoid EarlyReflection(ALverbState *State, ALfloat in, ALfloat *out)
{
ALfloat d[4], v, f[4];
// Obtain the decayed results of each early delay line.
d[0] = EarlyDelayLineOut(State, 0);
d[1] = EarlyDelayLineOut(State, 1);
d[2] = EarlyDelayLineOut(State, 2);
d[3] = EarlyDelayLineOut(State, 3);
/* The following uses a lossless scattering junction from waveguide
* theory. It actually amounts to a householder mixing matrix, which
* will produce a maximally diffuse response, and means this can probably
* be considered a simple feedback delay network (FDN).
* N
* ---
* \
* v = 2/N / d_i
* ---
* i=1
*/
v = (d[0] + d[1] + d[2] + d[3]) * 0.5f;
// The junction is loaded with the input here.
v += in;
// Calculate the feed values for the delay lines.
f[0] = v - d[0];
f[1] = v - d[1];
f[2] = v - d[2];
f[3] = v - d[3];
// Refeed the delay lines.
DelayLineIn(&State->Early.Delay[0], State->Offset, f[0]);
DelayLineIn(&State->Early.Delay[1], State->Offset, f[1]);
DelayLineIn(&State->Early.Delay[2], State->Offset, f[2]);
DelayLineIn(&State->Early.Delay[3], State->Offset, f[3]);
// Output the results of the junction for all four lines.
out[0] = State->Early.Gain * f[0];
out[1] = State->Early.Gain * f[1];
out[2] = State->Early.Gain * f[2];
out[3] = State->Early.Gain * f[3];
}
// All-pass input/output routine for late reverb.
static __inline ALfloat LateAllPassInOut(ALverbState *State, ALuint index, ALfloat in)
{
ALfloat out;
out = State->Late.ApCoeff[index] *
DelayLineOut(&State->Late.ApDelay[index],
State->Offset - State->Late.ApOffset[index]);
out -= (State->Late.ApFeedCoeff * in);
DelayLineIn(&State->Late.ApDelay[index], State->Offset,
(State->Late.ApFeedCoeff * out) + in);
return out;
}
// Delay line output routine for late reverb.
static __inline ALfloat LateDelayLineOut(ALverbState *State, ALuint index)
{
return State->Late.Coeff[index] *
DelayLineOut(&State->Late.Delay[index],
State->Offset - State->Late.Offset[index]);
}
// Low-pass filter input/output routine for late reverb.
static __inline ALfloat LateLowPassInOut(ALverbState *State, ALuint index, ALfloat in)
{
State->Late.LpSample[index] = in +
((State->Late.LpSample[index] - in) * State->Late.LpCoeff[index]);
return State->Late.LpSample[index];
}
// Given four decorrelated input samples, this function produces stereo
// output for late reverb.
static __inline ALvoid LateReverb(ALverbState *State, ALfloat *in, ALfloat *out)
{
ALfloat d[4], f[4];
// Obtain the decayed results of the cyclical delay lines, and add the
// corresponding input channels attenuated by density. Then pass the
// results through the low-pass filters.
d[0] = LateLowPassInOut(State, 0, (State->Late.DensityGain * in[0]) +
LateDelayLineOut(State, 0));
d[1] = LateLowPassInOut(State, 1, (State->Late.DensityGain * in[1]) +
LateDelayLineOut(State, 1));
d[2] = LateLowPassInOut(State, 2, (State->Late.DensityGain * in[2]) +
LateDelayLineOut(State, 2));
d[3] = LateLowPassInOut(State, 3, (State->Late.DensityGain * in[3]) +
LateDelayLineOut(State, 3));
// To help increase diffusion, run each line through an all-pass filter.
// The order of the all-pass filters is selected so that the shortest
// all-pass filter will feed the shortest delay line.
d[0] = LateAllPassInOut(State, 1, d[0]);
d[1] = LateAllPassInOut(State, 3, d[1]);
d[2] = LateAllPassInOut(State, 0, d[2]);
d[3] = LateAllPassInOut(State, 2, d[3]);
/* Late reverb is done with a modified feedback delay network (FDN)
* topology. Four input lines are each fed through their own all-pass
* filter and then into the mixing matrix. The four outputs of the
* mixing matrix are then cycled back to the inputs. Each output feeds
* a different input to form a circlular feed cycle.
*
* The mixing matrix used is a 4D skew-symmetric rotation matrix derived
* using a single unitary rotational parameter:
*
* [ d, a, b, c ] 1 = a^2 + b^2 + c^2 + d^2
* [ -a, d, c, -b ]
* [ -b, -c, d, a ]
* [ -c, b, -a, d ]
*
* The rotation is constructed from the effect's diffusion parameter,
* yielding: 1 = x^2 + 3 y^2; where a, b, and c are the coefficient y
* with differing signs, and d is the coefficient x. The matrix is thus:
*
* [ x, y, -y, y ] x = 1 - (0.5 diffusion^3)
* [ -y, x, y, y ] y = sqrt((1 - x^2) / 3)
* [ y, -y, x, y ]
* [ -y, -y, -y, x ]
*
* To reduce the number of multiplies, the x coefficient is applied with
* the cyclical delay line coefficients. Thus only the y coefficient is
* applied when mixing, and is modified to be: y / x.
*/
f[0] = d[0] + (State->Late.MixCoeff * ( d[1] - d[2] + d[3]));
f[1] = d[1] + (State->Late.MixCoeff * (-d[0] + d[2] + d[3]));
f[2] = d[2] + (State->Late.MixCoeff * ( d[0] - d[1] + d[3]));
f[3] = d[3] + (State->Late.MixCoeff * (-d[0] - d[1] - d[2]));
// Output the results of the matrix for all four cyclical delay lines,
// attenuated by the late reverb gain (which is attenuated by the 'x'
// mix coefficient).
out[0] = State->Late.Gain * f[0];
out[1] = State->Late.Gain * f[1];
out[2] = State->Late.Gain * f[2];
out[3] = State->Late.Gain * f[3];
// The delay lines are fed circularly in the order:
// 0 -> 1 -> 3 -> 2 -> 0 ...
DelayLineIn(&State->Late.Delay[0], State->Offset, f[2]);
DelayLineIn(&State->Late.Delay[1], State->Offset, f[0]);
DelayLineIn(&State->Late.Delay[2], State->Offset, f[3]);
DelayLineIn(&State->Late.Delay[3], State->Offset, f[1]);
}
// Process the reverb for a given input sample, resulting in separate four-
// channel output for both early reflections and late reverb.
static __inline ALvoid ReverbInOut(ALverbState *State, ALfloat in, ALfloat *early, ALfloat *late)
{
ALfloat taps[4];
// Low-pass filter the incoming sample.
in = lpFilter2P(&State->LpFilter, 0, in);
// Feed the initial delay line.
DelayLineIn(&State->Delay, State->Offset, in);
// Calculate the early reflection from the first delay tap.
in = DelayLineOut(&State->Delay, State->Offset - State->Tap[0]);
EarlyReflection(State, in, early);
// Calculate the late reverb from the last four delay taps.
taps[0] = DelayLineOut(&State->Delay, State->Offset - State->Tap[1]);
taps[1] = DelayLineOut(&State->Delay, State->Offset - State->Tap[2]);
taps[2] = DelayLineOut(&State->Delay, State->Offset - State->Tap[3]);
taps[3] = DelayLineOut(&State->Delay, State->Offset - State->Tap[4]);
LateReverb(State, taps, late);
// Step all delays forward one sample.
State->Offset++;
}
// This destroys the reverb state. It should be called only when the effect
// slot has a different (or no) effect loaded over the reverb effect.
ALvoid VerbDestroy(ALeffectState *effect)
{
ALverbState *State = (ALverbState*)effect;
if(State)
{
free(State->SampleBuffer);
State->SampleBuffer = NULL;
free(State);
}
}
// NOTE: Temp, remove later.
static __inline ALint aluCart2LUTpos(ALfloat re, ALfloat im)
{
ALint pos = 0;
ALfloat denom = aluFabs(re) + aluFabs(im);
if(denom > 0.0f)
pos = (ALint)(QUADRANT_NUM*aluFabs(im) / denom + 0.5);
if(re < 0.0)
pos = 2 * QUADRANT_NUM - pos;
if(im < 0.0)
pos = LUT_NUM - pos;
return pos%LUT_NUM;
}
// This updates the reverb state. This is called any time the reverb effect
// is loaded into a slot.
ALvoid VerbUpdate(ALeffectState *effect, ALCcontext *Context, ALeffect *Effect)
{
ALverbState *State = (ALverbState*)effect;
ALuint index;
ALfloat length, mixCoeff, cw, g, coeff;
ALfloat hfRatio = Effect->Reverb.DecayHFRatio;
// Calculate the master low-pass filter (from the master effect HF gain).
cw = cos(2.0 * M_PI * Effect->Reverb.HFReference / Context->Frequency);
g = __max(Effect->Reverb.GainHF, 0.0001f);
State->LpFilter.coeff = 0.0f;
if(g < 0.9999f) // 1-epsilon
State->LpFilter.coeff = (1 - g*cw - aluSqrt(2*g*(1-cw) - g*g*(1 - cw*cw))) / (1 - g);
// Calculate the initial delay taps.
length = Effect->Reverb.ReflectionsDelay;
State->Tap[0] = (ALuint)(length * Context->Frequency);
length += Effect->Reverb.LateReverbDelay;
/* The four inputs to the late reverb are decorrelated to smooth the
* initial reverb and reduce harsh echos. The timings are calculated as
* multiples of a fraction of the smallest cyclical delay time. This
* result is then adjusted so that the first tap occurs immediately (all
* taps are reduced by the shortest fraction).
*
* offset[index] = ((FRACTION MULTIPLIER^index) - 1) delay
*/
for(index = 0;index < 4;index++)
{
length += LATE_LINE_LENGTH[0] *
(1.0f + (Effect->Reverb.Density * LATE_LINE_MULTIPLIER)) *
(DECO_FRACTION * (pow(DECO_MULTIPLIER, (ALfloat)index) - 1.0f));
State->Tap[1 + index] = (ALuint)(length * Context->Frequency);
}
// Calculate the early reflections gain (from the master effect gain, and
// reflections gain parameters).
State->Early.Gain = Effect->Reverb.Gain * Effect->Reverb.ReflectionsGain;
// Calculate the gain (coefficient) for each early delay line.
for(index = 0;index < 4;index++)
State->Early.Coeff[index] = pow(10.0f, EARLY_LINE_LENGTH[index] /
Effect->Reverb.LateReverbDelay *
-60.0f / 20.0f);
// Calculate the first mixing matrix coefficient (x).
mixCoeff = 1.0f - (0.5f * pow(Effect->Reverb.Diffusion, 3.0f));
// Calculate the late reverb gain (from the master effect gain, and late
// reverb gain parameters). Since the output is tapped prior to the
// application of the delay line coefficients, this gain needs to be
// attenuated by the 'x' mix coefficient from above.
State->Late.Gain = Effect->Reverb.Gain * Effect->Reverb.LateReverbGain * mixCoeff;
/* To compensate for changes in modal density and decay time of the late
* reverb signal, the input is attenuated based on the maximal energy of
* the outgoing signal. This is calculated as the ratio between a
* reference value and the current approximation of energy for the output
* signal.
*
* Reverb output matches exponential decay of the form Sum(a^n), where a
* is the attenuation coefficient, and n is the sample ranging from 0 to
* infinity. The signal energy can thus be approximated using the area
* under this curve, calculated as: 1 / (1 - a).
*
* The reference energy is calculated from a signal at the lowest (effect
* at 1.0) density with a decay time of one second.
*
* The coefficient is calculated as the average length of the cyclical
* delay lines. This produces a better result than calculating the gain
* for each line individually (most likely a side effect of diffusion).
*
* The final result is the square root of the ratio bound to a maximum
* value of 1 (no amplification).
*/
length = (LATE_LINE_LENGTH[0] + LATE_LINE_LENGTH[1] +
LATE_LINE_LENGTH[2] + LATE_LINE_LENGTH[3]);
g = length * (1.0f + LATE_LINE_MULTIPLIER) * 0.25f;
g = pow(10.0f, g * -60.0f / 20.0f);
g = 1.0f / (1.0f - (g * g));
length *= 1.0f + (Effect->Reverb.Density * LATE_LINE_MULTIPLIER) * 0.25f;
length = pow(10.0f, length / Effect->Reverb.DecayTime * -60.0f / 20.0f);
length = 1.0f / (1.0f - (length * length));
State->Late.DensityGain = __min(aluSqrt(g / length), 1.0f);
// Calculate the all-pass feed-back and feed-forward coefficient.
State->Late.ApFeedCoeff = 0.6f * pow(Effect->Reverb.Diffusion, 3.0f);
// Calculate the mixing matrix coefficient (y / x).
g = aluSqrt((1.0f - (mixCoeff * mixCoeff)) / 3.0f);
State->Late.MixCoeff = g / mixCoeff;
for(index = 0;index < 4;index++)
{
// Calculate the gain (coefficient) for each all-pass line.
State->Late.ApCoeff[index] = pow(10.0f, ALLPASS_LINE_LENGTH[index] /
Effect->Reverb.DecayTime *
-60.0f / 20.0f);
}
// If the HF limit parameter is flagged, calculate an appropriate limit
// based on the air absorption parameter.
if(Effect->Reverb.DecayHFLimit && Effect->Reverb.AirAbsorptionGainHF < 1.0f)
{
ALfloat limitRatio;
// For each of the cyclical delays, find the attenuation due to air
// absorption in dB (converting delay time to meters using the speed
// of sound). Then reversing the decay equation, solve for HF ratio.
// The delay length is cancelled out of the equation, so it can be
// calculated once for all lines.
limitRatio = 1.0f / (log10(Effect->Reverb.AirAbsorptionGainHF) *
SPEEDOFSOUNDMETRESPERSEC *
Effect->Reverb.DecayTime / -60.0f * 20.0f);
// Need to limit the result to a minimum of 0.1, just like the HF
// ratio parameter.
limitRatio = __max(limitRatio, 0.1f);
// Using the limit calculated above, apply the upper bound to the
// HF ratio.
hfRatio = __min(hfRatio, limitRatio);
}
// Calculate the low-pass filter frequency.
cw = cos(2.0f * M_PI * Effect->Reverb.HFReference / Context->Frequency);
for(index = 0;index < 4;index++)
{
// Calculate the length (in seconds) of each cyclical delay line.
length = LATE_LINE_LENGTH[index] * (1.0f + (Effect->Reverb.Density *
LATE_LINE_MULTIPLIER));
// Calculate the delay offset for the cyclical delay lines.
State->Late.Offset[index] = (ALuint)(length * Context->Frequency);
// Calculate the gain (coefficient) for each cyclical line.
State->Late.Coeff[index] = pow(10.0f, length / Effect->Reverb.DecayTime *
-60.0f / 20.0f);
// Eventually this should boost the high frequencies when the ratio
// exceeds 1.
coeff = 0.0f;
if (hfRatio < 1.0f)
{
// Calculate the decay equation for each low-pass filter.
g = pow(10.0f, length / (Effect->Reverb.DecayTime * hfRatio) *
-60.0f / 20.0f) / State->Late.Coeff[index];
g = __max(g, 0.1f);
g *= g;
// Calculate the gain (coefficient) for each low-pass filter.
if(g < 0.9999f) // 1-epsilon
coeff = (1 - g*cw - aluSqrt(2*g*(1-cw) - g*g*(1 - cw*cw))) / (1 - g);
// Very low decay times will produce minimal output, so apply an
// upper bound to the coefficient.
coeff = __min(coeff, 0.98f);
}
State->Late.LpCoeff[index] = coeff;
// Attenuate the cyclical line coefficients by the mixing coefficient
// (x).
State->Late.Coeff[index] *= mixCoeff;
}
// Calculate the 3D-panning gains for the early reflections and late
// reverb (for EAX mode).
{
ALfloat earlyPan[3] = { Effect->Reverb.ReflectionsPan[0], Effect->Reverb.ReflectionsPan[1], Effect->Reverb.ReflectionsPan[2] };
ALfloat latePan[3] = { Effect->Reverb.LateReverbPan[0], Effect->Reverb.LateReverbPan[1], Effect->Reverb.LateReverbPan[2] };
ALfloat *speakerGain, dirGain, ambientGain;
ALfloat length;
ALint pos;
length = earlyPan[0]*earlyPan[0] + earlyPan[1]*earlyPan[1] + earlyPan[2]*earlyPan[2];
if(length > 1.0f)
{
length = 1.0f / aluSqrt(length);
earlyPan[0] *= length;
earlyPan[1] *= length;
earlyPan[2] *= length;
}
length = latePan[0]*latePan[0] + latePan[1]*latePan[1] + latePan[2]*latePan[2];
if(length > 1.0f)
{
length = 1.0f / aluSqrt(length);
latePan[0] *= length;
latePan[1] *= length;
latePan[2] *= length;
}
// This code applies directional reverb just like the mixer applies
// directional sources. It diffuses the sound toward all speakers
// as the magnitude of the panning vector drops, which is only an
// approximation of the expansion of sound across the speakers from
// the panning direction.
pos = aluCart2LUTpos(earlyPan[2], earlyPan[0]);
speakerGain = &Context->PanningLUT[OUTPUTCHANNELS * pos];
dirGain = aluSqrt((earlyPan[0] * earlyPan[0]) + (earlyPan[2] * earlyPan[2]));
ambientGain = (1.0 - dirGain);
for(index = 0;index < OUTPUTCHANNELS;index++)
State->Early.PanGain[index] = dirGain * speakerGain[index] + ambientGain;
pos = aluCart2LUTpos(latePan[2], latePan[0]);
speakerGain = &Context->PanningLUT[OUTPUTCHANNELS * pos];
dirGain = aluSqrt((latePan[0] * latePan[0]) + (latePan[2] * latePan[2]));
ambientGain = (1.0 - dirGain);
for(index = 0;index < OUTPUTCHANNELS;index++)
State->Late.PanGain[index] = dirGain * speakerGain[index] + ambientGain;
}
}
// This processes the reverb state, given the input samples and an output
// buffer.
ALvoid VerbProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[OUTPUTCHANNELS])
{
ALverbState *State = (ALverbState*)effect;
ALuint index;
ALfloat early[4], late[4], out[4];
ALfloat gain = Slot->Gain;
for(index = 0;index < SamplesToDo;index++)
{
// Process reverb for this sample.
ReverbInOut(State, SamplesIn[index], early, late);
// Mix early reflections and late reverb.
out[0] = (early[0] + late[0]) * gain;
out[1] = (early[1] + late[1]) * gain;
out[2] = (early[2] + late[2]) * gain;
out[3] = (early[3] + late[3]) * gain;
// Output the results.
SamplesOut[index][FRONT_LEFT] += out[0];
SamplesOut[index][FRONT_RIGHT] += out[1];
SamplesOut[index][FRONT_CENTER] += out[3];
SamplesOut[index][SIDE_LEFT] += out[0];
SamplesOut[index][SIDE_RIGHT] += out[1];
SamplesOut[index][BACK_LEFT] += out[0];
SamplesOut[index][BACK_RIGHT] += out[1];
SamplesOut[index][BACK_CENTER] += out[2];
}
}
// This processes the EAX reverb state, given the input samples and an output
// buffer.
ALvoid EAXVerbProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[OUTPUTCHANNELS])
{
ALverbState *State = (ALverbState*)effect;
ALuint index;
ALfloat early[4], late[4];
ALfloat gain = Slot->Gain;
for(index = 0;index < SamplesToDo;index++)
{
// Process reverb for this sample.
ReverbInOut(State, SamplesIn[index], early, late);
// Unfortunately, while the number and configuration of gains for
// panning adjust according to OUTPUTCHANNELS, the output from the
// reverb engine is not so scalable.
SamplesOut[index][FRONT_LEFT] +=
(State->Early.PanGain[FRONT_LEFT]*early[0] +
State->Late.PanGain[FRONT_LEFT]*late[0]) * gain;
SamplesOut[index][FRONT_RIGHT] +=
(State->Early.PanGain[FRONT_RIGHT]*early[1] +
State->Late.PanGain[FRONT_RIGHT]*late[1]) * gain;
SamplesOut[index][FRONT_CENTER] +=
(State->Early.PanGain[FRONT_CENTER]*early[3] +
State->Late.PanGain[FRONT_CENTER]*late[3]) * gain;
SamplesOut[index][SIDE_LEFT] +=
(State->Early.PanGain[SIDE_LEFT]*early[0] +
State->Late.PanGain[SIDE_LEFT]*late[0]) * gain;
SamplesOut[index][SIDE_RIGHT] +=
(State->Early.PanGain[SIDE_RIGHT]*early[1] +
State->Late.PanGain[SIDE_RIGHT]*late[1]) * gain;
SamplesOut[index][BACK_LEFT] +=
(State->Early.PanGain[BACK_LEFT]*early[0] +
State->Late.PanGain[BACK_LEFT]*late[0]) * gain;
SamplesOut[index][BACK_RIGHT] +=
(State->Early.PanGain[BACK_RIGHT]*early[1] +
State->Late.PanGain[BACK_RIGHT]*late[1]) * gain;
SamplesOut[index][BACK_CENTER] +=
(State->Early.PanGain[BACK_CENTER]*early[2] +
State->Late.PanGain[BACK_CENTER]*late[2]) * gain;
}
}
// This creates the reverb state. It should be called only when the reverb
// effect is loaded into a slot that doesn't already have a reverb effect.
ALeffectState *VerbCreate(ALCcontext *Context)
{
ALverbState *State = NULL;
ALuint samples, length[13], totalLength, index;
State = malloc(sizeof(ALverbState));
if(!State)
{
alSetError(AL_OUT_OF_MEMORY);
return NULL;
}
State->state.Destroy = VerbDestroy;
State->state.Update = VerbUpdate;
State->state.Process = VerbProcess;
// All line lengths are powers of 2, calculated from their lengths, with
// an additional sample in case of rounding errors.
// See VerbUpdate() for an explanation of the additional calculation
// added to the master line length.
samples = (ALuint)
((MASTER_LINE_LENGTH +
(LATE_LINE_LENGTH[0] * (1.0f + LATE_LINE_MULTIPLIER) *
(DECO_FRACTION * ((DECO_MULTIPLIER * DECO_MULTIPLIER *
DECO_MULTIPLIER) - 1.0f)))) *
Context->Frequency) + 1;
length[0] = NextPowerOf2(samples);
totalLength = length[0];
for(index = 0;index < 4;index++)
{
samples = (ALuint)(EARLY_LINE_LENGTH[index] * Context->Frequency) + 1;
length[1 + index] = NextPowerOf2(samples);
totalLength += length[1 + index];
}
for(index = 0;index < 4;index++)
{
samples = (ALuint)(ALLPASS_LINE_LENGTH[index] * Context->Frequency) + 1;
length[5 + index] = NextPowerOf2(samples);
totalLength += length[5 + index];
}
for(index = 0;index < 4;index++)
{
samples = (ALuint)(LATE_LINE_LENGTH[index] *
(1.0f + LATE_LINE_MULTIPLIER) * Context->Frequency) + 1;
length[9 + index] = NextPowerOf2(samples);
totalLength += length[9 + index];
}
// All lines share a single sample buffer and have their masks and start
// addresses calculated once.
State->SampleBuffer = malloc(totalLength * sizeof(ALfloat));
if(!State->SampleBuffer)
{
free(State);
alSetError(AL_OUT_OF_MEMORY);
return NULL;
}
for(index = 0; index < totalLength;index++)
State->SampleBuffer[index] = 0.0f;
State->LpFilter.coeff = 0.0f;
State->LpFilter.history[0] = 0.0f;
State->LpFilter.history[1] = 0.0f;
State->Delay.Mask = length[0] - 1;
State->Delay.Line = &State->SampleBuffer[0];
totalLength = length[0];
State->Tap[0] = 0;
State->Tap[1] = 0;
State->Tap[2] = 0;
State->Tap[3] = 0;
State->Tap[4] = 0;
State->Early.Gain = 0.0f;
for(index = 0;index < 4;index++)
{
State->Early.Coeff[index] = 0.0f;
State->Early.Delay[index].Mask = length[1 + index] - 1;
State->Early.Delay[index].Line = &State->SampleBuffer[totalLength];
totalLength += length[1 + index];
// The early delay lines have their read offsets calculated once.
State->Early.Offset[index] = (ALuint)(EARLY_LINE_LENGTH[index] *
Context->Frequency);
}
State->Late.Gain = 0.0f;
State->Late.DensityGain = 0.0f;
State->Late.ApFeedCoeff = 0.0f;
State->Late.MixCoeff = 0.0f;
for(index = 0;index < 4;index++)
{
State->Late.ApCoeff[index] = 0.0f;
State->Late.ApDelay[index].Mask = length[5 + index] - 1;
State->Late.ApDelay[index].Line = &State->SampleBuffer[totalLength];
totalLength += length[5 + index];
// The late all-pass lines have their read offsets calculated once.
State->Late.ApOffset[index] = (ALuint)(ALLPASS_LINE_LENGTH[index] *
Context->Frequency);
}
for(index = 0;index < 4;index++)
{
State->Late.Coeff[index] = 0.0f;
State->Late.Delay[index].Mask = length[9 + index] - 1;
State->Late.Delay[index].Line = &State->SampleBuffer[totalLength];
totalLength += length[9 + index];
State->Late.Offset[index] = 0;
State->Late.LpCoeff[index] = 0.0f;
State->Late.LpSample[index] = 0.0f;
}
// Panning is applied as an independent gain for each output channel.
for(index = 0;index < OUTPUTCHANNELS;index++)
{
State->Early.PanGain[index] = 0.0f;
State->Late.PanGain[index] = 0.0f;
}
State->Offset = 0;
return &State->state;
}
ALeffectState *EAXVerbCreate(ALCcontext *Context)
{
ALeffectState *State = VerbCreate(Context);
if(State) State->Process = EAXVerbProcess;
return State;
}
| Java |
[http://www.byteshiftcode.com/project/tank-maze-js-game](http://www.byteshiftcode.com/project/tank-maze-js-game)
| Java |
# baites.github.io
# Installation
* Cloning and creating docker image
**NOTE**: This installation requires installed docker server.
```bash
$ git clone git clone https://github.com/baites/baites.github.io.git
$ cd baites.github.io
$ docker build -t jekyll -f jekyll.dockerfile .
...
Successfully tagged jekyll:latest
```
* Creating container
```bash
$ USER_ID=$(id -u)
$ USER_NAME=$(id -un)
$ GROUP_ID=$(id -g)
$ GROUP_NAME=$(id -gn)
$ docker create \
--name jekyll-$USER_NAME \
--mount type=bind,source=$PWD,target=/home/$USER_NAME/baites.github.io \
--mount type=bind,source=$HOME/.ssh,target=/home/$USER_NAME/.ssh \
--workdir /home/$USER_NAME/baites.github.io \
-t -p 4000:4000 jekyll
$ docker start jekyll-$USER_NAME
```
* Mirror user and group to the container
```bash
$ CMD="useradd -u $USER_ID -N $USER_NAME && \
groupadd -g $GROUP_ID $GROUP_NAME && \
usermod -g $GROUP_NAME $USER_NAME &&\
echo '$USER_NAME ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/$USER_NAME &&\
chown -R $USER_NAME:$GROUP_NAME /home/$USER_NAME"
docker exec jekyll-$USER_NAME /bin/bash -c "$CMD"
```
* Entering in the container install gihub pages
```bash
$ docker exec -it -u $USER_NAME jekyll-$USER_NAME /bin/bash
$USER_NAME@bcfa7ea7eb52 baites.github.io$ export PATH="/home/baites/.gem/ruby/2.7.0/bin:$PATH"
$USER_NAME@bcfa7ea7eb52 baites.github.io$ gem install bundler
...
$USER_NAME@bcfa7ea7eb52 baites.github.io$ bundle exec jekyll serve -I --future --host 0.0.0.0
...
```
* Open browser at http://localhost:4000/ | Java |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Product(Model):
_required = []
_attribute_map = {
'integer': {'key': 'integer', 'type': 'int'},
'string': {'key': 'string', 'type': 'str'},
}
def __init__(self, *args, **kwargs):
"""Product
:param int integer
:param str string
"""
self.integer = None
self.string = None
super(Product, self).__init__(*args, **kwargs)
| Java |
// # Ghost Configuration
// Setup your Ghost install for various environments
// Documentation can be found at http://support.ghost.org/config/
var path = require('path'),
config;
config = {
// ### Production
// When running Ghost in the wild, use the production environment
// Configure your URL and mail settings here
production: {
url: 'http://my-ghost-blog.com',
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost.db')
},
debug: false
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
}
},
// ### Development **(default)**
development: {
// The url to use when providing links to the site, E.g. in RSS and email.
// Change this to your Ghost blogs published URL.
url: 'http://localhost:2368',
// Example mail config
// Visit http://support.ghost.org/mail for instructions
// ```
mail: {
transport: 'SMTP',
options: {
service: 'Gmail',
auth: {
user: 'thewanderingconsultant@gmail.com', // mailgun username
pass: 'ghostblogwandering' // mailgun password
}
}
},
//```
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost-dev.db')
},
debug: false
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
},
paths: {
contentPath: path.join(__dirname, '/content/')
}
},
// **Developers only need to edit below here**
// ### Testing
// Used when developing Ghost to run tests and check the health of Ghost
// Uses a different port number
testing: {
url: 'http://127.0.0.1:2369',
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost-test.db')
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},
// ### Testing MySQL
// Used by Travis - Automated testing run through GitHub
'testing-mysql': {
url: 'http://127.0.0.1:2369',
database: {
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'root',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},
// ### Testing pg
// Used by Travis - Automated testing run through GitHub
'testing-pg': {
url: 'http://127.0.0.1:2369',
database: {
client: 'pg',
connection: {
host : '127.0.0.1',
user : 'postgres',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
}
};
// Export config
module.exports = config;
| Java |
import React from 'react';
import PropTypes from 'prop-types';
import styled, { keyframes } from 'styled-components';
const blink = keyframes`
from, to {
opacity: 1;
}
50% {
opacity: 0;
}
`;
const CursorSpan = styled.span`
font-weight: 100;
color: black;
font-size: 1em;
padding-left: 2px;
animation: ${blink} 1s step-end infinite;
`;
const Cursor = ({ className }) => (
<CursorSpan className={className}>|</CursorSpan>
);
Cursor.propTypes = { className: PropTypes.string };
Cursor.defaultProps = { className: '' };
export default Cursor;
| Java |
// Copyright Louis Dionne 2015
// Distributed under the Boost Software License, Version 1.0.
#include <type_traits>
template <typename T>
using void_t = std::conditional_t<true, void, T>;
// sample(common_type-N3843)
template <typename T, typename U>
using builtin_common_t = std::decay_t<decltype(
true ? std::declval<T>() : std::declval<U>()
)>;
template <typename, typename ...>
struct ct { };
template <typename T>
struct ct<void, T> : std::decay<T> { };
template <typename T, typename U, typename ...V>
struct ct<void_t<builtin_common_t<T, U>>, T, U, V...>
: ct<void, builtin_common_t<T, U>, V...>
{ };
template <typename ...T>
struct common_type : ct<void, T...> { };
// end-sample
template <typename ...Ts>
using common_type_t = typename common_type<Ts...>::type;
//////////////////////////////////////////////////////////////////////////////
// Tests
//////////////////////////////////////////////////////////////////////////////
template <typename T, typename = void>
struct has_type : std::false_type { };
template <typename T>
struct has_type<T, void_t<typename T::type>> : std::true_type { };
struct A { }; struct B { }; struct C { };
// Ensure proper behavior in normal cases
static_assert(std::is_same<
common_type_t<char>,
char
>{}, "");
static_assert(std::is_same<
common_type_t<A, A>,
A
>{}, "");
static_assert(std::is_same<
common_type_t<char, short, char, short>,
int
>{}, "");
static_assert(std::is_same<
common_type_t<char, double, short, char, short, double>,
double
>{}, "");
static_assert(std::is_same<
common_type_t<char, short, float, short>,
float
>{}, "");
// Ensure SFINAE-friendliness
static_assert(!has_type<common_type<>>{}, "");
static_assert(!has_type<common_type<int, void>>{}, "");
int main() { }
| Java |
package remove_duplicates_from_sorted_list;
import common.ListNode;
public class RemoveDuplicatesfromSortedList {
public class Solution {
public ListNode deleteDuplicates(ListNode head) {
if (head != null) {
ListNode pre = head;
ListNode p = pre.next;
while (p != null) {
if (p.val == pre.val) {
pre.next = p.next;
} else {
pre = p;
}
p = p.next;
}
}
return head;
}
}
public static class UnitTest {
}
}
| Java |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
namespace Umbraco.Core.Models.EntityBase
{
/// <summary>
/// A base class for use to implement IRememberBeingDirty/ICanBeDirty
/// </summary>
public abstract class TracksChangesEntityBase : IRememberBeingDirty
{
/// <summary>
/// Tracks the properties that have changed
/// </summary>
private readonly IDictionary<string, bool> _propertyChangedInfo = new Dictionary<string, bool>();
/// <summary>
/// Tracks the properties that we're changed before the last commit (or last call to ResetDirtyProperties)
/// </summary>
private IDictionary<string, bool> _lastPropertyChangedInfo = null;
/// <summary>
/// Property changed event
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Method to call on a property setter.
/// </summary>
/// <param name="propertyInfo">The property info.</param>
protected virtual void OnPropertyChanged(PropertyInfo propertyInfo)
{
_propertyChangedInfo[propertyInfo.Name] = true;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyInfo.Name));
}
}
/// <summary>
/// Indicates whether a specific property on the current entity is dirty.
/// </summary>
/// <param name="propertyName">Name of the property to check</param>
/// <returns>True if Property is dirty, otherwise False</returns>
public virtual bool IsPropertyDirty(string propertyName)
{
return _propertyChangedInfo.Any(x => x.Key == propertyName);
}
/// <summary>
/// Indicates whether the current entity is dirty.
/// </summary>
/// <returns>True if entity is dirty, otherwise False</returns>
public virtual bool IsDirty()
{
return _propertyChangedInfo.Any();
}
/// <summary>
/// Indicates that the entity had been changed and the changes were committed
/// </summary>
/// <returns></returns>
public bool WasDirty()
{
return _lastPropertyChangedInfo != null && _lastPropertyChangedInfo.Any();
}
/// <summary>
/// Indicates whether a specific property on the current entity was changed and the changes were committed
/// </summary>
/// <param name="propertyName">Name of the property to check</param>
/// <returns>True if Property was changed, otherwise False. Returns false if the entity had not been previously changed.</returns>
public virtual bool WasPropertyDirty(string propertyName)
{
return WasDirty() && _lastPropertyChangedInfo.Any(x => x.Key == propertyName);
}
/// <summary>
/// Resets the remembered dirty properties from before the last commit
/// </summary>
public void ForgetPreviouslyDirtyProperties()
{
_lastPropertyChangedInfo.Clear();
}
/// <summary>
/// Resets dirty properties by clearing the dictionary used to track changes.
/// </summary>
/// <remarks>
/// Please note that resetting the dirty properties could potentially
/// obstruct the saving of a new or updated entity.
/// </remarks>
public virtual void ResetDirtyProperties()
{
ResetDirtyProperties(true);
}
/// <summary>
/// Resets dirty properties by clearing the dictionary used to track changes.
/// </summary>
/// <param name="rememberPreviouslyChangedProperties">
/// true if we are to remember the last changes made after resetting
/// </param>
/// <remarks>
/// Please note that resetting the dirty properties could potentially
/// obstruct the saving of a new or updated entity.
/// </remarks>
public virtual void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
{
if (rememberPreviouslyChangedProperties)
{
//copy the changed properties to the last changed properties
_lastPropertyChangedInfo = _propertyChangedInfo.ToDictionary(v => v.Key, v => v.Value);
}
_propertyChangedInfo.Clear();
}
/// <summary>
/// Used by inheritors to set the value of properties, this will detect if the property value actually changed and if it did
/// it will ensure that the property has a dirty flag set.
/// </summary>
/// <param name="setValue"></param>
/// <param name="value"></param>
/// <param name="propertySelector"></param>
/// <returns>returns true if the value changed</returns>
/// <remarks>
/// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we
/// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set
/// to the same value, so it's really not dirty.
/// </remarks>
internal bool SetPropertyValueAndDetectChanges<T>(Func<T, T> setValue, T value, PropertyInfo propertySelector)
{
var initVal = value;
var newVal = setValue(value);
if (!Equals(initVal, newVal))
{
OnPropertyChanged(propertySelector);
return true;
}
return false;
}
}
} | Java |
# coding=utf8
"""
Parser for todo format string.
from todo.parser import parser
parser.parse(string) # return an Todo instance
"""
from models import Task
from models import Todo
from ply import lex
from ply import yacc
class TodoLexer(object):
"""
Lexer for Todo format string.
Tokens
ID e.g. '1.'
DONE e.g. '(x)'
TASK e.g. 'This is a task'
"""
tokens = (
"ID",
"DONE",
"TASK",
)
t_ignore = "\x20\x09" # ignore spaces and tabs
def t_ID(self, t):
r'\d+\.([uU]|[lL]|[uU][lL]|[lL][uU])?'
t.value = int(t.value[:-1])
return t
def t_DONE(self, t):
r'(\(x\))'
return t
def t_TASK(self, t):
r'((?!\(x\))).+'
return t
def t_newline(self, t):
r'\n+'
t.lexer.lineno += len(t.value)
def t_error(self, t):
raise SyntaxError(
"Illegal character: '%s' at Line %d" % (t.value[0], t.lineno)
)
def __init__(self):
self.lexer = lex.lex(module=self)
class TodoParser(object):
"""
Parser for Todo format string, works with a todo lexer.
Parse string to Python list
todo_str = "1. (x) Write email to tom"
TodoParser().parse(todo_str)
"""
tokens = TodoLexer.tokens
def p_error(self, p):
if p:
raise SyntaxError(
"Character '%s' at line %d" % (p.value[0], p.lineno)
)
else:
raise SyntaxError("SyntaxError at EOF")
def p_start(self, p):
"start : translation_unit"
p[0] = self.todo
def p_translation_unit(self, p):
"""
translation_unit : translate_task
| translation_unit translate_task
|
"""
pass
def p_translation_task(self, p):
"""
translate_task : ID DONE TASK
| ID TASK
"""
if len(p) == 4:
done = True
content = p[3]
elif len(p) == 3:
done = False
content = p[2]
task = Task(p[1], content, done)
self.todo.append(task)
def __init__(self):
self.parser = yacc.yacc(module=self, debug=0, write_tables=0)
def parse(self, data):
# reset list
self.todo = Todo()
return self.parser.parse(data)
lexer = TodoLexer() # build lexer
parser = TodoParser() # build parser
| Java |
var test = require('tape');
var BSFS = require('../lib/bsfs');
indexedDB.deleteDatabase('bsfs-tests');
function randomId () { return Math.random().toString(36).substr(2) }
test('bsfs exists', function (t) {
t.plan(1);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs._ready) return bsfs.once('ready', ready);
else process.nextTick(ready);
function ready () {
t.equals(typeof bsfs, 'object');
}
});
test('bsfs has file router', function (t) {
t.plan(1);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs._ready) return bsfs.once('ready', ready);
else process.nextTick(ready);
function ready () {
t.equal(typeof bsfs._fileRouter, 'object');
}
});
test('write without path throws', function (t) {
t.plan(1);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs._ready) return bsfs.once('ready', ready);
else process.nextTick(ready);
function ready () {
t.throws(function() {
bsfs.createWriteStream(null, function() {})
});
}
});
test('write file', function (t) {
t.plan(1);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs._ready) return bsfs.once('ready', ready);
else process.nextTick(ready);
function ready () {
var path = '/tmp/test-' + randomId();
var content = 'Hello cruel world ' + randomId();
var w = bsfs.createWriteStream(path, function(err, meta) {
t.equal(err, null);
});
w.end(content);
}
});
test('write then read file by key', function (t) {
t.plan(1);
var path = '/tmp/test-' + randomId();
var content = 'Hello cruel world ' + randomId();
var bsfs = new BSFS('bsfs-tests');
if (!bsfs._ready) return bsfs.once('ready', ready);
else process.nextTick(ready);
function readBack (key) {
var r = bsfs.createReadStreamFromKey(key);
var readContent = '';
r.on('data', function (chunk) {
readContent += chunk;
});
r.on('end', function () {
t.equal(content, readContent);
});
}
function ready () {
var w = bsfs.createWriteStream(path, function(err, meta) {
readBack(meta.key);
});
w.end(content);
}
});
test('write then read file by name', function (t) {
t.plan(1);
var content = 'Hello cruel world ' + randomId();
var path = '/tmp/test-' + randomId();
var bsfs = new BSFS('bsfs-tests');
if (!bsfs._ready) return bsfs.once('ready', ready);
else process.nextTick(ready);
function readBack (path) {
var r = bsfs.createReadStream(path);
var readContent = '';
r.on('data', function (chunk) {
readContent += chunk;
});
r.on('end', function () {
t.equal(content, readContent);
});
}
function ready () {
var w = bsfs.createWriteStream(path, function(err, meta) {
readBack(path);
});
w.end(content);
}
});
test('access', function (t) {
t.test('is silent (for now)', function (t) {
t.plan(3);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs.ready) return bsfs.once('ready', ready)
else process.nextTick(ready);
function ready () {
bsfs.access(null, function (err) {
t.ifError(err);
});
bsfs.access('/tmp', function (err) {
t.ifError(err);
});
bsfs.access('/tmp', 2, function (err) {
t.ifError(err);
});
}
});
t.test('throws on invalid callback argument', function (t) {
t.plan(1);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs.ready) return bsfs.once('ready', ready)
else process.nextTick(ready);
function ready () {
t.throws(function () {
bsfs.access('/tmp/', 0, 'potatoe');
})
}
});
});
test('accessSync', function (t) {
t.test('is silent (for now)', function (t) {
t.plan(2);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs.ready) return bsfs.once('ready', ready)
else process.nextTick(ready);
function ready () {
t.ifError(bsfs.accessSync(randomId()));
t.ifError(bsfs.accessSync());
}
})
});
test('exists', function (t) {
t.test('is true for all paths (for now)', function (t) {
t.plan(1);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs.ready) return bsfs.once('ready', ready);
else proccess.nextTick(ready);
function ready () {
bsfs.exists(randomId(), function (exists) {
t.ok(exists);
});
}
});
});
test('existsSync', function (t) {
t.test('throws on null path', function (t) {
t.plan(1);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs.ready) return bsfs.once('ready', ready);
else proccess.nextTick(ready);
function ready () {
t.throws(bsfs.existsSync());
}
});
t.test('is true for all paths (for now)', function (t) {
t.plan(2);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs.ready) return bsfs.once('ready', ready);
else proccess.nextTick(ready);
function ready () {
t.ok(bsfs.existsSync(randomId()));
t.ok(bsfs.existsSync());
}
});
});
test('appendFile without path throws', function (t) {
t.plan(1);
var bsfs = new BSFS('bsfs-tests');
if (!bsfs._ready) return bsfs.once('ready', ready);
else process.nextTick(ready);
function ready () {
t.throws(function () {
bsfs.appendFile(null, function () {});
});
}
});
| Java |
---
title: A List of the White Rabbit Mechanics We Are Considering
author: all
date: 15/01/11
tags: [concept, summary, gamemechanics, whiterabbit]
layout: post
---
The white rabbit.
Here is a list of some of the rabbits we could pull out of our designer's magical top hat.
## Cooperative Rope Walking
### Summary
One scenario is while one person crawls across a cable to breach the hull of another ship, the other must move the ship in sync with the other ship to ensure the crawling player doesn't fall.
Could further add elements of wind and obstacles.
### Pros
+ Very explicit cooperative components
+ Leaves room for interesting use of physics
+ Fits well as minigame between core hack and slash
### Cons
+ Direct cooperation between players requires very fast and accurate network syncing
+ Can be frustrating if your partner is very poor at this minigame
## Ghost with Visibility Goggles
### Summary
While one player only sees shimmers of an enemy or an important object, the other can see it very clearly.
They must cooperate
### Pros
### Cons
## Building Blocks with Imbuement
> Originally by me but I find the gravitational singularities to be more interesting and probably even easier to implement. This could be interesting regardless and could be considered in another light where one player can imbue the weaponry of the others. - Calem
### Summary
### Pros
### Cons
## Cooperative Gravitational Singularities
### Summary
Players get a singularity tool that can produce singularities that either push or pull all objects within a sphere of influence.
The map would preferably be prepared to be interactive with this weapon.
For the ice planet, this could be as simple as pre-subdividing the terrain mesh into large icy chunks and into ice shards that can damage enemies.
Interesting physics based puzzles become available.
In the prototype, this was used to traverse a bridge of objects trapped between to singularities.
Another mode is allowing a double jump by jumping onto the top of a singularity, which pushes the character up or allows them to walk on top of the sphere of influence depending on the gravitational factor.


(note this image has a low framerate as it is a low quality gif :-) actual prototype is very smooth)
Mesh collision can greatly improve the look and feel, but will dramatically reduce performance.
Smooth performance with mesh collision limited to some 250 cubes.

A bridge can be formed with 25 sheets if optimising for few objects with convex collision meshes.

### Pros
+ Very easy to implemented if the prototyping is any indication
+ Adds more interesting components to level design
+ Purely physics based cooperation and problem solving, which should be very intuitive, deterministic (like Portal)
+ No particularly special considerations for AI
+ Concept has been tested for resource usage and does well without optimisations
+ Particle effects can be used to hide unrealistic collision a bit and make sense in the context of the singularity
+ Cooperative elements are less contrived, and if friendly fire is enabled accidentally sucking your partner into a singularity could be very amusing given the appropriate sound effects and cues
### Cons
+ Would require level design considerations beyond normal puzzle making (subdivisions)
+ Fine control of singularity location may be awkward (though could be easy if both joysticks used in fine control mode?)
+ Syncing physics of multiple bodies between players may be difficult and needs to be tested.
+ Approximated collision has to be used for the objects in the sphere of influence if there are going to be more than a couple hundred objects
## Transition into spirit with different environmental interactions
### Summary
### Pros
### Cons
## Time travelling with effects on past
### Summary
### Pros
### Cons
## Collector and defender with pinging for resource collection
### Summary
### Pros
### Cons
## Single item to share
### Summary
> The mechanics of this need to be fleshed out more, I think. - Calem
### Pros
### Cons
## One player can transform the other, changing their abilities
### Summary
### Pros
### Cons
| Java |
---
layout: page
title: Pride Solutions Conference
date: 2016-05-24
author: Carl Mccarty
tags: weekly links, java
status: published
summary: Curabitur ipsum ante, aliquam sit.
banner: images/banner/office-01.jpg
booking:
startDate: 05/26/2016
endDate: 05/31/2016
ctyhocn: LITWTHX
groupCode: PSC
published: true
---
Cras vitae ullamcorper libero, id laoreet lacus. Praesent sed ligula suscipit, interdum nulla in, blandit ipsum. Nunc sem massa, posuere ut tellus et, tempus consectetur erat. Suspendisse potenti. Etiam ultricies nunc sit amet congue vestibulum. Pellentesque vehicula tristique tellus, sed pellentesque risus fringilla eget. Nullam id malesuada ligula. Praesent ante nibh, accumsan non urna vel, molestie condimentum justo. Ut feugiat ligula vitae odio mattis, at facilisis neque ultricies. In sagittis ante justo, eu ornare nibh rhoncus non. Ut vel ligula nec est maximus gravida non nec massa. Sed placerat orci sed lacus tristique dictum. Sed id ipsum cursus, lacinia ligula id, scelerisque nibh. Nullam fringilla mi metus, a rutrum tortor aliquam in. Sed et nibh vulputate, iaculis nulla id, auctor mi. Integer elit dui, eleifend eget diam commodo, sagittis vestibulum magna.
* Aenean luctus metus in quam elementum, vitae mollis augue ornare
* Praesent eget ipsum accumsan, scelerisque ex id, pharetra quam.
Aenean tempor sollicitudin aliquet. Ut interdum ex et mauris finibus tempus. Aliquam erat volutpat. Morbi mollis laoreet elit, at iaculis lectus iaculis ut. Donec rutrum volutpat purus, sed pretium urna feugiat a. Mauris porta feugiat ligula, eget posuere tellus vehicula vel. Sed commodo eros eget ante sollicitudin, id pretium enim consequat. Duis sed ex sit amet elit venenatis consequat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam gravida nisl quis nisl porta, ut malesuada lacus iaculis. Proin suscipit orci id dolor mattis, ac mollis ligula placerat. Curabitur facilisis nibh odio, eu vulputate nulla congue et. Quisque dolor dolor, accumsan et vestibulum a, suscipit nec felis.
| Java |
/**
* 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.
*
* 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/>.
*
**/
#include "stateengine/AtomicState.h"
#include "stateengine/Defines.h"
//--------------------------------------------------------------------
// TAtomicState
//--------------------------------------------------------------------
//--------------------------------------------------------------------
namespace donut
{
typedef void (*TUpdaterFunction)(const TStateEngineId&, double);
typedef void (*TStateCallBack)(const TStateEngineId&, TStateData *);
//--------------------------------------------------------------------
TAtomicState::TAtomicState(TStateEngineId parStateEngineId, TStateId parId, TStateData (* parTStateData), void (* parEnterCallBack), void (* parLeaveCallBack), void (* parUpdater))
: FStateEngineId (parStateEngineId)
{
FEnterCallBack = parEnterCallBack;
FLeaveCallBack = parLeaveCallBack;
FStateData = parTStateData;
FUpdater = parUpdater;
FId = parId;
}
TAtomicState::~TAtomicState()
{
// assert_msg_NO_RELEASE(FStateData!=NULL, "The state data has been already deleted. you do not need to.")
delete FStateData;
}
void TAtomicState::AddTransition(TTransitionId parId, TTransition * parTransition)
{
FOutTransitions[parId] = parTransition;
}
#if _DEBUG
void TAtomicState::AddInTransition(const TTransition * parTransition)
{
// FInTransitions.push_back(parTransition)
}
#endif
void TAtomicState::Update(double parDt)
{
void (*updater)( const TStateEngineId&, double) = *((TUpdaterFunction*) (&FUpdater));
updater(FStateEngineId , parDt);
}
void TAtomicState::Enter()
{
void (*enter)(const TStateEngineId&, TStateData *) = *((TStateCallBack*) (&FEnterCallBack));
enter(FStateEngineId, FStateData);
}
void TAtomicState::Leave()
{
void (*leave)(const TStateEngineId&, TStateData *) = *((TStateCallBack*) (&FLeaveCallBack));
leave(FStateEngineId, FStateData);
}
void TAtomicState::TransitionCallBack()
{
}
} // End namestate StateEngine | Java |
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
//Bundle ajouté
new FOS\UserBundle\FOSUserBundle(),
new Psa\PageBundle\PsaPageBundle(),
//new Psa\UserBundle\PsaUserBundle(),
new Psa\AdminBundle\PsaAdminBundle(),
new Psa\CommonBundle\PsaCommonBundle(),
//Forum Bundles
new EWZ\Bundle\TimeBundle\EWZTimeBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new CCDNComponent\CommonBundle\CCDNComponentCommonBundle(),
new CCDNComponent\BBCodeBundle\CCDNComponentBBCodeBundle(),
new CCDNComponent\CrumbTrailBundle\CCDNComponentCrumbTrailBundle(),
new CCDNComponent\DashboardBundle\CCDNComponentDashboardBundle(),
new CCDNComponent\AttachmentBundle\CCDNComponentAttachmentBundle(),
new CCDNComponent\MenuBundle\CCDNComponentMenuBundle(),
new CCDNForum\KarmaBundle\CCDNForumKarmaBundle(),
new CCDNUser\UserBundle\CCDNUserUserBundle(),
new CCDNForum\AdminBundle\CCDNForumAdminBundle(),
new CCDNForum\ForumBundle\CCDNForumForumBundle(),
new CCDNUser\AdminBundle\CCDNUserAdminBundle(),
new EWZ\Bundle\RecaptchaBundle\EWZRecaptchaBundle(),
new CCDNUser\ProfileBundle\CCDNUserProfileBundle(),
new CCDNForum\ModeratorBundle\CCDNForumModeratorBundle(),
new CCDNUser\MemberBundle\CCDNUserMemberBundle(),
new CCDNMessage\MessageBundle\CCDNMessageMessageBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new CoreSphere\ConsoleBundle\CoreSphereConsoleBundle();
}
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}
| Java |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Dumper;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\DependencyInjection\Scope;
/**
* GraphvizDumper dumps a service container as a graphviz file.
*
* You can convert the generated dot file with the dot utility (http://www.graphviz.org/):
*
* dot -Tpng container.dot > foo.png
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class GraphvizDumper extends Dumper
{
private $nodes;
private $edges;
private $options = array(
'graph' => array('ratio' => 'compress'),
'node' => array('fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'),
'edge' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5),
'node.instance' => array('fillcolor' => '#9999ff', 'style' => 'filled'),
'node.definition' => array('fillcolor' => '#eeeeee'),
'node.missing' => array('fillcolor' => '#ff9999', 'style' => 'filled'),
);
/**
* Dumps the service container as a graphviz graph.
*
* Available options:
*
* * graph: The default options for the whole graph
* * node: The default options for nodes
* * edge: The default options for edges
* * node.instance: The default options for services that are defined directly by object instances
* * node.definition: The default options for services that are defined via service definition instances
* * node.missing: The default options for missing services
*
* @param array $options An array of options
*
* @return string The dot representation of the service container
*/
public function dump(array $options = array())
{
foreach (array('graph', 'node', 'edge', 'node.instance', 'node.definition', 'node.missing') as $key) {
if (isset($options[$key])) {
$this->options[$key] = array_merge($this->options[$key], $options[$key]);
}
}
$this->nodes = $this->findNodes();
$this->edges = array();
foreach ($this->container->getDefinitions() as $id => $definition) {
$this->edges[$id] = array_merge(
$this->findEdges($id, $definition->getArguments(), true, ''),
$this->findEdges($id, $definition->getProperties(), false, '')
);
foreach ($definition->getMethodCalls() as $call) {
$this->edges[$id] = array_merge(
$this->edges[$id],
$this->findEdges($id, $call[1], false, $call[0].'()')
);
}
}
return $this->startDot().$this->addNodes().$this->addEdges().$this->endDot();
}
/**
* Returns all nodes.
*
* @return string A string representation of all nodes
*/
private function addNodes()
{
$code = '';
foreach ($this->nodes as $id => $node) {
$aliases = $this->getAliases($id);
$code .= sprintf(" node_%s [label=\"%s\\n%s\\n\", shape=%s%s];\n", $this->dotize($id), $id.($aliases ? ' ('.implode(', ', $aliases).')' : ''), $node['class'], $this->options['node']['shape'], $this->addAttributes($node['attributes']));
}
return $code;
}
/**
* Returns all edges.
*
* @return string A string representation of all edges
*/
private function addEdges()
{
$code = '';
foreach ($this->edges as $id => $edges) {
foreach ($edges as $edge) {
$code .= sprintf(" node_%s -> node_%s [label=\"%s\" style=\"%s\"];\n", $this->dotize($id), $this->dotize($edge['to']), $edge['name'], $edge['required'] ? 'filled' : 'dashed');
}
}
return $code;
}
/**
* Finds all edges belonging to a specific service id.
*
* @param string $id The service id used to find edges
* @param array $arguments An array of arguments
* @param bool $required
* @param string $name
*
* @return array An array of edges
*/
private function findEdges($id, $arguments, $required, $name)
{
$edges = array();
foreach ($arguments as $argument) {
if ($argument instanceof Parameter) {
$argument = $this->container->hasParameter($argument) ? $this->container->getParameter($argument) : null;
} elseif (is_string($argument) && preg_match('/^%([^%]+)%$/', $argument, $match)) {
$argument = $this->container->hasParameter($match[1]) ? $this->container->getParameter($match[1]) : null;
}
if ($argument instanceof Reference) {
if (!$this->container->has((string) $argument)) {
$this->nodes[(string) $argument] = array('name' => $name, 'required' => $required, 'class' => '', 'attributes' => $this->options['node.missing']);
}
$edges[] = array('name' => $name, 'required' => $required, 'to' => $argument);
} elseif (is_array($argument)) {
$edges = array_merge($edges, $this->findEdges($id, $argument, $required, $name));
}
}
return $edges;
}
/**
* Finds all nodes.
*
* @return array An array of all nodes
*/
private function findNodes()
{
$nodes = array();
$container = $this->cloneContainer();
foreach ($container->getDefinitions() as $id => $definition) {
$class = $definition->getClass();
if ('\\' === substr($class, 0, 1)) {
$class = substr($class, 1);
}
$nodes[$id] = array('class' => str_replace('\\', '\\\\', $this->container->getParameterBag()->resolveValue($class)), 'attributes' => array_merge($this->options['node.definition'], array('style' => ContainerInterface::SCOPE_PROTOTYPE !== $definition->getScope() ? 'filled' : 'dotted')));
$container->setDefinition($id, new Definition('stdClass'));
}
foreach ($container->getServiceIds() as $id) {
$service = $container->get($id);
if (array_key_exists($id, $container->getAliases())) {
continue;
}
if (!$container->hasDefinition($id)) {
$class = ('service_container' === $id) ? get_class($this->container) : get_class($service);
$nodes[$id] = array('class' => str_replace('\\', '\\\\', $class), 'attributes' => $this->options['node.instance']);
}
}
return $nodes;
}
private function cloneContainer()
{
$parameterBag = new ParameterBag($this->container->getParameterBag()->all());
$container = new ContainerBuilder($parameterBag);
$container->setDefinitions($this->container->getDefinitions());
$container->setAliases($this->container->getAliases());
$container->setResources($this->container->getResources());
foreach ($this->container->getScopes() as $scope => $parentScope) {
$container->addScope(new Scope($scope, $parentScope));
}
foreach ($this->container->getExtensions() as $extension) {
$container->registerExtension($extension);
}
return $container;
}
/**
* Returns the start dot.
*
* @return string The string representation of a start dot
*/
private function startDot()
{
return sprintf("digraph sc {\n %s\n node [%s];\n edge [%s];\n\n",
$this->addOptions($this->options['graph']),
$this->addOptions($this->options['node']),
$this->addOptions($this->options['edge'])
);
}
/**
* Returns the end dot.
*
* @return string
*/
private function endDot()
{
return "}\n";
}
/**
* Adds attributes.
*
* @param array $attributes An array of attributes
*
* @return string A comma separated list of attributes
*/
private function addAttributes($attributes)
{
$code = array();
foreach ($attributes as $k => $v) {
$code[] = sprintf('%s="%s"', $k, $v);
}
return $code ? ', '.implode(', ', $code) : '';
}
/**
* Adds options.
*
* @param array $options An array of options
*
* @return string A space separated list of options
*/
private function addOptions($options)
{
$code = array();
foreach ($options as $k => $v) {
$code[] = sprintf('%s="%s"', $k, $v);
}
return implode(' ', $code);
}
/**
* Dotizes an identifier.
*
* @param string $id The identifier to dotize
*
* @return string A dotized string
*/
private function dotize($id)
{
return strtolower(preg_replace('/\W/i', '_', $id));
}
/**
* Compiles an array of aliases for a specified service id.
*
* @param string $id A service id
*
* @return array An array of aliases
*/
private function getAliases($id)
{
$aliases = array();
foreach ($this->container->getAliases() as $alias => $origin) {
if ($id == $origin) {
$aliases[] = $alias;
}
}
return $aliases;
}
}
| Java |
'use strict';
angular.module('mean.system').directive('googleMaps', ['GoogleMaps', 'Global',
function(GoogleMaps, Global) {
return {
restrict: 'E',
template: '<div id="map" style="height: 600px; width: 100%;"></div>',
controller: function() {
var mapOptions;
if ( GoogleMaps ) {
mapOptions = {
center: new GoogleMaps.LatLng(-34.397, 150.644),
zoom: 14,
mapTypeId: GoogleMaps.MapTypeId.ROADMAP
};
Global.map = new GoogleMaps.Map(document.getElementById('map'), mapOptions);
}
}
};
}]);
| Java |
#!/bin/sh
set -e
NEEDS_CONFIG=0
if [ "$#" -lt "1" ]; then
echo "Bad usage: check_reconf.sh [target_package] (optional configure arguments)"
exit 1
fi
if [ "$ONYX_ARCH" = "" ]; then
echo "ONYX_ARCH needs to be set!"
exit 1
fi
if [ "$HOST" = "" ]; then
echo "HOST needs to be set!"
exit 1
fi
if [ "$SYSROOT" = "" ]; then
echo "SYSROOT needs to be set!"
exit 1
fi
TARGET_PKG=$1
cd $TARGET_PKG
if [ -f "CONF_STAMP" ]; then
if [ $(cat CONF_STAMP) != "ARCH=${ONYX_ARCH}" ]; then
NEEDS_CONFIG=1
fi
else
NEEDS_CONFIG=1
fi
#echo "Needs conf: ${NEEDS_CONFIG}"
# Shift the arguments by one so we discard the first argument
shift 1
if [ "$NEEDS_CONFIG" = 0 ]; then
exit 0
fi
# Try and make clean/make distclean because some makefiles are kind of buggy **cough cough musl**
if [ -f Makefile ]; then
make distclean || make clean || true
fi
./configure --host=$HOST --with-sysroot=$SYSROOT "$@"
echo "ARCH=${ONYX_ARCH}" > CONF_STAMP
| Java |
<?php
namespace PxS\PeerReviewingBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$crawler = $client->request('GET', '/hello/Fabien');
$this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
}
}
| Java |
//
// URBSegmentedControl.h
// URBSegmentedControlDemo
//
// Created by Nicholas Shipes on 2/1/13.
// Copyright (c) 2013 Urban10 Interactive. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, URBSegmentedControlOrientation) {
URBSegmentedControlOrientationHorizontal = 0,
URBSegmentedControlOrientationVertical
};
typedef NS_ENUM(NSUInteger, URBSegmentViewLayout) {
URBSegmentViewLayoutDefault = 0,
URBSegmentViewLayoutVertical
};
typedef NS_ENUM(NSUInteger, URBSegmentImagePosition) {
URBSegmentImagePositionLeft = 0,
URBSegmentImagePositionRight
};
@interface URBSegmentedControl : UISegmentedControl <UIAppearance>
typedef void (^URBSegmentedControlBlock)(NSInteger index, URBSegmentedControl *segmentedControl);
/**
Layout behavior for the segments (row or columns).
*/
@property (nonatomic) URBSegmentedControlOrientation layoutOrientation;
/**
Layout behavior of the segment contents.
*/
@property (nonatomic) URBSegmentViewLayout segmentViewLayout;
/**
* Position of the image when placed horizontally next to a segment label. Not used for controls containing only text or images.
*/
@property (nonatomic, assign) URBSegmentImagePosition imagePosition;
/**
Block handle called when the selected segment has changed.
*/
@property (nonatomic, copy) URBSegmentedControlBlock controlEventBlock;
/**
Background color for the base container view.
*/
@property (nonatomic, strong) UIColor *baseColor;
@property (nonatomic, strong) UIColor *baseGradient;
/**
Stroke color used around the base container view.
*/
@property (nonatomic, strong) UIColor *strokeColor;
/**
Stroke width for the base container view.
*/
@property (nonatomic, assign) CGFloat strokeWidth;
/**
Corner radius for the base container view.
*/
@property (nonatomic) CGFloat cornerRadius;
/**
Whether or not a gradient should be automatically applied to the base and segment backgrounds based on the defined base colors.
*/
@property (nonatomic, assign) BOOL showsGradient;
/**
Padding between the segments and the base container view.
*/
@property (nonatomic, assign) UIEdgeInsets segmentEdgeInsets;
///----------------------------
/// @name Segment Customization
///----------------------------
@property (nonatomic, strong) UIColor *segmentBackgroundColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *segmentBackgroundGradient UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *imageColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, strong) UIColor *selectedImageColor UI_APPEARANCE_SELECTOR;
@property (nonatomic, assign) UIEdgeInsets contentEdgeInsets;
@property (nonatomic, assign) UIEdgeInsets titleEdgeInsets;
@property (nonatomic, assign) UIEdgeInsets imageEdgeInsets;
- (id)initWithTitles:(NSArray *)titles;
- (id)initWithIcons:(NSArray *)icons;
- (id)initWithTitles:(NSArray *)titles icons:(NSArray *)icons;
- (void)insertSegmentWithTitle:(NSString *)title image:(UIImage *)image atIndex:(NSUInteger)segment animated:(BOOL)animated;
- (void)setSegmentBackgroundColor:(UIColor *)segmentBackgroundColor atIndex:(NSUInteger)segment;
- (void)setImageColor:(UIColor *)imageColor forState:(UIControlState)state UI_APPEARANCE_SELECTOR;
- (void)setSegmentBackgroundColor:(UIColor *)segmentBackgroundColor UI_APPEARANCE_SELECTOR;
- (void)setControlEventBlock:(URBSegmentedControlBlock)controlEventBlock;
@end
@interface UIImage (URBSegmentedControl)
- (UIImage *)imageTintedWithColor:(UIColor *)color;
@end | Java |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34011
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WinFormsApp.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
| Java |
import { Component, OnInit, HostListener, ElementRef } from '@angular/core';
import { Router, NavigationEnd, NavigationExtras } from '@angular/router';
import { AuthService } from '../../services/auth.service';
@Component({
selector: 'app-nav',
templateUrl: 'app-nav.component.html'
})
export class AppNavComponent implements OnInit {
loggedIn: boolean;
menuDropped: boolean;
searchKeyword: string;
constructor(
public auth: AuthService,
private router: Router,
private elementRef: ElementRef
) {
this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
this.menuDropped = false;
this.searchKeyword = '';
}
});
this.searchKeyword = '';
}
ngOnInit() {
this.auth.checkLogin();
}
toggleMenu() {
this.menuDropped = !this.menuDropped;
}
logout(): void {
this.auth.logout();
this.menuDropped = false;
}
searchPackages(e: Event): void {
e.preventDefault();
const navigationExtras: NavigationExtras = {
queryParams: { 'keyword': this.searchKeyword }
};
this.router.navigate(['search'], navigationExtras);
}
@HostListener('document:click', ['$event'])
onBlur(e: MouseEvent) {
if (!this.menuDropped) {
return;
}
let toggleBtn = this.elementRef.nativeElement.querySelector('.drop-menu-act');
if (e.target === toggleBtn || toggleBtn.contains(<any>e.target)) {
return;
}
let dropMenu: HTMLElement = this.elementRef.nativeElement.querySelector('.nav-dropdown');
if (dropMenu && dropMenu !== e.target && !dropMenu.contains((<any>e.target))) {
this.menuDropped = false;
}
}
}
| Java |
// Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "walletview.h"
#include "addressbookpage.h"
#include "askpassphrasedialog.h"
#include "bitcoingui.h"
#include "clientmodel.h"
#include "guiutil.h"
#include "optionsmodel.h"
#include "overviewpage.h"
#include "receivecoinsdialog.h"
#include "sendcoinsdialog.h"
#include "signverifymessagedialog.h"
#include "transactiontablemodel.h"
#include "transactionview.h"
#include "walletmodel.h"
#include "miningpage.h"
#include "ui_interface.h"
#include <QAction>
#include <QActionGroup>
#include <QFileDialog>
#include <QHBoxLayout>
#include <QProgressDialog>
#include <QPushButton>
#include <QVBoxLayout>
WalletView::WalletView(QWidget *parent):
QStackedWidget(parent),
clientModel(0),
walletModel(0)
{
// Create tabs
overviewPage = new OverviewPage();
transactionsPage = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
QHBoxLayout *hbox_buttons = new QHBoxLayout();
transactionView = new TransactionView(this);
vbox->addWidget(transactionView);
QPushButton *exportButton = new QPushButton(tr("&Export"), this);
exportButton->setToolTip(tr("Export the data in the current tab to a file"));
#ifndef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
exportButton->setIcon(QIcon(":/icons/export"));
#endif
hbox_buttons->addStretch();
hbox_buttons->addWidget(exportButton);
vbox->addLayout(hbox_buttons);
transactionsPage->setLayout(vbox);
receiveCoinsPage = new ReceiveCoinsDialog();
sendCoinsPage = new SendCoinsDialog();
miningPage = new MiningPage();
addWidget(overviewPage);
addWidget(transactionsPage);
addWidget(receiveCoinsPage);
addWidget(sendCoinsPage);
addWidget(miningPage);
// Clicking on a transaction on the overview pre-selects the transaction on the transaction history page
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));
// Double-clicking on a transaction on the transaction history page shows details
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
// Clicking on "Export" allows to export the transaction list
connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked()));
// Pass through messages from sendCoinsPage
connect(sendCoinsPage, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));
// Pass through messages from transactionView
connect(transactionView, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));
}
WalletView::~WalletView()
{
}
void WalletView::setBitcoinGUI(BitcoinGUI *gui)
{
if (gui)
{
// Clicking on a transaction on the overview page simply sends you to transaction history page
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), gui, SLOT(gotoHistoryPage()));
// Receive and report messages
connect(this, SIGNAL(message(QString,QString,unsigned int)), gui, SLOT(message(QString,QString,unsigned int)));
// Pass through encryption status changed signals
connect(this, SIGNAL(encryptionStatusChanged(int)), gui, SLOT(setEncryptionStatus(int)));
// Pass through transaction notifications
connect(this, SIGNAL(incomingTransaction(QString,int,qint64,QString,QString)), gui, SLOT(incomingTransaction(QString,int,qint64,QString,QString)));
}
}
void WalletView::setClientModel(ClientModel *clientModel)
{
this->clientModel = clientModel;
overviewPage->setClientModel(clientModel);
miningPage->setClientModel(clientModel);
}
void WalletView::setWalletModel(WalletModel *walletModel)
{
this->walletModel = walletModel;
// Put transaction list in tabs
transactionView->setModel(walletModel);
overviewPage->setWalletModel(walletModel);
receiveCoinsPage->setModel(walletModel);
sendCoinsPage->setModel(walletModel);
miningPage->setWalletModel(walletModel);
if (walletModel)
{
// Receive and pass through messages from wallet model
connect(walletModel, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));
// Handle changes in encryption status
connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SIGNAL(encryptionStatusChanged(int)));
updateEncryptionStatus();
// Balloon pop-up for new transaction
connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(processNewTransaction(QModelIndex,int,int)));
// Ask for passphrase if needed
connect(walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));
// Show progress dialog
connect(walletModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));
}
}
void WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/)
{
// Prevent balloon-spam when initial block download is in progress
if (!walletModel || !clientModel || clientModel->inInitialBlockDownload())
return;
TransactionTableModel *ttm = walletModel->getTransactionTableModel();
QString date = ttm->index(start, TransactionTableModel::Date, parent).data().toString();
qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent).data(Qt::EditRole).toULongLong();
QString type = ttm->index(start, TransactionTableModel::Type, parent).data().toString();
QString address = ttm->index(start, TransactionTableModel::ToAddress, parent).data().toString();
emit incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address);
}
void WalletView::gotoOverviewPage()
{
setCurrentWidget(overviewPage);
}
void WalletView::gotoHistoryPage()
{
setCurrentWidget(transactionsPage);
}
void WalletView::gotoReceiveCoinsPage()
{
setCurrentWidget(receiveCoinsPage);
}
void WalletView::gotoSendCoinsPage(QString addr)
{
setCurrentWidget(sendCoinsPage);
if (!addr.isEmpty())
sendCoinsPage->setAddress(addr);
}
void WalletView::gotoMiningPage()
{
setCurrentWidget(miningPage);
}
void WalletView::gotoSignMessageTab(QString addr)
{
// calls show() in showTab_SM()
SignVerifyMessageDialog *signVerifyMessageDialog = new SignVerifyMessageDialog(this);
signVerifyMessageDialog->setAttribute(Qt::WA_DeleteOnClose);
signVerifyMessageDialog->setModel(walletModel);
signVerifyMessageDialog->showTab_SM(true);
if (!addr.isEmpty())
signVerifyMessageDialog->setAddress_SM(addr);
}
void WalletView::gotoVerifyMessageTab(QString addr)
{
// calls show() in showTab_VM()
SignVerifyMessageDialog *signVerifyMessageDialog = new SignVerifyMessageDialog(this);
signVerifyMessageDialog->setAttribute(Qt::WA_DeleteOnClose);
signVerifyMessageDialog->setModel(walletModel);
signVerifyMessageDialog->showTab_VM(true);
if (!addr.isEmpty())
signVerifyMessageDialog->setAddress_VM(addr);
}
bool WalletView::handlePaymentRequest(const SendCoinsRecipient& recipient)
{
return sendCoinsPage->handlePaymentRequest(recipient);
}
void WalletView::showOutOfSyncWarning(bool fShow)
{
overviewPage->showOutOfSyncWarning(fShow);
}
void WalletView::updateEncryptionStatus()
{
emit encryptionStatusChanged(walletModel->getEncryptionStatus());
}
void WalletView::encryptWallet(bool status)
{
if(!walletModel)
return;
AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt : AskPassphraseDialog::Decrypt, this);
dlg.setModel(walletModel);
dlg.exec();
updateEncryptionStatus();
}
void WalletView::backupWallet()
{
QString filename = GUIUtil::getSaveFileName(this,
tr("Backup Wallet"), QString(),
tr("Wallet Data (*.dat)"), NULL);
if (filename.isEmpty())
return;
if (!walletModel->backupWallet(filename)) {
emit message(tr("Backup Failed"), tr("There was an error trying to save the wallet data to %1.").arg(filename),
CClientUIInterface::MSG_ERROR);
}
else {
emit message(tr("Backup Successful"), tr("The wallet data was successfully saved to %1.").arg(filename),
CClientUIInterface::MSG_INFORMATION);
}
}
void WalletView::changePassphrase()
{
AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this);
dlg.setModel(walletModel);
dlg.exec();
}
void WalletView::unlockWallet()
{
if(!walletModel)
return;
// Unlock wallet when requested by wallet model
if (walletModel->getEncryptionStatus() == WalletModel::Locked)
{
AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this);
dlg.setModel(walletModel);
dlg.exec();
}
}
void WalletView::usedSendingAddresses()
{
if(!walletModel)
return;
AddressBookPage *dlg = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab, this);
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->setModel(walletModel->getAddressTableModel());
dlg->show();
}
void WalletView::usedReceivingAddresses()
{
if(!walletModel)
return;
AddressBookPage *dlg = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab, this);
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->setModel(walletModel->getAddressTableModel());
dlg->show();
}
void WalletView::showProgress(const QString &title, int nProgress)
{
if (nProgress == 0)
{
progressDialog = new QProgressDialog(title, "", 0, 100);
progressDialog->setWindowModality(Qt::ApplicationModal);
progressDialog->setMinimumDuration(0);
progressDialog->setCancelButton(0);
progressDialog->setAutoClose(false);
progressDialog->setValue(0);
}
else if (nProgress == 100)
{
if (progressDialog)
{
progressDialog->close();
progressDialog->deleteLater();
}
}
else if (progressDialog)
progressDialog->setValue(nProgress);
}
| Java |
<?php
return array (
'id' => 'samsung_gt_m5650_ver1',
'fallback' => 'generic_dolfin',
'capabilities' =>
array (
'pointing_method' => 'touchscreen',
'mobile_browser_version' => '1.0',
'uaprof' => 'http://wap.samsungmobile.com/uaprof/GT-M5650.rdf',
'model_name' => 'GT M5650',
'brand_name' => 'Samsung',
'marketing_name' => 'Corby Lindy',
'release_date' => '2010_february',
'softkey_support' => 'true',
'table_support' => 'true',
'wml_1_1' => 'true',
'wml_1_2' => 'true',
'xhtml_support_level' => '3',
'wml_1_3' => 'true',
'columns' => '20',
'rows' => '16',
'max_image_width' => '228',
'resolution_width' => '240',
'resolution_height' => '320',
'max_image_height' => '280',
'jpg' => 'true',
'gif' => 'true',
'bmp' => 'true',
'wbmp' => 'true',
'png' => 'true',
'colors' => '65536',
'nokia_voice_call' => 'true',
'streaming_vcodec_mpeg4_asp' => '0',
'streaming_vcodec_h263_0' => '10',
'streaming_3g2' => 'true',
'streaming_3gpp' => 'true',
'streaming_acodec_amr' => 'nb',
'streaming_vcodec_h264_bp' => '1',
'streaming_video' => 'true',
'streaming_vcodec_mpeg4_sp' => '0',
'wap_push_support' => 'true',
'mms_png' => 'true',
'mms_max_size' => '307200',
'mms_max_width' => '0',
'mms_spmidi' => 'true',
'mms_max_height' => '0',
'mms_gif_static' => 'true',
'mms_wav' => 'true',
'mms_vcard' => 'true',
'mms_midi_monophonic' => 'true',
'mms_bmp' => 'true',
'mms_wbmp' => 'true',
'mms_amr' => 'true',
'mms_jpeg_baseline' => 'true',
'aac' => 'true',
'sp_midi' => 'true',
'mp3' => 'true',
'amr' => 'true',
'midi_monophonic' => 'true',
'imelody' => 'true',
'j2me_midp_2_0' => 'true',
'j2me_cldc_1_0' => 'true',
'j2me_cldc_1_1' => 'true',
'j2me_midp_1_0' => 'true',
'wifi' => 'true',
'max_data_rate' => '3600',
'directdownload_support' => 'true',
'oma_support' => 'true',
'oma_v_1_0_separate_delivery' => 'true',
'image_inlining' => 'true',
),
);
| Java |
<?php
/**
* File: SimpleImage.php
* Author: Simon Jarvis
* Modified by: Miguel Fermín
* Based in: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php
*
* 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:
* http://www.gnu.org/licenses/gpl.html
*/
class Image_compression_helper {
public $image;
public $image_type;
public function __construct($filename = null) {
if (!empty($filename)) {
$this->load($filename);
}
}
public function load($filename) {
$image_info = getimagesize($filename);
$this->image_type = $image_info[2];
if ($this->image_type == IMAGETYPE_JPEG) {
$this->image = imagecreatefromjpeg($filename);
} elseif ($this->image_type == IMAGETYPE_GIF) {
$this->image = imagecreatefromgif($filename);
} elseif ($this->image_type == IMAGETYPE_PNG) {
$this->image = imagecreatefrompng($filename);
} else {
throw new Exception("The file you're trying to open is not supported");
}
}
public function example($url) {
// Usage:
// Load the original image
$image = new SimpleImage($url);
// Resize the image to 600px width and the proportional height
$image->resizeToWidth(600);
$image->save('lemon_resized.jpg');
// Create a squared version of the image
$image->square(200);
$image->save('lemon_squared.jpg');
// Scales the image to 75%
$image->scale(75);
$image->save('lemon_scaled.jpg');
// Resize the image to specific width and height
$image->resize(80, 60);
$image->save('lemon_resized2.jpg');
// Resize the canvas and fill the empty space with a color of your choice
$image->maxareafill(600, 400, 32, 39, 240);
$image->save('lemon_filled.jpg');
// Output the image to the browser:
$image->output();
}
public function save($filename, $image_type = IMAGETYPE_JPEG, $compression = 75, $permissions = null) {
if ($image_type == IMAGETYPE_JPEG) {
imagejpeg($this->image, $filename, $compression);
} elseif ($image_type == IMAGETYPE_GIF) {
imagegif($this->image, $filename);
} elseif ($image_type == IMAGETYPE_PNG) {
imagepng($this->image, $filename);
}
if ($permissions != null) {
chmod($filename, $permissions);
}
}
public function output($image_type = IMAGETYPE_JPEG, $quality = 80) {
if ($image_type == IMAGETYPE_JPEG) {
header("Content-type: image/jpeg");
imagejpeg($this->image, null, $quality);
} elseif ($image_type == IMAGETYPE_GIF) {
header("Content-type: image/gif");
imagegif($this->image);
} elseif ($image_type == IMAGETYPE_PNG) {
header("Content-type: image/png");
imagepng($this->image);
}
}
public function getWidth() {
return imagesx($this->image);
}
public function getHeight() {
return imagesy($this->image);
}
public function resizeToHeight($height) {
$ratio = $height / $this->getHeight();
$width = round($this->getWidth() * $ratio);
$this->resize($width, $height);
}
public function resizeToWidth($width) {
$ratio = $width / $this->getWidth();
$height = round($this->getHeight() * $ratio);
$this->resize($width, $height);
}
public function square($size) {
$new_image = imagecreatetruecolor($size, $size);
if ($this->getWidth() > $this->getHeight()) {
$this->resizeToHeight($size);
imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));
imagealphablending($new_image, false);
imagesavealpha($new_image, true);
imagecopy($new_image, $this->image, 0, 0, ($this->getWidth() - $size) / 2, 0, $size, $size);
} else {
$this->resizeToWidth($size);
imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));
imagealphablending($new_image, false);
imagesavealpha($new_image, true);
imagecopy($new_image, $this->image, 0, 0, 0, ($this->getHeight() - $size) / 2, $size, $size);
}
$this->image = $new_image;
}
public function scale($scale) {
$width = $this->getWidth() * $scale / 100;
$height = $this->getHeight() * $scale / 100;
$this->resize($width, $height);
}
public function resize($width, $height) {
$new_image = imagecreatetruecolor($width, $height);
imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));
imagealphablending($new_image, false);
imagesavealpha($new_image, true);
imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());
$this->image = $new_image;
}
public function cut($x, $y, $width, $height) {
$new_image = imagecreatetruecolor($width, $height);
imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));
imagealphablending($new_image, false);
imagesavealpha($new_image, true);
imagecopy($new_image, $this->image, 0, 0, $x, $y, $width, $height);
$this->image = $new_image;
}
public function maxarea($width, $height = null) {
$height = $height ? $height : $width;
if ($this->getWidth() > $width) {
$this->resizeToWidth($width);
}
if ($this->getHeight() > $height) {
$this->resizeToheight($height);
}
}
public function minarea($width, $height = null) {
$height = $height ? $height : $width;
if ($this->getWidth() < $width) {
$this->resizeToWidth($width);
}
if ($this->getHeight() < $height) {
$this->resizeToheight($height);
}
}
public function cutFromCenter($width, $height) {
if ($width < $this->getWidth() && $width > $height) {
$this->resizeToWidth($width);
}
if ($height < $this->getHeight() && $width < $height) {
$this->resizeToHeight($height);
}
$x = ($this->getWidth() / 2) - ($width / 2);
$y = ($this->getHeight() / 2) - ($height / 2);
return $this->cut($x, $y, $width, $height);
}
public function maxareafill($width, $height, $red = 0, $green = 0, $blue = 0) {
$this->maxarea($width, $height);
$new_image = imagecreatetruecolor($width, $height);
$color_fill = imagecolorallocate($new_image, $red, $green, $blue);
imagefill($new_image, 0, 0, $color_fill);
imagecopyresampled($new_image, $this->image, floor(($width - $this->getWidth()) / 2), floor(($height - $this->getHeight()) / 2), 0, 0, $this->getWidth(), $this->getHeight(), $this->getWidth(), $this->getHeight()
);
$this->image = $new_image;
}
}
| Java |
# == Schema Information
#
# Table name: accounts
#
# id :integer not null, primary key
# type :string default("Account"), not null
# description :string default(""), not null
# currency :string default("USD"), not null
# created_at :datetime not null
# updated_at :datetime not null
# owner_id :integer
# owner_type :string
# standalone :boolean default(FALSE)
# override_fee_percentage :integer
#
# Indexes
#
# index_accounts_on_item_id (owner_id)
# index_accounts_on_item_type (owner_type)
# index_accounts_on_type (type)
#
class Account::SoftwarePublicInterest < Account
end
| Java |
package illume.analysis;
import java.awt.image.BufferedImage;
/* This simple analyser example averages pixel values. */
public class SimpleImageAnalyser<T extends BufferedImage> extends AbstractImageAnalyser<T> {
@Override
public double analyse(T input) {
int sum_r = 0;
int sum_g = 0;
int sum_b = 0;
for (int y = 0; y < input.getHeight(); y++) {
for (int x = 0; x < input.getWidth(); x++) {
final int clr = input.getRGB(x, y);
sum_r += (clr & 0x00ff0000) >> 16;
sum_g += (clr & 0x0000ff00) >> 8;
sum_b += clr & 0x000000ff;
}
}
double sum_rgb = ((sum_r + sum_b + sum_g) / 3.0d);
double avg = sum_rgb / (input.getHeight() * input.getWidth());
// 8-bit RGB
return avg / 255;
}
}
| Java |
import { ExtraGlamorousProps } from './glamorous-component'
import {
ViewProperties,
TextStyle,
ViewStyle,
ImageStyle,
TextInputProperties,
ImageProperties,
ScrollViewProps,
TextProperties,
TouchableHighlightProperties,
TouchableNativeFeedbackProperties,
TouchableOpacityProperties,
TouchableWithoutFeedbackProps,
FlatListProperties,
SectionListProperties
} from 'react-native'
export interface NativeComponent {
Image: React.StatelessComponent<
ImageProperties & ExtraGlamorousProps & ImageStyle
>
ScrollView: React.StatelessComponent<
ScrollViewProps & ExtraGlamorousProps & ViewStyle
>
Text: React.StatelessComponent<
TextProperties & ExtraGlamorousProps & TextStyle
>
TextInput: React.StatelessComponent<
TextInputProperties & ExtraGlamorousProps & TextStyle
>
TouchableHighlight: React.StatelessComponent<
TouchableHighlightProperties & ExtraGlamorousProps & ViewStyle
>
TouchableNativeFeedback: React.StatelessComponent<
TouchableNativeFeedbackProperties & ExtraGlamorousProps & ViewStyle
>
TouchableOpacity: React.StatelessComponent<
TouchableOpacityProperties & ExtraGlamorousProps & ViewStyle
>
TouchableWithoutFeedback: React.StatelessComponent<
TouchableWithoutFeedbackProps & ExtraGlamorousProps & ViewStyle
>
View: React.StatelessComponent<
ViewProperties & ExtraGlamorousProps & ViewStyle
>
FlatList: React.StatelessComponent<
FlatListProperties<any> & ExtraGlamorousProps & ViewStyle
>
SectionList: React.StatelessComponent<
SectionListProperties<any> & ExtraGlamorousProps & ViewStyle
>
}
| Java |
var express = require('../')
, Router = express.Router
, request = require('./support/http')
, methods = require('methods')
, assert = require('assert');
describe('Router', function(){
var router, app;
beforeEach(function(){
router = new Router;
app = express();
})
describe('.match(method, url, i)', function(){
it('should match based on index', function(){
router.route('get', '/foo', function(){});
router.route('get', '/foob?', function(){});
router.route('get', '/bar', function(){});
var method = 'GET';
var url = '/foo?bar=baz';
var route = router.match(method, url, 0);
route.constructor.name.should.equal('Route');
route.method.should.equal('get');
route.path.should.equal('/foo');
var route = router.match(method, url, 1);
route.path.should.equal('/foob?');
var route = router.match(method, url, 2);
assert(!route);
url = '/bar';
var route = router.match(method, url);
route.path.should.equal('/bar');
})
})
describe('.matchRequest(req, i)', function(){
it('should match based on index', function(){
router.route('get', '/foo', function(){});
router.route('get', '/foob?', function(){});
router.route('get', '/bar', function(){});
var req = { method: 'GET', url: '/foo?bar=baz' };
var route = router.matchRequest(req, 0);
route.constructor.name.should.equal('Route');
route.method.should.equal('get');
route.path.should.equal('/foo');
var route = router.matchRequest(req, 1);
req._route_index.should.equal(1);
route.path.should.equal('/foob?');
var route = router.matchRequest(req, 2);
assert(!route);
req.url = '/bar';
var route = router.matchRequest(req);
route.path.should.equal('/bar');
})
})
describe('.middleware', function(){
it('should dispatch', function(done){
router.route('get', '/foo', function(req, res){
res.send('foo');
});
app.use(router.middleware);
request(app)
.get('/foo')
.expect('foo', done);
})
})
describe('.multiple callbacks', function(){
it('should throw if a callback is null', function(){
assert.throws(function () {
router.route('get', '/foo', null, function(){});
})
})
it('should throw if a callback is undefined', function(){
assert.throws(function () {
router.route('get', '/foo', undefined, function(){});
})
})
it('should throw if a callback is not a function', function(){
assert.throws(function () {
router.route('get', '/foo', 'not a function', function(){});
})
})
it('should not throw if all callbacks are functions', function(){
router.route('get', '/foo', function(){}, function(){});
})
})
describe('.all', function() {
it('should support using .all to capture all http verbs', function() {
var router = new Router();
router.all('/foo', function(){});
var url = '/foo?bar=baz';
methods.forEach(function testMethod(method) {
var route = router.match(method, url);
route.constructor.name.should.equal('Route');
route.method.should.equal(method);
route.path.should.equal('/foo');
});
})
})
})
| Java |
#include "EventQueueThread.h"
| Java |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>slickgrid-colfix-plugin example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../bower_components/slickgrid/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="../bower_components/slickgrid/css/smoothness/jquery-ui-1.8.16.custom.css" type="text/css" />
<link rel="stylesheet" href="../bower_components/slickgrid/examples/examples.css" type="text/css" />
<style>
body {margin: 0;}
.grid {background: white; outline: 0; border: 1px solid gray;}
.slick-row.active {background-color: #fcc;}
.idx {background-color: #f2f2f2; border-right: 1px solid #aaa; text-align: right; font-size: 0.8em; padding-right: 8px;}
</style>
</head>
<body>
<div id="my-grid" class="grid" style="width: 800px; height: 400px"></div>
<script src="../bower_components/slickgrid/lib/jquery-1.7.min.js"></script>
<script src="../bower_components/slickgrid/lib/jquery-ui-1.8.16.custom.min.js"></script>
<script src="../bower_components/slickgrid/lib/jquery.event.drag-2.2.js"></script>
<script src="../bower_components/slickgrid/slick.core.js"></script>
<script src="../bower_components/slickgrid/slick.grid.js"></script>
<script src="../dist/slick.colfix.js"></script>
<script>
/** columns defination */
var columns = [
{id: '#', name: '', field: 'idx', width: 50, cssClass: 'idx'},
{id: 'col1', name: 'col 1', field: 'col1', width: 50},
{id: 'col2', name: 'col 2', field: 'col2', width: 80},
{id: 'col3', name: 'col 3', field: 'col3', width: 100},
{id: 'col4', name: 'col 4', field: 'col4', width: 200},
{id: 'col5', name: 'col 5', field: 'col5', width: 50},
{id: 'col6', name: 'col 6', field: 'col6', width: 300},
{id: 'col7', name: 'col 7', field: 'col7', width: 100},
{id: 'col8', name: 'col 8', field: 'col8', width: 200},
{id: 'col9', name: 'col 9', field: 'col9', width: 100}
];
/** grid options */
var options = {
enableColumnReorder: false,
explicitInitialization: true
};
/** data */
var data = [];
for (var i = 0; i < 500; i++) {
data[i] = {
idx: i,
col1: 'col 1-' + i,
col2: 'col 2-' + i,
col3: 'col 3-' + i,
col4: 'col 4-' + i,
col5: 'col 5-' + i,
col6: 'col 6-' + i,
col7: 'col 7-' + i,
col8: 'col 8-' + i,
col9: 'col 9-' + i
};
}
/** SlickGrid */
var grid = new Slick.Grid('#my-grid', data, columns, options);
// register colfix plguin
grid.registerPlugin(new Slick.Plugins.ColFix('#'));
// initialize
grid.init();
</script>
</body>
</html>
| Java |
using Foundation;
using System;
using System.Linq;
using UIKit;
namespace UICatalog
{
public partial class BaseSearchController : UITableViewController, IUISearchResultsUpdating
{
private const string CellIdentifier = "searchResultsCell";
private readonly string[] allItems =
{
"Here's", "to", "the", "crazy", "ones.", "The", "misfits.", "The", "rebels.",
"The", "troublemakers.", "The", "round", "pegs", "in", "the", "square", "holes.", "The", "ones", "who",
"see", "things", "differently.", "They're", "not", "fond", "of", @"rules.", "And", "they", "have", "no",
"respect", "for", "the", "status", "quo.", "You", "can", "quote", "them,", "disagree", "with", "them,",
"glorify", "or", "vilify", "them.", "About", "the", "only", "thing", "you", "can't", "do", "is", "ignore",
"them.", "Because", "they", "change", "things.", "They", "push", "the", "human", "race", "forward.",
"And", "while", "some", "may", "see", "them", "as", "the", "crazy", "ones,", "we", "see", "genius.",
"Because", "the", "people", "who", "are", "crazy", "enough", "to", "think", "they", "can", "change",
"the", "world,", "are", "the", "ones", "who", "do."
};
private string[] items;
private string query;
public BaseSearchController(IntPtr handle) : base(handle) { }
public override void ViewDidLoad()
{
base.ViewDidLoad();
items = allItems;
}
protected void ApplyFilter(string filter)
{
query = filter;
items = string.IsNullOrEmpty(query) ? allItems : allItems.Where(s => s.Contains(query)).ToArray();
TableView.ReloadData();
}
public override nint RowsInSection(UITableView tableView, nint section)
{
return items.Length;
}
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
var cell = tableView.DequeueReusableCell(CellIdentifier, indexPath);
cell.TextLabel.Text = items[indexPath.Row];
return cell;
}
#region IUISearchResultsUpdating
[Export("updateSearchResultsForSearchController:")]
public void UpdateSearchResultsForSearchController(UISearchController searchController)
{
// UpdateSearchResultsForSearchController is called when the controller is being dismissed
// to allow those who are using the controller they are search as the results controller a chance to reset their state.
// No need to update anything if we're being dismissed.
if (searchController.Active)
{
ApplyFilter(searchController.SearchBar.Text);
}
}
#endregion
}
} | Java |
//
// AppDelegate.h
// DecoratorPattern
//
// Created by Vito on 13-11-15.
// Copyright (c) 2013年 Vito. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| Java |
<?php
/**
* This file is part of the Cubiche package.
*
* Copyright (c) Cubiche
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cubiche\Core\EventDispatcher;
use Cubiche\Core\Bus\MessageInterface;
/**
* Event interface.
*
* @author Ivannis Suárez Jerez <ivannis.suarez@gmail.com>
*/
interface EventInterface extends MessageInterface
{
/**
* Stop event propagation.
*
* @return $this
*/
public function stopPropagation();
/**
* Check whether propagation was stopped.
*
* @return bool
*/
public function isPropagationStopped();
/**
* Get the event name.
*
* @return string
*/
public function eventName();
}
| Java |
<?php
namespace Kordy\Ticketit\Controllers;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
use Kordy\Ticketit\Models\Agent;
use Kordy\Ticketit\Models\Setting;
use Kordy\Ticketit\Seeds\SettingsTableSeeder;
use Kordy\Ticketit\Seeds\TicketitTableSeeder;
class InstallController extends Controller
{
public $migrations_tables = [];
public function __construct()
{
$migrations = \File::files(dirname(dirname(__FILE__)).'/Migrations');
foreach ($migrations as $migration) {
$this->migrations_tables[] = basename($migration, '.php');
}
}
public function publicAssets()
{
$public = $this->allFilesList(public_path('vendor/ticketit'));
$assets = $this->allFilesList(base_path('vendor/kordy/ticketit/src/Public'));
if ($public !== $assets) {
Artisan::call('vendor:publish', [
'--provider' => 'Kordy\\Ticketit\\TicketitServiceProvider',
'--tag' => ['public'],
]);
}
}
/*
* Initial install form
*/
public function index()
{
// if all migrations are not yet installed or missing settings table,
// then start the initial install with admin and master template choices
if (count($this->migrations_tables) == count($this->inactiveMigrations())
|| in_array('2015_10_08_123457_create_settings_table', $this->inactiveMigrations())
) {
$views_files_list = $this->viewsFilesList('../resources/views/') + ['another' => trans('ticketit::install.another-file')];
$inactive_migrations = $this->inactiveMigrations();
$users_list = User::lists('first_name', 'id')->toArray();
return view('ticketit::install.index', compact('views_files_list', 'inactive_migrations', 'users_list'));
}
// other than that, Upgrade to a new version, installing new migrations and new settings slugs
if (Agent::isAdmin()) {
$inactive_migrations = $this->inactiveMigrations();
$inactive_settings = $this->inactiveSettings();
return view('ticketit::install.upgrade', compact('inactive_migrations', 'inactive_settings'));
}
\Log::emergency('Ticketit needs upgrade, admin should login and visit ticketit-install to activate the upgrade');
throw new \Exception('Ticketit needs upgrade, admin should login and visit ticketit install route');
}
/*
* Do all pre-requested setup
*/
public function setup(Request $request)
{
$master = $request->master;
if ($master == 'another') {
$another_file = $request->other_path;
$views_content = strstr(substr(strstr($another_file, 'views/'), 6), '.blade.php', true);
$master = str_replace('/', '.', $views_content);
}
$this->initialSettings($master);
$admin_id = $request->admin_id;
$admin = User::find($admin_id);
$admin->ticketit_admin = true;
$admin->save();
return redirect('/'.Setting::grab('main_route'));
}
/*
* Do version upgrade
*/
public function upgrade()
{
if (Agent::isAdmin()) {
$this->initialSettings();
return redirect('/'.Setting::grab('main_route'));
}
\Log::emergency('Ticketit upgrade path access: Only admin is allowed to upgrade');
throw new \Exception('Ticketit upgrade path access: Only admin is allowed to upgrade');
}
/*
* Initial installer to install migrations, seed default settings, and configure the master_template
*/
public function initialSettings($master = false)
{
$inactive_migrations = $this->inactiveMigrations();
if ($inactive_migrations) { // If a migration is missing, do the migrate
Artisan::call('vendor:publish', [
'--provider' => 'Kordy\\Ticketit\\TicketitServiceProvider',
'--tag' => ['db'],
]);
Artisan::call('migrate');
$this->settingsSeeder($master);
// if this is the first install of the html editor, seed old posts text to the new html column
if (in_array('2016_01_15_002617_add_htmlcontent_to_ticketit_and_comments', $inactive_migrations)) {
Artisan::call('ticketit:htmlify');
}
} elseif ($this->inactiveSettings()) { // new settings to be installed
$this->settingsSeeder($master);
}
\Cache::forget('settings');
}
/**
* Run the settings table seeder.
*
* @param string $master
*/
public function settingsSeeder($master = false)
{
$cli_path = 'config/ticketit.php'; // if seeder run from cli, use the cli path
$provider_path = '../config/ticketit.php'; // if seeder run from provider, use the provider path
$config_settings = [];
$settings_file_path = false;
if (File::isFile($cli_path)) {
$settings_file_path = $cli_path;
} elseif (File::isFile($provider_path)) {
$settings_file_path = $provider_path;
}
if ($settings_file_path) {
$config_settings = include $settings_file_path;
File::move($settings_file_path, $settings_file_path.'.backup');
}
$seeder = new SettingsTableSeeder();
if ($master) {
$config_settings['master_template'] = $master;
}
$seeder->config = $config_settings;
$seeder->run();
}
/**
* Get list of all files in the views folder.
*
* @return mixed
*/
public function viewsFilesList($dir_path)
{
$dir_files = File::files($dir_path);
$files = [];
foreach ($dir_files as $file) {
$path = basename($file);
$name = strstr(basename($file), '.', true);
$files[$name] = $path;
}
return $files;
}
/**
* Get list of all files in the views folder.
*
* @return mixed
*/
public function allFilesList($dir_path)
{
$files = [];
if (File::exists($dir_path)) {
$dir_files = File::allFiles($dir_path);
foreach ($dir_files as $file) {
$path = basename($file);
$name = strstr(basename($file), '.', true);
$files[$name] = $path;
}
}
return $files;
}
/**
* Get all Ticketit Package migrations that were not migrated.
*
* @return array
*/
public function inactiveMigrations()
{
$inactiveMigrations = [];
$migration_arr = [];
// Package Migrations
$tables = $this->migrations_tables;
// Application active migrations
$migrations = DB::select('select * from migrations');
foreach ($migrations as $migration_parent) { // Count active package migrations
$migration_arr [] = $migration_parent->migration;
}
foreach ($tables as $table) {
if (!in_array($table, $migration_arr)) {
$inactiveMigrations [] = $table;
}
}
return $inactiveMigrations;
}
/**
* Check if all Ticketit Package settings that were not installed to setting table.
*
* @return bool
*/
public function inactiveSettings()
{
$seeder = new SettingsTableSeeder();
// Package Settings
$installed_settings = DB::table('ticketit_settings')->lists('value', 'slug');
// Application active migrations
$default_Settings = $seeder->getDefaults();
if (count($installed_settings) == count($default_Settings)) {
return false;
}
$inactive_settings = array_diff_key($default_Settings, $installed_settings);
return $inactive_settings;
}
/**
* Generate demo users, agents, and tickets.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function demoDataSeeder()
{
$seeder = new TicketitTableSeeder();
$seeder->run();
session()->flash('status', 'Demo tickets, users, and agents are seeded!');
return redirect()->action('\Kordy\Ticketit\Controllers\TicketsController@index');
}
}
| Java |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>V8 API Reference Guide for node.js v7.2.1: v8::Maybe< T > Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v7.2.1
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1Maybe.html">Maybe</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#friends">Friends</a> |
<a href="classv8_1_1Maybe-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::Maybe< T > Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <<a class="el" href="v8_8h_source.html">v8.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a486b608c21c8038d5019bd7d75866345"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a486b608c21c8038d5019bd7d75866345"></a>
V8_INLINE bool </td><td class="memItemRight" valign="bottom"><b>IsNothing</b> () const </td></tr>
<tr class="separator:a486b608c21c8038d5019bd7d75866345"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adc82dc945891060d312fb6fbf8fb56ae"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc82dc945891060d312fb6fbf8fb56ae"></a>
V8_INLINE bool </td><td class="memItemRight" valign="bottom"><b>IsJust</b> () const </td></tr>
<tr class="separator:adc82dc945891060d312fb6fbf8fb56ae"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4959bad473c4549048c1d2271a1a73e0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4959bad473c4549048c1d2271a1a73e0"></a>
V8_INLINE T </td><td class="memItemRight" valign="bottom"><b>ToChecked</b> () const </td></tr>
<tr class="separator:a4959bad473c4549048c1d2271a1a73e0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae2e1c6d0bd1ab5ff8de22a312c4dbb37"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae2e1c6d0bd1ab5ff8de22a312c4dbb37"></a>
V8_WARN_UNUSED_RESULT V8_INLINE bool </td><td class="memItemRight" valign="bottom"><b>To</b> (T *out) const </td></tr>
<tr class="separator:ae2e1c6d0bd1ab5ff8de22a312c4dbb37"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a02b19d7fcb7744d8dba3530ef8e14c8c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02b19d7fcb7744d8dba3530ef8e14c8c"></a>
V8_INLINE T </td><td class="memItemRight" valign="bottom"><b>FromJust</b> () const </td></tr>
<tr class="separator:a02b19d7fcb7744d8dba3530ef8e14c8c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0bcb5fb0d0e92a3f0cc546f11068a8df"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0bcb5fb0d0e92a3f0cc546f11068a8df"></a>
V8_INLINE T </td><td class="memItemRight" valign="bottom"><b>FromMaybe</b> (const T &default_value) const </td></tr>
<tr class="separator:a0bcb5fb0d0e92a3f0cc546f11068a8df"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adf61111c2da44e10ba5ab546a9a525ce"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adf61111c2da44e10ba5ab546a9a525ce"></a>
V8_INLINE bool </td><td class="memItemRight" valign="bottom"><b>operator==</b> (const <a class="el" href="classv8_1_1Maybe.html">Maybe</a> &other) const </td></tr>
<tr class="separator:adf61111c2da44e10ba5ab546a9a525ce"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5bbacc606422d7ab327c2683462342ec"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5bbacc606422d7ab327c2683462342ec"></a>
V8_INLINE bool </td><td class="memItemRight" valign="bottom"><b>operator!=</b> (const <a class="el" href="classv8_1_1Maybe.html">Maybe</a> &other) const </td></tr>
<tr class="separator:a5bbacc606422d7ab327c2683462342ec"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:aeb9593e125b42d748acbd69b72c89f37"><td class="memTemplParams" colspan="2"><a class="anchor" id="aeb9593e125b42d748acbd69b72c89f37"></a>
template<class U > </td></tr>
<tr class="memitem:aeb9593e125b42d748acbd69b72c89f37"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classv8_1_1Maybe.html">Maybe</a>< U > </td><td class="memTemplItemRight" valign="bottom"><b>Nothing</b> ()</td></tr>
<tr class="separator:aeb9593e125b42d748acbd69b72c89f37"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aeff0e7fedd63cfebe9a5286e2cd8552d"><td class="memTemplParams" colspan="2"><a class="anchor" id="aeff0e7fedd63cfebe9a5286e2cd8552d"></a>
template<class U > </td></tr>
<tr class="memitem:aeff0e7fedd63cfebe9a5286e2cd8552d"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classv8_1_1Maybe.html">Maybe</a>< U > </td><td class="memTemplItemRight" valign="bottom"><b>Just</b> (const U &u)</td></tr>
<tr class="separator:aeff0e7fedd63cfebe9a5286e2cd8552d"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template<class T><br />
class v8::Maybe< T ></h3>
<p>A simple <a class="el" href="classv8_1_1Maybe.html">Maybe</a> type, representing an object which may or may not have a value, see <a href="https://hackage.haskell.org/package/base/docs/Data-Maybe.html">https://hackage.haskell.org/package/base/docs/Data-Maybe.html</a>.</p>
<p>If an API method returns a Maybe<>, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a TerminateExecution exception was thrown. In that case, a "Nothing" value is returned. </p>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
| Java |
package com.covoex.qarvox;
import com.covoex.qarvox.Application.BasicFunction;
/**
* @author Myeongjun Kim
*/
public class Main {
public static void main(String[] args) {
BasicFunction.programStart();
}
}
| Java |
##  Device Info Plugin for Xamarin
Simple way of getting common device information.
### Setup
* Available on NuGet: http://www.nuget.org/packages/Xam.Plugin.DeviceInfo [](https://www.nuget.org/packages/Xam.Plugin.DeviceInfo/)
* Install into your PCL project and Client projects.
**Platform Support**
|Platform|Supported|Version|
| ------------------- | :-----------: | :------------------: |
|Xamarin.iOS|Yes|iOS 7+|
|Xamarin.iOS Unified|Yes|iOS 7+|
|Xamarin.Android|Yes|API 10+|
|Windows Phone Silverlight|Yes|8.0+|
|Windows Phone RT|Yes|8.1+|
|Windows Store RT|Yes|8.1+|
|Windows 10 UWP|Yes|10+|
|Xamarin.Mac|No||
### API Usage
Call **CrossDeviceInfo.Current** from any project or PCL to gain access to APIs.
**GenerateAppId**
Used to generate a unique Id for your app.
```csharp
/// <summary>
/// Generates a an AppId optionally using the PhoneId a prefix and a suffix and a Guid to ensure uniqueness
///
/// The AppId format is as follows {prefix}guid{phoneid}{suffix}, where parts in {} are optional.
/// </summary>
/// <param name="usingPhoneId">Setting this to true adds the device specific id to the AppId (remember to give the app the correct permissions)</param>
/// <param name="prefix">Sets the prefix of the AppId</param>
/// <param name="suffix">Sets the suffix of the AppId</param>
/// <returns></returns>
string GenerateAppId(bool usingPhoneId = false, string prefix = null, string suffix = null);
```
**Id**
```csharp
/// <summary>
/// This is the device specific Id (remember the correct permissions in your app to use this)
/// </summary>
string Id { get; }
```
Important:
Windows Phone:
Permissions to add:
ID_CAP_IDENTITY_DEVICE
**Device Model**
```csharp
/// <summary>
/// Get the model of the device
/// </summary>
string Model { get; }
```
**Version**
```csharp
/// <summary>
/// Get the version of the Operating System
/// </summary>
string Version { get; }
```
Returns the specific version number of the OS such as:
* iOS: 8.1
* Android: 4.4.4
* Windows Phone: 8.10.14219.0
* WinRT: always 8.1 until there is a work around
**Platform**
```csharp
/// <summary>
/// Get the platform of the device
/// </summary>
Platform Platform { get; }
```
Returns the Platform Enum of:
```csharp
public enum Platform
{
Android,
iOS,
WindowsPhone,
Windows
}
```
#### Contributors
* [jamesmontemagno](https://github.com/jamesmontemagno)
Thanks!
#### License
Dirived from: [@Cheesebaron](http://www.github.com/cheesebaron)
//---------------------------------------------------------------------------------
// Copyright 2013 Tomasz Cielecki (tomasz@ostebaronen.dk)
// 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
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
// INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR
// CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing
// permissions and limitations under the License.
//---------------------------------------------------------------------------------
| Java |
<?php
/*
Safe sample
input : get the field UserData from the variable $_POST
sanitize : use of ternary condition
construction : concatenation with simple quote
*/
/*Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.*/
$tainted = $_POST['UserData'];
$tainted = $tainted == 'safe1' ? 'safe1' : 'safe2';
$var = http_redirect("pages/'". $tainted . "'.php");
?> | Java |
-----------------------------------------------------------
-- LibAddonManager.lua
-----------------------------------------------------------
-- Take the global "..." (name, addon) as parameters to
-- initialize an addon object.
--
-- Abin (2014-11-04)
-----------------------------------------------------------
-- API Documentation:
-----------------------------------------------------------
-- addon = LibAddonManager:CreateAddon("name", addon) -- Take over the addon object
-- addon is a table represents your addon object, it contains the following field upon creation:
-- version: string, the value of fileld "## Version" in toc file, or "1.0" if missing
-- numericVersion: number, numeric form of version
-- name: string, name of the addon, same as the toc file name
-- title: string, same as "name" by default but developers may change for different locales
-- player: string, player name
-- realm: string, current realm name
-- faction: string, player faction group in English, either "Alliance" or "Horde"
-- class: string, player class in upper-cased English, "WARRIOR", "MAGE", "PALADIN" etc.
-- race: string, player race in English, "Human", "NightElf", "Troll", etc.
-- guid: string, GUID of the player
-- And the following functions & methods are defined for the object:
-- addon.tcopy(source [, destination]) -- Copy entire table data includes sub-tables from source to destination, return new table
-- addon.tfind(table, value) -- Seach a numeric based table for match value, return index
-- addon.tfind(table, func, ...) -- Seach a numeric based table for match value using defined function, return index, [boolean] func(element, ...)
-- addon:Print("text" [, r, g, b]) -- Prints a message
-- addon:Debug("text") -- Prints a message ONLY if addon.debug is true
-- addon:Initialized() -- Returns whether the addon has been initialized
-- addon:RegisterDB("dbName", hasCharDB) -- "hasCharDB" can be string, in which case char db will be the contents in toc field "SavedVariablesPerCharacter". Non-string type will treated as "name - realm" stored in db["profiles"]
-- addon:VerifyDBVersion(version [, db]) -- Returns true only if value of [db].version is numeric and no smaller than the specified version value
-- addon:RegisterSlashCmd("command1" [, "command2" [, ...]]) -- Register slash commands, no limited numbers
-- addon:RegisterBindingClick(button, "name", "text") -- Set an override binding click to a button, "name" is the binding name, "text" is what appears in the game's "Key Bindings" UI
-- addon:GetCurProfileName() -- Return current profile name string, in format of "name - realm"
-- addob:GetProfileNameList() -- Return a table stores list of profile names { "name1", "name2", ... }
-- addon:GetProfileData("name") -- Return the profile data table specified by "name"
-- addon:CopyProfile("src" [, "dest"]) -- Copy contents from profile "src" to "dest", copy to current profile if "dest" is not specified
-- addon:DeleteProfile("name") -- Delete a profile specified by "name", cannot delete current profile
-- addon:RegisterLocale("name", "locale", data) -- Register a localized string table
-- addon:GetLocale("name", "locale") -- Get a registered string table
-- addon:PopupShowConfirm("text", func, arg1 [, "buttons"]) -- Show a popup dialog without editbox, func(arg1) will be called. "buttons" can be "MB_OK", "MB_OKCANCEL", "MB_YESNO", "MB_ACCEPTCANCEL", "MB_ACCEPTDECLINE"
-- addon:PopupShowAck("text" [, func, arg1]) -- Show an acknowledgement dialog with a fixed "Okay" button
-- addon:PopupShowInput("text", func, arg1, "default" [, wide]) -- Show a popup dialog with editbox for user inputs, func(arg1, "text") will be called. editbox width will be set to 260 if "wide" is true
-- addon:PopupHide() -- Hide the popup dialog shown by this addon
-- addon:EmbedEventObject([ object ]) -- Embeds an object with event-handling capability
-- addon:RegisterEvent("event" [, func])
-- addon:RegisterEvent("event" [, "method"])
-- addon:UnregisterEvent("event")
-- addon:RegisterAllEvents()
-- addon:UnregisterAllEvents()
-- addon:RegisterTick(interval)
-- addon:UnregisterTick()
-- addon:SetInterval(interval)
-- addon:IsTicking()
-- addon:BroadcastEvent("event" [, ...])
-- addon:RegisterEventCallback("event", func [, arg1])
-- addon:BroadcastOptionEvent(option [, ...])
-- addon:RegisterOptionCallback("option", func [, arg1])
-- addon:CreateModule("key", "dbType" [, ...]) -- Create a module using an unique key, "dbType" can be "ACCOUNT", "CHAR" or "ACCOUNT|CHAR", ... can be anything
-- addon:NumModules() -- Return number of modules registered in this addon
-- addon:GetModule(index) -- Get a module specified by index
-- addon:GetModule("key") -- Get a module specified by key string
-- addon:EnumModules(func, ...) -- Enum all modules and call func(module, ...)
-- addon:CallAllModules("method", ...) -- Call all modules' method specified by "method"(STRING), regardless the enable/disable states of the module
-- addon:CallAllEnabledModules("method", ...) -- Call all modules' method specified by "method"(STRING), only enabled modules are involved
-----------------------------------------------------------
-- Callback functions:
-----------------------------------------------------------
-- addon:OnInitialize(db, dbIsNew, chardb, chardbIsNew) -- Called when PLAYER_LOGIN event fires
-- addon:OnModulesInitDone() -- Called after all modules of this addon are initialized done
-- addon:OnTick(elapsed) -- Fires when ticking
-- addon:OnSlashCmd(text) -- Fires when the user types a slash command registered by this addon
-- addon:OnVerifyModule("key", "dbType" [, ...]) -- Called before creates a new module, if this method exists and returns nil/false, the creatiopn fails
-- addon:OnCreateModule(module, "key", ...) -- Called when a new module is created, "..." is what passed in addon:CreateModule
-- addon:OnEvent(event, ...) -- Fires when an event fires and this callback is defined
-- addon:OnEnterCombat() -- Fires when the player enters combat
-- addon:OnLeaveCombat() -- Fires when the player leaves combat
-----------------------------------------------------------
-- Module functions:
-----------------------------------------------------------
-- module:Enable()
-- module:Disable()
-- module:IsEnabled()
-----------------------------------------------------------
-- Module callback functions:
-----------------------------------------------------------
-- module:OnInitialize(db, dbIsNew, chardb, chardbIsNew) -- Fires after the PLAYER_LOGIN event fires, db and chardb are subsets of the addon dbs
-- module:OnEnable() -- Fires when the module is enabled via "module:Enable()"
-- module:OnDisable() -- Fires when the module is disabled via "module:Disable()"
-- module:OnTick(elapsed) -- Fires when ticking
-- module:OnEvent(event, ...) -- Fires when an event fires and this callback is defined
-- module:OnEnterCombat() -- Fires when the player enters combat, only for enabled modules
-- module:OnLeaveCombat() -- Fires when the player leaves combat, only for enabled modules
-----------------------------------------------------------
local type = type
local CreateFrame = CreateFrame
local tinsert = tinsert
local GetAddOnMetadata = GetAddOnMetadata
local tonumber = tonumber
local tostring = tostring
local select = select
local strupper = strupper
local strfind = strfind
local strtrim = strtrim
local wipe = wipe
local ClearOverrideBindings = ClearOverrideBindings
local GetBindingKey = GetBindingKey
local SetOverrideBindingClick = SetOverrideBindingClick
local pairs = pairs
local ipairs = ipairs
local InCombatLockdown = InCombatLockdown
local UnitName = UnitName
local GetRealmName = GetRealmName
local UnitFactionGroup = UnitFactionGroup
local UnitClass = UnitClass
local UnitGUID = UnitGUID
local format = format
local error = error
local StaticPopup_Show = StaticPopup_Show
local StaticPopup_Hide = StaticPopup_Hide
local StaticPopupDialogs = StaticPopupDialogs
local _G = _G
local VERSION = 1.22
local lib = _G.LibAddonManager
if type(lib) == "table" then
local version = lib.version
if type(version) == "number" and version >= VERSION then
return
end
else
lib = {}
_G.LibAddonManager = lib
end
lib.version = VERSION
local PRIVATE = "{62B10A9A-6AF5-40EF-93F6-D7271489AA66}"
local PLAYER_INFO = {}
local PROFILE_NAME
-------------------------------------------------------
-- Library utility function
-------------------------------------------------------
function lib.tcopy(src, dest)
if type(dest) == "table" then
wipe(dest)
else
dest = {}
end
local k, v
for k, v in pairs(src) do
if type(v) == "table" then
dest[k] = lib.tcopy(v)
else
dest[k] = v
end
end
return dest
end
function lib.tfind(t, arg, ...)
if type(t) ~= "table" then
return
end
local funcSearch = type(arg) == "function"
local index, data
for index, data in ipairs(t) do
if funcSearch then
if arg(data, ...) then
return index
end
else
if data == arg then
return index
end
end
end
end
local function Addon_Print(self, msg, r, g, b)
DEFAULT_CHAT_FRAME:AddMessage("|cffffff78"..self.title..":|r "..tostring(msg), r or 0.5, g or 0.75, b or 1)
end
local function Addon_Debug(self, msg)
if self.debug then
Addon_Print(self, msg, 1, 0.5, 0)
end
end
local function Addon_GetCurProfileName(self)
return PROFILE_NAME
end
local function Addon_GetProfileNameList(self)
local list = {}
if self.db and type(self.db.profiles) == "table" then
local name
for name in pairs(self.db.profiles) do
tinsert(list, name)
end
end
return list
end
-- Depreciated
local function Addon_CopyTable(self, ...)
return lib.tcopy(...)
end
local function Addon_GetProfileData(self, profile)
if self.db and type(self.db.profiles) == "table" then
return self.db.profiles[profile]
end
end
local function Addon_CopyProfile(self, source, dest)
if type(source) ~= "string" then
source = Addon_GetCurProfileName(self)
end
if type(dest) ~= "string" then
dest = Addon_GetCurProfileName(self)
end
if source == dest then
return
end
if self.db and type(self.db.profiles) == "table" then
if self.db.profiles[source] then
self.db.profiles[dest] = lib.tcopy(self.db.profiles[source])
end
end
end
local function Addon_DeleteProfile(self, profile)
if self.db and type(self.db.profiles) == "table" and type(profile) == "string" and profile ~= Addon_GetCurProfileName(self) then
self.db.profiles[profile] = nil
end
end
local function Addon_RegisterSlashCmd(self, ...)
local UPPER_NAME = strupper(self.name)
local i
for i = 1, select("#", ...) do
local cmd = select(i, ...)
if type(cmd) == "string" then
if strfind(cmd, "/") ~= 1 then
cmd = "/"..cmd
end
_G["SLASH_"..UPPER_NAME..i] = cmd
end
end
SlashCmdList[UPPER_NAME] = function(text)
if type(self.OnSlashCmd) == "function" then
self:OnSlashCmd(strtrim(text)) -- The addon wants to process the slash command itself
elseif type(self.OnClashCmd) == "function" then
self:OnClashCmd(strtrim(text)) -- The addon wants to process the slash command itself
else
local frame = self.optionFrame or self.optionPage or self.frame
if type(frame) ~= "table" then
return
end
if type(frame.Toggle) == "function" then
frame:Toggle()
elseif type(frame.Open) == "function" then
frame:Open()
elseif frame:IsShown() then
frame:Hide()
else
frame:Show()
end
end
end
end
local function Addon_RegisterDB(self, dbName, hasCharDB)
if type(dbName) ~= "string" then
dbName = nil
end
if dbName then
local private = self[PRIVATE]
private.dbName, private.hasCharDB = dbName, hasCharDB
end
end
local function Addon_RegisterBindingClick(self, button, name, text)
if type(name) ~= "string" or type(button) ~= "table" then
return
end
--local header = "BINDING_HEADER_"..strupper(self.name).."_TITLE"
--if not _G[header] then
-- _G[header] = self.title
--end
if type(text) == "string" then
_G["BINDING_NAME_"..name] = text
end
button.bindingName, button.bindingText = name, text
lib._bindingList[name] = button
end
local function EEO_RegisterEvent(self, event, method)
if type(method) ~= "function" and type(method) ~= "string" then
method = nil
end
local frame = self[PRIVATE].frame
if not frame:IsEventRegistered(event) then
frame:RegisterEvent(event)
end
frame.events[event] = method
end
local function EEO_UnregisterEvent(self, event)
local frame = self[PRIVATE].frame
frame.events[event] = nil
if frame:IsEventRegistered(event) then
frame:UnregisterEvent(event)
end
end
local function EEO_IsEventRegistered(self, event)
return self[PRIVATE].frame:IsEventRegistered(event)
end
local function EEO_RegisterAllEvents(self)
return self[PRIVATE].frame:RegisterAllEvents()
end
local function EEO_UnregisterAllEvents(self)
return self[PRIVATE].frame:UnregisterAllEvents()
end
local function EEO_SetInterval(self, interval)
if type(interval) ~= "number" or interval < 0.2 then
interval = 0.2
end
local frame = self[PRIVATE].frame
frame.elapsed = 0
frame.tickSeconds = interval
end
local function EEO_RegisterTick(self, interval)
EEO_SetInterval(self, interval)
self[PRIVATE].frame:Show()
end
local function EEO_UnregisterTick(self)
local frame = self[PRIVATE].frame
frame:Hide()
frame.tickSeconds = nil
end
local function EEO_IsTicking(self)
return self[PRIVATE].frame:IsShown()
end
local function EEOFrame_OnEvent(self, event, ...)
local object = self.parentObject
if type(object.OnEvent) == "function" then
object:OnEvent(event, ...)
else
local func = self.events[event]
if not func then
func = object[event]
elseif type(func) ~= "function" then -- string, number, etc
func = object[func]
end
if type(func) == "function" then
func(object, ...)
end
end
end
local function EEOFrame_OnUpdate(self, elapsed)
local tickSeconds = self.tickSeconds
if not tickSeconds then
self:Hide()
return
end
local updateElapsed = (self.elapsed or 0) + elapsed
if updateElapsed >= tickSeconds then
local object = self.parentObject
if object.OnTick then
object:OnTick(updateElapsed)
end
updateElapsed = 0
end
self.elapsed = updateElapsed
end
local function Lib_EmbedEventObject(object)
if type(object) ~= "table" then
object = {}
end
local private = lib._SetupTable(object, PRIVATE)
local frame = CreateFrame("Frame")
private.frame = frame
frame.parentObject = object
frame.events = {}
frame:Hide()
frame:SetScript("OnEvent", EEOFrame_OnEvent)
frame:SetScript("OnUpdate", EEOFrame_OnUpdate)
object.RegisterEvent = EEO_RegisterEvent
object.UnregisterEvent = EEO_UnregisterEvent
object.IsEventRegistered = EEO_IsEventRegistered
object.RegisterAllEvents = EEO_RegisterAllEvents
object.UnregisterAllEvents = EEO_UnregisterAllEvents
object.RegisterTick = EEO_RegisterTick
object.UnregisterTick = EEO_UnregisterTick
object.SetInterval = EEO_SetInterval
object.IsTicking = EEO_IsTicking
return object
end
local function BCO_BroadcastEvent(self, event, ...)
local callbacks = self[PRIVATE].broadcastCallbacks[event]
if not callbacks then
return
end
local i
for i = 1, #callbacks do
local arg1 = callbacks[i].arg1
if arg1 then
callbacks[i].func(arg1, ...)
else
callbacks[i].func(...)
end
end
end
local function BCO_RegisterEventCallback(self, event, func, arg1)
if type(event) ~= "string" or type(func) ~= "function" then
return
end
local list = self[PRIVATE].broadcastCallbacks
local callbacks = list[event]
if not callbacks then
callbacks = {}
list[event] = callbacks
end
tinsert(callbacks, { func = func, arg1 = arg1 })
end
local OPTION_EVENT_PREFX = "OnOptionChanged_" -- Option event name prefix
local function BCO_BroadcastOptionEvent(self, option, ...)
if type(option) == "string" then
BCO_BroadcastEvent(self, OPTION_EVENT_PREFX..option, ...)
end
end
local function BCO_RegisterOptionCallback(self, option, func, arg1)
if type(option) == "string" then
BCO_RegisterEventCallback(self, OPTION_EVENT_PREFX..option, func, arg1)
end
end
local function Lib_EmbedBroadcastObject(object)
if type(object) ~= "table" then
object = {}
end
local private = lib._SetupTable(object, PRIVATE)
private.broadcastCallbacks = {}
object.BroadcastEvent = BCO_BroadcastEvent
object.RegisterEventCallback = BCO_RegisterEventCallback
object.BroadcastOptionEvent = BCO_BroadcastOptionEvent
object.RegisterOptionCallback = BCO_RegisterOptionCallback
return object
end
local function Module_IsEnabled(self)
return self[PRIVATE].enabled
end
local function Module_Enable(self)
if Module_IsEnabled(self) then
return
end
self[PRIVATE].enabled = 1
if type(self.OnEnable) == "function" then
self:OnEnable()
end
end
local function Module_Disable(self)
if not Module_IsEnabled(self) then
return
end
self[PRIVATE].enabled = nil
self:UnregisterAllEvents()
self:UnregisterTick()
if type(self.OnDisable) == "function" then
self:OnDisable()
end
end
local function Addon_EnumModules(self, func, ...)
if type(func) == "function" then
local modules = self[PRIVATE].modules
local i
for i = 1, #modules do
func(modules[i], ...)
end
end
end
local function Addon_CallAllModules(self, method, ...)
local modules = self[PRIVATE].modules
local i
for i = 1, #modules do
local module = modules[i]
local func = module[method]
if type(func) == "function" then
func(module, ...)
end
end
end
local function Addon_CallAllEnabledModules(self, method, ...)
local modules = self[PRIVATE].modules
local i
for i = 1, #modules do
local module = modules[i]
if Module_IsEnabled(module) then
local func = module[method]
if type(func) == "function" then
func(module, ...)
end
end
end
end
local function Addon_GetModule(self, key)
local modules = self[PRIVATE].modules
if type(key) ~= "string" then
return modules[key]
end
local _, module
for _, module in ipairs(modules) do
if module.key == key then
return module
end
end
end
local function Addon_NumModules(self)
return #(self[PRIVATE].modules)
end
local function Addon_CreateModule(self, key, dbType, ...)
if type(key) ~= "string" then
error(format("bad argument #1 to 'addon:CreateModule' (string expected, got %s)", type(key)))
return
end
local module = Addon_GetModule(self, key)
if module then
error(format("bad argument #1 to 'addon:CreateModule' (key '%s' already used)", key))
return
end
if type(dbType) == "string" then
dbType = strupper(dbType)
else
dbType = nil
end
local verifyFunc = self.OnVerifyModule
if type(verifyFunc) == "function" and not verifyFunc(self, key, dbType, ...) then
return
end
module = Lib_EmbedEventObject()
module.key, module.dbType = key, dbType
module.IsEnabled = Module_IsEnabled
module.Enable = Module_Enable
module.Disable = Module_Disable
tinsert(self[PRIVATE].modules, module)
if type(self.OnCreateModule) == "function" then
self:OnCreateModule(module, key, ...)
end
return module
end
local function Addon_RegisterLocale(self, name, locale, data)
if type(name) == "string" and type(data) == "table" and type(locale) == "string" then
local moduleLocales = self[PRIVATE].moduleLocales
if not moduleLocales[name] then
moduleLocales[name] = {}
end
if not moduleLocales[name][locale] then
moduleLocales[name][locale] = data
end
end
end
local function Addon_GetLocale(self, name, locale)
local data = self[PRIVATE].moduleLocales[name]
if data then
if type(locale) ~= "string" then
locale = GetLocale()
end
return data[locale] or data.enUS
end
end
local function Addon_EmbedEventObject(self, object)
return Lib_EmbedEventObject(object)
end
local function Addon_VerifyDBVersion(self, version, t)
if type(version) ~= "number" then
version = 0
end
if type(t) ~= "table" then
t = self.db
end
if t and type(t.version) == "number" then
return t.version >= version
end
end
local function Addon_Initialized(self)
return self[PRIVATE].initDone
end
local function EditBox_Highlight(self)
self:SetFocus()
self:HighlightText()
end
local function PopupData_EditBoxOnEnterPressed(self)
local text = strtrim(self:GetText())
local parent = self:GetParent()
local func = parent.data2
if text == "" or (type(func) == "function" and func(parent.data, text)) then
EditBox_Highlight(self)
else
self:GetParent():Hide()
end
end
local function PopupData_OnShow(self)
local editBox = self.editBox
if editBox:IsShown() and editBox:GetText() ~= "" then
EditBox_Highlight(editBox)
end
end
local function PopupData_EditBoxOnEscapePressed(self)
self:GetParent():Hide()
end
local function PopupData_OnAccept(self, arg1, func)
if type(func) ~= "function" then
return
end
local editBox = self.editBox
if not editBox:IsShown() then
return func(arg1)
end
local text = strtrim(editBox:GetText())
if text == "" or func(arg1, text) then
EditBox_Highlight(editBox)
return 1
end
end
local function ParsePopupButtons(buttons)
if buttons == "MB_OK" then
return OKAY
end
if buttons == "MB_YESNO" then
return YES, NO
end
if buttons == "MB_ACCEPTCANCEL" then
return ACCEPT, CANCEL
end
if buttons == "MB_ACCEPTDECLINE" then
return ACCEPT, DECLINE
end
return OKAY, CANCEL -- "MB_OKCANCEL" or others
end
local function Addon_PopupShowConfirm(self, text, func, arg1, buttons)
local data = self[PRIVATE].popupData
data.text = text
data.hasEditBox = nil
data.editBoxWidth = nil
data.button1, data.button2, data.button3 = ParsePopupButtons(buttons)
local dialog = StaticPopup_Show(self[PRIVATE].popupId)
if dialog then
dialog.data = arg1
dialog.data2 = func
return dialog
end
end
local function Addon_PopupShowAck(self, text, func, arg1)
return Addon_PopupShowConfirm(self, text, func, arg1, "MB_OK")
end
local function Addon_PopupShowInput(self, text, func, arg1, default, wide)
local data = self[PRIVATE].popupData
data.text = text
data.hasEditBox = 1
data.editBoxWidth = wide and 260 or nil
data.button1, data.button2, data.button3 = ParsePopupButtons()
local dialog = StaticPopup_Show(self[PRIVATE].popupId)
if dialog then
dialog.data = arg1
dialog.data2 = func
if default then
dialog.editBox:SetText(tostring(default))
return dialog
end
end
end
local function Addon_PopupHide(self)
StaticPopup_Hide(self[PRIVATE].popupId)
end
function lib:CreateAddon(name, addon)
if type(name) ~= "string" then
error(format("bad argument #1 to 'LibAddonManager:CreateAddon' (string expected, got %s)", type(name)))
return
end
if type(addon) ~= "table" then
error(format("bad argument #2 to 'LibAddonManager:CreateAddon' (table expected, got %s)", type(addon)))
return
end
if _G[name] then
error(format("'LibAddonManager:CreateAddon' failed to register addon '%s' (object already exists)", name))
return
end
_G[name] = addon
addon.version = GetAddOnMetadata(name, "Version") or "1.0"
addon.numericVersion = tonumber(addon.version) or 1.0
addon.name = name
addon.title = name -- This may be changed by developers into other locales, but just use name for now
lib.CopyPlayerInfo(addon)
local popupId = "LibAddonManager_PopupData_"..name
local popupData = {
exclusive = 1,
whileDead = 1,
hideOnEscape = 1,
OnAccept = PopupData_OnAccept,
EditBoxOnEnterPressed = PopupData_EditBoxOnEnterPressed,
EditBoxOnEscapePressed = PopupData_EditBoxOnEscapePressed,
OnShow = PopupData_OnShow,
}
StaticPopupDialogs[popupId] = popupData
addon[PRIVATE] = { modules = {}, moduleLocales = {}, popupData = popupData, popupId = popupId }
Lib_EmbedEventObject(addon)
Lib_EmbedBroadcastObject(addon)
addon.Print = Addon_Print
addon.Debug = Addon_Debug
addon.RegisterDB = Addon_RegisterDB
addon.GetCurProfileName = Addon_GetCurProfileName
addon.GetProfileNameList = Addon_GetProfileNameList
addon.GetProfileData = Addon_GetProfileData
addon.CopyProfile = Addon_CopyProfile
addon.DeleteProfile = Addon_DeleteProfile
addon.Initialized = Addon_Initialized
addon.RegisterBindingClick = Addon_RegisterBindingClick
addon.RegisterSlashCmd = Addon_RegisterSlashCmd
addon.RegisterLocale = Addon_RegisterLocale
addon.GetLocale = Addon_GetLocale
addon.EmbedEventObject = Addon_EmbedEventObject
addon.VerifyDBVersion = Addon_VerifyDBVersion
addon.PopupShowConfirm = Addon_PopupShowConfirm
addon.PopupShowAck = Addon_PopupShowAck
addon.PopupShowInput = Addon_PopupShowInput
addon.PopupHide = Addon_PopupHide
addon.tcopy = lib.tcopy
addon.tfind = lib.tfind
addon.CreateModule = Addon_CreateModule
addon.NumModules = Addon_NumModules
addon.GetModule = Addon_GetModule
addon.EnumModules = Addon_EnumModules
addon.CallAllModules = Addon_CallAllModules
addon.CallAllEnabledModules = Addon_CallAllEnabledModules
-- Depreciated functions but stay for downward compatibility
addon.CopyTable = Addon_CopyTable
tinsert(lib._addonList, addon)
return addon
end
-------------------------------------------------------
-- The library background event frame works
-------------------------------------------------------
function lib.CopyPlayerInfo(addon)
local key, val
for key, val in pairs(PLAYER_INFO) do
addon[key] = val
end
end
local function Lib_UpdatePlayerInfo()
PLAYER_INFO.player = UnitName("player")
PLAYER_INFO.realm = GetRealmName()
PLAYER_INFO.faction = UnitFactionGroup("player")
PLAYER_INFO.class = select(2, UnitClass("player"))
PLAYER_INFO.race = select(2, UnitRace("player"))
PLAYER_INFO.guid = UnitGUID("player")
PROFILE_NAME = PLAYER_INFO.player.." - "..PLAYER_INFO.realm
end
Lib_UpdatePlayerInfo()
function lib._SetupTable(parent, key, isFrame)
if type(parent) ~= "table" or not key then
return
end
local t = parent[key]
local isNew
if type(t) ~= "table" then
isNew = 1
if isFrame then
t = CreateFrame("Frame")
else
t = {}
end
parent[key] = t
end
return t, isNew
end
lib._SetupTable(lib, "_addonList")
lib._SetupTable(lib, "_bindingList")
local function Module_InitializeDB(self, db, chardb)
local moduledb, moduledbNew, moduleChardb, moduleChardbNew
if strfind(self.dbType or "", "ACCOUNT") then
local temp = lib._SetupTable(db, "modules")
moduledb, moduledbNew = lib._SetupTable(temp, self.key)
end
if strfind(self.dbType or "", "CHAR") then
local temp = lib._SetupTable(chardb, "modules")
moduleChardb, moduleChardbNew = lib._SetupTable(temp, self.key)
end
self.db, self.chardb = moduledb, moduleChardb
local private = self[PRIVATE]
if type(self.OnInitialize) == "function" then
self:OnInitialize(moduledb, moduledbNew, moduleChardb, moduleChardbNew)
end
end
local function Lib_CallAllAddonsAndEnabledModules(method, ...)
local _, addon
for _, addon in ipairs(lib._addonList) do
local func = addon[method]
if type(func) == "function" then
func(addon, ...)
end
Addon_CallAllEnabledModules(addon, method, ...)
end
end
local function Lib_CheckInitDB(addon)
local private = addon[PRIVATE]
local db, dbIsNew = lib._SetupTable(_G, private.dbName)
addon.db = db
local chardb, chardbIsNew
if db and private.hasCharDB then
if type(private.hasCharDB) == "string" then
chardb, chardbIsNew = lib._SetupTable(_G, private.hasCharDB)
addon.chardb = chardb
else
local profileName = addon:GetCurProfileName()
local profiles = lib._SetupTable(db, "profiles")
chardb, chardbIsNew = lib._SetupTable(profiles, profileName)
addon.chardb = chardb
end
end
if type(addon.OnInitialize) == "function" then
addon:OnInitialize(db, dbIsNew, chardb, chardbIsNew)
end
end
local function Lib_ApplyAllBindings()
local name, button
for name, button in pairs(lib._bindingList) do
ClearOverrideBindings(button)
local key1, key2 = GetBindingKey(name)
if key2 then
SetOverrideBindingClick(button, false, key2, button:GetName())
end
if key1 then
SetOverrideBindingClick(button, false, key1, button:GetName())
end
end
end
local function EventFrame_TryUpdateBindings(self)
if InCombatLockdown() then
self.hasPending = 1 -- Delay call
else
Lib_ApplyAllBindings()
end
end
local frame = lib._SetupTable(lib, "_eventFrame", 1)
frame:RegisterEvent("PLAYER_LOGIN")
frame:SetScript("OnEvent", function(self, event, arg1)
if event == "PLAYER_LOGIN" then
Lib_UpdatePlayerInfo()
local _, addon
for _, addon in ipairs(lib._addonList) do
lib.CopyPlayerInfo(addon)
Lib_CheckInitDB(addon)
end
for _, addon in ipairs(lib._addonList) do
Addon_EnumModules(addon, Module_InitializeDB, addon.db, addon.chardb)
end
for _, addon in ipairs(lib._addonList) do
addon[PRIVATE].initDone = 1
if type(addon.OnModulesInitDone) == "function" then
addon:OnModulesInitDone()
end
end
self:RegisterEvent("PLAYER_REGEN_DISABLED")
self:RegisterEvent("PLAYER_REGEN_ENABLED")
self:RegisterEvent("UPDATE_BINDINGS")
EventFrame_TryUpdateBindings(self)
elseif event == "UPDATE_BINDINGS" then
EventFrame_TryUpdateBindings(self)
elseif event == "PLAYER_REGEN_DISABLED" then
Lib_CallAllAddonsAndEnabledModules("OnEnterCombat")
elseif event == "PLAYER_REGEN_ENABLED" then
if self.hasPending then
self.hasPending = nil
Lib_ApplyAllBindings()
end
Lib_CallAllAddonsAndEnabledModules("OnLeaveCombat")
end
end) | Java |
import {Curve} from '../curve'
export class Line extends Curve {
constructor(p0, v) {
super();
this.p0 = p0;
this.v = v;
this._pointsCache = new Map();
}
intersectSurface(surface) {
if (surface.isPlane) {
const s0 = surface.normal.multiply(surface.w);
return surface.normal.dot(s0.minus(this.p0)) / surface.normal.dot(this.v); // 4.7.4
} else {
return super.intersectSurface(surface);
}
}
intersectCurve(curve, surface) {
if (curve.isLine && surface.isPlane) {
const otherNormal = surface.normal.cross(curve.v)._normalize();
return otherNormal.dot(curve.p0.minus(this.p0)) / otherNormal.dot(this.v); // (4.8.3)
}
return super.intersectCurve(curve, surface);
}
parametricEquation(t) {
return this.p0.plus(this.v.multiply(t));
}
t(point) {
return point.minus(this.p0).dot(this.v);
}
pointOfSurfaceIntersection(surface) {
let point = this._pointsCache.get(surface);
if (!point) {
const t = this.intersectSurface(surface);
point = this.parametricEquation(t);
this._pointsCache.set(surface, point);
}
return point;
}
translate(vector) {
return new Line(this.p0.plus(vector), this.v);
}
approximate(resolution, from, to, path) {
}
offset() {};
}
Line.prototype.isLine = true;
Line.fromTwoPlanesIntersection = function(plane1, plane2) {
const n1 = plane1.normal;
const n2 = plane2.normal;
const v = n1.cross(n2)._normalize();
const pf1 = plane1.toParametricForm();
const pf2 = plane2.toParametricForm();
const r0diff = pf1.r0.minus(pf2.r0);
const ww = r0diff.minus(n2.multiply(r0diff.dot(n2)));
const p0 = pf2.r0.plus( ww.multiply( n1.dot(r0diff) / n1.dot(ww)));
return new Line(p0, v);
};
Line.fromSegment = function(a, b) {
return new Line(a, b.minus(a)._normalize());
};
| Java |
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2019_11_01
module Models
#
# Properties of the Radius client root certificate of
# VpnServerConfiguration.
#
class VpnServerConfigRadiusClientRootCertificate
include MsRestAzure
# @return [String] The certificate name.
attr_accessor :name
# @return [String] The Radius client root certificate thumbprint.
attr_accessor :thumbprint
#
# Mapper for VpnServerConfigRadiusClientRootCertificate class as Ruby
# Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'VpnServerConfigRadiusClientRootCertificate',
type: {
name: 'Composite',
class_name: 'VpnServerConfigRadiusClientRootCertificate',
model_properties: {
name: {
client_side_validation: true,
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
thumbprint: {
client_side_validation: true,
required: false,
serialized_name: 'thumbprint',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end
| Java |
---
layout: default
title: Distributed compressed sensing
---
<h2>{{ page.title }}</h2>
<p>To be writen<a href="">here</a></p> | Java |
<?php
/**
*
* Enter address data for the cart, when anonymous users checkout
*
* @package VirtueMart
* @subpackage User
* @author Max Milbers
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: edit_address_addshipto.php 7499 2013-12-18 15:11:51Z Milbo $
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
?>
<fieldset>
<legend>
<?php echo '<span class="userfields_info">' .vmText::_('COM_VIRTUEMART_USER_FORM_SHIPTO_LBL').'</span>'; ?>
</legend>
<?php echo $this->lists['shipTo']; ?>
</fieldset> | Java |
#include "TString.h"
#include "TGraph.h"
#include "TGraphErrors.h"
#include "TGraphAsymmErrors.h"
#include <fstream>
#include <Riostream.h>
#include <sstream>
#include <fstream>
using namespace std;
TGraphErrors* GetGraphWithSymmYErrorsFromFile(TString txtFileName, Color_t markerColor=1, Style_t markerStyle=20, Size_t markerSize=1, Style_t lineStyle=1,Width_t lineWidth=2, bool IsNoErr=0)
{
Float_t x_array[400],ex_array[400],y_array[400],ey_array[400];
Char_t buffer[2048];
Float_t x,y,ex,ey;
Int_t nlines = 0;
ifstream infile(txtFileName.Data());
if (!infile.is_open()) {
cout << "Error opening file. Exiting." << endl;
} else {
while (!infile.eof()) {
infile.getline(buffer,2048);
sscanf(buffer,"%f %f %f\n",&x,&y,&ey);
x_array[nlines] = x;
ex_array[nlines] = 0;
y_array[nlines] = y;
ey_array[nlines] = ey;
if(IsNoErr) ey_array[nlines]=0;
nlines++;
}
}
TGraphErrors *graph =
new TGraphErrors(nlines-1,x_array,y_array,ex_array,ey_array);
txtFileName.Remove(txtFileName.Index(".txt"),4);
graph->SetName(txtFileName.Data());
graph->SetMarkerStyle(markerStyle);
graph->SetMarkerColor(markerColor);
graph->SetLineStyle(lineStyle);
graph->SetLineColor(markerColor);
graph->SetMarkerSize(markerSize);
graph->SetLineWidth(3);
return graph;
}
void drawSysBoxValue(TGraph* gr, int fillcolor=TColor::GetColor("#ffff00"), double xwidth=0.3, double *percent, double xshift=0)
{
TBox* box;
for(int n=0;n<gr->GetN();n++)
{
double x,y;
gr->GetPoint(n,x,y);
double yerr = percent[n];
box = new TBox(x+xshift-xwidth,y-fabs(yerr),x+xwidth,y+fabs(yerr));
box->SetLineWidth(0);
box->SetFillColor(kGray);
box->Draw("Fsame");
}
}
| Java |
<?php
// Documentation test config file for "Components / Jumbotron" part
return [
'title' => 'Jumbotron',
'url' => '%bootstrap-url%/components/jumbotron/',
'rendering' => function (\Laminas\View\Renderer\PhpRenderer $oView) {
echo $oView->jumbotron([
'title' => 'Hello, world!',
'lead' => 'This is a simple hero unit, a simple jumbotron-style component ' .
'for calling extra attention to featured content or information.',
'---' => ['attributes' => ['class' => 'my-4']],
'It uses utility classes for typography and spacing to space ' .
'content out within the larger container.',
'button' => [
'options' => [
'tag' => 'a',
'label' => 'Learn more',
'variant' => 'primary',
'size' => 'lg',
],
'attributes' => [
'href' => '#',
]
],
]) . PHP_EOL;
// To make the jumbotron full width, and without rounded corners, add the option fluid
echo $oView->jumbotron(
[
'title' => 'Fluid jumbotron',
'lead' => 'This is a modified jumbotron that occupies the entire horizontal space of its parent.',
],
['fluid' => true]
);
},
'expected' => '<div class="jumbotron">' . PHP_EOL .
' <h1 class="display-4">Hello, world!</h1>' . PHP_EOL .
' <p class="lead">This is a simple hero unit, a simple jumbotron-style component ' .
'for calling extra attention to featured content or information.</p>' . PHP_EOL .
' <hr class="my-4" />' . PHP_EOL .
' <p>It uses utility classes for typography and spacing to space ' .
'content out within the larger container.</p>' . PHP_EOL .
' <a href="#" class="btn btn-lg btn-primary" role="button">Learn more</a>' . PHP_EOL .
'</div>' . PHP_EOL .
'<div class="jumbotron jumbotron-fluid">' . PHP_EOL .
' <div class="container">' . PHP_EOL .
' <h1 class="display-4">Fluid jumbotron</h1>' . PHP_EOL .
' <p class="lead">This is a modified jumbotron that occupies ' .
'the entire horizontal space of its parent.</p>' . PHP_EOL .
' </div>' . PHP_EOL .
'</div>',
];
| Java |
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CssMerger.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CssMerger.Tests")]
[assembly: AssemblyCopyright("Copyright © 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM componenets. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f7c36817-3ade-4d22-88b3-aca652491500")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] | Java |
import time
import pymemcache.client
import pytest
from limits import RateLimitItemPerMinute, RateLimitItemPerSecond
from limits.storage import MemcachedStorage, storage_from_string
from limits.strategies import (
FixedWindowElasticExpiryRateLimiter,
FixedWindowRateLimiter,
)
from tests.utils import fixed_start
@pytest.mark.memcached
@pytest.mark.flaky
class TestMemcachedStorage:
@pytest.fixture(autouse=True)
def setup(self, memcached, memcached_cluster):
self.storage_url = "memcached://localhost:22122"
def test_init_options(self, mocker):
constructor = mocker.spy(pymemcache.client, "PooledClient")
assert storage_from_string(self.storage_url, connect_timeout=1).check()
assert constructor.call_args[1]["connect_timeout"] == 1
@fixed_start
def test_fixed_window(self):
storage = MemcachedStorage("memcached://localhost:22122")
limiter = FixedWindowRateLimiter(storage)
per_min = RateLimitItemPerSecond(10)
start = time.time()
count = 0
while time.time() - start < 0.5 and count < 10:
assert limiter.hit(per_min)
count += 1
assert not limiter.hit(per_min)
while time.time() - start <= 1:
time.sleep(0.1)
assert limiter.hit(per_min)
@fixed_start
def test_fixed_window_cluster(self):
storage = MemcachedStorage("memcached://localhost:22122,localhost:22123")
limiter = FixedWindowRateLimiter(storage)
per_min = RateLimitItemPerSecond(10)
start = time.time()
count = 0
while time.time() - start < 0.5 and count < 10:
assert limiter.hit(per_min)
count += 1
assert not limiter.hit(per_min)
while time.time() - start <= 1:
time.sleep(0.1)
assert limiter.hit(per_min)
@fixed_start
def test_fixed_window_with_elastic_expiry(self):
storage = MemcachedStorage("memcached://localhost:22122")
limiter = FixedWindowElasticExpiryRateLimiter(storage)
per_sec = RateLimitItemPerSecond(2, 2)
assert limiter.hit(per_sec)
time.sleep(1)
assert limiter.hit(per_sec)
assert not limiter.test(per_sec)
time.sleep(1)
assert not limiter.test(per_sec)
time.sleep(1)
assert limiter.test(per_sec)
@fixed_start
def test_fixed_window_with_elastic_expiry_cluster(self):
storage = MemcachedStorage("memcached://localhost:22122,localhost:22123")
limiter = FixedWindowElasticExpiryRateLimiter(storage)
per_sec = RateLimitItemPerSecond(2, 2)
assert limiter.hit(per_sec)
time.sleep(1)
assert limiter.hit(per_sec)
assert not limiter.test(per_sec)
time.sleep(1)
assert not limiter.test(per_sec)
time.sleep(1)
assert limiter.test(per_sec)
def test_clear(self):
storage = MemcachedStorage("memcached://localhost:22122")
limiter = FixedWindowRateLimiter(storage)
per_min = RateLimitItemPerMinute(1)
limiter.hit(per_min)
assert not limiter.hit(per_min)
limiter.clear(per_min)
assert limiter.hit(per_min)
| Java |
<?php
namespace Tutorial\ToDoListBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class TutorialToDoListExtension extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
}
}
| Java |
import os
import sys
import tempfile
from fabric.api import run, sudo, env, local, hide, settings
from fabric.contrib.files import append, sed, exists, contains
from fabric.context_managers import prefix
from fabric.operations import get, put
from fabric.context_managers import cd
from fabric.tasks import Task
from fab_deploy.functions import random_password
from fab_deploy.base import postgres as base_postgres
class JoyentMixin(object):
version_directory_join = ''
def _get_data_dir(self, db_version):
# Try to get from svc first
output = run('svcprop -p config/data postgresql')
if output.stdout and exists(output.stdout, use_sudo=True):
return output.stdout
return base_postgres.PostgresInstall._get_data_dir(self, db_version)
def _install_package(self, db_version):
sudo("pkg_add postgresql%s-server" %db_version)
sudo("pkg_add postgresql%s-replicationtools" %db_version)
sudo("svcadm enable postgresql")
def _restart_db_server(self, db_version):
sudo('svcadm restart postgresql')
def _stop_db_server(self, db_version):
sudo('svcadm disable postgresql')
def _start_db_server(self, db_version):
sudo('svcadm enable postgresql')
class PostgresInstall(JoyentMixin, base_postgres.PostgresInstall):
"""
Install postgresql on server
install postgresql package;
enable postgres access from localhost without password;
enable all other user access from other machines with password;
setup a few parameters related with streaming replication;
database server listen to all machines '*';
create a user for database with password.
"""
name = 'master_setup'
db_version = '9.1'
class SlaveSetup(JoyentMixin, base_postgres.SlaveSetup):
"""
Set up master-slave streaming replication: slave node
"""
name = 'slave_setup'
class PGBouncerInstall(Task):
"""
Set up PGBouncer on a database server
"""
name = 'setup_pgbouncer'
pgbouncer_src = 'http://pkgsrc.smartos.org/packages/SmartOS/2012Q2/databases/pgbouncer-1.4.2.tgz'
pkg_name = 'pgbouncer-1.4.2.tgz'
config_dir = '/etc/opt/pkg'
config = {
'*': 'host=127.0.0.1',
'logfile': '/var/log/pgbouncer/pgbouncer.log',
'listen_addr': '*',
'listen_port': '6432',
'unix_socket_dir': '/tmp',
'auth_type': 'md5',
'auth_file': '%s/pgbouncer.userlist' %config_dir,
'pool_mode': 'session',
'admin_users': 'postgres',
'stats_users': 'postgres',
}
def install_package(self):
sudo('pkg_add libevent')
with cd('/tmp'):
run('wget %s' %self.pgbouncer_src)
sudo('pkg_add %s' %self.pkg_name)
def _setup_parameter(self, file_name, **kwargs):
for key, value in kwargs.items():
origin = "%s =" %key
new = "%s = %s" %(key, value)
sudo('sed -i "/%s/ c\%s" %s' %(origin, new, file_name))
def _get_passwd(self, username):
with hide('output'):
string = run('echo "select usename, passwd from pg_shadow where '
'usename=\'%s\' order by 1" | sudo su postgres -c '
'"psql"' %username)
user, passwd = string.split('\n')[2].split('|')
user = user.strip()
passwd = passwd.strip()
__, tmp_name = tempfile.mkstemp()
fn = open(tmp_name, 'w')
fn.write('"%s" "%s" ""\n' %(user, passwd))
fn.close()
put(tmp_name, '%s/pgbouncer.userlist'%self.config_dir, use_sudo=True)
local('rm %s' %tmp_name)
def _get_username(self, section=None):
try:
names = env.config_object.get_list(section, env.config_object.USERNAME)
username = names[0]
except:
print ('You must first set up a database server on this machine, '
'and create a database user')
raise
return username
def run(self, section=None):
"""
"""
sudo('mkdir -p /opt/pkg/bin')
sudo("ln -sf /opt/local/bin/awk /opt/pkg/bin/nawk")
sudo("ln -sf /opt/local/bin/sed /opt/pkg/bin/nbsed")
self.install_package()
svc_method = os.path.join(env.configs_dir, 'pgbouncer.xml')
put(svc_method, self.config_dir, use_sudo=True)
home = run('bash -c "echo ~postgres"')
bounce_home = os.path.join(home, 'pgbouncer')
pidfile = os.path.join(bounce_home, 'pgbouncer.pid')
self._setup_parameter('%s/pgbouncer.ini' %self.config_dir,
pidfile=pidfile, **self.config)
if not section:
section = 'db-server'
username = self._get_username(section)
self._get_passwd(username)
# postgres should be the owner of these config files
sudo('chown -R postgres:postgres %s' %self.config_dir)
sudo('mkdir -p %s' % bounce_home)
sudo('chown postgres:postgres %s' % bounce_home)
sudo('mkdir -p /var/log/pgbouncer')
sudo('chown postgres:postgres /var/log/pgbouncer')
# set up log
sudo('logadm -C 3 -p1d -c -w /var/log/pgbouncer/pgbouncer.log -z 1')
run('svccfg import %s/pgbouncer.xml' %self.config_dir)
# start pgbouncer
sudo('svcadm enable pgbouncer')
setup = PostgresInstall()
slave_setup = SlaveSetup()
setup_pgbouncer = PGBouncerInstall()
| Java |
//
// bridging-header.h
// BitWake
//
// Created by Niklas Berglund on 2017-07-08.
// Copyright © 2017 Niklas Berglund. All rights reserved.
//
#import "NSMenu+setHasPadding.h"
| Java |
"""
Gauged
https://github.com/chriso/gauged (MIT Licensed)
Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com>
"""
from urlparse import urlparse, parse_qsl
from urllib import unquote
from .mysql import MySQLDriver
from .sqlite import SQLiteDriver
from .postgresql import PostgreSQLDriver
def parse_dsn(dsn_string):
"""Parse a connection string and return the associated driver"""
dsn = urlparse(dsn_string)
scheme = dsn.scheme.split('+')[0]
username = password = host = port = None
host = dsn.netloc
if '@' in host:
username, host = host.split('@')
if ':' in username:
username, password = username.split(':')
password = unquote(password)
username = unquote(username)
if ':' in host:
host, port = host.split(':')
port = int(port)
database = dsn.path.split('?')[0][1:]
query = dsn.path.split('?')[1] if '?' in dsn.path else dsn.query
kwargs = dict(parse_qsl(query, True))
if scheme == 'sqlite':
return SQLiteDriver, [dsn.path], {}
elif scheme == 'mysql':
kwargs['user'] = username or 'root'
kwargs['db'] = database
if port:
kwargs['port'] = port
if host:
kwargs['host'] = host
if password:
kwargs['passwd'] = password
return MySQLDriver, [], kwargs
elif scheme == 'postgresql':
kwargs['user'] = username or 'postgres'
kwargs['database'] = database
if port:
kwargs['port'] = port
if 'unix_socket' in kwargs:
kwargs['host'] = kwargs.pop('unix_socket')
elif host:
kwargs['host'] = host
if password:
kwargs['password'] = password
return PostgreSQLDriver, [], kwargs
else:
raise ValueError('Unknown driver %s' % dsn_string)
def get_driver(dsn_string):
driver, args, kwargs = parse_dsn(dsn_string)
return driver(*args, **kwargs)
| Java |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for DSA-3345-1
#
# Security announcement date: 2015-08-29 00:00:00 UTC
# Script generation date: 2017-01-01 21:07:32 UTC
#
# Operating System: Debian 8 (Jessie)
# Architecture: x86_64
#
# Vulnerable packages fix on version:
# - iceweasel:38.2.1esr-1~deb8u1
#
# Last versions recommanded by security team:
# - iceweasel:38.8.0esr-1~deb8u1
#
# CVE List:
# - CVE-2015-4497
# - CVE-2015-4498
#
# More details:
# - https://www.cyberwatch.fr/vulnerabilites
#
# Licence: Released under The MIT License (MIT), See LICENSE FILE
sudo apt-get install --only-upgrade iceweasel=38.8.0esr-1~deb8u1 -y
| Java |
/***
* ASM: a very small and fast Java bytecode manipulation framework
* Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
package mockit.external.asm4;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
/**
* A Java field or method type. This class can be used to make it easier to
* manipulate type and method descriptors.
*
* @author Eric Bruneton
* @author Chris Nokleberg
*/
public class Type {
/**
* The sort of the <tt>void</tt> type. See {@link #getSort getSort}.
*/
public static final int VOID = 0;
/**
* The sort of the <tt>boolean</tt> type. See {@link #getSort getSort}.
*/
public static final int BOOLEAN = 1;
/**
* The sort of the <tt>char</tt> type. See {@link #getSort getSort}.
*/
public static final int CHAR = 2;
/**
* The sort of the <tt>byte</tt> type. See {@link #getSort getSort}.
*/
public static final int BYTE = 3;
/**
* The sort of the <tt>short</tt> type. See {@link #getSort getSort}.
*/
public static final int SHORT = 4;
/**
* The sort of the <tt>int</tt> type. See {@link #getSort getSort}.
*/
public static final int INT = 5;
/**
* The sort of the <tt>float</tt> type. See {@link #getSort getSort}.
*/
public static final int FLOAT = 6;
/**
* The sort of the <tt>long</tt> type. See {@link #getSort getSort}.
*/
public static final int LONG = 7;
/**
* The sort of the <tt>double</tt> type. See {@link #getSort getSort}.
*/
public static final int DOUBLE = 8;
/**
* The sort of array reference types. See {@link #getSort getSort}.
*/
public static final int ARRAY = 9;
/**
* The sort of object reference types. See {@link #getSort getSort}.
*/
public static final int OBJECT = 10;
/**
* The sort of method types. See {@link #getSort getSort}.
*/
public static final int METHOD = 11;
/**
* The <tt>void</tt> type.
*/
public static final Type VOID_TYPE = new Type(VOID, null, ('V' << 24)
| (5 << 16) | (0 << 8) | 0, 1);
/**
* The <tt>boolean</tt> type.
*/
public static final Type BOOLEAN_TYPE = new Type(BOOLEAN, null, ('Z' << 24)
| (0 << 16) | (5 << 8) | 1, 1);
/**
* The <tt>char</tt> type.
*/
public static final Type CHAR_TYPE = new Type(CHAR, null, ('C' << 24)
| (0 << 16) | (6 << 8) | 1, 1);
/**
* The <tt>byte</tt> type.
*/
public static final Type BYTE_TYPE = new Type(BYTE, null, ('B' << 24)
| (0 << 16) | (5 << 8) | 1, 1);
/**
* The <tt>short</tt> type.
*/
public static final Type SHORT_TYPE = new Type(SHORT, null, ('S' << 24)
| (0 << 16) | (7 << 8) | 1, 1);
/**
* The <tt>int</tt> type.
*/
public static final Type INT_TYPE = new Type(INT, null, ('I' << 24)
| (0 << 16) | (0 << 8) | 1, 1);
/**
* The <tt>float</tt> type.
*/
public static final Type FLOAT_TYPE = new Type(FLOAT, null, ('F' << 24)
| (2 << 16) | (2 << 8) | 1, 1);
/**
* The <tt>long</tt> type.
*/
public static final Type LONG_TYPE = new Type(LONG, null, ('J' << 24)
| (1 << 16) | (1 << 8) | 2, 1);
/**
* The <tt>double</tt> type.
*/
public static final Type DOUBLE_TYPE = new Type(DOUBLE, null, ('D' << 24)
| (3 << 16) | (3 << 8) | 2, 1);
private static final Type[] NO_ARGS = new Type[0];
// ------------------------------------------------------------------------
// Fields
// ------------------------------------------------------------------------
/**
* The sort of this Java type.
*/
private final int sort;
/**
* A buffer containing the internal name of this Java type. This field is
* only used for reference types.
*/
private final char[] buf;
/**
* The offset of the internal name of this Java type in {@link #buf buf} or,
* for primitive types, the size, descriptor and getOpcode offsets for this
* type (byte 0 contains the size, byte 1 the descriptor, byte 2 the offset
* for IALOAD or IASTORE, byte 3 the offset for all other instructions).
*/
private final int off;
/**
* The length of the internal name of this Java type.
*/
private final int len;
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
/**
* Constructs a reference type.
*
* @param sort the sort of the reference type to be constructed.
* @param buf a buffer containing the descriptor of the previous type.
* @param off the offset of this descriptor in the previous buffer.
* @param len the length of this descriptor.
*/
private Type(int sort, char[] buf, int off, int len)
{
this.sort = sort;
this.buf = buf;
this.off = off;
this.len = len;
}
/**
* Returns the Java type corresponding to the given type descriptor.
*
* @param typeDescriptor a field or method type descriptor.
* @return the Java type corresponding to the given type descriptor.
*/
public static Type getType(String typeDescriptor) {
return getType(typeDescriptor.toCharArray(), 0);
}
/**
* Returns the Java type corresponding to the given internal name.
*
* @param internalName an internal name.
* @return the Java type corresponding to the given internal name.
*/
public static Type getObjectType(String internalName) {
char[] buf = internalName.toCharArray();
return new Type(buf[0] == '[' ? ARRAY : OBJECT, buf, 0, buf.length);
}
/**
* Returns the Java type corresponding to the given method descriptor.
* Equivalent to <code>Type.getType(methodDescriptor)</code>.
*
* @param methodDescriptor a method descriptor.
* @return the Java type corresponding to the given method descriptor.
*/
public static Type getMethodType(String methodDescriptor) {
return getType(methodDescriptor.toCharArray(), 0);
}
/**
* Returns the Java type corresponding to the given class.
*
* @param c a class.
* @return the Java type corresponding to the given class.
*/
public static Type getType(Class<?> c) {
if (c.isPrimitive()) {
if (c == Integer.TYPE) {
return INT_TYPE;
} else if (c == Void.TYPE) {
return VOID_TYPE;
} else if (c == Boolean.TYPE) {
return BOOLEAN_TYPE;
} else if (c == Byte.TYPE) {
return BYTE_TYPE;
} else if (c == Character.TYPE) {
return CHAR_TYPE;
} else if (c == Short.TYPE) {
return SHORT_TYPE;
} else if (c == Double.TYPE) {
return DOUBLE_TYPE;
} else if (c == Float.TYPE) {
return FLOAT_TYPE;
} else /* if (c == Long.TYPE) */{
return LONG_TYPE;
}
} else {
return getType(getDescriptor(c));
}
}
/**
* Returns the Java method type corresponding to the given constructor.
*
* @param c a {@link Constructor Constructor} object.
* @return the Java method type corresponding to the given constructor.
*/
public static Type getType(Constructor<?> c) {
return getType(getConstructorDescriptor(c));
}
/**
* Returns the Java method type corresponding to the given method.
*
* @param m a {@link Method Method} object.
* @return the Java method type corresponding to the given method.
*/
public static Type getType(Method m) {
return getType(getMethodDescriptor(m));
}
/**
* Returns the Java types corresponding to the argument types of the given
* method descriptor.
*
* @param methodDescriptor a method descriptor.
* @return the Java types corresponding to the argument types of the given
* method descriptor.
*/
public static Type[] getArgumentTypes(String methodDescriptor) {
if (methodDescriptor.charAt(1) == ')') return NO_ARGS;
char[] buf = methodDescriptor.toCharArray();
int off = 1;
int size = 0;
while (true) {
char car = buf[off++];
if (car == ')') {
break;
} else if (car == 'L') {
while (buf[off++] != ';') {
}
++size;
} else if (car != '[') {
++size;
}
}
Type[] args = new Type[size];
off = 1;
size = 0;
while (buf[off] != ')') {
args[size] = getType(buf, off);
off += args[size].len + (args[size].sort == OBJECT ? 2 : 0);
size += 1;
}
return args;
}
/**
* Returns the Java type corresponding to the return type of the given
* method descriptor.
*
* @param methodDescriptor a method descriptor.
* @return the Java type corresponding to the return type of the given
* method descriptor.
*/
public static Type getReturnType(String methodDescriptor) {
char[] buf = methodDescriptor.toCharArray();
return getType(buf, methodDescriptor.indexOf(')') + 1);
}
/**
* Computes the size of the arguments and of the return value of a method.
*
* @param desc the descriptor of a method.
* @return the size of the arguments of the method (plus one for the
* implicit this argument), argSize, and the size of its return
* value, retSize, packed into a single int i =
* <tt>(argSize << 2) | retSize</tt> (argSize is therefore equal
* to <tt>i >> 2</tt>, and retSize to <tt>i & 0x03</tt>).
*/
public static int getArgumentsAndReturnSizes(String desc) {
int n = 1;
int c = 1;
while (true) {
char car = desc.charAt(c++);
if (car == ')') {
car = desc.charAt(c);
return n << 2
| (car == 'V' ? 0 : (car == 'D' || car == 'J' ? 2 : 1));
} else if (car == 'L') {
while (desc.charAt(c++) != ';') {
}
n += 1;
} else if (car == '[') {
while ((car = desc.charAt(c)) == '[') {
++c;
}
if (car == 'D' || car == 'J') {
n -= 1;
}
} else if (car == 'D' || car == 'J') {
n += 2;
} else {
n += 1;
}
}
}
/**
* Returns the Java type corresponding to the given type descriptor. For
* method descriptors, buf is supposed to contain nothing more than the
* descriptor itself.
*
* @param buf a buffer containing a type descriptor.
* @param off the offset of this descriptor in the previous buffer.
* @return the Java type corresponding to the given type descriptor.
*/
private static Type getType(char[] buf, int off) {
int len;
switch (buf[off]) {
case 'V':
return VOID_TYPE;
case 'Z':
return BOOLEAN_TYPE;
case 'C':
return CHAR_TYPE;
case 'B':
return BYTE_TYPE;
case 'S':
return SHORT_TYPE;
case 'I':
return INT_TYPE;
case 'F':
return FLOAT_TYPE;
case 'J':
return LONG_TYPE;
case 'D':
return DOUBLE_TYPE;
case '[':
len = 1;
while (buf[off + len] == '[') {
++len;
}
if (buf[off + len] == 'L') {
++len;
while (buf[off + len] != ';') {
++len;
}
}
return new Type(ARRAY, buf, off, len + 1);
case 'L':
len = 1;
while (buf[off + len] != ';') {
++len;
}
return new Type(OBJECT, buf, off + 1, len - 1);
case '(':
return new Type(METHOD, buf, 0, buf.length);
default:
throw new IllegalArgumentException("Invalid type descriptor: " + new String(buf));
}
}
// ------------------------------------------------------------------------
// Accessors
// ------------------------------------------------------------------------
/**
* Returns the sort of this Java type.
*
* @return {@link #VOID VOID}, {@link #BOOLEAN BOOLEAN},
* {@link #CHAR CHAR}, {@link #BYTE BYTE}, {@link #SHORT SHORT},
* {@link #INT INT}, {@link #FLOAT FLOAT}, {@link #LONG LONG},
* {@link #DOUBLE DOUBLE}, {@link #ARRAY ARRAY},
* {@link #OBJECT OBJECT} or {@link #METHOD METHOD}.
*/
public int getSort() {
return sort;
}
/**
* Returns the number of dimensions of this array type. This method should
* only be used for an array type.
*
* @return the number of dimensions of this array type.
*/
public int getDimensions() {
int i = 1;
while (buf[off + i] == '[') {
++i;
}
return i;
}
/**
* Returns the type of the elements of this array type. This method should
* only be used for an array type.
*
* @return Returns the type of the elements of this array type.
*/
public Type getElementType() {
return getType(buf, off + getDimensions());
}
/**
* Returns the binary name of the class corresponding to this type. This
* method must not be used on method types.
*
* @return the binary name of the class corresponding to this type.
*/
public String getClassName() {
switch (sort) {
case VOID:
return "void";
case BOOLEAN:
return "boolean";
case CHAR:
return "char";
case BYTE:
return "byte";
case SHORT:
return "short";
case INT:
return "int";
case FLOAT:
return "float";
case LONG:
return "long";
case DOUBLE:
return "double";
case ARRAY:
StringBuffer b = new StringBuffer(getElementType().getClassName());
for (int i = getDimensions(); i > 0; --i) {
b.append("[]");
}
return b.toString();
case OBJECT:
return new String(buf, off, len).replace('/', '.');
default:
return null;
}
}
/**
* Returns the internal name of the class corresponding to this object or
* array type. The internal name of a class is its fully qualified name (as
* returned by Class.getName(), where '.' are replaced by '/'. This method
* should only be used for an object or array type.
*
* @return the internal name of the class corresponding to this object type.
*/
public String getInternalName() {
return new String(buf, off, len);
}
// ------------------------------------------------------------------------
// Conversion to type descriptors
// ------------------------------------------------------------------------
/**
* Returns the descriptor corresponding to this Java type.
*
* @return the descriptor corresponding to this Java type.
*/
public String getDescriptor() {
StringBuffer buf = new StringBuffer();
getDescriptor(buf);
return buf.toString();
}
/**
* Appends the descriptor corresponding to this Java type to the given
* string buffer.
*
* @param buf the string buffer to which the descriptor must be appended.
*/
private void getDescriptor(StringBuffer buf) {
if (this.buf == null) {
// descriptor is in byte 3 of 'off' for primitive types (buf == null)
buf.append((char) ((off & 0xFF000000) >>> 24));
} else if (sort == OBJECT) {
buf.append('L');
buf.append(this.buf, off, len);
buf.append(';');
} else { // sort == ARRAY || sort == METHOD
buf.append(this.buf, off, len);
}
}
// ------------------------------------------------------------------------
// Direct conversion from classes to type descriptors,
// without intermediate Type objects
// ------------------------------------------------------------------------
/**
* Returns the internal name of the given class. The internal name of a
* class is its fully qualified name, as returned by Class.getName(), where
* '.' are replaced by '/'.
*
* @param c an object or array class.
* @return the internal name of the given class.
*/
public static String getInternalName(Class<?> c) {
return c.getName().replace('.', '/');
}
/**
* Returns the descriptor corresponding to the given Java type.
*
* @param c an object class, a primitive class or an array class.
* @return the descriptor corresponding to the given class.
*/
public static String getDescriptor(Class<?> c) {
StringBuffer buf = new StringBuffer();
getDescriptor(buf, c);
return buf.toString();
}
/**
* Returns the descriptor corresponding to the given constructor.
*
* @param c a {@link Constructor Constructor} object.
* @return the descriptor of the given constructor.
*/
public static String getConstructorDescriptor(Constructor<?> c) {
Class<?>[] parameters = c.getParameterTypes();
StringBuffer buf = new StringBuffer();
buf.append('(');
for (int i = 0; i < parameters.length; ++i) {
getDescriptor(buf, parameters[i]);
}
return buf.append(")V").toString();
}
/**
* Returns the descriptor corresponding to the given method.
*
* @param m a {@link Method Method} object.
* @return the descriptor of the given method.
*/
public static String getMethodDescriptor(Method m) {
Class<?>[] parameters = m.getParameterTypes();
StringBuffer buf = new StringBuffer();
buf.append('(');
for (int i = 0; i < parameters.length; ++i) {
getDescriptor(buf, parameters[i]);
}
buf.append(')');
getDescriptor(buf, m.getReturnType());
return buf.toString();
}
/**
* Appends the descriptor of the given class to the given string buffer.
*
* @param buf the string buffer to which the descriptor must be appended.
* @param c the class whose descriptor must be computed.
*/
private static void getDescriptor(StringBuffer buf, Class<?> c) {
Class<?> d = c;
while (true) {
if (d.isPrimitive()) {
char car;
if (d == Integer.TYPE) {
car = 'I';
} else if (d == Void.TYPE) {
car = 'V';
} else if (d == Boolean.TYPE) {
car = 'Z';
} else if (d == Byte.TYPE) {
car = 'B';
} else if (d == Character.TYPE) {
car = 'C';
} else if (d == Short.TYPE) {
car = 'S';
} else if (d == Double.TYPE) {
car = 'D';
} else if (d == Float.TYPE) {
car = 'F';
} else /* if (d == Long.TYPE) */{
car = 'J';
}
buf.append(car);
return;
} else if (d.isArray()) {
buf.append('[');
d = d.getComponentType();
} else {
buf.append('L');
String name = d.getName();
int len = name.length();
for (int i = 0; i < len; ++i) {
char car = name.charAt(i);
buf.append(car == '.' ? '/' : car);
}
buf.append(';');
return;
}
}
}
// ------------------------------------------------------------------------
// Corresponding size and opcodes
// ------------------------------------------------------------------------
/**
* Returns the size of values of this type. This method must not be used for
* method types.
*
* @return the size of values of this type, i.e., 2 for <tt>long</tt> and
* <tt>double</tt>, 0 for <tt>void</tt> and 1 otherwise.
*/
public int getSize() {
// the size is in byte 0 of 'off' for primitive types (buf == null)
return buf == null ? off & 0xFF : 1;
}
/**
* Returns a JVM instruction opcode adapted to this Java type. This method
* must not be used for method types.
*
* @param opcode a JVM instruction opcode. This opcode must be one of ILOAD,
* ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL,
* ISHR, IUSHR, IAND, IOR, IXOR and IRETURN.
* @return an opcode that is similar to the given opcode, but adapted to
* this Java type. For example, if this type is <tt>float</tt> and
* <tt>opcode</tt> is IRETURN, this method returns FRETURN.
*/
public int getOpcode(int opcode) {
if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
// the offset for IALOAD or IASTORE is in byte 1 of 'off' for
// primitive types (buf == null)
return opcode + (buf == null ? (off & 0xFF00) >> 8 : 4);
} else {
// the offset for other instructions is in byte 2 of 'off' for
// primitive types (buf == null)
return opcode + (buf == null ? (off & 0xFF0000) >> 16 : 4);
}
}
// ------------------------------------------------------------------------
// Equals, hashCode and toString
// ------------------------------------------------------------------------
/**
* Tests if the given object is equal to this type.
*
* @param o the object to be compared to this type.
* @return <tt>true</tt> if the given object is equal to this type.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Type)) {
return false;
}
Type t = (Type) o;
if (sort != t.sort) {
return false;
}
if (sort >= ARRAY) {
if (len != t.len) {
return false;
}
for (int i = off, j = t.off, end = i + len; i < end; i++, j++) {
if (buf[i] != t.buf[j]) {
return false;
}
}
}
return true;
}
/**
* Returns a hash code value for this type.
*
* @return a hash code value for this type.
*/
@Override
public int hashCode() {
int hc = 13 * sort;
if (sort >= ARRAY) {
for (int i = off, end = i + len; i < end; i++) {
hc = 17 * (hc + buf[i]);
}
}
return hc;
}
/**
* Returns a string representation of this type.
*
* @return the descriptor of this type.
*/
@Override
public String toString() {
return getDescriptor();
}
}
| Java |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ibtokin.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
execute_from_command_line(sys.argv)
| Java |
<table class="table table-striped table-bordered table-hover">
<tr>
<th>Student Id</th>
<th>Student Name</th>
<th>Course</th>
<!--<th>
<select class="form-control" name='Year Level' required>
<option> THIRD YEAR</option>
<option> ALL</option>
<option> FIRST YEAR</option>
<option> SECOND YEAR</option>
<option> FOURTH YEAR</option>
</select>
</th>-->
<th colspan="2">Action</th>
</tr>
<?php
// fetch the records in tbl_enrollment
$result = $this->enrollment->getStud($param);
foreach($result as $info)
{
extract($info);
$stud_info = $this->party->getStudInfo($partyid);
$course = $this->course->getCourse($coursemajor);
?>
<tr>
<td><?php echo $stud_info['legacyid']; ?></td>
<td><?php echo $stud_info['lastname'] . ' , ' . $stud_info['firstname'] ?></td>
<td><?php echo $course; ?></td>
<!--<td></td>-->
<td>
<?php if($stud_info['status'] != 'C'){
?>
<a class="a-table label label-info" href="/rgstr_build/<?php echo $stud_info['legacyid'];?>">View
Records <span class="glyphicon glyphicon-file"></span></a>
<?php } ?>
</td>
</tr>
<?php
//}
}
?>
</table> | Java |
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.eclipse.bpel4chor.model.pbd;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Query</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.bpel4chor.model.pbd.Query#getQueryLanguage <em>Query Language</em>}</li>
* <li>{@link org.eclipse.bpel4chor.model.pbd.Query#getOpaque <em>Opaque</em>}</li>
* <li>{@link org.eclipse.bpel4chor.model.pbd.Query#getValue <em>Value</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.bpel4chor.model.pbd.PbdPackage#getQuery()
* @model
* @generated
*/
public interface Query extends ExtensibleElements {
/**
* Returns the value of the '<em><b>Query Language</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Query Language</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Query Language</em>' attribute.
* @see #setQueryLanguage(String)
* @see org.eclipse.bpel4chor.model.pbd.PbdPackage#getQuery_QueryLanguage()
* @model
* @generated
*/
String getQueryLanguage();
/**
* Sets the value of the '{@link org.eclipse.bpel4chor.model.pbd.Query#getQueryLanguage <em>Query Language</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Query Language</em>' attribute.
* @see #getQueryLanguage()
* @generated
*/
void setQueryLanguage(String value);
/**
* Returns the value of the '<em><b>Opaque</b></em>' attribute.
* The literals are from the enumeration {@link org.eclipse.bpel4chor.model.pbd.OpaqueBoolean}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Opaque</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Opaque</em>' attribute.
* @see org.eclipse.bpel4chor.model.pbd.OpaqueBoolean
* @see #setOpaque(OpaqueBoolean)
* @see org.eclipse.bpel4chor.model.pbd.PbdPackage#getQuery_Opaque()
* @model
* @generated
*/
OpaqueBoolean getOpaque();
/**
* Sets the value of the '{@link org.eclipse.bpel4chor.model.pbd.Query#getOpaque <em>Opaque</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Opaque</em>' attribute.
* @see org.eclipse.bpel4chor.model.pbd.OpaqueBoolean
* @see #getOpaque()
* @generated
*/
void setOpaque(OpaqueBoolean value);
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(String)
* @see org.eclipse.bpel4chor.model.pbd.PbdPackage#getQuery_Value()
* @model
* @generated
*/
String getValue();
/**
* Sets the value of the '{@link org.eclipse.bpel4chor.model.pbd.Query#getValue <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Value</em>' attribute.
* @see #getValue()
* @generated
*/
void setValue(String value);
} // Query
| Java |
//
// SMActivityEventBuilder.h
// SessionMEventsKit
//
// Copyright © 2018 SessionM. All rights reserved.
//
#ifndef __SM_ACTIVITY_EVENT_BUILDER__
#define __SM_ACTIVITY_EVENT_BUILDER__
#import "SMEventBuilder.h"
#import "SMActivityEvent.h"
NS_ASSUME_NONNULL_BEGIN
/*!
@class SMActivityEventBuilder
@abstract Class used for building <code>SMActivityEvent</code> objects that represent a basic activity event performed by the user to make progress towards completing an application-specific campaign.
*/
@interface SMActivityEventBuilder : SMEventBuilder
/*!
@abstract Generates an activity event based on the builder's current configuration.
@result The generated <code>SMActivityEvent</code> object.
*/
- (SMActivityEvent *)build;
@end
NS_ASSUME_NONNULL_END
#endif /* __SM_ACTIVITY_EVENT_BUILDER__ */
| Java |
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextPane;
import java.awt.SystemColor;
/**
* The GUIError object is used to show an error message if the Path of Exile API is not responding.
*
* @author Joschn
*/
public class GUIError{
private JFrame windowError;
private JButton buttonRetry;
private volatile boolean buttonPressed = false;
private ButtonRetryListener buttonRetryListener = new ButtonRetryListener();
private String errorMessage = "Error! Path of Exile's API is not responding! Servers are probably down! Check www.pathofexile.com";
private String version = "2.7";
/**
* Constructor for the GUIError object.
*/
public GUIError(){
initialize();
}
/**
* Initializes the GUI.
*/
private void initialize(){
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
// error window
windowError = new JFrame();
windowError.setBounds(100, 100, 300, 145);
windowError.setLocation(dim.width/2-windowError.getSize().width/2, dim.height/2-windowError.getSize().height/2);
windowError.setResizable(false);
windowError.setTitle("Ladder Tracker v" + version);
windowError.setIconImage(new ImageIcon(getClass().getResource("icon.png")).getImage());
windowError.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
windowError.getContentPane().setLayout(null);
// button retry
buttonRetry = new JButton("Retry");
buttonRetry.setBounds(10, 80, 274, 23);
buttonRetry.addActionListener(buttonRetryListener);
windowError.getContentPane().add(buttonRetry);
// error text
JTextPane textError = new JTextPane();
textError.setText(errorMessage);
textError.setEditable(false);
textError.setBackground(SystemColor.menu);
textError.setBounds(10, 21, 274, 39);
windowError.getContentPane().add(textError);
}
/**
* Shows the error GUI and waits for the retry button to be pressed.
*/
public void show(){
windowError.setVisible(true);
while(!buttonPressed){}
windowError.dispose();
}
/**
* The definition of the action listener for the retry button.
*
* @author Joschn
*/
private class ButtonRetryListener implements ActionListener{
public void actionPerformed(ActionEvent e){
buttonPressed = true;
}
}
} | Java |
import { GraphQLError } from '../../error/GraphQLError';
import type {
SchemaDefinitionNode,
SchemaExtensionNode,
} from '../../language/ast';
import type { ASTVisitor } from '../../language/visitor';
import type { SDLValidationContext } from '../ValidationContext';
/**
* Unique operation types
*
* A GraphQL document is only valid if it has only one type per operation.
*/
export function UniqueOperationTypesRule(
context: SDLValidationContext,
): ASTVisitor {
const schema = context.getSchema();
const definedOperationTypes = Object.create(null);
const existingOperationTypes = schema
? {
query: schema.getQueryType(),
mutation: schema.getMutationType(),
subscription: schema.getSubscriptionType(),
}
: {};
return {
SchemaDefinition: checkOperationTypes,
SchemaExtension: checkOperationTypes,
};
function checkOperationTypes(
node: SchemaDefinitionNode | SchemaExtensionNode,
) {
// See: https://github.com/graphql/graphql-js/issues/2203
/* c8 ignore next */
const operationTypesNodes = node.operationTypes ?? [];
for (const operationType of operationTypesNodes) {
const operation = operationType.operation;
const alreadyDefinedOperationType = definedOperationTypes[operation];
if (existingOperationTypes[operation]) {
context.reportError(
new GraphQLError(
`Type for ${operation} already defined in the schema. It cannot be redefined.`,
operationType,
),
);
} else if (alreadyDefinedOperationType) {
context.reportError(
new GraphQLError(
`There can be only one ${operation} type in schema.`,
[alreadyDefinedOperationType, operationType],
),
);
} else {
definedOperationTypes[operation] = operationType;
}
}
return false;
}
}
| Java |
"$CLOUD_REBUILD" CDump 32 dll release same | Java |
#include "DirectShow.h" | Java |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
namespace Podcasts.Converters
{
public class PodcastDurationConverter : TypedConverter<TimeSpan?, string>
{
public override string Convert(TimeSpan? duration, object parameter, string language)
{
if (!duration.HasValue)
{
return "--";
}
else if (duration.Value.TotalHours >= 1.0)
{
return duration?.ToString(@"h\:mm\:ss");
}
else
{
return duration?.ToString(@"m\:ss");
}
}
public override TimeSpan? ConvertBack(string value, object parameter, string language)
{
throw new NotImplementedException();
}
}
} | Java |
include(Util)
once()
include (Plugins)
if (ANDROID)
set (Android_List_dir ${CMAKE_CURRENT_LIST_DIR})
if (NOT ANDROID_SDK)
MESSAGE(SEND_ERROR "No ANDROID_SDK location provided!")
endif()
MESSAGE(STATUS "Targeting Android-SDK version: ${ANDROID_PLATFORM_LEVEL}")
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/gradle)
if (CMAKE_HOST_WIN32)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/gradle/gradlew
COMMAND gradle wrapper --gradle-version=4.10.2 --distribution-type=all
COMMAND gradle --stop
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/gradle)
else()
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/gradle/gradlew
COMMAND gradle wrapper --gradle-version=4.10.2 --distribution-type=all
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/gradle)
endif()
add_custom_target(gradlew DEPENDS ${CMAKE_BINARY_DIR}/gradle/gradlew)
macro(add_workspace_application target)
set(target ${target})
string(REGEX REPLACE "\\\\" "\\\\\\\\" ANDROID_SDK_ESCAPED "${ANDROID_SDK}")
configure_file(${Android_List_dir}/android/build.gradle.in build.gradle @ONLY)
configure_file(${Android_List_dir}/android/local.properties.in local.properties @ONLY)
configure_file(${Android_List_dir}/android/AndroidManifest.xml.in AndroidManifest.xml.in @ONLY)
file(GENERATE OUTPUT AndroidManifest.xml INPUT ${CMAKE_CURRENT_BINARY_DIR}/AndroidManifest.xml.in)
#configure_file(${Android_List_dir}/android/launch.vs.json.in ${CMAKE_SOURCE_DIR}/.vs/launch.vs.json @ONLY)
#configure_file(${Android_List_dir}/android/debug_apk.bat.in debug_${target}_apk.bat @ONLY)
#configure_file(${Android_List_dir}/android/launch_apk.sh.in launch_${target}_apk.sh @ONLY)
#configure_file(${Android_List_dir}/android/gdbcommands.in gdbcommands_${target}_apk @ONLY)
#configure_file(${Android_List_dir}/android/launch_jdb.bat.in launch_jdb.bat @ONLY)
add_library(${target} SHARED ${ARGN})
if (NOT MODULES_ENABLE_PLUGINS)
patch_toplevel_target(${target})
endif()
add_executable(${target}_apk android/dummy.cpp)
target_link_libraries(${target}_apk PRIVATE ${target})
if (CMAKE_HOST_WIN32)
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_BINARY_DIR}/gradle/gradlew assembleDebug
COMMAND ${CMAKE_BINARY_DIR}/gradle/gradlew --stop
COMMENT "Build APK - ${target}"
BYPRODUCTS apk/${target}-debug.apk
)
else()
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_BINARY_DIR}/gradle/gradlew assembleDebug
COMMENT "Build APK - ${target}"
BYPRODUCTS apk/${target}-debug.apk
)
endif()
add_dependencies(${target} gradlew)
endmacro(add_workspace_application)
endif() | Java |
//
// JJProductCell.h
// Footprints
//
// Created by Jinjin on 14/12/3.
// Copyright (c) 2014年 JiaJun. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void(^ExchangeBlock)(GiftProductModel *model);
@interface JJProductCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIView *realCotent;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *jifenLabel;
@property (weak, nonatomic) IBOutlet UIImageView *avatarLabel;
@property (weak, nonatomic) IBOutlet UIButton *exchangeBtn;
@property (nonatomic,strong) GiftProductModel *model;
@property (nonatomic,strong) ExchangeBlock exChangeBlock;
@property (weak, nonatomic) IBOutlet UILabel *countLabel;
- (IBAction)exchangeBtnDidTap:(id)sender;
@end
| Java |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import PipelineRunNodeedges from './PipelineRunNodeedges';
/**
* The PipelineRunNode model module.
* @module model/PipelineRunNode
* @version 1.1.2-pre.0
*/
class PipelineRunNode {
/**
* Constructs a new <code>PipelineRunNode</code>.
* @alias module:model/PipelineRunNode
*/
constructor() {
PipelineRunNode.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>PipelineRunNode</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/PipelineRunNode} obj Optional instance to populate.
* @return {module:model/PipelineRunNode} The populated <code>PipelineRunNode</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new PipelineRunNode();
if (data.hasOwnProperty('_class')) {
obj['_class'] = ApiClient.convertToType(data['_class'], 'String');
}
if (data.hasOwnProperty('displayName')) {
obj['displayName'] = ApiClient.convertToType(data['displayName'], 'String');
}
if (data.hasOwnProperty('durationInMillis')) {
obj['durationInMillis'] = ApiClient.convertToType(data['durationInMillis'], 'Number');
}
if (data.hasOwnProperty('edges')) {
obj['edges'] = ApiClient.convertToType(data['edges'], [PipelineRunNodeedges]);
}
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String');
}
if (data.hasOwnProperty('result')) {
obj['result'] = ApiClient.convertToType(data['result'], 'String');
}
if (data.hasOwnProperty('startTime')) {
obj['startTime'] = ApiClient.convertToType(data['startTime'], 'String');
}
if (data.hasOwnProperty('state')) {
obj['state'] = ApiClient.convertToType(data['state'], 'String');
}
}
return obj;
}
}
/**
* @member {String} _class
*/
PipelineRunNode.prototype['_class'] = undefined;
/**
* @member {String} displayName
*/
PipelineRunNode.prototype['displayName'] = undefined;
/**
* @member {Number} durationInMillis
*/
PipelineRunNode.prototype['durationInMillis'] = undefined;
/**
* @member {Array.<module:model/PipelineRunNodeedges>} edges
*/
PipelineRunNode.prototype['edges'] = undefined;
/**
* @member {String} id
*/
PipelineRunNode.prototype['id'] = undefined;
/**
* @member {String} result
*/
PipelineRunNode.prototype['result'] = undefined;
/**
* @member {String} startTime
*/
PipelineRunNode.prototype['startTime'] = undefined;
/**
* @member {String} state
*/
PipelineRunNode.prototype['state'] = undefined;
export default PipelineRunNode;
| Java |
package com.lamost.update;
import java.io.IOException;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;
import android.util.Log;
/**
* Created by Jia on 2016/4/6.
*/
public class UpdateWebService {
private static final String TAG = "WebService";
// 命名空间
private final static String SERVICE_NS = "http://ws.smarthome.zfznjj.com/";
// 阿里云
private final static String SERVICE_URL = "http://101.201.211.87:8080/zfzn02/services/smarthome?wsdl=SmarthomeWs.wsdl";
// SOAP Action
private static String soapAction = "";
// 调用的方法名称
private static String methodName = "";
private HttpTransportSE ht;
private SoapSerializationEnvelope envelope;
private SoapObject soapObject;
private SoapObject result;
public UpdateWebService() {
ht = new HttpTransportSE(SERVICE_URL); // ①
ht.debug = true;
}
public String getAppVersionVoice(String appName) {
ht = new HttpTransportSE(SERVICE_URL);
ht.debug = true;
methodName = "getAppVersionVoice";
soapAction = SERVICE_NS + methodName;// 通常为命名空间 + 调用的方法名称
// 使用SOAP1.1协议创建Envelop对象
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); // ②
// 实例化SoapObject对象
soapObject = new SoapObject(SERVICE_NS, methodName); // ③
// 将soapObject对象设置为 SoapSerializationEnvelope对象的传出SOAP消息
envelope.bodyOut = soapObject; // ⑤
envelope.dotNet = true;
envelope.setOutputSoapObject(soapObject);
soapObject.addProperty("appName", appName);
try {
// System.out.println("测试1");
ht.call(soapAction, envelope);
// System.out.println("测试2");
// 根据测试发现,运行这行代码时有时会抛出空指针异常,使用加了一句进行处理
if (envelope != null && envelope.getResponse() != null) {
// 获取服务器响应返回的SOAP消息
// System.out.println("测试3");
result = (SoapObject) envelope.bodyIn; // ⑦
// 接下来就是从SoapObject对象中解析响应数据的过程了
// System.out.println("测试4");
String flag = result.getProperty(0).toString();
Log.e(TAG, "*********Webservice masterReadElecticOrder 服务器返回值:"
+ flag);
return flag;
}
} catch (IOException e) {
e.printStackTrace();
} catch (XmlPullParserException e) {
e.printStackTrace();
} finally {
resetParam();
}
return -1 + "";
}
private void resetParam() {
envelope = null;
soapObject = null;
result = null;
}
}
| Java |
<?php
namespace gries\Pokemath\Numbers;
use gries\Pokemath\PokeNumber;
class Mienshao extends PokeNumber
{
public function __construct()
{
parent::__construct('mienshao');
}
} | Java |
Blog
Powered by Jekyll | Theme H2O
| Java |
MinimalCaleydoIntegration
=========================
a minimal eclipse rcp example for integrating caleydo gl elements into a view
| Java |
<?php
/**
* This file is automatically created by Recurly's OpenAPI generation process
* and thus any edits you make by hand will be lost. If you wish to make a
* change to this file, please create a Github issue explaining the changes you
* need and we will usher them to the appropriate places.
*/
namespace Recurly\Resources;
use Recurly\RecurlyResource;
// phpcs:disable
class ShippingMethodMini extends RecurlyResource
{
private $_code;
private $_id;
private $_name;
private $_object;
protected static $array_hints = [
];
/**
* Getter method for the code attribute.
* The internal name used identify the shipping method.
*
* @return ?string
*/
public function getCode(): ?string
{
return $this->_code;
}
/**
* Setter method for the code attribute.
*
* @param string $code
*
* @return void
*/
public function setCode(string $code): void
{
$this->_code = $code;
}
/**
* Getter method for the id attribute.
* Shipping Method ID
*
* @return ?string
*/
public function getId(): ?string
{
return $this->_id;
}
/**
* Setter method for the id attribute.
*
* @param string $id
*
* @return void
*/
public function setId(string $id): void
{
$this->_id = $id;
}
/**
* Getter method for the name attribute.
* The name of the shipping method displayed to customers.
*
* @return ?string
*/
public function getName(): ?string
{
return $this->_name;
}
/**
* Setter method for the name attribute.
*
* @param string $name
*
* @return void
*/
public function setName(string $name): void
{
$this->_name = $name;
}
/**
* Getter method for the object attribute.
* Object type
*
* @return ?string
*/
public function getObject(): ?string
{
return $this->_object;
}
/**
* Setter method for the object attribute.
*
* @param string $object
*
* @return void
*/
public function setObject(string $object): void
{
$this->_object = $object;
}
} | Java |
<!-- content start -->
<div class="admin-content" style="min-height:450px">
<div class="am-cf am-padding">
<div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">成交明细表</strong></div>
</div>
<div class="am-g">
<div class="am-u-sm-12 am-u-md-6"> </div>
<form method="post" action="{{site_url url='cw_brokerage/list_brokerage'}}" class="search_form">
<div class="am-u-sm-12 am-u-md-3">
<div class="am-input-group am-input-group-sm">
<select data-am-selected="{btnWidth: '120', btnSize: 'sm', btnStyle: 'default'}" name="house_id">
<option value="0">- 楼盘(全选) -</option>
{{foreach from=$houses item=item}}
<option value="{{$item.id}}" {{if $item.id == $data.house_id}}selected{{/if}}>{{$item.name}}</option>
{{/foreach}}
</select>
</div>
</div>
<div class="am-u-sm-12 am-u-md-3">
<div class="am-input-group am-input-group-sm">
<input type="text" class="am-form-field" name="uname" value="{{$data.uname}}">
<span class="am-input-group-btn">
<input type="submit" class="am-btn am-btn-default" value="搜索" />
</span>
</div>
</div>
</form>
</div>
<div class="am-g">
<div class="am-u-sm-12">
<table class="am-table am-table-striped am-table-hover table-main">
<thead>
<tr>
<th class="table-id">ID</th>
<th class="table-title">客户姓名</th>
<th class="table-title">客户电话</th>
<th class="table-title">楼盘</th>
<th class="table-title">房号</th>
<th class="table-title">面积</th>
<th class="table-title">总价</th>
<th class="table-title">业务员</th>
<th class="table-title">订购日期</th>
<th class="table-set">操作</th>
</tr>
</thead>
<tbody>
{{foreach from=$data.items key=key item=item}}
<tr>
<td>{{$item.id}}</td>
<td>{{$item.customer}}</td>
<td>{{$item.phone}}</td>
<td>{{$item.name}}</td>
<td>{{$item.house_no}}</td>
<td>{{$item.acreage}}</td>
<td>{{$item.total_price}}</td>
<td>{{$item.rel_name}}</td>
<td class="am-hide-sm-only">{{$item.date}}</td>
<td>
<div class="am-btn-toolbar">
<div class="am-btn-group am-btn-group-xs">
<button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="javascript:location.href='{{site_url url='cw_brokerage/view_brokerage'}}/{{$item.id}}';"><span class="am-icon-pencil-square-o"></span> 查看</button>
</div>
</div>
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="am-cf">{{$pager}}</div>
</div>
</div>
</div>
<!-- content end -->
| Java |
class Client {
constructor(http_client){
this.http_client = http_client
this.method_list = []
}
xyz() {
return this.http_client
}
}
function chainable_client () {
HttpClient = require('./http_client.js')
http_client = new HttpClient(arguments[0])
chainable_method = require('./chainable_method.js')
return chainable_method(new Client(http_client), true)
}
module.exports = chainable_client
| Java |
<div class="collapsibleregioninner" id="aera_core_competency_template_has_related_data_inner"><br/><div style="border:solid 1px #DEDEDE;background:#E2E0E0;
color:#222222;padding:4px;">Check if a template has related data</div><br/><br/><span style="color:#EA33A6">Arguments</span><br/><span style="font-size:80%"><b>id</b> (Required)<br/> The template id<br/><br/><div><div style="border:solid 1px #DEDEDE;background:#FFF1BC;color:#222222;padding:4px;"><pre><b>General structure</b><br/>
int <span style="color:#2A33A6"> <i>//The template id</i></span><br/>
</pre></div></div><div><div style="border:solid 1px #DEDEDE;background:#DFEEE7;color:#222222;padding:4px;"><pre><b>XML-RPC (PHP structure)</b><br/>
[id] => int
</pre></div></div><div><div style="border:solid 1px #DEDEDE;background:#FEEBE5;color:#222222;padding:4px;"><pre><b>REST (POST parameters)</b><br/>
id= int
</pre></div></div></span><br/><br/><span style="color:#EA33A6">Response</span><br/><span style="font-size:80%">True if the template has related data<br/><br/><div><div style="border:solid 1px #DEDEDE;background:#FFF1BC;color:#222222;padding:4px;"><pre><b>General structure</b><br/>
int <span style="color:#2A33A6"> <i>//True if the template has related data</i></span><br/>
</pre></div></div><div><div style="border:solid 1px #DEDEDE;background:#DFEEE7;color:#222222;padding:4px;"><pre><b>XML-RPC (PHP structure)</b><br/>
int
</pre></div></div><div><div style="border:solid 1px #DEDEDE;background:#FEEBE5;color:#222222;padding:4px;"><pre><b>REST</b><br/>
<?xml version="1.0" encoding="UTF-8" ?>
<RESPONSE>
<VALUE>int</VALUE>
</RESPONSE>
</pre></div></div></span><br/><br/><span style="color:#EA33A6">Error message</span><br/><br/><span style="font-size:80%"><div><div style="border:solid 1px #DEDEDE;background:#FEEBE5;color:#222222;padding:4px;"><pre><b>REST</b><br/>
<?xml version="1.0" encoding="UTF-8"?>
<EXCEPTION class="invalid_parameter_exception">
<MESSAGE>Invalid parameter value detected</MESSAGE>
<DEBUGINFO></DEBUGINFO>
</EXCEPTION>
</pre></div></div></span><br/><br/><span style="color:#EA33A6">Restricted to logged-in users<br/></span>Yes<br/><br/><span style="color:#EA33A6">Callable from AJAX<br/></span>Yes<br/><br/></div> | Java |
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="flayoutclass"><div class="flayoutclass_first"><table class="tableoutfmt2"><tr><th class="std1"><b>條目 </b></th><td class="std2">軟硬兼施</td></tr>
<tr><th class="std1"><b>注音 </b></th><td class="std2">ㄖㄨㄢ<sup class="subfont">ˇ</sup> |ㄥ<sup class="subfont">ˋ</sup> ㄐ|ㄢ ㄕ</td></tr>
<tr><th class="std1"><b>漢語拼音 </b></th><td class="std2"><font class="english_word">ruǎn yìng jiān shī</font></td></tr>
<tr><th class="std1"><b>釋義 </b></th><td class="std2">委婉和強硬的手段一齊用上。如:<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center>這次會議我方代表軟硬兼施,終於使對方代表讓步而達成協議。<img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center></td></tr>
<tr><th class="std1"><b><font class="fltypefont">附錄</font> </b></th><td class="std2">修訂本參考資料</td></tr>
</td></tr></table></div> <!-- flayoutclass_first --><div class="flayoutclass_second"></div> <!-- flayoutclass_second --></div> <!-- flayoutclass --></td></tr></table>
| Java |
import boto
import mock
import moto
import tempfile
import unittest
from click.testing import CliRunner
from rubberjackcli.click import rubberjack
class CLITests(unittest.TestCase):
@moto.mock_s3_deprecated
@mock.patch('boto.beanstalk.layer1.Layer1.create_application_version')
@mock.patch('boto.beanstalk.layer1.Layer1.update_environment')
def test_deploy(self, cav, ue):
s3 = boto.connect_s3()
s3.create_bucket("laterpay-rubberjack-ebdeploy") # FIXME Remove hardcoded bucket name
with tempfile.NamedTemporaryFile() as tmp:
result = CliRunner().invoke(rubberjack, ['deploy', tmp.name], catch_exceptions=False)
self.assertEquals(result.exit_code, 0, result.output)
@moto.mock_s3_deprecated
@mock.patch('boto.beanstalk.layer1.Layer1.describe_environments')
@mock.patch('boto.beanstalk.layer1.Layer1.update_environment')
def test_promote(self, ue, de):
de.return_value = {
'DescribeEnvironmentsResponse': {
'DescribeEnvironmentsResult': {
'Environments': [
{
'EnvironmentName': 'laterpay-devnull-live', # FIXME Remove hardcoded EnvName
'VersionLabel': 'old',
},
{
'EnvironmentName': 'laterpay-devnull-dev', # FIXME Remove hardcoded EnvName
'VersionLabel': 'new',
},
],
},
},
}
CliRunner().invoke(rubberjack, ['promote'], catch_exceptions=False)
@moto.mock_s3_deprecated
@mock.patch('sys.exit')
@mock.patch('boto.beanstalk.layer1.Layer1.describe_environments')
@mock.patch('boto.beanstalk.layer1.Layer1.update_environment')
def test_promoting_same_version(self, ue, de, se):
de.return_value = {
'DescribeEnvironmentsResponse': {
'DescribeEnvironmentsResult': {
'Environments': [
{
'EnvironmentName': 'laterpay-devnull-live', # FIXME Remove hardcoded EnvName
'VersionLabel': 'same',
},
{
'EnvironmentName': 'laterpay-devnull-dev', # FIXME Remove hardcoded EnvName
'VersionLabel': 'same',
},
],
},
},
}
CliRunner().invoke(rubberjack, ['promote'], catch_exceptions=False)
self.assertTrue(se.called)
@moto.mock_s3_deprecated
def test_sigv4(self):
CliRunner().invoke(rubberjack, ['--sigv4-host', 'foo', 'deploy'], catch_exceptions=False)
@moto.mock_s3_deprecated
@mock.patch('boto.beanstalk.layer1.Layer1.create_application_version')
@mock.patch('boto.beanstalk.layer1.Layer1.update_environment')
def test_deploy_to_custom_environment(self, ue, cav):
s3 = boto.connect_s3()
s3.create_bucket("laterpay-rubberjack-ebdeploy") # FIXME Remove hardcoded bucket name
with tempfile.NamedTemporaryFile() as tmp:
result = CliRunner().invoke(rubberjack, ['deploy', '--environment', 'wibble', tmp.name], catch_exceptions=False)
self.assertEquals(result.exit_code, 0, result.output)
self.assertEqual(cav.call_count, 1, "create_application_version wasn't called, but it should")
self.assertEqual(ue.call_count, 1, "update_environment wasn't called, but it should")
@moto.mock_s3_deprecated
@mock.patch('boto.beanstalk.layer1.Layer1.create_application_version')
@mock.patch('boto.beanstalk.layer1.Layer1.update_environment')
def test_deploy_without_updating_the_environment(self, ue, cav):
s3 = boto.connect_s3()
s3.create_bucket("laterpay-rubberjack-ebdeploy") # FIXME Remove hardcoded bucket name
with tempfile.NamedTemporaryFile() as tmp:
result = CliRunner().invoke(rubberjack, ['deploy', '--no-update-environment', tmp.name], catch_exceptions=False)
self.assertEquals(result.exit_code, 0, result.output)
self.assertEqual(cav.call_count, 1, "create_application_version wasn't called, but it should")
self.assertEqual(ue.call_count, 0, "update_environment was called, but it shouldn't")
@moto.mock_s3_deprecated
@mock.patch('boto.beanstalk.layer1.Layer1.create_application_version')
@mock.patch('boto.beanstalk.layer1.Layer1.update_environment')
def test_deploy_to_custom_bucket(self, ue, cav):
bucket_name = 'rbbrjck-test'
s3 = boto.connect_s3()
s3.create_bucket(bucket_name)
with tempfile.NamedTemporaryFile() as tmp:
result = CliRunner().invoke(rubberjack, ['--bucket', bucket_name, 'deploy', tmp.name], catch_exceptions=False)
self.assertEquals(result.exit_code, 0, result.output)
self.assertEqual(cav.call_count, 1, "create_application_version wasn't called, but it should")
self.assertEqual(ue.call_count, 1, "update_environment wasn't called, but it should")
_, cav_kwargs = cav.call_args
self.assertEqual(bucket_name, cav_kwargs['s3_bucket'])
@moto.mock_s3_deprecated
@mock.patch('boto.beanstalk.layer1.Layer1.update_environment')
@mock.patch('boto.beanstalk.layer1.Layer1.describe_environments')
def test_promote_to_custom_environment(self, de, ue):
CUSTOM_TO_ENVIRONMENT = "loremipsum"
de.return_value = {
'DescribeEnvironmentsResponse': {
'DescribeEnvironmentsResult': {
'Environments': [
{
'EnvironmentName': CUSTOM_TO_ENVIRONMENT,
'VersionLabel': 'old',
},
{
'EnvironmentName': 'laterpay-devnull-dev', # FIXME Remove hardcoded EnvName
'VersionLabel': 'new',
},
],
},
},
}
result = CliRunner().invoke(rubberjack, ['promote', '--to-environment', CUSTOM_TO_ENVIRONMENT], catch_exceptions=False)
self.assertEquals(result.exit_code, 0, result.output)
| Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.