repo_name
stringlengths 4
116
| path
stringlengths 3
942
| size
stringlengths 1
7
| content
stringlengths 3
1.05M
| license
stringclasses 15
values |
---|---|---|---|---|
sebastian-software/edgeapp | src/components/Navigation.js | 832 | import React from "react"
import { injectIntl } from "react-intl"
import { NavLink } from "react-router-dom"
import PropTypes from "prop-types"
import Styles from "./Navigation.css"
function Navigation({ intl }) {
return (
<ul className={Styles.list}>
<li><NavLink exact to="/" activeClassName={Styles.activeLink}>Home</NavLink></li>
<li><NavLink to="/redux" activeClassName={Styles.activeLink}>Redux</NavLink></li>
<li><NavLink to="/localization" activeClassName={Styles.activeLink}>Localization</NavLink></li>
<li><NavLink to="/markdown" activeClassName={Styles.activeLink}>Markdown</NavLink></li>
<li><NavLink to="/missing" activeClassName={Styles.activeLink}>Missing</NavLink></li>
</ul>
)
}
Navigation.propTypes = {
intl: PropTypes.object
}
export default injectIntl(Navigation)
| mit |
farmatholin/gopl-exercises | ch4/ex4_9/ex4_9.go | 608 | package main
import (
"bufio"
"os"
"fmt"
)
func main() {
counts := make(map[string]int)
fileReader, err := os.Open("words.txt")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer fileReader.Close()
scanner := bufio.NewScanner(fileReader)
// Set the split function for the scanning operation.
scanner.Split(bufio.ScanWords)
for scanner.Scan() {
word := scanner.Text()
counts[word]++
}
if err := scanner.Err(); err != nil {
fmt.Fprintf(os.Stderr, "wordfreq: %v\n", err)
os.Exit(1)
}
fmt.Printf("word\t freq\n")
for c, n := range counts {
fmt.Printf("%q\t %d\n", c, n)
}
} | mit |
georgehristov/EPESI | modules/Utils/RecordBrowser/patches/add_help_to_fields.php | 611 | <?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
$recordsets = Utils_RecordBrowserCommon::list_installed_recordsets();
$checkpoint = Patch::checkpoint('recordset');
$processed = $checkpoint->get('processed', array());
foreach ($recordsets as $tab => $caption) {
if (isset($processed[$tab])) {
continue;
}
$processed[$tab] = true;
Patch::require_time(3);
$tab = $tab . "_field";
$columns = DB::MetaColumnNames($tab);
if (!isset($columns['HELP'])) {
PatchUtil::db_add_column($tab, 'help', 'X');
}
$checkpoint->set('processed', $processed);
}
| mit |
monitron/jarvis-ha | lib/web/scripts/capabilities/energy/EnergyMetersView.js | 625 |
const Marionette = require('backbone.marionette');
const MeterValuesView = require('./MeterValuesView.js');
module.exports = class EnergyMetersView extends Marionette.View {
template = Templates['capabilities/energy/meters'];
className() { return 'energy-meters'; }
regions() {
return {
metersByPeriod: '.metersByPeriod'
};
}
modelEvents() {
return {change: 'render'};
}
onRender() {
const metersView = new Marionette.CollectionView({
collection: this.model.metersByPeriod(),
childView: MeterValuesView
});
this.showChildView('metersByPeriod', metersView);
}
}
| mit |
rokups/Urho3D | Source/Tools/Editor/Tabs/ResourceTab.h | 3802 | //
// Copyright (c) 2017-2020 the rbfx project.
//
// 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.
//
#pragma once
#include <EASTL/utility.h>
#include "Tabs/Tab.h"
namespace Urho3D
{
class Asset;
class FileChange;
struct ResourceContextMenuArgs
{
ea::string resourceName_;
};
URHO3D_EVENT(E_RESOURCEBROWSERDELETE, ResourceBrowserDelete)
{
URHO3D_PARAM(P_NAME, Name); // String
}
/// Resource browser tab.
class ResourceTab : public Tab
{
URHO3D_OBJECT(ResourceTab, Tab)
public:
/// Construct.
explicit ResourceTab(Context* context);
/// Render content of tab window. Returns false if tab was closed.
bool RenderWindowContent() override;
/// Clear any user selection tracked by this tab.
void ClearSelection() override;
/// Serialize current user selection into a buffer and return it.
bool SerializeSelection(Archive& archive) override;
/// Signal set when user right-clicks a resource or folder.
Signal<void(const ResourceContextMenuArgs&)> resourceContextMenu_;
protected:
///
void OnLocateResource(StringHash, VariantMap& args);
/// Constructs a name for newly created resource based on specified template name.
ea::string GetNewResourcePath(const ea::string& name);
/// Select current item in attribute inspector.
void SelectCurrentItemInspector();
///
void OnEndFrame(StringHash, VariantMap&);
///
void OnResourceUpdated(const FileChange& change);
///
void ScanAssets();
///
void OpenResource(const ea::string& resourceName);
///
void RenderContextMenu();
///
void RenderDirectoryTree(const eastl::string& path = "");
///
void ScanDirTree(StringVector& result, const eastl::string& path);
///
void RenderDeletionDialog();
///
void StartRename();
///
bool RenderRenameWidget(const ea::string& icon = "");
/// Current open resource path.
ea::string currentDir_;
/// Current selected resource file name.
ea::string selectedItem_;
/// Assets visible in resource browser.
ea::vector<WeakPtr<Asset>> assets_;
/// Cache of directory names at current selected resource path.
StringVector currentDirs_;
/// Cache of file names at current selected resource path.
StringVector currentFiles_;
/// Flag which requests rescan of current selected resource path.
bool rescan_ = true;
/// Flag requesting to scroll to selection on next frame.
bool scrollToCurrent_ = false;
/// State cache.
ValueCache cache_{context_};
/// Frame at which rename started. Non-zero means rename is in-progress.
unsigned isRenamingFrame_ = 0;
/// Current value of text widget during rename.
ea::string renameBuffer_;
};
}
| mit |
hegemonic/catharsis | test/specs/nullable.js | 9138 | const _ = require('lodash');
const en = {
modifiers: require('../../res/en').modifiers
};
const Types = require('../../lib/types');
const optional = {
optional: true
};
const repeatable = {
repeatable: true
};
const nullableNumber = {
type: Types.NameExpression,
name: 'number',
nullable: true
};
const nullableNumberOptional = _.extend({}, nullableNumber, optional);
const nullableNumberOptionalRepeatable = _.extend({}, nullableNumber, optional, repeatable);
const nullableNumberRepeatable = _.extend({}, nullableNumber, repeatable);
const nonNullableObject = {
type: Types.NameExpression,
name: 'Object',
nullable: false
};
const nonNullableObjectOptional = _.extend({}, nonNullableObject, optional);
const nonNullableObjectOptionalRepeatable = _.extend({}, nonNullableObject, optional, repeatable);
const nonNullableObjectRepeatable = _.extend({}, nonNullableObject, repeatable);
module.exports = [
{
description: 'nullable number',
expression: '?number',
parsed: nullableNumber,
described: {
en: {
simple: 'nullable number',
extended: {
description: 'number',
modifiers: {
nullable: en.modifiers.extended.nullable
},
returns: ''
}
}
}
},
{
description: 'postfix nullable number',
expression: 'number?',
newExpression: '?number',
parsed: nullableNumber,
described: {
en: {
simple: 'nullable number',
extended: {
description: 'number',
modifiers: {
nullable: en.modifiers.extended.nullable
},
returns: ''
}
}
}
},
{
description: 'non-nullable object',
expression: '!Object',
parsed: nonNullableObject,
described: {
en: {
simple: 'non-null Object',
extended: {
description: 'Object',
modifiers: {
nullable: en.modifiers.extended.nonNullable
},
returns: ''
}
}
}
},
{
description: 'postfix non-nullable object',
expression: 'Object!',
newExpression: '!Object',
parsed: nonNullableObject,
described: {
en: {
simple: 'non-null Object',
extended: {
description: 'Object',
modifiers: {
nullable: en.modifiers.extended.nonNullable
},
returns: ''
}
}
}
},
{
description: 'repeatable nullable number',
expression: '...?number',
parsed: nullableNumberRepeatable,
described: {
en: {
simple: 'nullable repeatable number',
extended: {
description: 'number',
modifiers: {
nullable: en.modifiers.extended.nullable,
repeatable: en.modifiers.extended.repeatable
},
returns: ''
}
}
}
},
{
description: 'postfix repeatable nullable number',
expression: '...number?',
newExpression: '...?number',
parsed: nullableNumberRepeatable,
described: {
en: {
simple: 'nullable repeatable number',
extended: {
description: 'number',
modifiers: {
nullable: en.modifiers.extended.nullable,
repeatable: en.modifiers.extended.repeatable
},
returns: ''
}
}
}
},
{
description: 'repeatable non-nullable object',
expression: '...!Object',
parsed: nonNullableObjectRepeatable,
described: {
en: {
simple: 'non-null repeatable Object',
extended: {
description: 'Object',
modifiers: {
nullable: en.modifiers.extended.nonNullable,
repeatable: en.modifiers.extended.repeatable
},
returns: ''
}
}
}
},
{
description: 'postfix repeatable non-nullable object',
expression: '...Object!',
newExpression: '...!Object',
parsed: nonNullableObjectRepeatable,
described: {
en: {
simple: 'non-null repeatable Object',
extended: {
description: 'Object',
modifiers: {
nullable: en.modifiers.extended.nonNullable,
repeatable: en.modifiers.extended.repeatable
},
returns: ''
}
}
}
},
{
description: 'postfix optional nullable number',
expression: 'number=?',
newExpression: '?number=',
parsed: nullableNumberOptional,
described: {
en: {
simple: 'optional nullable number',
extended: {
description: 'number',
modifiers: {
nullable: en.modifiers.extended.nullable,
optional: en.modifiers.extended.optional
},
returns: ''
}
}
}
},
{
description: 'postfix nullable optional number',
expression: 'number?=',
newExpression: '?number=',
parsed: nullableNumberOptional,
described: {
en: {
simple: 'optional nullable number',
extended: {
description: 'number',
modifiers: {
nullable: en.modifiers.extended.nullable,
optional: en.modifiers.extended.optional
},
returns: ''
}
}
}
},
{
description: 'postfix repeatable nullable optional number',
expression: '...number?=',
newExpression: '...?number=',
parsed: nullableNumberOptionalRepeatable,
described: {
en: {
simple: 'optional nullable repeatable number',
extended: {
description: 'number',
modifiers: {
nullable: en.modifiers.extended.nullable,
optional: en.modifiers.extended.optional,
repeatable: en.modifiers.extended.repeatable
},
returns: ''
}
}
}
},
{
description: 'postfix optional non-nullable object',
expression: 'Object=!',
newExpression: '!Object=',
parsed: nonNullableObjectOptional,
described: {
en: {
simple: 'optional non-null Object',
extended: {
description: 'Object',
modifiers: {
nullable: en.modifiers.extended.nonNullable,
optional: en.modifiers.extended.optional
},
returns: ''
}
}
}
},
{
description: 'postfix non-nullable optional object',
expression: 'Object!=',
newExpression: '!Object=',
parsed: nonNullableObjectOptional,
described: {
en: {
simple: 'optional non-null Object',
extended: {
description: 'Object',
modifiers: {
nullable: en.modifiers.extended.nonNullable,
optional: en.modifiers.extended.optional
},
returns: ''
}
}
}
},
{
description: 'postfix repeatable non-nullable optional object',
expression: '...Object!=',
newExpression: '...!Object=',
parsed: nonNullableObjectOptionalRepeatable,
described: {
en: {
simple: 'optional non-null repeatable Object',
extended: {
description: 'Object',
modifiers: {
nullable: en.modifiers.extended.nonNullable,
optional: en.modifiers.extended.optional,
repeatable: en.modifiers.extended.repeatable
},
returns: ''
}
}
}
}
];
| mit |
be9/acl9 | test/dummy/app/controllers/acl_helper_method.rb | 232 | class ACLHelperMethod < ApplicationController
access_control :helper => :foo? do
allow :owner, :of => :foo
end
def allow
@foo = Foo.first
render inline: "<div><%= foo? ? 'OK' : 'AccessDenied' %></div>"
end
end
| mit |
issabdo/DIVCODING | app/Application/Controllers/Traits/HelpersTrait.php | 527 | <?php
namespace App\Application\Controllers\Traits;
trait HelpersTrait{
protected function checkIfArray($request){
return is_array($request) ? $request : [$request];
}
protected function createLog($action , $status , $messages = ''){
$data = [
'action' => $action,
'model' => $this->model->getTable(),
'status' => $status,
'user_id' => auth()->user()->id,
'messages' => $messages
];
$this->log->create($data);
}
} | mit |
StudyExchange/PatPractise | pat-basic-level/1023.c | 939 | /* 1023 组个最小数 (20 分)
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
// 处理输入
int n = 10;
int quantities[n];
for (int i = 0; i < n; i++)
{
if (scanf("%d", &quantities[i]) != 1)
return EXIT_FAILURE;
}
// 组装数字
int nums[50] = {0};
int count = 0;
// 找到开头的数字
for (int i = 1; i < n; i++)
{
if (quantities[i] > 0)
{
nums[count] = i;
count++;
quantities[i]--;
break;
}
}
// 组装剩余的数字
for (int i = 0; i < n; i++)
{
while (quantities[i] > 0)
{
nums[count] = i;
count++;
quantities[i]--;
}
}
// 处理输出
for (int i = 0; i < count; i++)
{
printf("%d", nums[i]);
}
return EXIT_SUCCESS;
}
| mit |
epikcraw/ggool | public/Windows 10 x64 (19041.508)/_XPF_MCE_FLAGS.html | 307 | <html><body>
<h4>Windows 10 x64 (19041.508)</h4><br>
<h2>_XPF_MCE_FLAGS</h2>
<font face="arial"> +0x000 MCG_CapabilityRW : Pos 0, 1 Bit<br>
+0x000 MCG_GlobalControlRW : Pos 1, 1 Bit<br>
+0x000 Reserved : Pos 2, 30 Bits<br>
+0x000 AsULONG : Uint4B<br>
</font></body></html> | mit |
Janpot/google-reader-notifier | app/js/services/options.js | 858 | angular.module('Reader.services.options', [])
.factory('options', function($rootScope, $q) {
var controllerObj = {};
options.onChange(function (changes) {
$rootScope.$apply(function () {
for (var property in changes) {
controllerObj[property] = changes[property].newValue;
}
});
});
return {
get: function (callback) {
options.get(function (values) {
$rootScope.$apply(function () {
angular.copy(values, controllerObj);
if (callback instanceof Function) {
callback(controllerObj);
}
});
});
return controllerObj;
},
set: function (values) {
options.set(values);
},
enableSync: options.enableSync,
isSyncEnabled: options.isSyncEnabled
};
}); | mit |
reginad1/skipdamenu | app/controllers/users_controller.rb | 409 | class UsersController < ApplicationController
def index
end
def show
@user = User.find(params[:id])
end
def edit
@user = User.find(params[:id])
end
def update
@user = User.find(params[:id])
if @user.update_attributes(user_params)
@user.geocode
else
render 'edit'
end
end
private
def user_params
params.require(:user).permit(:city, :zip, :name)
end
end
| mit |
Lurk/blog | README.md | 638 | # blog
[](https://travis-ci.org/Lurk/blog)
Weekend project for self education
## backend configuration
create config.local.js on ./server directory with
```
module.exports = {
secret: 'some random text',
port: 3000,
greeting: 'blog server running on http://localhost:',
mongoose: 'mongodb://localhost/blog'
}
```
where:
- secret is random string and it should be defined for security reasons
- port is int, default is 3000
- greeting is text which will be printed on console when server starts successfully
- mongoose is mongodb connection string | mit |
malept/guardhaus | main/openssl_sys/ssl/fn.SSL_CTX_set_read_ahead.html | 433 | <!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../openssl_sys/fn.SSL_CTX_set_read_ahead.html">
</head>
<body>
<p>Redirecting to <a href="../../openssl_sys/fn.SSL_CTX_set_read_ahead.html">../../openssl_sys/fn.SSL_CTX_set_read_ahead.html</a>...</p>
<script>location.replace("../../openssl_sys/fn.SSL_CTX_set_read_ahead.html" + location.search + location.hash);</script>
</body>
</html> | mit |
Densaugeo/TriDIYBio | README.md | 288 | # TriDIYBio
Web site for TriDIYBio
## Workflow
Setup:
- `git clone https://github.com/Densaugeo/TriDIYBio.git`
- `npm install`
Making changes:
- `git pull`
- Make your changes and save files
- `node gen.js`
- `node test_server.js`
- `git commit -am "Commit message"`
- `npm run push`
| mit |
atmire/dsember-core | addon/adapters/application.js | 949 | import Ember from 'ember';
import DS from 'ember-data';
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
export default DS.RESTAdapter.extend(DataAdapterMixin, {
authorizer: 'authorizer:dspace',
initENVProperties: Ember.on('init', function() {
let ENV = this.container.lookupFactory('config:environment');
if (Ember.isPresent(ENV.namespace)) {
this.set('namespace', ENV.namespace);
}
if (Ember.isPresent(ENV.host)) {
this.set('host', ENV.host);
}
}),
//coalesceFindRequests: true, -> commented out, because it only works for some endpoints (e.g. items) and not others (e.g. communities)
ajax(url, type, hash) {
if (Ember.isEmpty(hash)) {
hash = {};
}
if (Ember.isEmpty(hash.data)) {
hash.data = {};
}
if (type === "GET") {
hash.data.expand = 'all'; //add ?expand=all to all GET calls
}
return this._super(url, type, hash);
}
});
| mit |
Strassengezwitscher/Strassengezwitscher | crowdgezwitscher/base/static/css/login.css | 962 | html {
height: 100%;
}
body {
background: #538eb8; /* For browsers that do not support gradients */
background: -webkit-linear-gradient(left top, #538eb8, #ffd044); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(bottom right, #538eb8, #ffd044); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(bottom right, #538eb8, #ffd044); /* For Firefox 3.6 to 15 */
background: linear-gradient(to bottom right, #538eb8, #ffd044); /* Standard syntax */
}
.login-panel {
position:absolute;
top:25%;
left: 50%;
width: 400px;
transform: translate(-50%, -25%);
}
.form-login input[type="text"]
{
margin-bottom: -1px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.form-login input[type="password"]
{
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.warning {
background-color: #fcf8e3;
}
.error {
background-color: #f2dede;
}
| mit |
mxchelle/PhillyAIMSApp | packages/custom/lib/callbacks.js | 148 | function alertThanks (post) {
alert("Thanks for submitting a post!");
return post;
}
Telescope.callbacks.add("postSubmitClient", alertThanks);
| mit |
herofei/study | 工作杂乱知识点记录/tc总结.md | 61072 | 1. ping命令与ICMP 协议
ping」是用来探测本机与网络中另一主机之间是否可达的命令,如果两台主机之间ping不通,则表明这两台主机不能建立起连接。ping是定位网络通不通的一个重要手段。
ping 命令是基于 ICMP 协议来工作的,「 ICMP 」全称为 Internet 控制报文协议(Internet Control Message Protocol)。ping 命令会发送一份ICMP回显请求报文给目标主机,并等待目标主机返回ICMP回显应答。因为ICMP协议会要求目标主机在收到消息之后,必须返回ICMP应答消息给源主机,如果源主机在一定时间内收到了目标主机的应答,则表明两台主机之间网络是可达的。
详见:
- [每天都在用的Ping命令,它到底是什么?](https://zhuanlan.zhihu.com/p/45110873)
- [ICMP协议与ping原理](https://www.s0nnet.com/archives/icmp-ping)
2. telnet命令
telnet可以测试目的IP某个端口的连通性,假设目的IP为10.14.40.17,目的端口为22,telnet 10.14.40.17 22,如果进入一个可以输入指令的页面,则说明连通成功。如果最后报错,则说明连通失败。
详见:
- [利用Telnet进行HTTP访问过程的协议分析](https://zhuanlan.zhihu.com/p/61352013)
- [win10系统下用telnet完成一次简单的HTTP请求](https://blog.csdn.net/Mr_DouDo/article/details/79771303)
3. 调试线上代码的技巧
- 直接通过代理工具(fiddler、whistle等)将线上的静态资源请求代理到本地,这样就可以在本地调试线上环境的代码
- 直接在本地起个服务,然后将所有后台端口请求代理(fiddler、whistle等)到线上环境,这样也可以在本地调试线上环境的代码
- 如果是Vue的项目的话,可以通过以下方式开启调试模式
```
步骤如下:
1. 找到Vue构造函数如window.Vue(可以通过搜索Vue的某个实例方法,然后打个断点,将this(此时的this指向Vue)挂载到window上。Vue实例化挂载的元素节点的__vue__属性指向它的vue实例,也可以通过该实例去找Vue构造函数)
1.1. 或者可以找到挂载vue实例的dom节点, 通过${dom}.__vue__.constructor.super获取Vue构造函数
2. Vue.config.devtools=true
3. __VUE_DEVTOOLS_GLOBAL_HOOK__.emit('init', Vue)
```
那么只需要找到页面中的Vue,就可非常方便的打开开发者工具了。
在使用Vue源码的生命周期lifecycle.js代码中,Vue会将vm实例保存在$el元素的 __vue__ 对象上
```js
// @name Vue调试
// @description 在生产环境开启Vue.js devtools调试
(function () {
function findVueInstance($el) {
// console.log(`Finding Vue: ${$el.tagName}`)
let __vue__ = $el.__vue__;
if (__vue__) {
return __vue__;
} else {
let tagName = $el.tagName;
if (["SCRIPT", "STYLE"].indexOf(tagName) === -1) {
let children = [...$el.children];
children.some($child => {
__vue__ = findVueInstance($child);
return __vue__;
});
return __vue__;
} else {
return;
}
}
}
function getVue(obj) {
if (!!obj && obj._isVue) {
let $constructor = obj.constructor;
if (
$constructor.config &&
typeof $constructor.config.devtools === "boolean"
) {
return obj.constructor;
}
if (
$constructor.super &&
$constructor.super.config &&
typeof $constructor.super.config.devtools === "boolean"
) {
return $constructor.super;
}
}
return;
}
setTimeout(() => {
if (
typeof window.__VUE_DEVTOOLS_GLOBAL_HOOK__ === "object" &&
typeof __VUE_DEVTOOLS_GLOBAL_HOOK__.emit === "function"
) {
let $vm = findVueInstance(document.querySelector("body"));
let _Vue = getVue($vm);
if (_Vue) {
_Vue.config.devtools = true;
__VUE_DEVTOOLS_GLOBAL_HOOK__.emit("init", _Vue);
console.log(
`已启用Vue生产环境调试,如果无法看到Vue调试Tab,请关闭DevTools再打开`
);
}
}
}, 500);
})();
```
4. 利用Traceroute定位网络问题
- [路由追踪程序Traceroute分析与科普](https://www.freebuf.com/articles/network/118221.html)
5. 前端权限管理机制
6. 自定义事件需要额外传参
```
子组件:
this.emit('test', data);
父组件(arguments拿到原来子组件传过来的参数,后面部分继续额外传参):
<sub-item @test="doSth(arguments, 'another params')">
```
7. git Hooks
详见: https://git-scm.com/book/zh/v2/%E8%87%AA%E5%AE%9A%E4%B9%89-Git-Git-%E9%92%A9%E5%AD%90
https://segmentfault.com/a/1190000016357480
一般会在git的pre-commit钩子中进行lint检测,如果该钩子以非零值退出,Git 将放弃此次提交。
可以用 git commit --no-verify 来绕过这个环节
8. prop
prop 是单向数据流, 传进来的值,子组件不能改动,否则会报错。如果要在prop的基础上实现双向绑定,应该使用.sync修饰符,并且子组件要抛出对应的时间。如下:
```
// 父组件
<son-component :title.sync="title"></son-component>
// 子组件
this.$emit('update:title', newTitle)
```
9. git 设置对文件大小写敏感`
git 会根据操作系统的默认配置设置是否区分文件大小写, Windows和mac默认不区分文件名大小写的, linux默认区分大小写. 在Windows中, 当你创建一个文件后, 叫 readme.md 写入内容后 提交到线上代码仓库. 然后你在本地修改文件名为 Readme.md 接着你去提交, 发现代码没有变化.
为了避免这种情况,可以通过改变git的默认设置:
```bash
### 默认是true
git config --get core.ignorecase
## 更给设置
git config core.ignorecase false
```
10. RPC、HTTP服务的区别
RPC是远端过程调用,其调用协议通常包含传输协议和序列化协议。RPC的协议可以多种,包括TCP或者HTTP等形式都可以。RPC框架会在普通的协议传输上进一步面向服务进行封装。HTTP服务则只是一个狭义的某种协议的传输请求。
- [既然有 HTTP 请求,为什么还要用 RPC 调用?](https://www.zhihu.com/question/41609070)
- [深入理解 RPC](https://juejin.im/entry/57c866230a2b58006b204712)
- [聊聊 Node.js RPC(一)— 协议](https://www.yuque.com/egg/nodejs/dklip5)
- [聊聊 Node.js RPC(二)— 服务发现](https://www.yuque.com/egg/nodejs/mhgl9f)
11. peerDependencies
peerDependencies的目的是提示宿主环境去安装满足插件peerDependencies所指定依赖的包,然后在插件import或者require所依赖的包的时候,永远都是引用宿主环境统一安装的npm包,最终解决插件与所依赖包不一致的问题。
- [探讨npm依赖管理之peerDependencies](https://www.cnblogs.com/wonyun/p/9692476.html)
- [Peer Dependencies](https://nodejs.org/zh-cn/blog/npm/peer-dependencies/)
- [peerDependencies介绍及简析](https://arayzou.com/2016/06/23/peerDependencies%E4%BB%8B%E7%BB%8D%E5%8F%8A%E7%AE%80%E6%9E%90/)
12. 前端路由的原理
要想改变url并且页面不刷新,有以下方式:
1. 改变location的hash
2. 使用history的相关接口(pushState, replaceState, go, back, forward)
根据以上原理,通过监听hashchange事件(hash模式的路由)即可实现前端路由
通过监听popstate事件(history模式的路由)也可实现前端路由, 但有一点需要注意的是, popstate 事件只能监听除 history.pushState() 和 history.replaceState() 外 url 的变化, 所以还得对pushState和replaceState进行额外封装处理
- [彻底搞懂路由跳转:location 和 history 接口](https://segmentfault.com/a/1190000014120456)
- [MDN history](https://developer.mozilla.org/en-US/docs/Web/API/Window/history)
13. 如果想要改变页面url的query或者path而不引起刷新,可以使用history对象的相关接口,使用pushState和replaceState
- [MDN 在history中跳转]()
14. 前端大文件上传、切片上传(主要基于FileReader和Blob实现)、并行上传
- [前端大文件上传](https://juejin.im/post/5cf765275188257c6b51775f)
14. 理解DOMString、Document、FormData、Blob、File、ArrayBuffer数据类型
- [理解DOMString、Document、FormData、Blob、File、ArrayBuffer数据类型](https://www.zhangxinxu.com/wordpress/2013/10/understand-domstring-document-formdata-blob-file-arraybuffer/)
- [Blob对象](https://github.com/pfan123/Articles/issues/10)
- [细说Web API中的Blob](https://juejin.im/post/59e35d0e6fb9a045030f1f35)
- [前端图片canvas,file,blob,DataURL等格式转换](https://juejin.im/post/5b5187da51882519ec07fa41)
- [javascript处理二进制之ArrayBuffer](https://juejin.im/post/5c36a4ec6fb9a049d97566f2)
- [阮一峰 - 二进制数组](https://javascript.ruanyifeng.com/stdlib/arraybuffer.html)
- [MDN - ArrayBuffer](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)
15. npm script和npm钩子的关系
[也许你不知道的npm-scripts](https://juejin.im/post/5caeffc6f265da03587bea9f)
[npm文档](https://docs.npmjs.com/misc/scripts)
[npm 相关知识点汇总](https://juejin.im/post/5d08d3d3f265da1b7e103a4d)
1. 用 githook、husky 和 lint-staged 构建代码检查工作流
- [官方文档 - 自定义 Git 钩子](https://git-scm.com/book/zh/v2/%E8%87%AA%E5%AE%9A%E4%B9%89-Git-Git-%E9%92%A9%E5%AD%90)
- [使用 Githook 实现团队 Coding Review 流程](https://www.jianshu.com/p/935409ce4c9a)
- [用 Git 钩子进行简单自动部署](https://aotu.io/notes/2017/04/10/githooks/index.html)
- [用 husky 和 lint-staged 构建超溜的代码检查工作流](https://segmentfault.com/a/1190000009546913)
- [【工具推荐】使用 husky 避免糟糕的 git commit](https://zhuanlan.zhihu.com/p/35913229)
- [手牵手使用Husky & Nodejs自定义你的Git钩子 ](https://github.com/PaicFE/blog/issues/10)
husky是一个npm包,安装后,可以快速的根据package.json配置创建git hook 脚本。yorkie是尤大从husky项目fork过来的进一步修改,并集成于vue-cli中,两者用法上的区别在以下:
Before
```json
{
"scripts": {
"precommit": "foo"
}
}
```
After
```json
{
"gitHooks": {
"pre-commit": "foo"
}
}
```
1. 快速打平数组的方法: join
对于多维数组,join会递归调用数组的toString方法将数组转换成字符串,再用分隔符隔开(没传分隔符默认是','),但分隔符只对最开始的第一维有效
```javascript
[[1,2, [7,8]], [3,4]].join() // 1,2,7,8,3,4
[[1,2, [7,8]], [3,4]].join('-') // 1,2,7,8-3,4
[[1,2, [7,8]], [3,4]].join().replace(/,/g, '-') // 1-2-7-8-3-4
[[1,2, [7,8]], [3,4]].toString() // 1,2,7,8,3,4
```
详见:
- [ES5/标准 ECMAScript 内置对象](https://www.w3.org/html/ig/zh/wiki/ES5/%E6%A0%87%E5%87%86_ECMAScript_%E5%86%85%E7%BD%AE%E5%AF%B9%E8%B1%A1#Array.prototype.join_.28separator.29)
18. nginx server_name的作用
在server_name这个配置中,nginx仅仅检查请求的“Host”头以决定该请求应由哪个虚拟主机来处理。如果Host头没有匹配任意一个虚拟主机,或者请求中根本没有包含Host头,那nginx会将请求分发到定义在此端口上的默认虚拟主机。在以上配置中,第一个被列出的虚拟主机即nginx的默认虚拟主机——这是nginx的默认行为。而且,可以显式地设置某个主机为默认虚拟主机,即在"listen"指令中设置"default_server"参数。
如果nginx中只配置一个server域的话,则nginx是不会去进行server_name的匹配的。因为只有一个server域,也就是这有一个虚拟主机,那么肯定是发送到该nginx的所有请求均是要转发到这一个域的,即便做一次匹配也是没有用的。还不如干脆直接就省了。如果一个http域的server域有多个,nginx才会根据$hostname去匹配server_name进而把请求转发到匹配的server域中。此时的匹配会按照匹配的优先级进行,一旦匹配成功进不会再进行匹配。
详见以下链接:
- [Nginx如何处理一个请求](https://tengine.taobao.org/nginx_docs/cn/docs/http/request_processing.html)
- [nginx 中通过server_name listen的方式配置多个服务器](https://blog.csdn.net/thlzjfefe/article/details/84489311)
- [理解Nginx中Server和Location的匹配逻辑](https://juejin.im/post/5c89f96f518825573a5e630b)
- [谁说前端不需要懂-Nginx反向代理与负载均衡](https://juejin.im/post/5b01336af265da0b8a67e5c9)
- [官方文档 - server_name](http://nginx.org/en/docs/http/server_names.html)
- [8分钟带你深入浅出搞懂Nginx](https://zhuanlan.zhihu.com/p/34943332)
19. 当用户最小化浏览器窗口或者切换到其他标签,可以通过Page Visibility API进行判断,这个 API 会发送一个 `visibilitychange` 事件,这样事件监听器就能感知到状态的变化了。对于一些页面定时请求,可以给予这个API进行判断,但页面切换和缩小的时候减小定时请求数,提高性能。不少视频网站也会根据这个API禁止防止用户进行切换。详见以下链接:
- [MDN Page Visibility API](https://developer.mozilla.org/zh-CN/docs/Web/API/Page_Visibility_API)
- [ifvisible.js, 对Visibility API的封装](https://github.com/serkanyersen/ifvisible.js)
20. Symbol
Symbol 主要的两个作用是:
- (1)防止属性名冲突
- (2)模拟私有属性
详见以下链接:
[JavaScript 为什么要有 Symbol 类型?](https://juejin.im/post/5c9042036fb9a070eb266fd6)
[ES6入门 - Symbol](http://es6.ruanyifeng.com/#docs/symbol)
[深入浅出 ES6(八):Symbols](https://www.infoq.cn/article/es6-in-depth-symbols)
21. 生成水印的方式(为了防止水印被上层的元素遮住,水印一般设置在顶层)
- (1) 通过canvas 对水印的文字生成图片,然后通过canvas.toDataURL将图片转换成base64的dataURL, 设为顶层水印元素的背景图(由于小程序中的canvas没有toDataURL方法, 可使用wx.canvasGetImageData接口获取其Uint8ClampedArray图像像素点数据, 然后通过upng.js库将其转换成base64)
- (2) 通过dom节点生成,即在顶层水印元素那里添加文字,设置成半透明显示
- 还有一要点是顶层元素需设置pointer-events:none
```javascript
// 常见的水印生成的canvas代码
let canvas
let ctx
// merge the default value
function mergeOptions(options) {
return Object.assign({
width: 250,
height: 80,
color: '#a0a0a0',
alpha: 0.8,
font: '10px Arial'
}, options)
}
/**
* alimask( text, options ) -> string
* - text (String): this text on water mask.
* - options(Object): water mask options.
* With keys:
{
width: 250,
height: 80,
color: '#ebebeb',
alpha: 0.8,
font: '10px Arial'
}
*
* return base64 of background water mask image.
* */
export default function(text, options) {
if (!canvas || !ctx) {
canvas = document.createElement('canvas')
ctx = canvas && canvas.getContext && canvas.getContext('2d')
if (!canvas || !ctx) return '' // if not exist also, then return blank.
}
const opts = mergeOptions(options)
const { width } = opts
const { height } = opts
canvas.width = width
canvas.height = height
ctx.clearRect(0, 0, width, height) // clear the canvas
// ctx.globalAlpha = 0 // backgroud is alpha
ctx.fillStyle = 'white' // no need because of alipha = 0;
ctx.fillRect(0, 0, width, height)
ctx.globalAlpha = opts.alpha // text alpha
ctx.fillStyle = opts.color
ctx.font = opts.font
ctx.textAlign = 'left'
ctx.textBaseline = 'bottom'
ctx.translate(width * 0.1, height * 0.9) // margin: 10
ctx.rotate(-Math.PI / 12) // 15 degree
ctx.fillText(text, 0, 0)
return canvas.toDataURL()
}
```
```css
/* canvas中的css代码 */
.watermark {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
pointer-events: none;
z-index: 9;
opacity: .1;
}
```
详见:
- [小程序--页面添加水印](https://juejin.im/post/5c8c8384e51d4509942b9249)
- [MDN - HTMLCanvasElement.toDataURL()](https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement/toDataURL)
- [mdn - pointer-events](https://developer.mozilla.org/zh-CN/docs/Web/CSS/pointer-events)
- [CSS3 pointer-events:none应用举例及扩展](https://www.zhangxinxu.com/wordpress/2011/12/css3-pointer-events-none-javascript/)
- [小程序官方文档 - wx.canvasGetImageData](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.canvasGetImageData.html)
22. 实现类似element UI的固定列
- [一起来聊聊table组件的固定列](https://blog.kaolafed.com/2017/12/25/%E4%B8%80%E8%B5%B7%E6%9D%A5%E8%81%8A%E8%81%8Atable%E7%BB%84%E4%BB%B6%E7%9A%84%E5%9B%BA%E5%AE%9A%E5%88%97/)
23. sass-loader的导入
webpack 提供一种解析文件的高级的机制。sass-loader 使用 Sass 的 custom importer 特性,将所有的 query 传递给 webpack 的解析引擎(resolving engine)。只要它们前面加上 ~,告诉 webpack 它不是一个相对路径,这样就可以 import 导入 node_modules 目录里面的 sass 模块:
```javascript
@import "~bootstrap/dist/css/bootstrap";
```
重要的是,只在前面加上 ~,因为 ~/ 会解析到主目录(home directory)。webpack 需要区分 bootstrap 和 ~bootstrap,因为 CSS 和 Sass 文件没有用于导入相关文件的特殊语法。@import "file" 与 @import "./file"; 这两种写法是相同的
```javascript
@import "~@/bootstrap/dist/css/bootstrap";
```
```javascript
{
resolve: {
alias: {
'@': resolve('src')
}
}
}
```
在以上例子中, @代表在webpack配置alias中的src目录, ~代表着项目根目录。
- [vue scss加载配置以及~@的使用](https://www.yuque.com/yiruans/qdnote/ur7d9q?language=en-us)
- [webpack中文文档 sass-loader](https://webpack.docschina.org/loaders/sass-loader/)
24. 禁止复制(或者修改复制的内容)
禁止操作:
```javascript
// 禁止右键菜单
document.body.oncontextmenu = e => {
console.log(e, '右键');
return false;
// e.preventDefault();
};
// 禁止文字选择
document.body.onselectstart = e => {
console.log(e, '文字选择');
return false;
// e.preventDefault();
};
// 禁止复制
document.body.oncopy = e => {
console.log(e, 'copy');
return false;
// e.preventDefault();
}
// 禁止剪切
document.body.oncut = e => {
console.log(e, 'cut');
return false;
// e.preventDefault();
};
// 禁止粘贴
document.body.onpaste = e => {
console.log(e, 'paste');
return false;
// e.preventDefault();
};
// css 禁止文本选择 这样不会触发js
body {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
```
修改操作:
```javascript
document.body.addEventListener('copy', function(e) {
const warningText = '数据管理内容禁止复制粘贴!'
let clipboardData = (e.clipboardData || window.clipboardData)
clipboardData.setData('text/plain', warningText)
console.warn(warningText)
e.preventDefault()
})
```
读取操作:
```javascript
let copyFont = window.getSelection(0).toString(); // 被复制的文字
```
* 详见[前端er怎样操作剪切复制以及禁止复制+破解等](https://juejin.im/post/5b66993ee51d451924734c35)
25. 计算指数时,可以使用 ** 运算符。
```javascript
// bad
const binary = Math.pow(2, 10);
// good
const binary = 2 ** 10;
```
26. webview中的input框被弹起的键盘遮挡的问题
```JavaScript
// 简单的判断
listenerKeyboardChange() {
if (IS_ANDROID) {
const originHeight = document.documentElement.clientHeight;
window.addEventListener('resize', (event) => {
const resizeheight = document.documentElement.clientHeight;
console.log('resize documentElement.clientHeight:', document.documentElement.clientHeight);
if (resizeheight < originHeight) {
console.log('Android 键盘已打开', event);
this.props.onKeyboardOpen(event);
} else {
console.log('Android 键盘已收起', event);
this.props.onKeyboardClose(event);
}
}, false);
}
if (IS_IOS) {
this.inputEle.current.addEventListener('focus', (event) => {
console.log('iOS 键盘已打开', event);
this.props.onKeyboardOpen(event);
}, false);
this.inputEle.current.addEventListener('blur', (event) => {
console.log('iOS 键盘已收起', event);
this.props.onKeyboardClose(event);
}, false);
}
}
```
更多参考:
* [如何用 js 获取虚拟键盘高度?(适用所有平台)](https://segmentfault.com/a/1190000010693229)
* [搜遍整个谷歌, 只有我是在认真解决安卓端hybrid app键盘遮挡输入框的问题](https://zhuanlan.zhihu.com/p/86582914)
27. CSS多行文字省略号
```css
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-line-clamp:2; (两行文字)
-webkit-box-orient:vertical;
```
更多参考:
* [CSS单行、多行文本溢出显示省略号](https://segmentfault.com/a/1190000009262433)
28. js库实现按需加载的实现
```
import { Button } from 'antd';
```
像这样的形式导入某个组件, 通常情况下会加载整个antd组件库, 再从整个库中导入其中的Button组件, 这会影响应用的网络性能
所以一般可通过这种形式实现按需加载
```
import Button from 'antd/lib/button';
import 'antd/es/button/style'; // 或者 antd/es/button/style/css 加载 css 文件
```
但是如果你使用了 babel,那么可以使用 babel-plugin-import 来进行按需加载,加入这个插件后。你可以仍然这么写:
```
import { Button } from 'antd';
```
这个插件的作用是, 会帮你转换成 antd/lib/xxx 的写法。另外此插件配合 style 属性可以做到模块样式的按需自动加载。
详见如下:
* [官方文档 - antd 按需加载](https://ant.design/docs/react/getting-started-cn#%E6%8C%89%E9%9C%80%E5%8A%A0%E8%BD%BD)
* [实现antd的按需加载](https://segmentfault.com/a/1190000016430794)
* [babel-plugin-import](https://github.com/ant-design/babel-plugin-import)
* [你的Tree-Shaking并没什么卵用](https://zhuanlan.zhihu.com/p/32831172)
29. sideEffects
在一个纯粹的 ESM 模块世界中,识别出哪些文件有副作用很简单。然而,我们的项目无法达到这种纯度,所以,此时有必要向 webpack 的 compiler 提供提示哪些代码是“纯粹部分”。 —— 《webpack 文档》
注意:样式部分是有副作用的!即不应该被 tree-shaking!
若是直接声明 sideEffects 为 false,那么打包时将不包括样式!所以应该像下面这样配置:
```json
{
"sideEffects": [ "*.sass", "*.scss", "*.css" , "*.vue"]
}
```
参考, 以下内容部分已过期, 注意甄别:
- [体积减少80%!释放webpack tree-shaking的真正潜力](https://juejin.im/post/5b8ce49df265da438151b468)
- [Tree-Shaking性能优化实践 - 原理篇](https://juejin.im/post/5a4dc842518825698e7279a9)
- [Tree-Shaking性能优化实践 - 实践篇](https://juejin.im/post/5a4dca1d518825128654fa78)
29. nginx配置总结
* [Linux运维 | nginx访问控制与参数调优](https://segmentfault.com/a/1190000018505993)
* [Nginx 配置简述](https://www.barretlee.com/blog/2016/11/19/nginx-configuration-start/)
30. vscode 源码开发及调试
* [让 VSCode 在本地 Run 起来](https://www.barretlee.com/blog/2019/10/23/vscode-study-01-start/)
* [带你开发和调试 VS Code 源码](https://www.barretlee.com/blog/2019/11/01/vscode-study-02-debugging/)
31. nodejs 断点调试的原理
* [解密 VS Code 断点调试的原理](https://www.barretlee.com/blog/2019/11/15/vscode-study-03-debug-protocol/)
32. 检测项目中 dependencies 和 devdependencies 无用的依赖
* [depcheck 工具](https://www.npmjs.com/package/depcheck)
33. git rebase [branch]、git rebase、git merge --squash [branch]的区别
#### git rebase [branch]
```bash
# 假设当前为feature1分支, 而且master分支领先该feature若干的提交
git rebase master
```
* 首先,git 会找到 feature1 分支和master的共同源节点, 从该节点开始的feature1 分支 里面的每个 commit 取消掉;
* 其次,把上面的操作临时保存成 patch 文件,存在 .git/rebase 目录下;
* 然后,把 feature1 分支更新到最新的 master 分支;
* 最后,把上面保存的 patch 文件应用到 feature1 分支上;
* 中间如果有冲突需要处理完冲突再输入git rebase --continue完成最终合并
#### git rebase
```bash
git rebase -i h78df3
```
git rebase -i [log hashID]可以将当前分支中的多次提交合并成一个提交记录, 可以保持分支提交记录的整洁性.
#### git merge --squash [branch]
```bash
# 假设当前为master分支, 需要合并feature1的若干次提交
git merge --squash feature1
```
* 首先,git 会将feature1的所有改动迁移过来,但是并不迁移提交记录
* 输入git status, 会发现一堆来自feature1的新增改动
* 这个时候需要你手动输入git add和git commit完成提交, 提交记录和提交信息来源于你, 而不是feature1的owner
#### 总结
(1) git rebase 可以尽可能保持 master 分支干净整洁,并且易于识别 author
(2) git merge --squash 也可以保持 master 分支干净,但是 master 中 author 都是 maintainer,而不是原 owner
(3) merge 不能保持 master 分支干净,但是保持了所有的 commit history,大多数情况下都是不好的,个别情况挺好
(4) git rebase 会改写提交历史, 是个很危险的操作, 如果分支已经push到线上的话, 切记要慎重使用, 否则很容易引起代码冲突
参考:
- [merge squash 和 merge rebase 区别](https://liqiang.io/post/difference-between-merge-squash-and-rebase)
- [彻底搞懂 Git-Rebase](http://jartto.wang/2018/12/11/git-rebase/)
- [Learn Version Control with Git - Rebase 代替合并](https://www.git-tower.com/learn/git/ebook/cn/command-line/advanced-topics/rebase)
- [git merge –squash介绍](https://www.cnblogs.com/lookphp/p/5799533.html)
34. yaml配置文件教程
详见: [YAML 语言教程](http://www.ruanyifeng.com/blog/2016/07/yaml.html)
35. js、css加载监控与重试
- [CSS文件动态加载(续)—— 残酷的真相](https://www.cnblogs.com/chyingp/archive/2013/03/03/how-to-judge-if-stylesheet-loaded-successfully.html)
- [谈一谈CDN的JS,CSS文件加载出错主域名重试的问题](https://imweb.io/topic/5923bf009d67101c034e77ea)
36. 关于CDN、CDN回源、DNS、CNAME以及GSLB的一系列知识点
- [DNS 原理入门](http://www.ruanyifeng.com/blog/2016/06/dns.html)
- [关于 cdn、回源等问题一网打尽](https://juejin.im/post/5af46498f265da0b8d41f6a3#comment)
- [面向前端的CDN原理介绍](https://github.com/renaesop/blog/issues/1)
- [CDN工作原理(CNAME)](https://blog.csdn.net/heluan123132/article/details/73331511)
- [CDN与DNS知识汇总](http://hpoenixf.com/DNS%E4%B8%8ECDN%E7%9F%A5%E8%AF%86%E6%B1%87%E6%80%BB.html)
- [工程师最容易搞错的域名知识](https://juejin.im/post/5d37cf70e51d4510664d17d3)
- [这就是CDN回源原理和CDN多级缓存啊!](https://cloud.tencent.com/developer/article/1439913)
- [全局负载均衡GSLB学习笔记](https://jjayyyyyyy.github.io/2017/05/17/GSLB.html)
- [GSLB概要和实现原理](https://chongit.github.io/2015/04/15/GSLB%E6%A6%82%E8%A6%81%E5%92%8C%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86/)
- [作为一名程序员,你真正了解CDN技术吗?](https://juejin.im/post/5dd3d57b51882521d417a33f)
- [CDN加速原理](https://www.jianshu.com/p/1dae6e1680ff)
- [也许是史上最全的一次CDN详解](https://zhuanlan.zhihu.com/p/28940451)
- [根域名的知识](http://www.ruanyifeng.com/blog/2018/05/root-domain.html)
如何找到离用户最近的 CDN 节点(CDN 是如何就近返回资源的)?
1)本地 DNS 服务器会将 static.xxx.example.cdn.com 会向第一层 GSLB 全局负载均衡发起请求,第一层全局负载均衡会根据用户所在运营商网络分析,比如移动运营商,返回 CNAME 到如 static.yd.example.cdn.com 域名地址。
2)本地 DNS 服务器会继续向第二层 GSLB 全局负载均衡发起请求,第二层全局负载均衡依据 DNS 地理位置判断,返回 SLB CDN 负载均衡地址。
3)本地 DNS 服务器从返回的多个 CDN 节点 IP 中,可以通过本地简单轮询的方式去选择一个 CDN IP 访问。
此时,最终通过 GSLB 全局负载均衡找到的这些 CDN 节点,就是离用户最近的 CDN 节点了。
37. 持续集成、持续交付、持续部署
- [持续集成是什么?](http://www.ruanyifeng.com/blog/2015/09/continuous-integration.html)
38. 网站全站升级https的流程:
- [HTTPS 升级指南](http://www.ruanyifeng.com/blog/2016/08/migrate-from-http-to-https.html)
39. 唤端(唤起app)的实现及相关原理
- [H5唤起APP指南(附开源唤端库)](https://juejin.im/post/5b7efb2ee51d45388b6af96c)
- [Web 唤起 Android app 的实现及原理](https://johnnyshieh.me/posts/web-evoke-app/)
- [Android 上玩转 DeepLink:如何最大程度的向 App 引流](https://medium.com/@zhoulujue/android-%E4%B8%8A%E7%8E%A9%E8%BD%AC-deeplink-%E5%A6%82%E4%BD%95%E6%9C%80%E5%A4%A7%E7%A8%8B%E5%BA%A6%E7%9A%84%E5%90%91-app-%E5%BC%95%E6%B5%81-5da646402c29)
40. 浅析a标签的download属性
- [浅析 HTML5 中的 download 属性](https://zhuanlan.zhihu.com/p/58888918)
41. 关于https、HSTS和mixed content
- [关于启用 HTTPS 的一些经验分享(一)](https://imququ.com/post/sth-about-switch-to-https.html)
- [MDN - MixedContent](https://developer.mozilla.org/zh-CN/docs/Security/MixedContent)
- [什么是混合内容?](https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content?hl=zh-cn)
42. lerna管理前端packages
- [lerna管理前端packages的最佳实践](http://www.sosout.com/2018/07/21/lerna-repo.html)
- [Lerna 中文教程详解](https://juejin.im/post/5ced1609e51d455d850d3a6c)
43. Vue项目自动转换 px 为 rem,高保真还原设计图
- [Vue项目自动转换 px 为 rem,高保真还原设计图](https://juejin.im/post/5a716c4c6fb9a01cb42cac4b)
44. 解决 canvas 在高清屏中绘制模糊的问题
基础知识点:
- 要设置canvas的画布大小,使用的是 canvas.width 和 canvas.height;
- 要设置画布的实际渲染大小,使用的 style 属性或CSS设置的 width 和height,只是简单的对画布进行缩放。
2倍屏幕下示例代码:
```html
<canvas width="640" height="800" style="width:320px; height:400px"></canvas>
```
canvas的实际大小的640px × 800px,但是实际渲染到页面的大小是320px × 400px,相当于缩小一倍来显示。
45. 移动端开发适配注意事项
- [关于移动端适配,你必须要知道的](https://juejin.im/post/5cddf289f265da038f77696c#heading-0)
- [移动端适配方案-让分辨率来的更猛烈些吧!](https://juejin.im/post/5bc7fb9ef265da0acd20ebeb#heading-0)
46. 理解DOMString、Document、FormData、Blob、File、ArrayBuffer数据类型
- [理解DOMString、Document、FormData、Blob、File、ArrayBuffer数据类型](https://www.zhangxinxu.com/wordpress/2013/10/understand-domstring-document-formdata-blob-file-arraybuffer/)
47. 在大型分布式服务中, 请求会通过网关负载均衡到服务机器上, 如果定位一个请求错误, 要去所有机器的服务日志中一个一个地查, 会相当繁杂, 令人崩溃。处理这种情况一般有两种方式:
- 统一日志服务:通过接入, 将所有机器的日志上报到统一日志服务, 在统一日志服务的管理后台就能查看所有机器的日志, 还能对特定用户的日志进行染色处理。
- 系统批量工具: 可以通过系统批量工具(也是一个基础服务), 通过后台管理系统输入所有服务机器的IP及日志目录和相关命令, 可以针对所有机器执行该命令, 返回相关结果。
48. 磁盘的随机读写和顺序读写
- [SSD的随机读写与顺序读写?](https://www.zhihu.com/question/47544675/answer/303644115)
- [linux之磁盘随机读写和顺序读写](https://zhuanlan.zhihu.com/p/34895884)
- [磁盘IO的那些事](https://tech.meituan.com/2017/05/19/about-desk-io.html)
49. 单点登录(SSO)
- [单点登录(SSO)的设计&实现思路](https://segmentfault.com/a/1190000016738030)
详见:
- [解决 canvas 在高清屏中绘制模糊的问题](https://www.html.cn/archives/9297)
50. 复杂页面代码组织设计的一些思考(如一个可配置页的报表渲染引擎)
- 对于内部各种属性的赋值操作, 不可随意赋值, 必须收紧由赋值函数统一处理, 便于数据变化跟踪
- 多变的逻辑不应该在内部做各种类型判断写不同的逻辑, 宜暴露出接口给外部, 由外部根据业务需要做处理
- 分层结构, 越是内部的组件层, 功能越是内聚, 越是外部, 接口和限制更自由
- 数据的初试化往往有多种形式(比如从后台获取初试化配置的形式、外部组件传入初始化参数、url传入初试化参数等), 需要梳理出各种形式的优先级, 在外层组件(这些初始化逻辑往往比较多变, 侵入性比较强, 应该交给外层组件, 内层组件负责好自己独立功能点)处理这些初始化逻辑
51. 环比与同比的理解
环比和同比用于描述统计数据的变化情况。
- 环比:表示本次统计段与相连的上次统计段之间的比较。比如2010年中国第一季度GDP为G10-1亿元,第二季度GDP为G10-2亿元,则第二季度GDP环比增长(G10-2-G10-1)/G10-1;
- 同比:即同期相比,表示某个特定统计段今年与去年之间的比较。比如2009年中国第一季度GDP为G9-1亿元,则2010年第一季度的GDP同比增长为(G10-1-G9-1)/G9-1。
环比和同比在英文中没有单一单词对应的翻译。同比英文可翻译为 compare with the performance/figure/statistics last year, year-on-year ratio, increase/decrease on a year-on-year basis。而环比则只需把前面的year改为month或season即可。
52. httpDNS
主要为了解决传统DNS的以下问题:
- Local DNS 劫持:由于 HttpDns 是通过 IP 直接请求 HTTP 获取服务器 A 记录地址,不存在向本地运营商询问 domain 解析过程,所以从根本避免了劫持问题。
- 平均访问延迟下降:由于是 IP 直接访问省掉了一次 domain 解析过程,通过智能算法排序后找到最快节点进行访问。
- 用户连接失败率下降:通过算法降低以往失败率过高的服务器排序,通过时间近期访问过的数据提高服务器排序,通过历史访问成功记录提高服务器排序。
参考:
- [HttpDns 原理是什么](http://www.linkedkeeper.com/171.html)
- [全面理解DNS及HTTPDNS](https://juejin.im/post/5dc14f096fb9a04a6b204c6f#heading-1)
- [移动解析HTTPDNS](https://cloud.tencent.com/product/httpdns)
53. svg入门
- [SVG 图像入门教程](https://www.ruanyifeng.com/blog/2018/08/svg.html)
- [MDN - SVG](https://developer.mozilla.org/zh-CN/docs/Web/SVG)
- [理解SVG viewport,viewBox,preserveAspectRatio缩放](https://www.zhangxinxu.com/wordpress/2014/08/svg-viewport-viewbox-preserveaspectratio/)
54. 分布式系统的CAP定理
CAP指的是Consistency(一致性)、Availability(可用性)、Partition tolerance(分区容错性),Consistency 和 Availability 的矛盾, 不能同时成立.
- [CAP 定理的含义](http://www.ruanyifeng.com/blog/2018/07/cap.html)
55. JWT(JSON Web Token)
- [JSON Web Token 入门教程](http://www.ruanyifeng.com/blog/2018/07/json_web_token-tutorial.html)
56. make命令教程
- [make命令教程](http://www.ruanyifeng.com/blog/2015/02/make.html)
57. contenteditable 属性的隐藏坑
```html
<div id="container" contenteditable>
12324234
<span contenteditable="false"></span>
</div>
```
类似如上情况, 当一个contenteditable属性为true的元素内部有个contenteditable为false的元素的时候, 在chrome中全部删除container中的文字时, 光标会丢失, 无法找到该元素的编辑区域, 即无法再编辑该元素内的文字。而在firefox中, 当全部删除container中的文字时, 如果不主动移除光标, 还是可以添加内部文字, 如果在文字没有后主动移除光标, 则也是再也找不到可编辑区域。
58. GIF生成
参考:
- [纯前端实现可传图可字幕台词定制的GIF表情生成器](https://www.zhangxinxu.com/wordpress/2018/05/js-custom-gif-generate/)
59. 如何读懂火焰图?
- [如何读懂火焰图?](http://www.ruanyifeng.com/blog/2017/09/flame-graph.html)
60. js内存泄漏
- [JavaScript 内存泄漏教程](http://www.ruanyifeng.com/blog/2017/04/memory-leak.html)
61. 大型前端项目性能优化
- [Front-End Performance Checklist 2019 [PDF, Apple Pages, MS Word]](https://www.smashingmagazine.com/2019/01/front-end-performance-checklist-2019-pdf-pages/)
- [Front-End Performance Checklist 2020 [PDF, Apple Pages, MS Word]](https://www.smashingmagazine.com/2020/01/front-end-performance-checklist-2020-pdf-pages/)
- [(译)2019年前端性能优化清单 — 上篇](https://juejin.im/post/5c46cbaee51d453f45612a2c)
- [(译)2019年前端性能优化清单 — 中篇](https://juejin.im/post/5c471eaff265da616d547c8c)
- [(译)2019年前端性能优化清单 — 下篇](https://juejin.im/post/5c473cdae51d45518d4701ff)
62. service mesh
- [什么是Service Mesh](https://zhuanlan.zhihu.com/p/61901608)
- [什么是Service Mesh(服务网格)?](https://jimmysong.io/blog/what-is-a-service-mesh/)
63. 自定义h5的video播放器
- [自定义H5 video 播放器](https://juejin.im/post/5daef8b6e51d4524e60e0f6a)
64. html5 video和视频文件流
- [Does HTML5 <video> playback support the .avi format?](https://stackoverflow.com/questions/4129674/does-html5-video-playback-support-the-avi-format)
- [VIDEO ON THE WEB](http://diveintohtml5.info/video.html)
- [HTML5 video](https://en.wikipedia.org/wiki/HTML5_video)
- [Media type and format guide: image, audio, and video content](https://developer.mozilla.org/en-US/docs/Web/Media/Formats)
- [为什么视频网站的视频链接地址是blob?](https://juejin.im/post/5d1ea7a8e51d454fd8057bea)
- [H5直播入门(理论篇)](https://juejin.im/post/5aaa34475188253640012847)
- [三种视频流浏览器播放解决方案](https://juejin.im/post/5d8b57dc6fb9a04e024073c4)
- [MDN - MediaSource](https://developer.mozilla.org/zh-CN/docs/Web/API/MediaSource#Browser_compatibility)
65. 开发UI组件库
- [从0开始搭建一套前端UI组件库 — 01 开篇](https://uxfan.com/fe/vue.js/2019/07/20/build-frontend-ui-framework-from-very-beginning_01.html)
- [从0开始搭建一套前端UI组件库 — 02 环境搭建](https://uxfan.com/fe/vue.js/2019/07/22/build-frontend-ui-framework-from-very-beginning_02.html)
- [从0开始搭建一套前端UI组件库 — 03 全局统筹](https://uxfan.com/fe/vue.js/2019/07/25/build-frontend-ui-framework-from-very-beginning_03.html)
66. 中间表
- [多对多中间表详解 -- Django从入门到精通系列教程](https://www.cnblogs.com/feixuelove1009/p/8417714.html)
- [数据库中间表](https://blog.cto163.com/wordpress/%E4%B8%AD%E9%97%B4%E8%A1%A8/)
67. Flex Basis与Width的区别
- [[翻译]Flex Basis与Width的区别](https://www.jianshu.com/p/17b1b445ecd4)
- [The Difference Between Width and Flex Basis](https://mastery.games/post/the-difference-between-width-and-flex-basis/)
68. 为什么flex-box可用于div,但不能用于表格?
- [Why does flex-box work with a div, but not a table?](https://stackoverflow.com/questions/41421512/why-does-flex-box-work-with-a-div-but-not-a-table)
- [www.w3.org/TR/CSS2/tables](https://www.w3.org/TR/CSS2/tables.html#model)
69. SameSite cookies explained
- [SameSite cookies explained](https://web.dev/samesite-cookies-explained/?utm_source=devtools)
- [Reject insecure SameSite=None cookies](https://www.chromestatus.com/feature/5633521622188032)
70. fetch进行post请求为什么会首先发一个options 请求?
- [fetch进行post请求为什么会首先发一个options 请求?](https://www.zhihu.com/question/49250449/answer/118740346)
71. 流量劫持、网络劫持
- [应对流量劫持,前端能做哪些工作?](https://www.zhihu.com/question/35720092/answer/523563873)
72. 事件循环
- [从Chrome源码看事件循环](https://zhuanlan.zhihu.com/p/48522249)
- [Event Loop 这个循环你晓得么?(附GIF详解)](https://zhuanlan.zhihu.com/p/41543963)
- [详解JavaScript中的Event Loop(事件循环)机制](https://zhuanlan.zhihu.com/p/33058983)
73. ES module 和 commonjs的区别
区别:
1. commonJs是被加载的时候运行,esModule是编译的时候运行
2. commonJs输出的是值的浅拷贝,esModule输出值的引用
3. commentJs具有缓存。在第一次被加载时,会完整运行整个文件并输出一个对象,拷贝(浅拷贝)在内存中。下次加载文件时,直接从内存中取值
ES module 执行步骤:
1. 构造: 查找、下载并解析所有文件到模块记录中。
2. 实例化: 在内存中寻找一块区域来存储所有导出的变量(但还没有填充值)。然后让 export 和 import 都指向这些内存块。这个过程叫做链接(linking)。
3. 求值: 运行代码,在内存块中填入变量的实际值。
所以es module的export和import指向的是一个内存地址, 故这个地址的值变化的话, 引用这个地址的变量都会变化。
ES6 模块会在程序开始前先根据模块关系查找到所有模块,生成一个无环关系图,并将所有模块实例都创建好,这种方式天然地避免了循环引用的问题,当然也有模块加载缓存,重复 import 同一个模块,只会执行一次代码。
一些example
```js
// es module
// constants.js
export const test = {
aa: 1,
bb: {
cc: 'hello'
}
}
export let test2 = 2
setTimeout(() => {
test2 = undefined
test1.aa = 3
test1.bb.cc = 'bye'
console.log('test1', test1)
console.log('test2', test2)
}, 2000)
// index.js
import { test1, test2 } from './constants'
console.log('import1', test1)
console.log('import2', test2)
setTimeout(() => {
console.log('trigger1', test1)
console.log('trigger2', test2)
}, 4000)
// 输出
// import1 {"aa":1,"bb":{"cc":"hello"}}
// import2 2
// test1 {"aa":3,"bb":{"cc":"bye"}}
// test2 undefined
// trigger1 {"aa":3,"bb":{"cc":"bye"}}
// trigger2 undefined
```
```js
// commonjs
// constants.js
let test1 = {
aa: 1,
bb: {
cc: 'hello'
}
}
let test2 = 2
setTimeout(() => {
test1.aa = 2
test1.bb.cc = 'bye'
test2 = undefined
console.log('test1', test1)
console.log('test2', test2)
}, 1000)
module.exports = {
test1,
test2
}
// index.js
let constants = require('./constants');
console.log('require1', constants.test1)
console.log('require2', constants.test2)
setTimeout(() => {
console.log('trigger1', constants.test1)
console.log('trigger2', constants.test2)
}, 4000)
// 输出
// require1 {"aa":1,"bb":{"cc":"hello"}}
// require2 2
// test1 {"aa":2,"bb":{"cc":"bye"}}
// test2 undefined
// trigger1 {"aa":2,"bb":{"cc":"bye"}}
// trigger2 2
```
- [ES modules: A cartoon deep-dive](https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/)
- [漫画:深入浅出 ES 模块](https://zhuanlan.zhihu.com/p/36358695)
- [CommonJS 和 ES6 Module 究竟有什么区别?](https://juejin.im/post/6844904080955932680#heading-0)
- [Node.js 中的 require 是如何工作的?](https://juejin.im/post/6844903957752463374)
- [CommonJs 和 ESModule 的 区别整理](https://juejin.im/post/6844903598480965646)
- [深入理解es module](https://juejin.im/post/6844903834532200461)
- [What do ES6 modules export?](https://2ality.com/2015/07/es6-module-exports.html)
- [MDN - export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export)
74. RegExp.prototype.exec()的一个坑
>exec() 方法在一个指定字符串中执行一个搜索匹配。返回一个结果数组或 null。
>
>在设置了 global 或 sticky 标志位的情况下(如 /foo/g or /foo/y),JavaScript RegExp 对象是有状态的。他们会将上次成功匹配后的位置记录在 lastIndex 属性中。使用此特性,exec() 可用来对单个字符串中的多次> 匹配结果进行逐条的遍历(包括捕获到的匹配),而相比之下, String.prototype.match() 只会返回匹配到的结果。
>
>如果你只是为了判断是否匹配(true或 false),可以使用 RegExp.test() 方法,或者 String.search() 方法。
- [MDN - RegExp.prototype.exec()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)
- [js正则exec方法的一个诡异现象](https://www.jianshu.com/p/c6f4e0f732f8)
75. 关于git在win或者mac下对文件名大小写不敏感的问题处理:
方案一:
```bash
git mv -f OldFileNameCase newfilenamecase
```
方案二:
```bash
git config core.ignorecase false
```
- [How do I commit case-sensitive only filename changes in Git?](https://stackoverflow.com/questions/17683458/how-do-i-commit-case-sensitive-only-filename-changes-in-git)
76. 声明式与命令式编程
- 声明式编程( Declarative):只告诉你想要的结果(What),机器自己摸索过程(How)。典型例子就是html和sql,抽象成简单易懂的语法,让机器去执行里面的复杂渲染和查询逻辑。
- 命令式编程(Imperative):详细的命令机器怎么(How)去处理一件事情以达到你想要的结果(What)。一步一步告诉机器应该怎么做。
参考:
- [声明式编程和命令式编程有什么区别?](https://www.zhihu.com/question/22285830)
- [命令式编程(Imperative) vs声明式编程( Declarative)](https://zhuanlan.zhihu.com/p/34445114)
- [声明式编程和命令式编程的比较](https://www.aqee.net/post/imperative-vs-declarative.html)
- [声明式(declarative) vs 命令式(imperative)](https://lotabout.me/2020/Declarative-vs-Imperative-language/)
77. HTTP协议中的Transfer-Encoding
1. Transfer-Encoding,是一个 HTTP 头部字段,字面意思是「传输编码」。实际上,HTTP 协议中还有另外一个头部与编码有关:Content-Encoding(内容编码)。Content-Encoding 通常用于对实体内容进行压缩编码,目的是优化传输,例如用 gzip 压缩文本文件,能大幅减小体积。内容编码通常是选择性的,例如 jpg / png 这类文件一般不开启,因为图片格式已经是高度压缩过的,再压一遍没什么效果不说还浪费 CPU。而 Transfer-Encoding 则是用来改变报文格式,它不但不会减少实体内容传输大小,甚至还会使传输变大,那它的作用是什么呢?本文接下来主要就是讲这个。我们先记住一点,Content-Encoding 和 Transfer-Encoding 二者是相辅相成的,对于一个 HTTP 报文,很可能同时进行了内容编码和传输编码。
2. 在node server的应用中, 如果返回数据中不添加Content-Length头部的话, 会默认是Transfer-Encoding: chunked的形式。
3. chunked还是会给浏览器传输了每段chunk(数据段)的长度,但是偷偷藏在了报文当中,所以并没有显式地像content-length在头部声明。
4. nginx中转发接口请求过程中, 会默认将所接受的数据buffer起来(proxy_request_buffering on;), 等这个连接的数据发送完毕之后再彻底转发, 也就是不走Transfer-Encoding: chunked的形式, 而是接受完所有数据, 赋值content-length头部的形式。 如果期望走Transfer-Encoding: chunked的形式转发接口请求的话, 可以将proxy_request_buffering配置改成off。
参考:
- [为什么在HTTP的chunked模式下不需要设置长度](https://zhuanlan.zhihu.com/p/65816404)
- [MDN - Transfer-Encoding](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Transfer-Encoding)
- [HTTP 协议中的 Transfer-Encoding](https://imququ.com/post/transfer-encoding-header-in-http.html)
- [用了这么久HTTP, 你是否了解Content-Length?](https://blog.fundebug.com/2019/09/10/understand-http-content-length/)
78. IOC(Inversion of Control, 控制反转)
#### 起源
早在2004年,Martin Fowler就提出了“哪些方面的控制被反转了?”这个问题。他总结出是依赖对象的获得被反转了,因为大多数应用程序都是由两个或是更多的类通过彼此的合作来实现业务逻辑,这使得每个对象都需要获取与其合作的对象(也就是它所依赖的对象)的引用。如果这个获取过程要靠自身实现,那么这将导致代码高度耦合并且难以维护和调试。
#### 技术描述
Class A中用到了Class B的对象b,一般情况下,需要在A的代码中显式的new一个B的对象。
采用依赖注入技术之后,A的代码只需要定义一个私有的B对象,不需要直接new来获得这个对象,而是通过相关的容器控制程序来将B对象在外部new出来并注入到A类里的引用中。而具体获取的方法、对象被获取时的状态由配置文件(如XML)来指定。
#### 实现方法
实现控制反转主要有两种方式:依赖注入和依赖查找。两者的区别在于,前者是被动的接收对象,在类A的实例创建过程中即创建了依赖的B对象,通过类型或名称来判断将不同的对象注入到不同的属性中,而后者是主动索取相应类型的对象,获得依赖对象的时间也可以在代码中自由控制。
- [IoC原理](https://www.liaoxuefeng.com/wiki/1252599548343744/1282381977747489)
- [控制反转](https://zh.wikipedia.org/wiki/%E6%8E%A7%E5%88%B6%E5%8F%8D%E8%BD%AC)
- [浅谈IOC--说清楚IOC是什么](https://www.cnblogs.com/DebugLZQ/archive/2013/06/05/3107957.html)
- [从前端角度彻底搞懂 DIP、IoC、DI、JS](https://zhuanlan.zhihu.com/p/61018434)
- [面向复杂应用,Node.js中的IoC容器 -- Rockerjs/core](https://cloud.tencent.com/developer/article/1405995)
- [当IoC遇见了Node.js](https://www.infoq.cn/article/ioc-meet-nodejs)
- [五分钟掌握 JavaScript 中的 IoC](https://segmentfault.com/a/1190000022264251)
- [前端 IoC 理念入门](https://efe.baidu.com/blog/introduction-about-ioc-in-frontend/)
- [IOC在Nodejs上的初体验](https://juejin.im/post/6844903957366571016)
- [浅谈阿里 Node 框架 Midway 在企业产品中的应用实践](https://zhuanlan.zhihu.com/p/81072053)
79. package-lock.json 与 npm-shrinkwrap.json
在npm5之后,对于某一package.json文件,输入npm install,在相同时间点时总是可以得到相同的package-lock.json。当package.json中的依赖/子依赖的存在新的版本迭代时,则会忽略package-lock.json,并用新版本号覆盖package-lock.json。
项目开发过程中肯定会持续更新依赖包的版本,如果需要确定性的构建结果,可以尝试使用npm ci。
npm ci将会直接从package-lock.json安装依赖项,并仅使用package.json来验证是否存在不匹配的版本。 如果缺少任何依赖项或版本不兼容,则将抛出异常。
package-lock的主要用处总结如下:
- 1. package-lock的依赖目录和node_modules完全相同,因此可以通过package-lock了解依赖树的结构;
- 2. 保证不同开发者间的版本库依赖关系完全相同;
- 3. 允许npm跳过以前安装的依赖包的重复meta数据解析,显著减少安装耗时;
基于以上的特点,笔者极力推荐开发者在生产项目中上传package-lock文件,以避免不必要的版本冲突。
这里需要注意两点,一个是在根目录之外的任何地方都将被忽略,所以不会存在跨目录间package-lock互相干扰的问题;另一点是package-lock.json无法随着npm包一起被发布出去,因此开发npm包时是不能锁依赖版本的。
如果发npm包有锁版本的需要,可以在存在node_modules或package-lock时通过npm shrinkwrap创建npm-shrinkwrap.json。npm-shrinkwrap与package-lock的结构与内容完全一致,唯一的区别就是npm-shrinkwrap可以随npm包一起上传,从而达到锁版本的目的。
额外提一下,npm-shrinkwrap的创建强依赖于node_modules以及package-lock文件,如果不存在上述两个文件,则会创建一个空依赖的文件。如果已经存在package-lock,则会将其rename为npm-shrinkwrap;若只存在node_modules则会根据其结构创建npm-shrinkwrap。
如果package-lock.json和npm-shrinkwrap.json都存在于包的根目录中,则package-lock.json将被忽略。
80. package-lock.json中的dev
如果依赖项仅是顶层模块的devDependencies,或者是一个传递依赖项,则dev属性为true;对于既是顶层的开发依赖关系又是顶层的非开发依赖关系的传递依赖关系的依赖关系,则为false。
这里的传递依赖是指,如果A依赖B,B依赖C,则C就是A的一个传递依赖。
简单来说就是一旦开发依赖包被非开发依赖包依赖,则dev为false。
81. vue 中使用watch方法监听对象和数组的变化的时候, 对数组进行push操作和对Obj进行$set操作,虽然都可能触发watch事件,但是在callback返回的结果中,oldValue和newValue相同。那时因为对数组和对象的引用是同源的,虽然会触发数据watch,但是newValue和oldValue是同一个,解决方案是重新赋值对象或者数组。
- [$watch中的oldvalue和newValue](https://segmentfault.com/a/1190000010397584)
- [Vue watch 复杂对象变化,oldvalue 和 newValue 一致,解决办法。](https://blog.csdn.net/u011330018/article/details/107322733/?utm_medium=distribute.pc_relevant.none-task-blog-title-2&spm=1001.2101.3001.4242)
82. Path-to-RegExp
- [Path-to-RegExp](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0)
83. vue-cli 分析
详见:
- [浅谈 vue-cli 扩展性和插件设计](https://juejin.im/post/5cedb26451882566477b7235)
- [vue-cli-analysis](https://kuangpf.com/vue-cli-analysis/foreword/)
- [【cli】这是看过最优秀的Vue-cli源码分析,绝对受益匪浅](https://juejin.cn/post/6844903586929868813)
84. ajax请求跨域携带cookie,cors支持ajax请求携带cookie
- [如何配置ajax请求跨域携带cookie,cors支持ajax请求携带cookie](https://cloud.tencent.com/developer/article/1467263)
85. 线程安全
- [【面试】如果你这样回答“什么是线程安全”,面试官都会对你刮目相看](https://www.cnblogs.com/lixinjie/p/a-answer-about-thread-safety-in-a-interview.html)
- [什么是线程安全以及如何实现?](https://segmentfault.com/a/1190000023187634)
86. js加载器的实现
- [[转]动态加载js文件的正确姿势](https://github.com/xiongwilee/blog/issues/8)
87. Protocol Buffers
- [在浏览器环境下使用Protocol Buffers协议](http://eux.baidu.com/blog/fe/%E6%B5%8F%E8%A7%88%E5%99%A8%E7%8E%AF%E5%A2%83%E4%B8%8B%E4%BD%BF%E7%94%A8Protocol%20Buffers)
- [Google Protocol Buffer 的使用和原理](https://www.ibm.com/developerworks/cn/linux/l-cn-gpb/index.html)
- [protobuf.js](https://github.com/protobufjs/protobuf.js)
88. SQL 外键
SQL 的主键和外键的作用:
外键取值规则:空值或参照的主键值
- (1)插入非空值时,如果主键值中没有这个值,则不能插入。
- (2)更新时,不能改为主键表中没有的值。
- (3)删除主键表记录时,可以在建外键时选定外键记录一起联删除还是拒绝删除。
- (4)更新主键记录时,同样有级联更新和拒绝执行的选择。
总的来说, 外键主要是起到约束的作用。在学院派的SQL范式中, 一般都推荐使用外键规范数据库。
然而, 在大部分互联网应用中, 一般都不会使用外键。因为现在传统SQL水平拓展一般都比较麻烦和复杂, 大部分互联网应用的数据层都是使用一主多从的部署方式(主库写从库读), 如果使用外键, 约束都在主库执行, 主库很容易成为性能瓶颈. 故在互联网应用中, 约束一般在应用层, 通过查询从库数据判断写入数据是否合法, 这样只需要水平拓展应用层的服务器(容易水平拓展), 就能达到约束的目的。
- [为什么数据库不应该使用外键](https://draveness.me/whys-the-design-database-foreign-key/)
- [SQL的主键和外键的作用](https://www.jianshu.com/p/394f8aa724f4)
- [关系模型 - 外键](https://www.liaoxuefeng.com/wiki/1177760294764384/1218728424164736)
- [大家设计数据库时使用外键吗?](https://www.zhihu.com/question/19600081)
89. 短链接服务的实现
目前比较流行的生成短码方法有:自增id、摘要算法、普通随机数。
- [如何实现一个短链接服务](https://www.cnblogs.com/rickiyang/p/12178644.html)
- [新浪短链接生成工具](https://www.sina.lt/)
- [短网址服务的原理是什么?](https://www.zhihu.com/question/19852154)
- [短网址(short URL)系统的原理及其实现](https://segmentfault.com/a/1190000012088345)
90. node应用docker部署的时候到底应不应该在容器内起个进程守护?
主流的观点是:
不应该在docker容器中起进程守护,这是因为:
- (1) 如果您使用pm2在每个容器中运行一个进程,则除了增加内存消耗之外,您不会获得太多收益。可以使用具有重新启动策略的纯docker重新启动。其他基于docker的环境(例如ECS或Kubernetes)也可以做到这一点。
- (2) 如果在docker容器中运行多个进程,将会使监视更加困难。CPU /内存指标不再对您的封闭环境直接可用。
- (3) 对于单个PM2进程的健康检查请求将会分配给各个worker进程,这很可能会隐藏不健康的目标。
- (4) pm2隐藏了worker的crash,你将很难从(云平台的)监控面板察觉到。
- (5) 负载均衡会变得更加复杂,因为你其实加多了一层负载均衡。
- (6) 在docker内运行多个进程也与docker的理念相违背的,即每个容器应该只保留一个进程。
更多见解:
```
PM2 本身可能比你 Node 的业务还复杂,出了问题不好 DEBUG,就像你和 log4js 一起用还得做兼容。其次,如果你的 Node 程序本身有问题,PM2 一直重启不成功,但是容器主进程是 PM2 一直在前台,定位问题就得进到容器。
有一种开发模式叫 let it crash,只有当一个程序退出了,你才知道隐藏的问题在哪里,而不是到处去做 try...catch,PM2 本身就是一种 try...catch。
补充答主第一个问题,Node.js 多进程模型是为了进程间通信更方便,一般采用 master-worker 的机制,worker 之间可以直接通过 master 通信。如果你用容器对进程进行隔离,就要借助第三方,如 mq 进行通信。
```
```
关于 Node.js 应用的稳定性,一般会有两种做法:
如果应用有异常情况没处理干净,挂掉就该挂掉,不重启。做好 TCP 端口监控的话,能及时发现问题,避免发生更大的事故。
使用 PM2、supervisor 这类进程管理工具,发现进程挂掉就立即重启。这样能保证大部分时间的可用性,但是对监控要求高一些,端口监控可能不太够用。
如果应用对稳定性的要求比较高,建议使用方案 1,可以早日让应用足够健壮。如果对稳定性没什么太高要求,比如 99% 的时间可用就行,可以使用方案 2 ,这也是大部分业务应用采用的做法。
关于是否应该使用多个进程来运行 Node.js 应用,我的经验是需要。
Node.js 应用对内存的要求比较高,如果使用 4 个 1c1g 的容器来运行,可能并不如 1 个 4c4g 的容器来运行稳定(比如某些接口 1g 内存会出现 oom)。如果负载均衡做的不好,你的 4 个 1c1g 的容器可能并不能达到 4c4g 的效果。之前我也做过这方面的压测,结果也能说明多核的 tps 会高一些,也更稳定一些。
如果只是想达到多进程运行 Node.js 应用的目的,PM2 可能略重,可以尝试使用 cfork 来代替。
```
- [what is the point of using pm2 and docker together?](https://stackoverflow.com/questions/51191378/what-is-the-point-of-using-pm2-and-docker-together)
91. VS Code 项目配置路径别名跳转
开发脚手架自定义路径别名的时候, vscode等编辑器无法识别这类自定义别名导致智能提示和智能跳转会失效, 可以通过以下方案处理.
- [VS Code 项目配置路径别名跳转](https://github.com/pfan123/Articles/issues/66)
- [vscode 开启对 webpack alias(文件别名) 引入的智能提示](https://blog.csdn.net/zzl1243976730/article/details/92820985) | mit |
emote/tools | lib/sfsetup.js | 5142 | "use strict";
var async = require('async');
var fs = require('fs');
var util = require('util');
var prompt = require('prompt');
var httpRequest = require('emsoap').subsystems.httpRequest;
var common = require('./common');
var mms = require('./mms');
var mmscmd = require('./mmscmd');
var deploy = require('./deploy');
var session; // MMS session
var modelFile = "sfmodel.json";
var externalSystemType = 'NODEX';
var externalSystem;
var accessAddress;
var credentials;
var mappedObjects;
var verboseLoggingForExternalSystem;
function afterAuth(cb) {
// munge mappedObjects as required
for (var name in mappedObjects) {
var map = mappedObjects[name];
if (!map.typeBindingProperties) {
map.typeBindingProperties = {};
for (var propName in map) {
switch(propName) {
case "target":
case "properties":
;
default:
map.typeBindingProperties[name] = map[name];
}
}
}
}
// invoke op to create model
session.directive(
{
op : "INVOKE",
targetType: "CdmExternalSystem",
name: "invokeExternal",
params: {
externalSystem: externalSystem,
opName : "createSfModel",
params : {
sfVersion : credentials.sfVersion,
externalSystem : externalSystem,
typeDescs : mappedObjects
}
}
},
function (err, result) {
if (err) {
return cb(err);
}
fs.writeFileSync(modelFile, JSON.stringify(result.results, null, 2));
mmscmd.execFile(modelFile,session, deploy.outputWriter, cb);
}
);
}
exports.deployModel = function deployModel(externalSystemName,mmsSession,cb) {
session = mmsSession;
externalSystem = externalSystemName;
var text;
if(!session.creds.externalCredentials) {
console.log("Profile must include externalCredentials");
process.exit(1);
}
credentials = session.creds.externalCredentials[externalSystemName];
if(!credentials) {
console.log("Profile does not provide externalCredentials for " + externalSystemName);
process.exit(1);
}
if(!credentials.oauthKey || !credentials.oauthSecret) {
console.log("externalSystemName for " + externalSystemName + " must contain the oAuth key and secret.");
}
accessAddress = credentials.host;
try {
text = fs.readFileSync("salesforce.json");
} catch(err) {
console.log('Error reading file salesforce.json:' + err);
process.exit(1);
}
try {
mappedObjects = JSON.parse(text);
} catch(err) {
console.log('Error parsing JSON in salesforce.json:' + err);
process.exit(1);
}
if(mappedObjects._verbose_logging_) {
verboseLoggingForExternalSystem = mappedObjects._verbose_logging_;
}
delete mappedObjects._verbose_logging_;
createExternalSystem(function(err) {
if (err) {
return cb(err);
}
var addr = common.global.session.creds.server + "/oauth/" + externalSystem + "/authenticate";
if (common.global.argv.nonInteractive) {
console.log("Note: what follows will fail unless Emotive has been authorized at " + addr);
afterAuth(cb);
}
else {
console.log("Please navigate to " + addr.underline + " with your browser");
prompt.start();
prompt.colors = false;
prompt.message = 'Press Enter when done';
prompt.delimiter = '';
var props = {
properties: {
q: {
description : ":"
}
}
}
prompt.get(props, function (err, result) {
if (err) {
return cb(err);
}
afterAuth(cb);
});
}
});
}
function createExternalSystem(cb) {
if (!session.creds.username)
{
console.log("session.creds.username was null");
process.exit(1);
}
if(verboseLoggingForExternalSystem) console.log('VERBOSE LOGGING IS ON FOR ' + externalSystem);
session.directive({
op: 'INVOKE',
targetType: 'CdmExternalSystem',
name: "updateOAuthExternalSystem",
params: {
name: externalSystem,
typeName: externalSystemType,
"oauthCredentials" : {
"oauthType": "salesforce",
"oauthKey": credentials.oauthKey,
"oauthSecret": credentials.oauthSecret
},
properties: {
proxyConfiguration: {verbose: verboseLoggingForExternalSystem, sfVersion: credentials.sfVersion},
globalPackageName : "sfProxy"
}
}
},
cb);
}
| mit |
boisde/Greed_Island | business_logic/order_collector/transwarp/orm.py | 11968 | #!/usr/bin/env python
# coding:utf-8
"""
Database operation module. This module is independent with web module.
"""
import time, logging
import db
class Field(object):
_count = 0
def __init__(self, **kw):
self.name = kw.get('name', None)
self.ddl = kw.get('ddl', '')
self._default = kw.get('default', None)
self.comment = kw.get('comment', '')
self.nullable = kw.get('nullable', False)
self.updatable = kw.get('updatable', True)
self.insertable = kw.get('insertable', True)
self.unique_key = kw.get('unique_key', False)
self.non_unique_key = kw.get('key', False)
self.primary_key = kw.get('primary_key', False)
self._order = Field._count
Field._count += 1
@property
def default(self):
d = self._default
return d() if callable(d) else d
def __str__(self):
s = ['<%s:%s,%s,default(%s),' % (self.__class__.__name__, self.name, self.ddl, self._default)]
self.nullable and s.append('N')
self.updatable and s.append('U')
self.insertable and s.append('I')
s.append('>')
return ''.join(s)
class StringField(Field):
def __init__(self, **kw):
if not 'default' in kw:
kw['default'] = ''
if not 'ddl' in kw:
kw['ddl'] = 'varchar(255)'
super(StringField, self).__init__(**kw)
class IntegerField(Field):
def __init__(self, **kw):
if not 'default' in kw:
kw['default'] = 0
if not 'ddl' in kw:
kw['ddl'] = 'bigint'
super(IntegerField, self).__init__(**kw)
class FloatField(Field):
def __init__(self, **kw):
if not 'default' in kw:
kw['default'] = 0.0
if not 'ddl' in kw:
kw['ddl'] = 'real'
super(FloatField, self).__init__(**kw)
class BooleanField(Field):
def __init__(self, **kw):
if not 'default' in kw:
kw['default'] = False
if not 'ddl' in kw:
kw['ddl'] = 'bool'
super(BooleanField, self).__init__(**kw)
class TextField(Field):
def __init__(self, **kw):
if not 'default' in kw:
kw['default'] = ''
if not 'ddl' in kw:
kw['ddl'] = 'text'
super(TextField, self).__init__(**kw)
class BlobField(Field):
def __init__(self, **kw):
if not 'default' in kw:
kw['default'] = ''
if not 'ddl' in kw:
kw['ddl'] = 'blob'
super(BlobField, self).__init__(**kw)
class VersionField(Field):
def __init__(self, name=None):
super(VersionField, self).__init__(name=name, default=0, ddl='bigint')
class DateTimeField(Field):
def __init__(self, **kw):
if 'ddl' not in kw:
kw['ddl'] = 'datetime'
super(DateTimeField, self).__init__(**kw)
class DateField(Field):
def __init__(self, **kw):
if 'ddl' not in kw:
kw['ddl'] = 'date'
super(DateField, self).__init__(**kw)
class EnumField(Field):
def __init__(self, **kw):
if 'ddl' not in kw:
kw['ddl'] = 'enum'
super(EnumField, self).__init__(**kw)
_triggers = frozenset(['pre_insert', 'pre_update', 'pre_delete'])
def _gen_sql(table_name, mappings):
pk, unique_keys, keys = None, [], []
sql = ['-- generating SQL for %s:' % table_name, 'create table `%s` (' % table_name]
for f in sorted(mappings.values(), lambda x, y: cmp(x._order, y._order)):
if not hasattr(f, 'ddl'):
raise StandardError('no ddl in field "%s".' % f)
ddl = f.ddl
nullable = f.nullable
has_comment = not (f.comment == '')
has_default = f._default is not None
left = nullable and ' `%s` %s' % (f.name, ddl) or ' `%s` %s not null' % (f.name, ddl)
mid = has_default and ' default \'%s\'' % f._default or None
right = has_comment and ' comment \'%s\',' % f.comment or ','
line = mid and '%s%s%s' % (left, mid, right) or '%s%s' % (left, right)
if f.primary_key:
pk = f.name
line = ' `%s` %s not null auto_increment,' % (f.name, ddl)
elif f.unique_key:
unique_keys.append(f.name)
elif f.non_unique_key:
keys.append(f.name)
sql.append(line)
for uk in unique_keys:
sql.append(' unique key(`%s`),' % uk)
for k in keys:
sql.append(' key(`%s`),' % k)
sql.append(' primary key(`%s`)' % pk)
sql.append(')ENGINE=InnoDB DEFAULT CHARSET=utf8;')
return '\n'.join(sql)
class ModelMetaclass(type):
"""
Metaclass for model objects.
"""
def __new__(cls, name, bases, attrs):
# skip base Model class:
if name == 'Model':
return type.__new__(cls, name, bases, attrs)
# store all subclasses info:
if not hasattr(cls, 'subclasses'):
cls.subclasses = {}
if not name in cls.subclasses:
cls.subclasses[name] = name
else:
logging.warning('Redefine class: %s', name)
logging.info('Scan ORMapping %s...', name)
mappings = dict()
primary_key = None
for k, v in attrs.iteritems():
if isinstance(v, Field):
if not v.name:
v.name = k
logging.debug('Found mapping: %s => %s' % (k, v))
# check duplicate primary key:
if v.primary_key:
if primary_key:
raise TypeError('Cannot define more than 1 primary key in class: %s' % name)
if v.updatable:
# logging.warning('NOTE: change primary key to non-updatable.')
v.updatable = False
if v.nullable:
# logging.warning('NOTE: change primary key to non-nullable.')
v.nullable = False
primary_key = v
mappings[k] = v
# check exist of primary key:
if not primary_key:
raise TypeError('Primary key not defined in class: %s' % name)
for k in mappings.iterkeys():
attrs.pop(k)
if '__table__' not in attrs:
attrs['__table__'] = name.lower()
attrs['__mappings__'] = mappings
attrs['__primary_key__'] = primary_key
attrs['__sql__'] = lambda self: _gen_sql(attrs['__table__'], mappings)
for trigger in _triggers:
if trigger not in attrs:
attrs[trigger] = None
return type.__new__(cls, name, bases, attrs)
class Model(dict):
"""
Base class for ORM.
>>> class User(Model):
... id = IntegerField(primary_key=True)
... name = StringField()
... email = StringField(updatable=False)
... passwd = StringField(default=lambda: '******')
... last_modified = FloatField()
... def pre_insert(self):
... self.last_modified = time.time()
>>> u = User(id=10190, name='Michael', email='[email protected]')
>>> r = u.insert()
>>> u.email
'[email protected]'
>>> u.passwd
'******'
>>> u.last_modified > (time.time() - 2)
True
>>> f = User.get(10190)
>>> f.name
u'Michael'
>>> f.email
u'[email protected]'
>>> f.email = '[email protected]'
>>> r = f.update() # change email but email is non-updatable!
>>> len(User.find_all())
1
>>> g = User.get(10190)
>>> g.email
u'[email protected]'
>>> r = g.mark_deleted()
>>> len(db.select('select * from user where id=10190'))
0
>>> import json
>>> print User().__sql__()
-- generating SQL for user:
create table `user` (
`id` bigint not null,
`name` varchar(255) not null,
`email` varchar(255) not null,
`passwd` varchar(255) not null,
`last_modified` real not null,
primary key(`id`)
);
"""
__metaclass__ = ModelMetaclass
def __init__(self, **kw):
super(Model, self).__init__(**kw)
def __getattr__(self, key):
try:
return self[key]
except KeyError:
raise AttributeError(r"'Dict' object has no attribute '%s'" % key)
def __setattr__(self, key, value):
self[key] = value
@classmethod
def get(cls, key_name, key_value):
"""
Get by primary/unique key.
"""
d = db.select_one('select * from %s where %s=?' % (cls.__table__, key_name), key_value)
if not d:
# TODO: change to logging?
raise AttributeError("Can't find in [%s] where %s=[%s]" % (cls.__table__, key_name, key_value))
return cls(**d) if d else None
@classmethod
def find_first(cls, where, *args):
"""
Find by where clause and return one result. If multiple results found,
only the first one returned. If no result found, return None.
"""
d = db.select_one('select * from %s %s' % (cls.__table__, where), *args)
return cls(**d) if d else None
@classmethod
def find_all(cls, *args):
"""
Find all and return list.
"""
L = db.select('select * from `%s`' % cls.__table__)
return [cls(**d) for d in L]
@classmethod
def find_by(cls, cols, where, *args):
"""
Find by where clause and return list.
"""
L = db.select('select %s from `%s` %s' % (cols, cls.__table__, where), *args)
if cols.find(',') == -1 and cols.strip() != '*':
return [d[0] for d in L]
return [cls(**d) for d in L]
@classmethod
def count_all(cls):
"""
Find by 'select count(pk) from table' and return integer.
"""
return db.select_int('select count(`%s`) from `%s`' % (cls.__primary_key__.name, cls.__table__))
@classmethod
def count_by(cls, where, *args):
"""
Find by 'select count(pk) from table where ... ' and return int.
"""
return db.select_int('select count(`%s`) from `%s` %s' % (cls.__primary_key__.name, cls.__table__, where), *args)
def update(self):
self.pre_update and self.pre_update()
L = []
args = []
for k, v in self.__mappings__.iteritems():
if v.updatable:
if hasattr(self, k):
arg = getattr(self, k)
else:
arg = v.default
setattr(self, k, arg)
L.append('`%s`=?' % k)
args.append(arg)
pk = self.__primary_key__.name
args.append(getattr(self, pk))
db.update('update `%s` set %s where %s=?' % (self.__table__, ','.join(L), pk), *args)
return self
def delete(self):
self.pre_delete and self.pre_delete()
pk = self.__primary_key__.name
args = (getattr(self, pk), )
db.update('delete from `%s` where `%s`=?' % (self.__table__, pk), *args)
return self
def insert(self):
self.pre_insert and self.pre_insert()
params = {}
for k, v in self.__mappings__.iteritems():
if v.insertable:
if not hasattr(self, k):
setattr(self, k, v.default)
params[v.name] = getattr(self, k)
try:
db.insert('%s' % self.__table__, **params)
except Exception as e:
logging.info(e.args)
print "MySQL Model.insert() error: args=", e.args
# TODO !!! generalize ORM return package
# return {'status': 'Failure', 'msg': e.args, 'data': self}
raise
return self
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
db.create_engine('www-data', 'www-data', 'test')
db.update('drop table if exists user')
db.update('create table user (id int primary key, name text, email text, passwd text, last_modified real)')
import doctest
doctest.testmod()
| mit |
Thewhitelight/Calendar | app/src/main/java/cn/libery/calendar/MaterialCalendar/EventDecorator.java | 752 | package cn.libery.calendar.MaterialCalendar;
import android.content.Context;
import java.util.Collection;
import java.util.HashSet;
import cn.libery.calendar.MaterialCalendar.spans.DotSpan;
/**
* Decorate several days with a dot
*/
public class EventDecorator implements DayViewDecorator {
private int color;
private HashSet<CalendarDay> dates;
public EventDecorator(int color, Collection<CalendarDay> dates) {
this.color = color;
this.dates = new HashSet<>(dates);
}
@Override
public boolean shouldDecorate(CalendarDay day) {
return dates.contains(day);
}
@Override
public void decorate(DayViewFacade view, Context context) {
view.addSpan(new DotSpan(4, color));
}
}
| mit |
luanlv/comhoavang | src/routes/admin/index.js | 959 | /**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
// import Layout from '../../components/Layout';
const title = 'Admin Page';
const isAdmin = false;
export default {
path: '/admin',
children : [
require('./dashboard').default,
require('./library').default,
require('./setting').default,
// require('./editor').default,
require('./news').default,
require('./monngon').default,
require('./product').default,
require('./seo').default,
],
async action({store, next}) {
let user = store.getState().user
const route = await next();
// Provide default values for title, description etc.
route.title = `${route.title || 'Amdmin Page'}`;
return route;
},
};
| mit |
pardeike/Harmony | Harmony/Public/Attributes.cs | 27094 | using System;
using System.Collections.Generic;
namespace HarmonyLib
{
/// <summary>Specifies the type of method</summary>
///
public enum MethodType
{
/// <summary>This is a normal method</summary>
Normal,
/// <summary>This is a getter</summary>
Getter,
/// <summary>This is a setter</summary>
Setter,
/// <summary>This is a constructor</summary>
Constructor,
/// <summary>This is a static constructor</summary>
StaticConstructor,
/// <summary>This targets the MoveNext method of the enumerator result</summary>
Enumerator
}
/// <summary>Specifies the type of argument</summary>
///
public enum ArgumentType
{
/// <summary>This is a normal argument</summary>
Normal,
/// <summary>This is a reference argument (ref)</summary>
Ref,
/// <summary>This is an out argument (out)</summary>
Out,
/// <summary>This is a pointer argument (&)</summary>
Pointer
}
/// <summary>Specifies the type of patch</summary>
///
public enum HarmonyPatchType
{
/// <summary>Any patch</summary>
All,
/// <summary>A prefix patch</summary>
Prefix,
/// <summary>A postfix patch</summary>
Postfix,
/// <summary>A transpiler</summary>
Transpiler,
/// <summary>A finalizer</summary>
Finalizer,
/// <summary>A reverse patch</summary>
ReversePatch
}
/// <summary>Specifies the type of reverse patch</summary>
///
public enum HarmonyReversePatchType
{
/// <summary>Use the unmodified original method (directly from IL)</summary>
Original,
/// <summary>Use the original as it is right now including previous patches but excluding future ones</summary>
Snapshot
}
/// <summary>Specifies the type of method call dispatching mechanics</summary>
///
public enum MethodDispatchType
{
/// <summary>Call the method using dynamic dispatching if method is virtual (including overriden)</summary>
/// <remarks>
/// <para>
/// This is the built-in form of late binding (a.k.a. dynamic binding) and is the default dispatching mechanic in C#.
/// This directly corresponds with the <see cref="System.Reflection.Emit.OpCodes.Callvirt"/> instruction.
/// </para>
/// <para>
/// For virtual (including overriden) methods, the instance type's most-derived/overriden implementation of the method is called.
/// For non-virtual (including static) methods, same behavior as <see cref="Call"/>: the exact specified method implementation is called.
/// </para>
/// <para>
/// Note: This is not a fully dynamic dispatch, since non-virtual (including static) methods are still called non-virtually.
/// A fully dynamic dispatch in C# involves using
/// the <see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/reference-types#the-dynamic-type"><c>dynamic</c> type</see>
/// (actually a fully dynamic binding, since even the name and overload resolution happens at runtime), which <see cref="MethodDispatchType"/> does not support.
/// </para>
/// </remarks>
VirtualCall,
/// <summary>Call the method using static dispatching, regardless of whether method is virtual (including overriden) or non-virtual (including static)</summary>
/// <remarks>
/// <para>
/// a.k.a. non-virtual dispatching, early binding, or static binding.
/// This directly corresponds with the <see cref="System.Reflection.Emit.OpCodes.Call"/> instruction.
/// </para>
/// <para>
/// For both virtual (including overriden) and non-virtual (including static) methods, the exact specified method implementation is called, without virtual/override mechanics.
/// </para>
/// </remarks>
Call
}
/// <summary>The base class for all Harmony annotations (not meant to be used directly)</summary>
///
public class HarmonyAttribute : Attribute
{
/// <summary>The common information for all attributes</summary>
public HarmonyMethod info = new HarmonyMethod();
}
/// <summary>Annotation to define your Harmony patch methods</summary>
///
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Delegate | AttributeTargets.Method, AllowMultiple = true)]
public class HarmonyPatch : HarmonyAttribute
{
/// <summary>An empty annotation can be used together with TargetMethod(s)</summary>
///
public HarmonyPatch()
{
}
/// <summary>An annotation that specifies a class to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
///
public HarmonyPatch(Type declaringType)
{
info.declaringType = declaringType;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="argumentTypes">The argument types of the method or constructor to patch</param>
///
public HarmonyPatch(Type declaringType, Type[] argumentTypes)
{
info.declaringType = declaringType;
info.argumentTypes = argumentTypes;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
///
public HarmonyPatch(Type declaringType, string methodName)
{
info.declaringType = declaringType;
info.methodName = methodName;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
///
public HarmonyPatch(Type declaringType, string methodName, params Type[] argumentTypes)
{
info.declaringType = declaringType;
info.methodName = methodName;
info.argumentTypes = argumentTypes;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
/// <param name="argumentVariations">Array of <see cref="ArgumentType"/></param>
///
public HarmonyPatch(Type declaringType, string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
{
info.declaringType = declaringType;
info.methodName = methodName;
ParseSpecialArguments(argumentTypes, argumentVariations);
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodType">The <see cref="MethodType"/></param>
///
public HarmonyPatch(Type declaringType, MethodType methodType)
{
info.declaringType = declaringType;
info.methodType = methodType;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodType">The <see cref="MethodType"/></param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
///
public HarmonyPatch(Type declaringType, MethodType methodType, params Type[] argumentTypes)
{
info.declaringType = declaringType;
info.methodType = methodType;
info.argumentTypes = argumentTypes;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodType">The <see cref="MethodType"/></param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
/// <param name="argumentVariations">Array of <see cref="ArgumentType"/></param>
///
public HarmonyPatch(Type declaringType, MethodType methodType, Type[] argumentTypes, ArgumentType[] argumentVariations)
{
info.declaringType = declaringType;
info.methodType = methodType;
ParseSpecialArguments(argumentTypes, argumentVariations);
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="methodType">The <see cref="MethodType"/></param>
///
public HarmonyPatch(Type declaringType, string methodName, MethodType methodType)
{
info.declaringType = declaringType;
info.methodName = methodName;
info.methodType = methodType;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
///
public HarmonyPatch(string methodName)
{
info.methodName = methodName;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
///
public HarmonyPatch(string methodName, params Type[] argumentTypes)
{
info.methodName = methodName;
info.argumentTypes = argumentTypes;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
/// <param name="argumentVariations">An array of <see cref="ArgumentType"/></param>
///
public HarmonyPatch(string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
{
info.methodName = methodName;
ParseSpecialArguments(argumentTypes, argumentVariations);
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="methodType">The <see cref="MethodType"/></param>
///
public HarmonyPatch(string methodName, MethodType methodType)
{
info.methodName = methodName;
info.methodType = methodType;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodType">The <see cref="MethodType"/></param>
///
public HarmonyPatch(MethodType methodType)
{
info.methodType = methodType;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodType">The <see cref="MethodType"/></param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
///
public HarmonyPatch(MethodType methodType, params Type[] argumentTypes)
{
info.methodType = methodType;
info.argumentTypes = argumentTypes;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodType">The <see cref="MethodType"/></param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
/// <param name="argumentVariations">An array of <see cref="ArgumentType"/></param>
///
public HarmonyPatch(MethodType methodType, Type[] argumentTypes, ArgumentType[] argumentVariations)
{
info.methodType = methodType;
ParseSpecialArguments(argumentTypes, argumentVariations);
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
///
public HarmonyPatch(Type[] argumentTypes)
{
info.argumentTypes = argumentTypes;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
/// <param name="argumentVariations">An array of <see cref="ArgumentType"/></param>
///
public HarmonyPatch(Type[] argumentTypes, ArgumentType[] argumentVariations)
{
ParseSpecialArguments(argumentTypes, argumentVariations);
}
void ParseSpecialArguments(Type[] argumentTypes, ArgumentType[] argumentVariations)
{
if (argumentVariations is null || argumentVariations.Length == 0)
{
info.argumentTypes = argumentTypes;
return;
}
if (argumentTypes.Length < argumentVariations.Length)
throw new ArgumentException("argumentVariations contains more elements than argumentTypes", nameof(argumentVariations));
var types = new List<Type>();
for (var i = 0; i < argumentTypes.Length; i++)
{
var type = argumentTypes[i];
switch (argumentVariations[i])
{
case ArgumentType.Normal:
break;
case ArgumentType.Ref:
case ArgumentType.Out:
type = type.MakeByRefType();
break;
case ArgumentType.Pointer:
type = type.MakePointerType();
break;
}
types.Add(type);
}
info.argumentTypes = types.ToArray();
}
}
/// <summary>Annotation to define the original method for delegate injection</summary>
///
[AttributeUsage(AttributeTargets.Delegate, AllowMultiple = true)]
public class HarmonyDelegate : HarmonyPatch
{
/// <summary>An annotation that specifies a class to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
///
public HarmonyDelegate(Type declaringType)
: base(declaringType) { }
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="argumentTypes">The argument types of the method or constructor to patch</param>
///
public HarmonyDelegate(Type declaringType, Type[] argumentTypes)
: base(declaringType, argumentTypes) { }
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
///
public HarmonyDelegate(Type declaringType, string methodName)
: base(declaringType, methodName) { }
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
///
public HarmonyDelegate(Type declaringType, string methodName, params Type[] argumentTypes)
: base(declaringType, methodName, argumentTypes) { }
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
/// <param name="argumentVariations">Array of <see cref="ArgumentType"/></param>
///
public HarmonyDelegate(Type declaringType, string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
: base(declaringType, methodName, argumentTypes, argumentVariations) { }
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodDispatchType">The <see cref="MethodDispatchType"/></param>
///
public HarmonyDelegate(Type declaringType, MethodDispatchType methodDispatchType)
: base(declaringType, MethodType.Normal)
{
info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodDispatchType">The <see cref="MethodDispatchType"/></param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
///
public HarmonyDelegate(Type declaringType, MethodDispatchType methodDispatchType, params Type[] argumentTypes)
: base(declaringType, MethodType.Normal, argumentTypes)
{
info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodDispatchType">The <see cref="MethodDispatchType"/></param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
/// <param name="argumentVariations">Array of <see cref="ArgumentType"/></param>
///
public HarmonyDelegate(Type declaringType, MethodDispatchType methodDispatchType, Type[] argumentTypes, ArgumentType[] argumentVariations)
: base(declaringType, MethodType.Normal, argumentTypes, argumentVariations)
{
info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="declaringType">The declaring class/type</param>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="methodDispatchType">The <see cref="MethodDispatchType"/></param>
///
public HarmonyDelegate(Type declaringType, string methodName, MethodDispatchType methodDispatchType)
: base(declaringType, methodName, MethodType.Normal)
{
info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
///
public HarmonyDelegate(string methodName)
: base(methodName) { }
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
///
public HarmonyDelegate(string methodName, params Type[] argumentTypes)
: base(methodName, argumentTypes) { }
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
/// <param name="argumentVariations">An array of <see cref="ArgumentType"/></param>
///
public HarmonyDelegate(string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
: base(methodName, argumentTypes, argumentVariations) { }
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="methodDispatchType">The <see cref="MethodDispatchType"/></param>
///
public HarmonyDelegate(string methodName, MethodDispatchType methodDispatchType)
: base(methodName, MethodType.Normal)
{
info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
}
/// <summary>An annotation that specifies call dispatching mechanics for the delegate</summary>
/// <param name="methodDispatchType">The <see cref="MethodDispatchType"/></param>
///
public HarmonyDelegate(MethodDispatchType methodDispatchType)
{
info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodDispatchType">The <see cref="MethodDispatchType"/></param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
///
public HarmonyDelegate(MethodDispatchType methodDispatchType, params Type[] argumentTypes)
: base(MethodType.Normal, argumentTypes)
{
info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="methodDispatchType">The <see cref="MethodDispatchType"/></param>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
/// <param name="argumentVariations">An array of <see cref="ArgumentType"/></param>
///
public HarmonyDelegate(MethodDispatchType methodDispatchType, Type[] argumentTypes, ArgumentType[] argumentVariations)
: base(MethodType.Normal, argumentTypes, argumentVariations)
{
info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
}
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
///
public HarmonyDelegate(Type[] argumentTypes)
: base(argumentTypes) { }
/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="argumentTypes">An array of argument types to target overloads</param>
/// <param name="argumentVariations">An array of <see cref="ArgumentType"/></param>
///
public HarmonyDelegate(Type[] argumentTypes, ArgumentType[] argumentVariations)
: base(argumentTypes, argumentVariations) { }
}
/// <summary>Annotation to define your standin methods for reverse patching</summary>
///
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public class HarmonyReversePatch : HarmonyAttribute
{
/// <summary>An annotation that specifies the type of reverse patching</summary>
/// <param name="type">The <see cref="HarmonyReversePatchType"/> of the reverse patch</param>
///
public HarmonyReversePatch(HarmonyReversePatchType type = HarmonyReversePatchType.Original)
{
info.reversePatchType = type;
}
}
/// <summary>A Harmony annotation to define that all methods in a class are to be patched</summary>
///
[AttributeUsage(AttributeTargets.Class)]
public class HarmonyPatchAll : HarmonyAttribute
{
}
/// <summary>A Harmony annotation</summary>
///
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class HarmonyPriority : HarmonyAttribute
{
/// <summary>A Harmony annotation to define patch priority</summary>
/// <param name="priority">The priority</param>
///
public HarmonyPriority(int priority)
{
info.priority = priority;
}
}
/// <summary>A Harmony annotation</summary>
///
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class HarmonyBefore : HarmonyAttribute
{
/// <summary>A Harmony annotation to define that a patch comes before another patch</summary>
/// <param name="before">The array of harmony IDs of the other patches</param>
///
public HarmonyBefore(params string[] before)
{
info.before = before;
}
}
/// <summary>A Harmony annotation</summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class HarmonyAfter : HarmonyAttribute
{
/// <summary>A Harmony annotation to define that a patch comes after another patch</summary>
/// <param name="after">The array of harmony IDs of the other patches</param>
///
public HarmonyAfter(params string[] after)
{
info.after = after;
}
}
/// <summary>A Harmony annotation</summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class HarmonyDebug : HarmonyAttribute
{
/// <summary>A Harmony annotation to debug a patch (output uses <see cref="FileLog"/> to log to your Desktop)</summary>
///
public HarmonyDebug()
{
info.debug = true;
}
}
/// <summary>Specifies the Prepare function in a patch class</summary>
///
[AttributeUsage(AttributeTargets.Method)]
public class HarmonyPrepare : Attribute
{
}
/// <summary>Specifies the Cleanup function in a patch class</summary>
///
[AttributeUsage(AttributeTargets.Method)]
public class HarmonyCleanup : Attribute
{
}
/// <summary>Specifies the TargetMethod function in a patch class</summary>
///
[AttributeUsage(AttributeTargets.Method)]
public class HarmonyTargetMethod : Attribute
{
}
/// <summary>Specifies the TargetMethods function in a patch class</summary>
///
[AttributeUsage(AttributeTargets.Method)]
public class HarmonyTargetMethods : Attribute
{
}
/// <summary>Specifies the Prefix function in a patch class</summary>
///
[AttributeUsage(AttributeTargets.Method)]
public class HarmonyPrefix : Attribute
{
}
/// <summary>Specifies the Postfix function in a patch class</summary>
///
[AttributeUsage(AttributeTargets.Method)]
public class HarmonyPostfix : Attribute
{
}
/// <summary>Specifies the Transpiler function in a patch class</summary>
///
[AttributeUsage(AttributeTargets.Method)]
public class HarmonyTranspiler : Attribute
{
}
/// <summary>Specifies the Finalizer function in a patch class</summary>
///
[AttributeUsage(AttributeTargets.Method)]
public class HarmonyFinalizer : Attribute
{
}
/// <summary>A Harmony annotation</summary>
///
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)]
public class HarmonyArgument : Attribute
{
/// <summary>The name of the original argument</summary>
///
public string OriginalName { get; private set; }
/// <summary>The index of the original argument</summary>
///
public int Index { get; private set; }
/// <summary>The new name of the original argument</summary>
///
public string NewName { get; private set; }
/// <summary>An annotation to declare injected arguments by name</summary>
///
public HarmonyArgument(string originalName) : this(originalName, null)
{
}
/// <summary>An annotation to declare injected arguments by index</summary>
/// <param name="index">Zero-based index</param>
///
public HarmonyArgument(int index) : this(index, null)
{
}
/// <summary>An annotation to declare injected arguments by renaming them</summary>
/// <param name="originalName">Name of the original argument</param>
/// <param name="newName">New name</param>
///
public HarmonyArgument(string originalName, string newName)
{
OriginalName = originalName;
Index = -1;
NewName = newName;
}
/// <summary>An annotation to declare injected arguments by index and renaming them</summary>
/// <param name="index">Zero-based index</param>
/// <param name="name">New name</param>
///
public HarmonyArgument(int index, string name)
{
OriginalName = null;
Index = index;
NewName = name;
}
}
}
| mit |
Joseki/Sandbox | app/MyApplication/Navigation/Navigation/NavigationControlFactory.php | 166 | <?php
namespace MyApplication\Navigation\Navigation;
interface NavigationControlFactory
{
/**
* @return NavigationControl
*/
function create();
}
| mit |
marshmallow-code/marshmallow-jsonapi | tests/conftest.py | 1521 | import pytest
from tests.base import Author, Post, Comment, Keyword, fake
def make_author():
return Author(
id=fake.random_int(),
first_name=fake.first_name(),
last_name=fake.last_name(),
twitter=fake.domain_word(),
)
def make_post(with_comments=True, with_author=True, with_keywords=True):
comments = [make_comment() for _ in range(2)] if with_comments else []
keywords = [make_keyword() for _ in range(3)] if with_keywords else []
author = make_author() if with_author else None
return Post(
id=fake.random_int(),
title=fake.catch_phrase(),
author=author,
author_id=author.id if with_author else None,
comments=comments,
keywords=keywords,
)
def make_comment(with_author=True):
author = make_author() if with_author else None
return Comment(id=fake.random_int(), body=fake.bs(), author=author)
def make_keyword():
return Keyword(keyword=fake.domain_word())
@pytest.fixture()
def author():
return make_author()
@pytest.fixture()
def authors():
return [make_author() for _ in range(3)]
@pytest.fixture()
def comments():
return [make_comment() for _ in range(3)]
@pytest.fixture()
def post():
return make_post()
@pytest.fixture()
def post_with_null_comment():
return make_post(with_comments=False)
@pytest.fixture()
def post_with_null_author():
return make_post(with_author=False)
@pytest.fixture()
def posts():
return [make_post() for _ in range(3)]
| mit |
uiuxsrini/Material | apis/geolocation-api-demo.html | 6289 | <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="author" content="Aurelio De Rosa">
<title>Geolocation API Demo by Aurelio De Rosa</title>
<style>
*
{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body
{
max-width: 500px;
margin: 2em auto;
padding: 0 0.5em;
font-size: 20px;
}
h1
{
text-align: center;
}
.api-support
{
display: block;
}
.hidden
{
display: none;
}
.buttons-wrapper
{
text-align: center;
}
.button-demo
{
padding: 0.5em;
margin: 1em auto;
}
.g-info
{
font-weight: bold;
}
#log
{
height: 200px;
width: 100%;
overflow-y: scroll;
border: 1px solid #333333;
line-height: 1.3em;
}
.author
{
display: block;
margin-top: 1em;
}
</style>
</head>
<body>
<a href="http://code.tutsplus.com/tutorials/an-introduction-to-the-geolocation-api--cms-20071">Go back to the article</a>
<span id="g-unsupported" class="api-support hidden">API not supported</span>
<h1>Geolocation API</h1>
<div class="buttons-wrapper">
<button id="button-get-position" class="button-demo">Get current position</button>
<button id="button-watch-position" class="button-demo">Watch position</button>
<button id="button-stop-watching" class="button-demo">Stop watching position</button>
</div>
<h2>Information</h2>
<div id="g-information">
<ul>
<li>
Your position is <span id="latitude" class="g-info">unavailable</span>° latitude,
<span id="longitude" class="g-info">unavailable</span>° longitude (with an accuracy of
<span id="position-accuracy" class="g-info">unavailable</span> meters)
</li>
<li>
Your altitude is <span id="altitude" class="g-info">unavailable</span> meters
(with an accuracy of <span id="altitude-accuracy" class="g-info">unavailable</span> meters)
</li>
<li>You're <span id="heading" class="g-info">unavailable</span>° from the True north</li>
<li>You're moving at a speed of <span id="speed" class="g-info">unavailable</span>° meters/second</li>
<li>Data updated at <span id="timestamp" class="g-info">unavailable</span></li>
</ul>
</div>
<h3>Log</h3>
<div id="log"></div>
<button id="clear-log" class="button-demo">Clear log</button>
<small class="author">
Demo created by <a href="http://www.audero.it">Aurelio De Rosa</a>
(<a href="https://twitter.com/AurelioDeRosa">@AurelioDeRosa</a>).<br />
This demo is part of the <a href="https://github.com/AurelioDeRosa/HTML5-API-demos">HTML5 API demos repository</a>.
</small>
<script>
if (!(window.navigator && window.navigator.geolocation)) {
document.getElementById('g-unsupported').classList.remove('hidden');
['button-get-position', 'button-watch-position', 'button-stop-watching'].forEach(function(elementId) {
document.getElementById(elementId).setAttribute('disabled', 'disabled');
});
} else {
var log = document.getElementById('log');
var watchId = null;
var positionOptions = {
enableHighAccuracy: true,
timeout: 10 * 1000, // 10 seconds
maximumAge: 30 * 1000 // 30 seconds
};
function success(position) {
document.getElementById('latitude').innerHTML = position.coords.latitude;
document.getElementById('longitude').innerHTML = position.coords.longitude;
document.getElementById('position-accuracy').innerHTML = position.coords.accuracy;
document.getElementById('altitude').innerHTML = position.coords.altitude ? position.coords.altitude :
'unavailable';
document.getElementById('altitude-accuracy').innerHTML = position.coords.altitudeAccuracy ?
position.coords.altitudeAccuracy :
'unavailable';
document.getElementById('heading').innerHTML = position.coords.heading ? position.coords.heading :
'unavailable';
document.getElementById('speed').innerHTML = position.coords.speed ? position.coords.speed :
'unavailable';
document.getElementById('timestamp').innerHTML = (new Date(position.timestamp)).toString();
log.innerHTML = 'Position succesfully retrieved<br />' + log.innerHTML;
}
function error(positionError) {
log.innerHTML = 'Error: ' + positionError.message + '<br />' + log.innerHTML;
}
document.getElementById('button-get-position').addEventListener('click', function() {
navigator.geolocation.getCurrentPosition(success, error, positionOptions);
});
document.getElementById('button-watch-position').addEventListener('click', function() {
watchId = navigator.geolocation.watchPosition(success, error, positionOptions);
});
document.getElementById('button-stop-watching').addEventListener('click', function() {
if (watchId !== null) {
navigator.geolocation.clearWatch(watchId);
log.innerHTML = 'Stopped watching position<br />' + log.innerHTML;
}
});
document.getElementById('clear-log').addEventListener('click', function() {
log.innerHTML = '';
});
}
</script>
</body>
</html>
| mit |
LisaOrtola/Mobileapp | index.html | 2877 | <!DOCTYPE html>
<!--[if IEMobile 7 ]> <html class="no-js iem7"> <![endif]-->
<!--[if (gt IEMobile 7)|!(IEMobile)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="cleartype" content="on">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/touch/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/touch/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/touch/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="img/touch/apple-touch-icon-57x57-precomposed.png">
<link rel="shortcut icon" href="img/touch/apple-touch-icon.png">
<!-- Tile icon for Win8 (144x144 + tile color) -->
<meta name="msapplication-TileImage" content="img/touch/apple-touch-icon-144x144-precomposed.png">
<meta name="msapplication-TileColor" content="#222222">
<!-- For iOS web apps. Delete if not needed. https://github.com/h5bp/mobile-boilerplate/issues/94 -->
<!--
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="">
-->
<!-- This script prevents links from opening in Mobile Safari. https://gist.github.com/1042026 -->
<!--
<script>(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone")</script>
-->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
</head>
<body>
Blablabla c'est moi Lisa
<script src="js/vendor/zepto.min.js"></script>
<script src="js/helper.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
var _gaq=[["_setAccount","UA-XXXXX-X"],["_trackPageview"]];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
s.parentNode.insertBefore(g,s)}(document,"script"));
</script>
</body>
</html>
| mit |
jabhij/MITx-6.00.1x-Python- | Week-3/L5/Prob3.py | 268 | # Declaring a Function
def recurPowerNew(base, exp):
# Base case is when exp = 0
if exp <= 0:
return 1
# Recursive Call
elif exp % 2 == 0:
return recurPowerNew(base*base, exp/2)
return base * recurPowerNew(base, exp - 1)
| mit |
cdiazbas/SIRcode | SIR2015/leemalla2.f | 5534 | c rutina leemallab
c lee el fichero de control de lineas y longitudes de onda:'mallaobs'
c ntau : numero de puntos en tau
c tau : log10(tau)
c ntl : numero total de lineas
c nlin : indice de cada linea y de cada blend
c npas : numero de puntos en cada linea
c dlamda:cada delta de l.d.o. en ma
c nble :numero de blends de cada linea
subroutine leemalla2(mallaobs,ntl,nli,nliobs,nlin,npasobs,
& npas,dlamdaobs,dlamda,nble,nposi,indice)
include 'PARAMETER' !por kl
integer npasobs(*),npas(kl),nble(kl),nd(kl),nposi(*),nlin(kl),ndd(kl,kl),nblee(kl)
real*4 dlamdaobs(*),dlamda(kld),dini,dipa,difi,dinii(kl),dipaa(kl),difii(kt)
integer indice(*),nddd(50),blanco
character mallaobs*(*),mensajito*31
character*80 men1,men2,men3
character*100 control
common/canal/icanal
common/nombrecontrol/control
common/nciclos/nciclos
common/contraste/contr
men1=' '
men2=' '
men3=' '
if(contr.gt.-1.e5.and.nciclos.gt.0)then
ntl=ntl-1
nliobs=nliobs-1
end if
ican=57
mensajito=' containing the wavelength grid'
call cabecera(ican,mallaobs,mensajito,ifail)
if(ifail.eq.1)goto 999
jj=0
k=0
nli=0
numlin=0
do i=1,1000
call mreadmalla(ican,ntonto,nddd,ddinii,ddipaa,ddifii,ierror,blanco)
if(ierror.eq.1)goto 8 !si he llegado al final del fichero
if(blanco.ne.1)then
numlin=numlin+1
if(numlin.gt.kl.or.ntonto.gt.kl)then
men1='STOP: The number of lines in the wavelength grid is larger than the '
men2=' current limit. Decrease this number or change the PARAMETER file.'
call mensaje(2,men1,men2,men3)
end if
nblee(numlin)=ntonto
dinii(numlin)=ddinii
dipaa(numlin)=ddipaa
difii(numlin)=ddifii
do j=1,nblee(numlin)
ndd(numlin,j)=nddd(j)
enddo
endif !el de blanco.ne.1
enddo
8 close(ican)
ntl=numlin
c Ahora las ordenamos como en los perfiles:
do i=1,ntl !indice en los perfiles
icheck=0
do l=1,numlin !indice en la malla
c print*,'indice(i) vale',i,indice(i)
if(indice(i).eq.ndd(l,1).and.icheck.lt.1)then !he encontrado una
icheck=icheck+1
nble(i)=nblee(l)
do ll=1,nblee(l)
nd(ll)=ndd(l,ll)
enddo
dini=dinii(l)
dipa=dipaa(l)
difi=difii(l)
do j=1,nble(i)
jj=jj+1
nlin(jj)=nd(j)
c print*,'nlin,jj',jj,nlin(jj)
end do
ntlblends=jj
pasmin=1.e30
primero=dlamdaobs(k+1)
ultimo=dlamdaobs(k+npasobs(i))
do j=1,npasobs(i)-1
k=k+1
pasoobs=dlamdaobs(k+1)-dlamdaobs(k)
pasmin=min(pasmin,pasoobs) !cambio amin0 por min
end do
k=k+1
c if(dipa.gt.pasmin)dipa=pasmin !provisional!!!!
if(dini.gt.primero)dini=primero
if(difi.lt.ultimo)difi=ultimo
ntimes=int(pasmin/dipa) !numero de veces que la red fina divide a la obs
c dipa=pasmin/ntimes
n1=nint((primero-dini)/dipa) !numero de puntos anteriores
n2=nint((difi-ultimo)/dipa) !nuero de puntos posteriores
dini=primero-n1*dipa
difi=ultimo+n2*dipa
c print*,'primero,ultimo,n1,n2,dini,difi',primero,ultimo,n1,n2,dini,difi
npas(i)=(difi-dini)/dipa+1
if(10*( (difi-dini)/dipa+1 -int( (difi-dini)/dipa+1 ) ).gt..5) npas(i)=npas(i)+1
do j=1,npas(i)
nli=nli+1
dlamda(nli)=dini+(j-1)*dipa
c print*,'en la malla,la serie es',nli,dlamda(nli),dipa
end do
endif
end do !fin del do en l
if(icheck.eq.0)then
men1='STOP: There are lines in the observed/stray light profiles which'
men2=' do not appear in the wavelength grid.'
men3=' Check also the wavelength grid for missing : symbols.'
call mensaje(3,men1,men2,men3)
endif
9 enddo !fin del do en i
c print*,'pasos 1 y 2',npas(1),npas(2)
k=1
epsilon=dipa/2.
do i=1,nliobs
dd=dlamdaobs(i)
do while(k.lt.nli.and.dd.gt.dlamda(k)+epsilon)
k=k+1
end do
do while(k.lt.nli.and.dd.lt.dlamda(k)-epsilon)
k=k+1
end do
do while(k.lt.nli.and.dd.gt.dlamda(k)+epsilon)
k=k+1
end do
nposi(i)=k
end do
if(contr.gt.-1.e5.and.nciclos.gt.0)then
ntl=ntl+1
ntlblends=ntlblends+1
nlin(ntlblends)=0
npas(ntl)=1
nble(ntl)=1
nli=nli+1
nliobs=nliobs+1
dlamda(nli)=0.
nposi(nliobs)=nli
end if
212 print*,'Number of wavelengths in the wavelength grid : ',nli
close(ican)
return
c ------------------------------------------------------------------------
c Mensajes de error:
999 men1='STOP: The file containing the wavelength grid does NOT exist:'
men2=mallaobs
call mensaje(2,men1,men2,men3)
992 men1='STOP: Incorrect format in the file containing the wavelength grid:'
men2=mallaobs
call mensaje(2,men1,men2,men3)
end
| mit |
danielsneijers/markslide | flow-typed/npm/react-redux_vx.x.x.js | 11881 | // flow-typed signature: 267f077135db8f8ca8e152b4b262406e
// flow-typed version: <<STUB>>/react-redux_v^5.0.4/flow_v0.46.0
/**
* This is an autogenerated libdef stub for:
*
* 'react-redux'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/
declare module 'react-redux' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'react-redux/dist/react-redux' {
declare module.exports: any;
}
declare module 'react-redux/dist/react-redux.min' {
declare module.exports: any;
}
declare module 'react-redux/es/components/connectAdvanced' {
declare module.exports: any;
}
declare module 'react-redux/es/components/Provider' {
declare module.exports: any;
}
declare module 'react-redux/es/connect/connect' {
declare module.exports: any;
}
declare module 'react-redux/es/connect/mapDispatchToProps' {
declare module.exports: any;
}
declare module 'react-redux/es/connect/mapStateToProps' {
declare module.exports: any;
}
declare module 'react-redux/es/connect/mergeProps' {
declare module.exports: any;
}
declare module 'react-redux/es/connect/selectorFactory' {
declare module.exports: any;
}
declare module 'react-redux/es/connect/verifySubselectors' {
declare module.exports: any;
}
declare module 'react-redux/es/connect/wrapMapToProps' {
declare module.exports: any;
}
declare module 'react-redux/es/index' {
declare module.exports: any;
}
declare module 'react-redux/es/utils/PropTypes' {
declare module.exports: any;
}
declare module 'react-redux/es/utils/shallowEqual' {
declare module.exports: any;
}
declare module 'react-redux/es/utils/Subscription' {
declare module.exports: any;
}
declare module 'react-redux/es/utils/verifyPlainObject' {
declare module.exports: any;
}
declare module 'react-redux/es/utils/warning' {
declare module.exports: any;
}
declare module 'react-redux/es/utils/wrapActionCreators' {
declare module.exports: any;
}
declare module 'react-redux/lib/components/connectAdvanced' {
declare module.exports: any;
}
declare module 'react-redux/lib/components/Provider' {
declare module.exports: any;
}
declare module 'react-redux/lib/connect/connect' {
declare module.exports: any;
}
declare module 'react-redux/lib/connect/mapDispatchToProps' {
declare module.exports: any;
}
declare module 'react-redux/lib/connect/mapStateToProps' {
declare module.exports: any;
}
declare module 'react-redux/lib/connect/mergeProps' {
declare module.exports: any;
}
declare module 'react-redux/lib/connect/selectorFactory' {
declare module.exports: any;
}
declare module 'react-redux/lib/connect/verifySubselectors' {
declare module.exports: any;
}
declare module 'react-redux/lib/connect/wrapMapToProps' {
declare module.exports: any;
}
declare module 'react-redux/lib/index' {
declare module.exports: any;
}
declare module 'react-redux/lib/utils/PropTypes' {
declare module.exports: any;
}
declare module 'react-redux/lib/utils/shallowEqual' {
declare module.exports: any;
}
declare module 'react-redux/lib/utils/Subscription' {
declare module.exports: any;
}
declare module 'react-redux/lib/utils/verifyPlainObject' {
declare module.exports: any;
}
declare module 'react-redux/lib/utils/warning' {
declare module.exports: any;
}
declare module 'react-redux/lib/utils/wrapActionCreators' {
declare module.exports: any;
}
declare module 'react-redux/src/components/connectAdvanced' {
declare module.exports: any;
}
declare module 'react-redux/src/components/Provider' {
declare module.exports: any;
}
declare module 'react-redux/src/connect/connect' {
declare module.exports: any;
}
declare module 'react-redux/src/connect/mapDispatchToProps' {
declare module.exports: any;
}
declare module 'react-redux/src/connect/mapStateToProps' {
declare module.exports: any;
}
declare module 'react-redux/src/connect/mergeProps' {
declare module.exports: any;
}
declare module 'react-redux/src/connect/selectorFactory' {
declare module.exports: any;
}
declare module 'react-redux/src/connect/verifySubselectors' {
declare module.exports: any;
}
declare module 'react-redux/src/connect/wrapMapToProps' {
declare module.exports: any;
}
declare module 'react-redux/src/index' {
declare module.exports: any;
}
declare module 'react-redux/src/utils/PropTypes' {
declare module.exports: any;
}
declare module 'react-redux/src/utils/shallowEqual' {
declare module.exports: any;
}
declare module 'react-redux/src/utils/Subscription' {
declare module.exports: any;
}
declare module 'react-redux/src/utils/verifyPlainObject' {
declare module.exports: any;
}
declare module 'react-redux/src/utils/warning' {
declare module.exports: any;
}
declare module 'react-redux/src/utils/wrapActionCreators' {
declare module.exports: any;
}
// Filename aliases
declare module 'react-redux/dist/react-redux.js' {
declare module.exports: $Exports<'react-redux/dist/react-redux'>;
}
declare module 'react-redux/dist/react-redux.min.js' {
declare module.exports: $Exports<'react-redux/dist/react-redux.min'>;
}
declare module 'react-redux/es/components/connectAdvanced.js' {
declare module.exports: $Exports<'react-redux/es/components/connectAdvanced'>;
}
declare module 'react-redux/es/components/Provider.js' {
declare module.exports: $Exports<'react-redux/es/components/Provider'>;
}
declare module 'react-redux/es/connect/connect.js' {
declare module.exports: $Exports<'react-redux/es/connect/connect'>;
}
declare module 'react-redux/es/connect/mapDispatchToProps.js' {
declare module.exports: $Exports<'react-redux/es/connect/mapDispatchToProps'>;
}
declare module 'react-redux/es/connect/mapStateToProps.js' {
declare module.exports: $Exports<'react-redux/es/connect/mapStateToProps'>;
}
declare module 'react-redux/es/connect/mergeProps.js' {
declare module.exports: $Exports<'react-redux/es/connect/mergeProps'>;
}
declare module 'react-redux/es/connect/selectorFactory.js' {
declare module.exports: $Exports<'react-redux/es/connect/selectorFactory'>;
}
declare module 'react-redux/es/connect/verifySubselectors.js' {
declare module.exports: $Exports<'react-redux/es/connect/verifySubselectors'>;
}
declare module 'react-redux/es/connect/wrapMapToProps.js' {
declare module.exports: $Exports<'react-redux/es/connect/wrapMapToProps'>;
}
declare module 'react-redux/es/index.js' {
declare module.exports: $Exports<'react-redux/es/index'>;
}
declare module 'react-redux/es/utils/PropTypes.js' {
declare module.exports: $Exports<'react-redux/es/utils/PropTypes'>;
}
declare module 'react-redux/es/utils/shallowEqual.js' {
declare module.exports: $Exports<'react-redux/es/utils/shallowEqual'>;
}
declare module 'react-redux/es/utils/Subscription.js' {
declare module.exports: $Exports<'react-redux/es/utils/Subscription'>;
}
declare module 'react-redux/es/utils/verifyPlainObject.js' {
declare module.exports: $Exports<'react-redux/es/utils/verifyPlainObject'>;
}
declare module 'react-redux/es/utils/warning.js' {
declare module.exports: $Exports<'react-redux/es/utils/warning'>;
}
declare module 'react-redux/es/utils/wrapActionCreators.js' {
declare module.exports: $Exports<'react-redux/es/utils/wrapActionCreators'>;
}
declare module 'react-redux/lib/components/connectAdvanced.js' {
declare module.exports: $Exports<'react-redux/lib/components/connectAdvanced'>;
}
declare module 'react-redux/lib/components/Provider.js' {
declare module.exports: $Exports<'react-redux/lib/components/Provider'>;
}
declare module 'react-redux/lib/connect/connect.js' {
declare module.exports: $Exports<'react-redux/lib/connect/connect'>;
}
declare module 'react-redux/lib/connect/mapDispatchToProps.js' {
declare module.exports: $Exports<'react-redux/lib/connect/mapDispatchToProps'>;
}
declare module 'react-redux/lib/connect/mapStateToProps.js' {
declare module.exports: $Exports<'react-redux/lib/connect/mapStateToProps'>;
}
declare module 'react-redux/lib/connect/mergeProps.js' {
declare module.exports: $Exports<'react-redux/lib/connect/mergeProps'>;
}
declare module 'react-redux/lib/connect/selectorFactory.js' {
declare module.exports: $Exports<'react-redux/lib/connect/selectorFactory'>;
}
declare module 'react-redux/lib/connect/verifySubselectors.js' {
declare module.exports: $Exports<'react-redux/lib/connect/verifySubselectors'>;
}
declare module 'react-redux/lib/connect/wrapMapToProps.js' {
declare module.exports: $Exports<'react-redux/lib/connect/wrapMapToProps'>;
}
declare module 'react-redux/lib/index.js' {
declare module.exports: $Exports<'react-redux/lib/index'>;
}
declare module 'react-redux/lib/utils/PropTypes.js' {
declare module.exports: $Exports<'react-redux/lib/utils/PropTypes'>;
}
declare module 'react-redux/lib/utils/shallowEqual.js' {
declare module.exports: $Exports<'react-redux/lib/utils/shallowEqual'>;
}
declare module 'react-redux/lib/utils/Subscription.js' {
declare module.exports: $Exports<'react-redux/lib/utils/Subscription'>;
}
declare module 'react-redux/lib/utils/verifyPlainObject.js' {
declare module.exports: $Exports<'react-redux/lib/utils/verifyPlainObject'>;
}
declare module 'react-redux/lib/utils/warning.js' {
declare module.exports: $Exports<'react-redux/lib/utils/warning'>;
}
declare module 'react-redux/lib/utils/wrapActionCreators.js' {
declare module.exports: $Exports<'react-redux/lib/utils/wrapActionCreators'>;
}
declare module 'react-redux/src/components/connectAdvanced.js' {
declare module.exports: $Exports<'react-redux/src/components/connectAdvanced'>;
}
declare module 'react-redux/src/components/Provider.js' {
declare module.exports: $Exports<'react-redux/src/components/Provider'>;
}
declare module 'react-redux/src/connect/connect.js' {
declare module.exports: $Exports<'react-redux/src/connect/connect'>;
}
declare module 'react-redux/src/connect/mapDispatchToProps.js' {
declare module.exports: $Exports<'react-redux/src/connect/mapDispatchToProps'>;
}
declare module 'react-redux/src/connect/mapStateToProps.js' {
declare module.exports: $Exports<'react-redux/src/connect/mapStateToProps'>;
}
declare module 'react-redux/src/connect/mergeProps.js' {
declare module.exports: $Exports<'react-redux/src/connect/mergeProps'>;
}
declare module 'react-redux/src/connect/selectorFactory.js' {
declare module.exports: $Exports<'react-redux/src/connect/selectorFactory'>;
}
declare module 'react-redux/src/connect/verifySubselectors.js' {
declare module.exports: $Exports<'react-redux/src/connect/verifySubselectors'>;
}
declare module 'react-redux/src/connect/wrapMapToProps.js' {
declare module.exports: $Exports<'react-redux/src/connect/wrapMapToProps'>;
}
declare module 'react-redux/src/index.js' {
declare module.exports: $Exports<'react-redux/src/index'>;
}
declare module 'react-redux/src/utils/PropTypes.js' {
declare module.exports: $Exports<'react-redux/src/utils/PropTypes'>;
}
declare module 'react-redux/src/utils/shallowEqual.js' {
declare module.exports: $Exports<'react-redux/src/utils/shallowEqual'>;
}
declare module 'react-redux/src/utils/Subscription.js' {
declare module.exports: $Exports<'react-redux/src/utils/Subscription'>;
}
declare module 'react-redux/src/utils/verifyPlainObject.js' {
declare module.exports: $Exports<'react-redux/src/utils/verifyPlainObject'>;
}
declare module 'react-redux/src/utils/warning.js' {
declare module.exports: $Exports<'react-redux/src/utils/warning'>;
}
declare module 'react-redux/src/utils/wrapActionCreators.js' {
declare module.exports: $Exports<'react-redux/src/utils/wrapActionCreators'>;
}
| mit |
black-trooper/semantic-ui-riot | test/spec/popup/su-popup.spec.js | 2656 | import * as riot from 'riot'
import { init, compile } from '../../helpers/'
import TargetComponent from '../../../dist/tags/popup/su-popup.js'
describe('su-popup', function () {
let element, component
let spyOnMouseover, spyOnMouseout
init(riot)
const mount = opts => {
const option = Object.assign({
'onmouseover': spyOnMouseover,
'onmouseout': spyOnMouseout,
}, opts)
element = document.createElement('app')
riot.register('su-popup', TargetComponent)
const AppComponent = compile(`
<app>
<su-popup
tooltip="{ props.tooltip }"
data-title="{ props.dataTitle }"
data-variation="{ props.dataVariation }"
onmouseover="{ () => dispatch('mouseover') }"
onmouseout="{ () => dispatch('mouseout') }"
><i class="add icon"></i></su-popup>
</app>`)
riot.register('app', AppComponent)
component = riot.mount(element, option)[0]
}
beforeEach(function () {
spyOnMouseover = sinon.spy()
spyOnMouseout = sinon.spy()
})
afterEach(function () {
riot.unregister('su-popup')
riot.unregister('app')
})
it('is mounted', function () {
mount()
expect(component).to.be.ok
})
it('show and hide popup', function () {
mount({
tooltip: 'Add users to your feed'
})
expect(component.$('.content').innerHTML).to.equal('Add users to your feed')
expect(component.$('su-popup .ui.popup').classList.contains('nowrap')).to.equal(true)
fireEvent(component.$('su-popup .ui.popup'), 'mouseover')
expect(spyOnMouseover).to.have.been.calledOnce
expect(component.$('su-popup .ui.popup').classList.contains('visible')).to.equal(true)
expect(component.$('su-popup .ui.popup').classList.contains('hidden')).to.equal(false)
fireEvent(component.$('su-popup .ui.popup'), 'mouseout')
expect(spyOnMouseout).to.have.been.calledOnce
expect(component.$('su-popup .ui.popup').classList.contains('visible')).to.equal(false)
expect(component.$('su-popup .ui.popup').classList.contains('hidden')).to.equal(true)
})
it('header', function () {
mount({
tooltip: 'Add users to your feed',
dataTitle: 'Title'
})
expect(component.$('.header').innerHTML).to.equal('Title')
expect(component.$('.content').innerHTML).to.equal('Add users to your feed')
})
it('wide', function () {
mount({
tooltip: 'Add users to your feed',
dataVariation: 'wide'
})
expect(component.$('su-popup .ui.popup').classList.contains('wide')).to.equal(true)
expect(component.$('su-popup .ui.popup').classList.contains('nowrap')).to.equal(false)
})
})
| mit |
Igorocky/lesn | client/src/main/scala/app/components/semanticui/Menu.scala | 1482 | package app.components.semanticui
import japgolly.scalajs.react
import japgolly.scalajs.react.{Callback, Children}
import japgolly.scalajs.react.vdom.VdomNode
import scala.scalajs.js
object Menu {
val component = react.JsComponent[js.Object, Children.Varargs, Null](SemanticUiComponents.Menu)
def apply()(children: VdomNode*) = {
val props = js.Dynamic.literal(
)
component(props)(children:_*)
}
object Item {
val component = react.JsComponent[js.Object, Children.Varargs, Null](SemanticUiComponents.Menu.Item)
def apply(name: js.UndefOr[String] = js.undefined,
as: js.UndefOr[String] = js.undefined,
active: js.UndefOr[Boolean] = js.undefined,
onClick: Callback = Callback.empty,
position: js.UndefOr[Position.Value] = js.undefined,
)(children: VdomNode*) = {
val props = js.Dynamic.literal(
name = name,
as = as,
active = active,
onClick = onClick.toJsCallback,
position = position.map(Position.toStr),
)
component(props)(children:_*)
}
}
object Menu {
val component = react.JsComponent[js.Object, Children.Varargs, Null](SemanticUiComponents.Menu.Menu)
def apply(position: js.UndefOr[Position.Value] = js.undefined,
)(children: VdomNode*) = {
val props = js.Dynamic.literal(
position = position.map(Position.toStr),
)
component(props)(children:_*)
}
}
}
| mit |
kenegozi/graph_engine | lib/graph_engine.rb | 54 | require "graph_engine/engine"
module GraphEngine
end
| mit |
ngx-formly/ngx-formly | demo/src/app/examples/other/material-prefix-suffix/config.module.ts | 2128 | import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { SharedModule, ExamplesRouterViewerComponent } from '../../../shared';
import { AppModule } from './app.module';
import { AppComponent } from './app.component';
@NgModule({
imports: [
SharedModule,
AppModule,
RouterModule.forChild([
{
path: '',
component: ExamplesRouterViewerComponent,
data: {
examples: [
{
title: 'Material Prefix and Suffix',
description: `
This demonstrates adding a material suffix and prefix for material form fields.
`,
component: AppComponent,
files: [
{
file: 'app.component.html',
content: require('!!highlight-loader?raw=true&lang=html!./app.component.html'),
filecontent: require('!!raw-loader!./app.component.html'),
},
{
file: 'app.component.ts',
content: require('!!highlight-loader?raw=true&lang=typescript!./app.component.ts'),
filecontent: require('!!raw-loader!./app.component.ts'),
},
{
file: 'addons.wrapper.ts',
content: require('!!highlight-loader?raw=true&lang=typescript!./addons.wrapper.ts'),
filecontent: require('!!raw-loader!./addons.wrapper.ts'),
},
{
file: 'addons.extension.ts',
content: require('!!highlight-loader?raw=true&lang=typescript!./addons.extension.ts'),
filecontent: require('!!raw-loader!./addons.extension.ts'),
},
{
file: 'app.module.ts',
content: require('!!highlight-loader?raw=true&lang=typescript!./app.module.ts'),
filecontent: require('!!raw-loader!./app.module.ts'),
},
],
},
],
},
},
]),
],
})
export class ConfigModule {}
| mit |
poyrazus/docker | README.md | 65 | # docker images
This repository includes docker container images
| mit |
ziedAb/PVMourakiboun | src/data/middleware/auth-check.js | 874 | const jwt = require('jsonwebtoken');
const User = require('../models/User');
// import { port, auth } from '../../config';
/**
* The Auth Checker middleware function.
*/
module.exports = (req, res, next) => {
if (!req.headers.authorization) {
return res.status(401).end();
}
// get the last part from a authorization header string like "bearer token-value"
const token = req.headers.authorization.split(' ')[1];
// decode the token using a secret key-phrase
return jwt.verify(token, "React Starter Kit", (err, decoded) => {
// the 401 code is for unauthorized status
if (err) { return res.status(401).end(); }
const userId = decoded.sub;
// check if a user exists
return User.findById(userId, (userErr, user) => {
if (userErr || !user) {
return res.status(401).end();
}
return next();
});
});
};
| mit |
HMNikolova/Telerik_Academy | CSharpPartOne/6. Loops/10. OddAndEvenProduct/OddAndEvenProduct.cs | 1480 | //10. Odd and Even Product
//You are given n integers (given in a single line, separated by a space).
//Write a program that checks whether the product of the odd elements is equal to the product of the even elements.
//Elements are counted from 1 to n, so the first element is odd, the second is even, etc.
using System;
class OddAndEvenProduct
{
static void Main()
{
Console.WriteLine("Odd And Even Product");
Console.Write("Enter a numbers in a single line separated with space: ");
string[] input = Console.ReadLine().Split();
int oddProduct = 1;
int evenProdduct = 1;
for (int index = 0; index < input.Length; index++)
{
int num = int.Parse(input[index]);
if (index %2 == 0 || index == 0)
{
oddProduct *= num;
}
else
{
evenProdduct *= num;
}
}
if (oddProduct == evenProdduct)
{
Console.WriteLine("yes");
Console.WriteLine("product = {0}", oddProduct);
}
else
{
Console.WriteLine("no");
Console.WriteLine("odd Product = {0}", oddProduct);
Console.WriteLine("even Product = {0}", evenProdduct);
}
}
}
| mit |
Andras-Simon/nodebp | second.js | 1982 | var Ringpop = require('ringpop');
var TChannel = require('TChannel');
var express = require('express');
var NodeCache = require('node-cache');
var cache = new NodeCache();
var host = '127.0.0.1'; // not recommended for production
var httpPort = process.env.PORT || 8080;
var port = httpPort - 5080;
var bootstrapNodes = ['127.0.0.1:3000'];
var tchannel = new TChannel();
var subChannel = tchannel.makeSubChannel({
serviceName: 'ringpop',
trace: false
});
var ringpop = new Ringpop({
app: 'yourapp',
hostPort: host + ':' + port,
channel: subChannel
});
ringpop.setupChannel();
ringpop.channel.listen(port, host, function onListen() {
console.log('TChannel is listening on ' + port);
ringpop.bootstrap(bootstrapNodes,
function onBootstrap(err) {
if (err) {
console.log('Error: Could not bootstrap ' + ringpop.whoami());
process.exit(1);
}
console.log('Ringpop ' + ringpop.whoami() + ' has bootstrapped!');
});
// This is how you wire up a handler for forwarded requests
ringpop.on('request', handleReq);
});
var server = express();
server.get('/*', onReq);
server.listen(httpPort, function onListen() {
console.log('Server is listening on ' + httpPort);
});
function extractKey(req) {
var urlParts = req.url.split('/');
if (urlParts.length < 3) return ''; // URL does not have 2 parts...
return urlParts[1];
}
function onReq(req, res) {
var key = extractKey(req);
if (ringpop.handleOrProxy(key, req, res)) {
handleReq(req, res);
}
}
function handleReq(req, res) {
cache.get(req.url, function(err, value) {
if (value == undefined) {
var key = extractKey(req);
var result = host + ':' + port + ' is responsible for ' + key;
cache.set(req.url, result, function(err, success) {
if (!err && success) {
res.end(result + ' NOT CACHED');
}
});
} else {
res.end(value + ' CACHED');
}
});
}
| mit |
jcarral/Subsub | build/script/lib/modals.js | 1439 | Element.prototype.remove = function() {
this.parentElement.removeChild(this);
}
const addIcon = (icon) => `<i class="fa fa-${icon}"></i>`
const headerTxt = (type) => {
switch (type) {
case 'error':
return `${addIcon('ban')} Error`
case 'warning':
return `${addIcon('exclamation')} Warning`
case 'success':
return `${addIcon('check')} Success`
default:
return `${addIcon('ban')} Error`
}
}
const createModal = (texto, type) => {
let modal = document.createElement('div')
modal.classList = 'modal-background'
let headertxt = 'Error'
let content = `
<div class="modal-frame">
<header class="modal-${type} modal-header">
<h4> ${headerTxt(type)} </h4>
<span id="closeModal">×</span>
</header>
<div class="modal-mssg"> ${texto} </div>
<button id="btnAcceptModal" class="btn modal-btn modal-${type}">Aceptar</button>
</div>
`
modal.innerHTML = content
document.body.appendChild(modal)
document.getElementById('btnAcceptModal').addEventListener('click', () => modal.remove())
document.getElementById('closeModal').addEventListener('click', () => modal.remove())
}
export const errorModal = (message) => createModal(message, 'error')
export const successModal = (message) => createModal(message, 'success')
export const warningModal = (message) => createModal(message, 'warning')
| mit |
rubenschulz/vps-health | client/index.html | 5206 | <!DOCTYPE html>
<!-- Developed by Ruben Schulz - www.rubenschulz.nl -->
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='x-ua-compatible' content='ie=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<meta name='apple-mobile-web-app-title' content='VPS Health' />
<meta name='apple-mobile-web-app-capable' content='yes' />
<meta name='apple-mobile-web-app-status-bar-style' content='black'/>
<link href='images/favicon-32x32.png' type='image/png' rel='icon' sizes='32x32' />
<link href='images/favicon-16x16.png' type='image/png' rel='icon' sizes='16x16' />
<link href='images/apple-touch-icon.png' rel='apple-touch-icon' sizes='180x180' />
<link href='images/manifest.json' rel='manifest' />
<link rel='stylesheet' href='style/foundation/foundation.min.css'>
<link rel='stylesheet' href='style/app.css'>
<title>VPS Health</title>
</head>
<body>
<div class='grid-y medium-grid-frame'>
<header class='cell shrink'>
<div class='grid-x grid-padding-x'>
<h1 class='cell small-12 medium-8'>
<img src='images/logo.png'>
VPS Health
</h1>
<div class='cell small-12 medium-4 medium-text-right'>
<button id='delete_all_history' class='button small' type='button'>
Delete all history
</button>
</div>
</div>
</header>
<main class='cell medium-auto medium-cell-block-container'>
<div class='grid-x'>
<div class='cell medium-cell-block-y'>
<div class='grid-container fluid'>
<div id='vpsses' class='grid-x grid-margin-x vpsses'>
<div id='dummy' class='cell small-12 medium-6 large-3 vps hide' data-sort='0'>
<h2>VPS title</h2>
<h3>VPS hostname</h3>
<div class='stats grid-x'>
<div id='load_1' title='Load 1 minute' class='cell small-4 stat load' ><img src='images/load.png' ><span>-</span></div>
<div id='load_5' title='Load 5 minutes' class='cell small-4 stat load' ><img src='images/load.png' ><span>-</span></div>
<div id='load_15' title='Load 15 minutes' class='cell small-4 stat load' ><img src='images/load.png' ><span>-</span></div>
</div>
<div class='stats grid-x'>
<div id='cpu' title='CPU usage' class='cell small-4 stat cpu' ><img src='images/cpu.png' ><span>-</span></div>
<div id='memory' title='Memory usage' class='cell small-4 stat memory' ><img src='images/memory.png' ><span>-</span></div>
<div id='disk' title='Disk usage' class='cell small-4 stat disk' ><img src='images/disk.png' ><span>-</span></div>
</div>
<div class='stats grid-x'>
<div id='uptime' title='Uptime' class='cell small-8 stat uptime' ></div>
<div id='availability' title='Availability' class='cell small-4 stat availability'><img src='images/availability.png'><span>-</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='reveal large vps_details' id='vps_details' data-vps-id='' data-reveal>
<h2>VPS title</h2>
<h3>VPS hostname</h3>
<button id='delete_vps_history' class='button small' type='button'>
Delete VPS history
</button>
<div class='stats grid-x'>
<div id='cpu' title='Total CPUs' class='cell small-4 stat cpu' ><img src='images/cpu.png' ><span>-</span></div>
<div id='memory' title='Total memory' class='cell small-4 stat memory'><img src='images/memory.png'><span>-</span></div>
<div id='disk' title='Total disk space' class='cell small-4 stat disk' ><img src='images/disk.png' ><span>-</span></div>
</div>
<div class='grid-x'>
<div class='cell small-12 large-6'>
<canvas id='history_load' data-label='Load %'></canvas>
</div>
<div class='cell small-12 large-6'>
<canvas id='history_availability' data-label='Availability %'></canvas>
</div>
</div>
<div class='grid-x'>
<div class='cell small-12 large-4'>
<canvas id='history_cpu' data-label='CPU usage %'></canvas>
</div>
<div class='cell small-12 large-4'>
<canvas id='history_memory' data-label='Memory usage %'></canvas>
</div>
<div class='cell small-12 large-4'>
<canvas id='history_disk' data-label='Disk usage %'></canvas>
</div>
</div>
<button class='close-button' type='button' data-close>
×
</button>
</div>
</main>
</div>
<script type='text/javascript' src='scripts/jquery/jquery-3.2.1.min.js'></script>
<script type='text/javascript' src='scripts/foundation/foundation.min.js'></script>
<script type='text/javascript' src='scripts/chart/chart.js'></script>
<script type='text/javascript' src='scripts/vps-health/vps-health-1.0.js'></script>
<script type='text/javascript' src='config.js'></script>
</body>
</html> | mit |
rocketeers/rocketeer | src/Rocketeer/Services/History/History.php | 1576 | <?php
/*
* This file is part of Rocketeer
*
* (c) Maxime Fabre <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace Rocketeer\Services\History;
use Illuminate\Support\Collection;
/**
* Keeps a memory of everything that was outputed/ran
* and on which connections/stages.
*/
class History extends Collection
{
/**
* Get the history, flattened.
*
* @return string[]|string[][]
*/
public function getFlattenedHistory()
{
return $this->getFlattened('history');
}
/**
* Get the output, flattened.
*
* @return string[]|string[][]
*/
public function getFlattenedOutput()
{
return $this->getFlattened('output');
}
/**
* Reset the history/output.
*/
public function reset()
{
$this->items = [];
}
//////////////////////////////////////////////////////////////////////
////////////////////////////// HELPERS ///////////////////////////////
//////////////////////////////////////////////////////////////////////
/**
* Get a flattened list of a certain type.
*
* @param string $type
*
* @return string[]|string[][]
*/
protected function getFlattened($type)
{
$history = [];
foreach ($this->items as $class => $entries) {
$history = array_merge($history, $entries[$type]);
}
ksort($history);
return array_values($history);
}
}
| mit |
casual-web/autodom | src/AppBundle/Entity/BusinessServiceRepository.php | 1434 | <?php
/**
* Created by PhpStorm.
* User: olivier
* Date: 01/02/15
* Time: 00:58
*/
namespace AppBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* BusinessServiceRepository
*/
class BusinessServiceRepository extends EntityRepository
{
public function findByRefList(array $refList)
{
$qb = $this->createQueryBuilder('s');
$qb->where($qb->expr()->in('s.ref', $refList));
return $qb->getQuery()->execute();
}
public function findEnabled()
{
return $this->findBy(array('enabled' => '1'));
}
/**
* get services enabled only by default or with a suffix if $filterEnabled=false
* @param bool $filterEnabled
* @return array
*/
public function getChoices($filterEnabled = true)
{
if ($filterEnabled) {
}
$qb = $this->createQueryBuilder('s');
$qb->select('s.ref, s.name, s.enabled');
$results = $qb->getQuery()->execute();
$choices = [];
foreach ($results as $item) {
if ($item['enabled'] === true) {
$choices[$item['ref']] = $item['name'];
} else {
if ($filterEnabled === false) {
$choices[$item['ref']] = sprintf('%s (désactivé)', $item['name']);
} else {
unset($choices[$item['ref']]);
}
}
}
return $choices;
}
} | mit |
andersonsilvade/workspacejava | Workspaceandroid/MainActivity/src/br/com/k19/android/cap3/MainActivity.java | 280 | package br.com.k19.android.cap3;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.frame);
}
}
| mit |
morelearn1990/blog_source | source/_posts/HTTP 原理.md | 3331 | ---
title: HTTP 原理
date: 2017-12-31
categories: HTTP
---
# TCP/IP 协议参考模型

TCP/IP是全世界的计算机和网络设备常用的层次化分组交换网络协议集,属于参考模型的传输层,用于过滤掉每个计算机的差异性,隐藏相关弱点,向应用程序提供“相同的”服务接口。
# HTTP 概念
http 是数据传输协议(超文本传输协议),用来沟通客户端和服务器,是一种 client-server 协议,它是承载于 TCP/IP 之上。通常是由像浏览器这样的接受方发起的,像浏览器这样的客户端发出的消息叫做 requests,那么被服务端回应的消息就叫做 responses。
## 媒体资源
网络上的一切内容皆资源,无论是静态文件,还是动态生成的代码。
我们通过 ***媒体类型(数据类型标记)*** 来告诉接收端(一般指客户端),接收到的数据是什么类型,让接收端知道怎么才能处理该文件。
常见标记方式就是 ***MIME*** ,MIME描述了文件的主要类型以及特定子类型,例如:"Content-Type":"text/html",其中text描述的文件的主要类型是文本,而其特定类型是html文档!
## URI、URL、URN
URI(Uniform Resource Identifier) 统一资源标识符,它的作用就是在网络上唯一确定一个资源。它有两个子集:URL(Uniform Resource Location)和URN(Uniform Resource Name)。如果不特别声明,我们所说的URI就是指URL。URL 通过给出的地址指向网络资源,URN 通过给出的命名指向资源(就像 ISBN 对于一本书一样)。
## HTTP 事务
“一次http链接(不包括tcp/ip连接,只包括一次http消息发送与接收)”的整个过程,由请求命令和响应结果组成
## 消息
消息是http协议一种纯文本的数据格式,分为请求消息和响应消息,两种消息都具有类似的结构,分别由三个部分构成:起始行、首部、主体,起始行描述消息干了什么!首部描述消息传输的具体细节!主体描述传输的实际内容!
## HTTP 的组件系统
代理、缓存、网关、隧道及Agent代理
+ 代理代理位于客户端和服务器之间,接收所有客户端的HTTP请求,并把这些请求转发给服务器(可能会对请求进行修改之后转发)。对用户来说,这些应用程序就是一个代理,代表用户访问服务器。代理的主要作用有过滤、屏蔽等!(还有需要注意一点:代理既可以代表服务器对客户端进行响应,又可以代表客户端对服务器进行请求!)
+ 缓存:首先说明一下,缓存某种意义上来说也是一种代理服务器。它主要使用代表服务器对客户端进行响应。发送预先缓存好的资源的副本。这样会加快事务响应速度、同时也会减少服务器的负载、减轻带宽等问题!
+ 网关:网关是一种特殊的服务器,面对客户端时好像它就是服务器,而对于服务器,他又充当客户端的角色,它的主要作用是协议转换!例如HTTP/FTP网关。
+ 隧道:就是一个连接通道,用于在http信道上发送非http协议的资源。
+ Agent代理:就是我们平时所说的浏览器,以及web机器人、爬虫等!
| mit |
reflectoring/infiniboard | dashy/src/app/dashboard/widget/widget.ts | 1245 | import {WidgetConfig} from '../shared/widget-config';
import {WidgetService} from '../shared/widget.service';
export class Widget {
title: string;
updateInterval: number = 1000;
widgetConfig: WidgetConfig;
titleUrl: string;
description: string;
constructor(private widgetService: WidgetService) {
}
getTitle(): string {
return this.title;
}
initWidget(widgetConfig: WidgetConfig) {
this.widgetConfig = widgetConfig;
this.title = widgetConfig.title;
this.titleUrl = widgetConfig.titleUrl;
this.description = widgetConfig.description;
this.triggerUpdate();
}
triggerUpdate() {
setInterval(() => {
this.updateWidgetData();
}, this.updateInterval);
}
updateWidgetData() {
this.widgetService.getWidgetData(this.widgetConfig).subscribe(
widgetData => {
if (widgetData.length > 0) {
this.updateData(widgetData);
}
},
error => console.error(error)
);
}
updateData(data: any) {
// log backend errors
for (const sourceData of data) {
if ((sourceData.data || {}).errors) {
sourceData.data.errors.forEach(error => console.error(error));
}
}
// custom logic is implemented by widgets
}
}
| mit |
petterip/exam-archive | test/rest_api_test_course.py | 16344 | '''
Testing class for database API's course related functions.
Authors: Ari Kairala, Petteri Ponsimaa
Originally adopted from Ivan's exercise 1 test class.
'''
import unittest, hashlib
import re, base64, copy, json, server
from database_api_test_common import BaseTestCase, db
from flask import json, jsonify
from exam_archive import ExamDatabaseErrorNotFound, ExamDatabaseErrorExists
from unittest import TestCase
from resources_common import COLLECTIONJSON, PROBLEMJSON, COURSE_PROFILE, API_VERSION
class RestCourseTestCase(BaseTestCase):
'''
RestCourseTestCase contains course related unit tests of the database API.
'''
# List of user credentials in exam_archive_data_dump.sql for testing purposes
super_user = "bigboss"
super_pw = hashlib.sha256("ultimatepw").hexdigest()
admin_user = "antti.admin"
admin_pw = hashlib.sha256("qwerty1234").hexdigest()
basic_user = "testuser"
basic_pw = hashlib.sha256("testuser").hexdigest()
wrong_pw = "wrong-pw"
test_course_template_1 = {"template": {
"data": [
{"name": "archiveId", "value": 1},
{"name": "courseCode", "value": "810136P"},
{"name": "name", "value": "Johdatus tietojenk\u00e4sittelytieteisiin"},
{"name": "description", "value": "Lorem ipsum"},
{"name": "inLanguage", "value": "fi"},
{"name": "creditPoints", "value": 4},
{"name": "teacherId", "value": 1}]
}
}
test_course_template_2 = {"template": {
"data": [
{"name": "archiveId", "value": 1},
{"name": "courseCode", "value": "810137P"},
{"name": "name", "value": "Introduction to Information Processing Sciences"},
{"name": "description", "value": "Aaa Bbbb"},
{"name": "inLanguage", "value": "en"},
{"name": "creditPoints", "value": 5},
{"name": "teacherId", "value": 2}]
}
}
course_resource_url = '/exam_archive/api/archives/1/courses/1/'
course_resource_not_allowed_url = '/exam_archive/api/archives/2/courses/1/'
courselist_resource_url = '/exam_archive/api/archives/1/courses/'
# Set a ready header for authorized admin user
header_auth = {'Authorization': 'Basic ' + base64.b64encode(super_user + ":" + super_pw)}
# Define a list of the sample contents of the database, so we can later compare it to the test results
@classmethod
def setUpClass(cls):
print "Testing ", cls.__name__
def test_user_not_authorized(self):
'''
Check that user in not able to get course list without authenticating.
'''
print '(' + self.test_user_not_authorized.__name__ + ')', \
self.test_user_not_authorized.__doc__
# Test CourseList/GET
rv = self.app.get(self.courselist_resource_url)
self.assertEquals(rv.status_code,401)
self.assertEquals(PROBLEMJSON,rv.mimetype)
# Test CourseList/POST
rv = self.app.post(self.courselist_resource_url)
self.assertEquals(rv.status_code,401)
self.assertEquals(PROBLEMJSON,rv.mimetype)
# Test Course/GET
rv = self.app.get(self.course_resource_url)
self.assertEquals(rv.status_code,401)
self.assertEquals(PROBLEMJSON,rv.mimetype)
# Test Course/PUT
rv = self.app.put(self.course_resource_url)
self.assertEquals(rv.status_code,401)
self.assertEquals(PROBLEMJSON,rv.mimetype)
# Test Course/DELETE
rv = self.app.put(self.course_resource_url)
self.assertEquals(rv.status_code,401)
self.assertEquals(PROBLEMJSON,rv.mimetype)
# Try to Course/POST when not admin or super user
rv = self.app.post(self.courselist_resource_url, headers={'Authorization': 'Basic ' + \
base64.b64encode(self.basic_user + ":" + self.basic_pw)})
self.assertEquals(rv.status_code,403)
self.assertEquals(PROBLEMJSON,rv.mimetype)
# Try to delete course, when not admin or super user
rv = self.app.delete(self.course_resource_url, headers={'Authorization': 'Basic ' + \
base64.b64encode(self.basic_user + ":" + self.basic_pw)})
self.assertEquals(rv.status_code,403)
self.assertEquals(PROBLEMJSON,rv.mimetype)
# Try to get Course list as basic user from unallowed archive
rv = self.app.get(self.course_resource_not_allowed_url, headers={'Authorization': 'Basic ' + \
base64.b64encode(self.basic_user + ":" + self.basic_pw)})
self.assertEquals(rv.status_code,403)
self.assertEquals(PROBLEMJSON,rv.mimetype)
# Try to get Course list as super user with wrong password
rv = self.app.get(self.courselist_resource_url, headers={'Authorization': 'Basic ' + \
base64.b64encode(self.super_user + ":" + self.wrong_pw)})
self.assertEquals(rv.status_code,401)
self.assertEquals(PROBLEMJSON,rv.mimetype)
def test_user_authorized(self):
'''
Check that authenticated user is able to get course list.
'''
print '(' + self.test_user_authorized.__name__ + ')', \
self.test_user_authorized.__doc__
# Try to get Course list as basic user from the correct archive
rv = self.app.get(self.course_resource_url, headers={'Authorization': 'Basic ' + \
base64.b64encode(self.basic_user + ":" + self.basic_pw)})
self.assertEquals(rv.status_code,200)
self.assertEquals(COLLECTIONJSON+";"+COURSE_PROFILE,rv.content_type)
# User authorized as super user
rv = self.app.get(self.courselist_resource_url, headers={'Authorization': 'Basic ' + \
base64.b64encode(self.super_user + ":" + self.super_pw)})
self.assertEquals(rv.status_code,200)
self.assertEquals(COLLECTIONJSON+";"+COURSE_PROFILE,rv.content_type)
def test_course_get(self):
'''
Check data consistency of Course/GET and CourseList/GET.
'''
print '(' + self.test_course_get.__name__ + ')', \
self.test_course_get.__doc__
# Test CourseList/GET
self._course_get(self.courselist_resource_url)
# Test single course Course/GET
self._course_get(self.course_resource_url)
def _course_get(self, resource_url):
'''
Check data consistency of CourseList/GET.
'''
# Get all the courses from database
courses = db.browse_courses(1)
# Get all the courses from API
rv = self.app.get(resource_url, headers=self.header_auth)
self.assertEquals(rv.status_code,200)
self.assertEquals(COLLECTIONJSON+";"+COURSE_PROFILE,rv.content_type)
input = json.loads(rv.data)
assert input
# Go through the data
data = input['collection']
items = data['items']
self.assertEquals(data['href'], resource_url)
self.assertEquals(data['version'], API_VERSION)
for item in items:
obj = self._create_dict(item['data'])
course = db.get_course(obj['courseId'])
assert self._isIdentical(obj, course)
def test_course_post(self):
'''
Check that a new course can be created.
'''
print '(' + self.test_course_post.__name__ + ')', \
self.test_course_post.__doc__
resource_url = self.courselist_resource_url
new_course = self.test_course_template_1.copy()
# Test CourseList/POST
rv = self.app.post(resource_url, headers=self.header_auth, data=json.dumps(new_course))
self.assertEquals(rv.status_code,201)
# Post returns the address of newly created resource URL in header, in 'location'. Get the identifier of
# the just created item, fetch it from database and compare.
location = rv.location
location_match = re.match('.*courses/([^/]+)/', location)
self.assertIsNotNone(location_match)
new_id = location_match.group(1)
# Fetch the item from database and set it to course_id_db, and convert the filled post template data above to
# similar format by replacing the keys with post data attributes.
course_in_db = db.get_course(new_id)
course_posted = self._convert(new_course)
# Compare the data in database and the post template above.
self.assertDictContainsSubset(course_posted, course_in_db)
# Next, try to add the same course twice - there should be conflict
rv = self.app.post(resource_url, headers=self.header_auth, data=json.dumps(new_course))
self.assertEquals(rv.status_code,409)
# Next check that by posting invalid JSON data we get status code 415
invalid_json = "INVALID " + json.dumps(new_course)
rv = self.app.post(resource_url, headers=self.header_auth, data=invalid_json)
self.assertEquals(rv.status_code,415)
# Check that template structure is validated
invalid_json = json.dumps(new_course['template'])
rv = self.app.post(resource_url, headers=self.header_auth, data=invalid_json)
self.assertEquals(rv.status_code,400)
# Check for the missing required field by removing the third row in array (course name)
invalid_template = copy.deepcopy(new_course)
invalid_template['template']['data'].pop(2)
rv = self.app.post(resource_url, headers=self.header_auth, data=json.dumps(invalid_template))
self.assertEquals(rv.status_code,400)
# Lastly, delete the item
rv = self.app.delete(location, headers=self.header_auth)
self.assertEquals(rv.status_code,204)
def test_course_put(self):
'''
Check that an existing course can be modified.
'''
print '(' + self.test_course_put.__name__ + ')', \
self.test_course_put.__doc__
resource_url = self.courselist_resource_url
new_course = self.test_course_template_1
edited_course = self.test_course_template_2
# First create the course
rv = self.app.post(resource_url, headers=self.header_auth, data=json.dumps(new_course))
self.assertEquals(rv.status_code,201)
location = rv.location
self.assertIsNotNone(location)
# Then try to edit the course
rv = self.app.put(location, headers=self.header_auth, data=json.dumps(edited_course))
self.assertEquals(rv.status_code,200)
location = rv.location
self.assertIsNotNone(location)
# Put returns the address of newly created resource URL in header, in 'location'. Get the identifier of
# the just created item, fetch it from database and compare.
location = rv.location
location_match = re.match('.*courses/([^/]+)/', location)
self.assertIsNotNone(location_match)
new_id = location_match.group(1)
# Fetch the item from database and set it to course_id_db, and convert the filled post template data above to
# similar format by replacing the keys with post data attributes.
course_in_db = db.get_course(new_id)
course_posted = self._convert(edited_course)
# Compare the data in database and the post template above.
self.assertDictContainsSubset(course_posted, course_in_db)
# Next check that by posting invalid JSON data we get status code 415
invalid_json = "INVALID " + json.dumps(new_course)
rv = self.app.put(location, headers=self.header_auth, data=invalid_json)
self.assertEquals(rv.status_code,415)
# Check that template structure is validated
invalid_json = json.dumps(new_course['template'])
rv = self.app.put(location, headers=self.header_auth, data=invalid_json)
self.assertEquals(rv.status_code,400)
# Lastly, we delete the course
rv = self.app.delete(location, headers=self.header_auth)
self.assertEquals(rv.status_code,204)
def test_course_delete(self):
'''
Check that course in not able to get course list without authenticating.
'''
print '(' + self.test_course_delete.__name__ + ')', \
self.test_course_delete.__doc__
# First create the course
resource_url = self.courselist_resource_url
rv = self.app.post(resource_url, headers=self.header_auth, data=json.dumps(self.test_course_template_2))
self.assertEquals(rv.status_code,201)
location = rv.location
self.assertIsNotNone(location)
# Get the identifier of the just created item, fetch it from database and compare.
location = rv.location
location_match = re.match('.*courses/([^/]+)/', location)
self.assertIsNotNone(location_match)
new_id = location_match.group(1)
# Then, we delete the course
rv = self.app.delete(location, headers=self.header_auth)
self.assertEquals(rv.status_code,204)
# Try to fetch the deleted course from database - expect to fail
self.assertIsNone(db.get_course(new_id))
def test_for_method_not_allowed(self):
'''
For inconsistency check for 405, method not allowed.
'''
print '(' + self.test_course_get.__name__ + ')', \
self.test_course_get.__doc__
# CourseList/PUT should not exist
rv = self.app.put(self.courselist_resource_url, headers=self.header_auth)
self.assertEquals(rv.status_code,405)
# CourseList/DELETE should not exist
rv = self.app.delete(self.courselist_resource_url, headers=self.header_auth)
self.assertEquals(rv.status_code,405)
# Course/POST should not exist
rv = self.app.post(self.course_resource_url, headers=self.header_auth)
self.assertEquals(rv.status_code,405)
def _isIdentical(self, api_item, db_item):
'''
Check whether template data corresponds to data stored in the database.
'''
return api_item['courseId'] == db_item['course_id'] and \
api_item['name'] == db_item['course_name'] and \
api_item['archiveId'] == db_item['archive_id'] and \
api_item['description'] == db_item['description'] and \
api_item['inLanguage'] == db_item['language_id'] and \
api_item['creditPoints'] == db_item['credit_points'] and \
api_item['courseCode'] == db_item['course_code']
def _convert(self, template_data):
'''
Convert template data to a dictionary representing the format the data is saved in the database.
'''
trans_table = {"name":"course_name", "url":"url", "archiveId":"archive_id", "courseCode":"course_code",
"dateModified": "modified_date", "modifierId":"modifier_id", "courseId":"course_id",
"description":"description", "inLanguage":"language_id", "creditPoints":"credit_points",
"teacherId":"teacher_id", "teacherName":"teacher_name"}
data = self._create_dict(template_data['template']['data'])
db_item = {}
for key, val in data.items():
db_item[trans_table[key]] = val
return db_item
def _create_dict(self,item):
'''
Create a dictionary from template data for easier handling.
'''
dict = {}
for f in item:
dict[f['name']] = f['value']
return dict
if __name__ == '__main__':
print 'Start running tests'
unittest.main()
| mit |
coq-bench/coq-bench.github.io | clean/Linux-x86_64-4.11.2-2.0.7/released/8.13.2/zorns-lemma/8.7.0.html | 7106 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>zorns-lemma: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.13.2 / zorns-lemma - 8.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
zorns-lemma
<small>
8.7.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-01-12 12:49:54 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-12 12:49:54 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 3 Virtual package relying on a GMP lib system installation
coq 8.13.2 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.11.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.11.2 Official release 4.11.2
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/zorns-lemma"
license: "LGPL"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/ZornsLemma"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
]
tags: [
"keyword: set theory"
"keyword: cardinal numbers"
"keyword: ordinal numbers"
"keyword: countable"
"keyword: quotients"
"keyword: well-orders"
"keyword: Zorn's lemma"
"category: Mathematics/Logic/Set theory"
]
authors: [ "Daniel Schepler <[email protected]>" ]
bug-reports: "https://github.com/coq-contribs/zorns-lemma/issues"
dev-repo: "git+https://github.com/coq-contribs/zorns-lemma.git"
synopsis: "Zorn's Lemma"
description:
"This library develops some basic set theory. The main purpose I had in writing it was as support for the Topology library."
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/zorns-lemma/archive/v8.7.0.tar.gz"
checksum: "md5=2b3b2abaea2336deb3615847a87ba07a"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-zorns-lemma.8.7.0 coq.8.13.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.13.2).
The following dependencies couldn't be met:
- coq-zorns-lemma -> coq < 8.8~ -> ocaml < 4.10
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-zorns-lemma.8.7.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| mit |
coq-bench/coq-bench.github.io | clean/Linux-x86_64-4.06.1-2.0.5/released/8.7.1+2/higman-s/8.6.0.html | 6978 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>higman-s: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.1+2 / higman-s - 8.6.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
higman-s
<small>
8.6.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-11-21 02:02:39 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-21 02:02:39 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 1 Virtual package relying on perl
coq 8.7.1+2 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.06.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.06.1 Official 4.06.1 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/higman-s"
license: "LGPL"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/HigmanS"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.7~"}
]
tags: [ "keyword: Higman's lemma" "keyword: well quasi-ordering" "category: Mathematics/Combinatorics and Graph Theory" "date: 2007-09-14" ]
authors: [ "William Delobel <[email protected]>" ]
bug-reports: "https://github.com/coq-contribs/higman-s/issues"
dev-repo: "git+https://github.com/coq-contribs/higman-s.git"
synopsis: "Higman's lemma on an unrestricted alphabet"
description:
"This proof is more or less the proof given by Monika Seisenberger in \"An Inductive Version of Nash-Williams' Minimal-Bad-Sequence Argument for Higman's Lemma\"."
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/higman-s/archive/v8.6.0.tar.gz"
checksum: "md5=16dee76d75e5bb21e16f246c52272afc"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-higman-s.8.6.0 coq.8.7.1+2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+2).
The following dependencies couldn't be met:
- coq-higman-s -> coq < 8.7~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-higman-s.8.6.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| mit |
v8-dox/v8-dox.github.io | a53c763/html/classv8_1_1_external_ascii_string_resource_impl.html | 10961 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v0.11.8: v8::ExternalAsciiStringResourceImpl Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.11.8
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main 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="hierarchy.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_1_external_ascii_string_resource_impl.html">ExternalAsciiStringResourceImpl</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classv8_1_1_external_ascii_string_resource_impl-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::ExternalAsciiStringResourceImpl Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for v8::ExternalAsciiStringResourceImpl:</div>
<div class="dyncontent">
<div class="center">
<img src="classv8_1_1_external_ascii_string_resource_impl.png" usemap="#v8::ExternalAsciiStringResourceImpl_map" alt=""/>
<map id="v8::ExternalAsciiStringResourceImpl_map" name="v8::ExternalAsciiStringResourceImpl_map">
<area href="classv8_1_1_string_1_1_external_ascii_string_resource.html" alt="v8::String::ExternalAsciiStringResource" shape="rect" coords="0,56,232,80"/>
<area href="classv8_1_1_string_1_1_external_string_resource_base.html" alt="v8::String::ExternalStringResourceBase" shape="rect" coords="0,0,232,24"/>
</map>
</div></div>
<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:ad43442534df30aebaf0125ba12aef925"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad43442534df30aebaf0125ba12aef925"></a>
 </td><td class="memItemRight" valign="bottom"><b>ExternalAsciiStringResourceImpl</b> (const char *<a class="el" href="classv8_1_1_external_ascii_string_resource_impl.html#a39719832d6d06fbfd8a86cf1cd6f9d6f">data</a>, size_t <a class="el" href="classv8_1_1_external_ascii_string_resource_impl.html#a8f37b80039c1ef29b0c755354a11424a">length</a>)</td></tr>
<tr class="separator:ad43442534df30aebaf0125ba12aef925"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a39719832d6d06fbfd8a86cf1cd6f9d6f"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_external_ascii_string_resource_impl.html#a39719832d6d06fbfd8a86cf1cd6f9d6f">data</a> () const </td></tr>
<tr class="separator:a39719832d6d06fbfd8a86cf1cd6f9d6f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8f37b80039c1ef29b0c755354a11424a"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_external_ascii_string_resource_impl.html#a8f37b80039c1ef29b0c755354a11424a">length</a> () const </td></tr>
<tr class="separator:a8f37b80039c1ef29b0c755354a11424a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classv8_1_1_string_1_1_external_ascii_string_resource"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classv8_1_1_string_1_1_external_ascii_string_resource')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classv8_1_1_string_1_1_external_ascii_string_resource.html">v8::String::ExternalAsciiStringResource</a></td></tr>
<tr class="memitem:acd8790ae14be1b90794b363d24a147d0 inherit pub_methods_classv8_1_1_string_1_1_external_ascii_string_resource"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_string_1_1_external_ascii_string_resource.html#acd8790ae14be1b90794b363d24a147d0">~ExternalAsciiStringResource</a> ()</td></tr>
<tr class="separator:acd8790ae14be1b90794b363d24a147d0 inherit pub_methods_classv8_1_1_string_1_1_external_ascii_string_resource"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_methods_classv8_1_1_string_1_1_external_string_resource_base"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classv8_1_1_string_1_1_external_string_resource_base')"><img src="closed.png" alt="-"/> Protected Member Functions inherited from <a class="el" href="classv8_1_1_string_1_1_external_string_resource_base.html">v8::String::ExternalStringResourceBase</a></td></tr>
<tr class="memitem:af4720342ae31e1ab4656df3f15d069c0 inherit pro_methods_classv8_1_1_string_1_1_external_string_resource_base"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1_string_1_1_external_string_resource_base.html#af4720342ae31e1ab4656df3f15d069c0">Dispose</a> ()</td></tr>
<tr class="separator:af4720342ae31e1ab4656df3f15d069c0 inherit pro_methods_classv8_1_1_string_1_1_external_string_resource_base"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a39719832d6d06fbfd8a86cf1cd6f9d6f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const char* v8::ExternalAsciiStringResourceImpl::data </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The string data from the underlying buffer. </p>
<p>Implements <a class="el" href="classv8_1_1_string_1_1_external_ascii_string_resource.html#adeb99e8c8c630e2dac5ad76476249d2f">v8::String::ExternalAsciiStringResource</a>.</p>
</div>
</div>
<a class="anchor" id="a8f37b80039c1ef29b0c755354a11424a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t v8::ExternalAsciiStringResourceImpl::length </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The number of ASCII characters in the string. </p>
<p>Implements <a class="el" href="classv8_1_1_string_1_1_external_ascii_string_resource.html#aeecccc52434c2057d3dc5c9732458a8e">v8::String::ExternalAsciiStringResource</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:46:13 for V8 API Reference Guide for node.js v0.11.8 by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
| mit |
mezzovide/btcd | libjl777/plugins/common/console777.c | 11054 | //
// console777.c
// crypto777
//
// Created by James on 4/9/15.
// Copyright (c) 2015 jl777. All rights reserved.
//
#ifdef DEFINES_ONLY
#ifndef crypto777_console777_h
#define crypto777_console777_h
#include <stdio.h>
#include <stdio.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "../includes/cJSON.h"
#include "../KV/kv777.c"
#include "../common/system777.c"
#endif
#else
#ifndef crypto777_console777_c
#define crypto777_console777_c
#ifndef crypto777_console777_h
#define DEFINES_ONLY
#include "console777.c"
#undef DEFINES_ONLY
#endif
int32_t getline777(char *line,int32_t max)
{
#ifndef _WIN32
static char prevline[1024];
struct timeval timeout;
fd_set fdset;
int32_t s;
line[0] = 0;
FD_ZERO(&fdset);
FD_SET(STDIN_FILENO,&fdset);
timeout.tv_sec = 0, timeout.tv_usec = 10000;
if ( (s= select(1,&fdset,NULL,NULL,&timeout)) < 0 )
fprintf(stderr,"wait_for_input: error select s.%d\n",s);
else
{
if ( FD_ISSET(STDIN_FILENO,&fdset) > 0 && fgets(line,max,stdin) == line )
{
line[strlen(line)-1] = 0;
if ( line[0] == 0 || (line[0] == '.' && line[1] == 0) )
strcpy(line,prevline);
else strcpy(prevline,line);
}
}
return((int32_t)strlen(line));
#else
fgets(line, max, stdin);
line[strlen(line)-1] = 0;
return((int32_t)strlen(line));
#endif
}
int32_t settoken(char *token,char *line)
{
int32_t i;
for (i=0; i<32&&line[i]!=0; i++)
{
if ( line[i] == ' ' || line[i] == '\n' || line[i] == '\t' || line[i] == '\b' || line[i] == '\r' )
break;
token[i] = line[i];
}
token[i] = 0;
return(i);
}
void update_alias(char *line)
{
char retbuf[8192],alias[1024],*value; int32_t i,err;
if ( (i= settoken(&alias[1],line)) < 0 )
return;
if ( line[i] == 0 )
value = &line[i];
else value = &line[i+1];
line[i] = 0;
alias[0] = '#';
printf("i.%d alias.(%s) value.(%s)\n",i,alias,value);
if ( value[0] == 0 )
printf("warning value for %s is null\n",alias);
kv777_findstr(retbuf,sizeof(retbuf),SUPERNET.alias,alias);
if ( strcmp(retbuf,value) == 0 )
printf("UNCHANGED ");
else printf("%s ",retbuf[0] == 0 ? "CREATE" : "UPDATE");
printf(" (%s) -> (%s)\n",alias,value);
if ( (err= kv777_addstr(SUPERNET.alias,alias,value)) != 0 )
printf("error.%d updating alias database\n",err);
}
char *expand_aliases(char *_expanded,char *_expanded2,int32_t max,char *line)
{
char alias[64],value[8192],*expanded,*otherbuf;
int32_t i,j,k,len=0,flag = 1;
expanded = _expanded, otherbuf = _expanded2;
while ( len < max-8192 && flag != 0 )
{
flag = 0;
len = (int32_t)strlen(line);
for (i=j=0; i<len; i++)
{
if ( line[i] == '#' )
{
if ( (k= settoken(&alias[1],&line[i+1])) <= 0 )
continue;
i += k;
alias[0] = '#';
if ( kv777_findstr(value,sizeof(value),SUPERNET.alias,alias) != 0 )
{
if ( value[0] != 0 )
for (k=0; value[k]!=0; k++)
expanded[j++] = value[k];
expanded[j] = 0;
//printf("found (%s) -> (%s) [%s]\n",alias,value,expanded);
flag++;
}
} else expanded[j++] = line[i];
}
expanded[j] = 0;
line = expanded;
if ( expanded == _expanded2 )
expanded = _expanded, otherbuf = _expanded2;
else expanded = _expanded2, otherbuf = _expanded;
}
//printf("(%s) -> (%s) len.%d flag.%d\n",line,expanded,len,flag);
return(line);
}
char *localcommand(char *line)
{
char *retstr;
if ( strcmp(line,"list") == 0 )
{
if ( (retstr= relays_jsonstr(0,0)) != 0 )
{
printf("%s\n",retstr);
free(retstr);
}
return(0);
}
else if ( strncmp(line,"alias",5) == 0 )
{
update_alias(line+6);
return(0);
}
else if ( strcmp(line,"help") == 0 )
{
printf("local commands:\nhelp, list, alias <name> <any string> then #name is expanded to <any string>\n");
printf("alias expansions are iterated, so be careful with recursive macros!\n\n");
printf("<plugin name> <method> {json args} -> invokes plugin with method and args, \"myipaddr\" and \"NXT\" are default attached\n\n");
printf("network commands: default timeout is used if not specified\n");
printf("relay <plugin name> <method> {json args} -> will send to random relay\n");
printf("peers <plugin name> <method> {json args} -> will send all peers\n");
printf("!<plugin name> <method> {json args} -> sends to random relay which will send to all its peers and combine results.\n\n");
printf("publish shortcut: pub <any string> -> invokes the subscriptions plugin with publish method and all subscribers will be sent <any string>\n\n");
printf("direct to specific relay needs to have a direct connection established first:\nrelay direct or peers direct <ipaddr>\n");
printf("in case you cant directly reach a specific relay with \"peers direct <ipaddr>\" you can add \"!\" and let a relay broadcast\n");
printf("without an <ipaddr> it will connect to a random relay. Once directly connected, commands are sent by:\n");
printf("<ipaddress> {\"plugin\":\"<name>\",\"method\":\"<methodname>\",...}\n");
printf("responses to direct requests are sent through as a subscription feed\n\n");
printf("\"relay join\" adds your node to the list of relay nodes, your node will need to stay in sync with the other relays\n");
//printf("\"relay mailbox <64bit number> <name>\" creates synchronized storage in all relays\n");
return(0);
}
return(line);
}
char *parse_expandedline(char *plugin,char *method,int32_t *timeoutp,char *line,int32_t broadcastflag)
{
int32_t i,j; char numstr[64],*pubstr,*cmdstr = 0; cJSON *json; uint64_t tag;
for (i=0; i<512&&line[i]!=' '&&line[i]!=0; i++)
plugin[i] = line[i];
plugin[i] = 0;
*timeoutp = 0;
pubstr = line;
if ( strcmp(plugin,"pub") == 0 )
strcpy(plugin,"subscriptions"), strcpy(method,"publish"), pubstr += 4;
else if ( line[i+1] != 0 )
{
for (++i,j=0; i<512&&line[i]!=' '&&line[i]!=0; i++,j++)
method[j] = line[i];
method[j] = 0;
} else method[0] = 0;
if ( (json= cJSON_Parse(line+i+1)) == 0 )
json = cJSON_CreateObject();
if ( json != 0 )
{
if ( strcmp("direct",method) == 0 && cJSON_GetObjectItem(json,"myipaddr") == 0 )
cJSON_AddItemToObject(json,"myipaddr",cJSON_CreateString(SUPERNET.myipaddr));
if ( cJSON_GetObjectItem(json,"tag") == 0 )
randombytes((void *)&tag,sizeof(tag)), sprintf(numstr,"%llu",(long long)tag), cJSON_AddItemToObject(json,"tag",cJSON_CreateString(numstr));
//if ( cJSON_GetObjectItem(json,"NXT") == 0 )
// cJSON_AddItemToObject(json,"NXT",cJSON_CreateString(SUPERNET.NXTADDR));
*timeoutp = get_API_int(cJSON_GetObjectItem(json,"timeout"),0);
if ( plugin[0] == 0 )
strcpy(plugin,"relay");
if ( cJSON_GetObjectItem(json,"plugin") == 0 )
cJSON_AddItemToObject(json,"plugin",cJSON_CreateString(plugin));
else copy_cJSON(plugin,cJSON_GetObjectItem(json,"plugin"));
if ( method[0] == 0 )
strcpy(method,"help");
cJSON_AddItemToObject(json,"method",cJSON_CreateString(method));
if ( broadcastflag != 0 )
cJSON_AddItemToObject(json,"broadcast",cJSON_CreateString("allrelays"));
cmdstr = cJSON_Print(json), _stripwhite(cmdstr,' ');
return(cmdstr);
}
else return(clonestr(pubstr));
}
char *process_user_json(char *plugin,char *method,char *cmdstr,int32_t broadcastflag,int32_t timeout)
{
struct daemon_info *find_daemoninfo(int32_t *indp,char *name,uint64_t daemonid,uint64_t instanceid);
uint32_t nonce; int32_t tmp,len; char *retstr;//,tokenized[8192];
len = (int32_t)strlen(cmdstr) + 1;
//printf("userjson.(%s).%d plugin.(%s) broadcastflag.%d method.(%s)\n",cmdstr,len,plugin,broadcastflag,method);
if ( broadcastflag != 0 || strcmp(plugin,"relay") == 0 )
{
if ( strcmp(method,"busdata") == 0 )
retstr = busdata_sync(&nonce,cmdstr,broadcastflag==0?0:"allnodes",0);
else retstr = clonestr("{\"error\":\"direct load balanced calls deprecated, use busdata\"}");
}
//else if ( strcmp(plugin,"peers") == 0 )
// retstr = nn_allrelays((uint8_t *)cmdstr,len,timeout,0);
else if ( find_daemoninfo(&tmp,plugin,0,0) != 0 )
{
//len = construct_tokenized_req(tokenized,cmdstr,SUPERNET.NXTACCTSECRET,broadcastflag!=0?"allnodes":0);
//printf("console.(%s)\n",tokenized);
retstr = plugin_method(-1,0,1,plugin,method,0,0,cmdstr,len,timeout != 0 ? timeout : 0,0);
}
else retstr = clonestr("{\"error\":\"invalid command\"}");
return(retstr);
}
void process_userinput(char *_line)
{
static char *line,*line2;
char plugin[512],ipaddr[1024],method[512],*cmdstr,*retstr; cJSON *json; int timeout,broadcastflag = 0;
printf("[%s]\n",_line);
if ( line == 0 )
line = calloc(1,65536), line2 = calloc(1,65536);
expand_aliases(line,line2,65536,_line);
if ( (line= localcommand(line)) == 0 )
return;
if ( line[0] == '!' )
broadcastflag = 1, line++;
if ( (json= cJSON_Parse(line)) != 0 )
{
char *process_nn_message(int32_t sock,char *jsonstr);
free_json(json);
char *SuperNET_JSON(char *jsonstr);
retstr = SuperNET_JSON(line);
//retstr = process_nn_message(-1,line);
//retstr = nn_loadbalanced((uint8_t *)line,(int32_t)strlen(line)+1);
printf("console.(%s) -> (%s)\n",line,retstr);
return;
} else printf("cant parse.(%s)\n",line);
settoken(ipaddr,line);
printf("expands to: %s [%s] %s\n",broadcastflag != 0 ? "broadcast": "",line,ipaddr);
if ( is_ipaddr(ipaddr) != 0 )
{
line += strlen(ipaddr) + 1;
if ( (cmdstr = parse_expandedline(plugin,method,&timeout,line,broadcastflag)) != 0 )
{
printf("ipaddr.(%s) (%s)\n",ipaddr,line);
//retstr = nn_direct(ipaddr,(uint8_t *)line,(int32_t)strlen(line)+1);
printf("deprecated (%s) -> (%s)\n",line,cmdstr);
free(cmdstr);
}
return;
}
if ( (cmdstr= parse_expandedline(plugin,method,&timeout,line,broadcastflag)) != 0 )
{
retstr = process_user_json(plugin,method,cmdstr,broadcastflag,timeout != 0 ? timeout : SUPERNET.PLUGINTIMEOUT);
printf("CONSOLE (%s) -> (%s) -> (%s)\n",line,cmdstr,retstr);
free(cmdstr);
}
}
#endif
#endif
| mit |
lion-coin/lioncoin | src/rpcrawtransaction.cpp | 32779 | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Lioncoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "base58.h"
#include "core.h"
#include "init.h"
#include "keystore.h"
#include "main.h"
#include "net.h"
#include "rpcserver.h"
#include "uint256.h"
#ifdef ENABLE_WALLET
#include "wallet.h"
#endif
#include <stdint.h>
#include <boost/assign/list_of.hpp>
#include "json/json_spirit_utils.h"
#include "json/json_spirit_value.h"
using namespace std;
using namespace boost;
using namespace boost::assign;
using namespace json_spirit;
void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out, bool fIncludeHex)
{
txnouttype type;
vector<CTxDestination> addresses;
int nRequired;
out.push_back(Pair("asm", scriptPubKey.ToString()));
if (fIncludeHex)
out.push_back(Pair("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())));
if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired))
{
out.push_back(Pair("type", GetTxnOutputType(type)));
return;
}
out.push_back(Pair("reqSigs", nRequired));
out.push_back(Pair("type", GetTxnOutputType(type)));
Array a;
BOOST_FOREACH(const CTxDestination& addr, addresses)
a.push_back(CLioncoinAddress(addr).ToString());
out.push_back(Pair("addresses", a));
}
void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry)
{
entry.push_back(Pair("txid", tx.GetHash().GetHex()));
entry.push_back(Pair("version", tx.nVersion));
entry.push_back(Pair("locktime", (boost::int64_t)tx.nLockTime));
Array vin;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
Object in;
if (tx.IsCoinBase())
in.push_back(Pair("coinbase", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())));
else
{
in.push_back(Pair("txid", txin.prevout.hash.GetHex()));
in.push_back(Pair("vout", (boost::int64_t)txin.prevout.n));
Object o;
o.push_back(Pair("asm", txin.scriptSig.ToString()));
o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())));
in.push_back(Pair("scriptSig", o));
}
in.push_back(Pair("sequence", (boost::int64_t)txin.nSequence));
vin.push_back(in);
}
entry.push_back(Pair("vin", vin));
Array vout;
for (unsigned int i = 0; i < tx.vout.size(); i++)
{
const CTxOut& txout = tx.vout[i];
Object out;
out.push_back(Pair("value", ValueFromAmount(txout.nValue)));
out.push_back(Pair("n", (boost::int64_t)i));
Object o;
ScriptPubKeyToJSON(txout.scriptPubKey, o, true);
out.push_back(Pair("scriptPubKey", o));
vout.push_back(out);
}
entry.push_back(Pair("vout", vout));
if (hashBlock != 0)
{
entry.push_back(Pair("blockhash", hashBlock.GetHex()));
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
if (mi != mapBlockIndex.end() && (*mi).second)
{
CBlockIndex* pindex = (*mi).second;
if (chainActive.Contains(pindex))
{
entry.push_back(Pair("confirmations", 1 + chainActive.Height() - pindex->nHeight));
entry.push_back(Pair("time", (boost::int64_t)pindex->nTime));
entry.push_back(Pair("blocktime", (boost::int64_t)pindex->nTime));
}
else
entry.push_back(Pair("confirmations", 0));
}
}
}
Value getrawtransaction(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"getrawtransaction \"txid\" ( verbose )\n"
"\nReturn the raw transaction data.\n"
"\nIf verbose=0, returns a string that is serialized, hex-encoded data for 'txid'.\n"
"If verbose is non-zero, returns an Object with information about 'txid'.\n"
"\nArguments:\n"
"1. \"txid\" (string, required) The transaction id\n"
"2. verbose (numeric, optional, default=0) If 0, return a string, other return a json object\n"
"\nResult (if verbose is not set or set to 0):\n"
"\"data\" (string) The serialized, hex-encoded data for 'txid'\n"
"\nResult (if verbose > 0):\n"
"{\n"
" \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n"
" \"txid\" : \"id\", (string) The transaction id (same as provided)\n"
" \"version\" : n, (numeric) The version\n"
" \"locktime\" : ttt, (numeric) The lock time\n"
" \"vin\" : [ (array of json objects)\n"
" {\n"
" \"txid\": \"id\", (string) The transaction id\n"
" \"vout\": n, (numeric) \n"
" \"scriptSig\": { (json object) The script\n"
" \"asm\": \"asm\", (string) asm\n"
" \"hex\": \"hex\" (string) hex\n"
" },\n"
" \"sequence\": n (numeric) The script sequence number\n"
" }\n"
" ,...\n"
" ],\n"
" \"vout\" : [ (array of json objects)\n"
" {\n"
" \"value\" : x.xxx, (numeric) The value in btc\n"
" \"n\" : n, (numeric) index\n"
" \"scriptPubKey\" : { (json object)\n"
" \"asm\" : \"asm\", (string) the asm\n"
" \"hex\" : \"hex\", (string) the hex\n"
" \"reqSigs\" : n, (numeric) The required sigs\n"
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
" \"addresses\" : [ (json array of string)\n"
" \"lioncoinaddress\" (string) lioncoin address\n"
" ,...\n"
" ]\n"
" }\n"
" }\n"
" ,...\n"
" ],\n"
" \"blockhash\" : \"hash\", (string) the block hash\n"
" \"confirmations\" : n, (numeric) The confirmations\n"
" \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n"
" \"blocktime\" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n"
"}\n"
"\nExamples:\n"
+ HelpExampleCli("getrawtransaction", "\"mytxid\"")
+ HelpExampleCli("getrawtransaction", "\"mytxid\" 1")
+ HelpExampleRpc("getrawtransaction", "\"mytxid\", 1")
);
uint256 hash = ParseHashV(params[0], "parameter 1");
bool fVerbose = false;
if (params.size() > 1)
fVerbose = (params[1].get_int() != 0);
CTransaction tx;
uint256 hashBlock = 0;
if (!GetTransaction(hash, tx, hashBlock, true))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction");
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
ssTx << tx;
string strHex = HexStr(ssTx.begin(), ssTx.end());
if (!fVerbose)
return strHex;
Object result;
result.push_back(Pair("hex", strHex));
TxToJSON(tx, hashBlock, result);
return result;
}
#ifdef ENABLE_WALLET
Value listunspent(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 3)
throw runtime_error(
"listunspent ( minconf maxconf [\"address\",...] )\n"
"\nReturns array of unspent transaction outputs\n"
"with between minconf and maxconf (inclusive) confirmations.\n"
"Optionally filter to only include txouts paid to specified addresses.\n"
"Results are an array of Objects, each of which has:\n"
"{txid, vout, scriptPubKey, amount, confirmations}\n"
"\nArguments:\n"
"1. minconf (numeric, optional, default=1) The minimum confirmationsi to filter\n"
"2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter\n"
"3. \"addresses\" (string) A json array of lioncoin addresses to filter\n"
" [\n"
" \"address\" (string) lioncoin address\n"
" ,...\n"
" ]\n"
"\nResult\n"
"[ (array of json object)\n"
" {\n"
" \"txid\" : \"txid\", (string) the transaction id \n"
" \"vout\" : n, (numeric) the vout value\n"
" \"address\" : \"address\", (string) the lioncoin address\n"
" \"account\" : \"account\", (string) The associated account, or \"\" for the default account\n"
" \"scriptPubKey\" : \"key\", (string) the script key\n"
" \"amount\" : x.xxx, (numeric) the transaction amount in btc\n"
" \"confirmations\" : n (numeric) The number of confirmations\n"
" }\n"
" ,...\n"
"]\n"
"\nExamples\n"
+ HelpExampleCli("listunspent", "")
+ HelpExampleCli("listunspent", "6 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
+ HelpExampleRpc("listunspent", "6, 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
);
RPCTypeCheck(params, list_of(int_type)(int_type)(array_type));
int nMinDepth = 1;
if (params.size() > 0)
nMinDepth = params[0].get_int();
int nMaxDepth = 9999999;
if (params.size() > 1)
nMaxDepth = params[1].get_int();
set<CLioncoinAddress> setAddress;
if (params.size() > 2)
{
Array inputs = params[2].get_array();
BOOST_FOREACH(Value& input, inputs)
{
CLioncoinAddress address(input.get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Lioncoin address: ")+input.get_str());
if (setAddress.count(address))
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+input.get_str());
setAddress.insert(address);
}
}
Array results;
vector<COutput> vecOutputs;
assert(pwalletMain != NULL);
pwalletMain->AvailableCoins(vecOutputs, false);
BOOST_FOREACH(const COutput& out, vecOutputs)
{
if (out.nDepth < nMinDepth || out.nDepth > nMaxDepth)
continue;
if (setAddress.size())
{
CTxDestination address;
if (!ExtractDestination(out.tx->vout[out.i].scriptPubKey, address))
continue;
if (!setAddress.count(address))
continue;
}
int64_t nValue = out.tx->vout[out.i].nValue;
const CScript& pk = out.tx->vout[out.i].scriptPubKey;
Object entry;
entry.push_back(Pair("txid", out.tx->GetHash().GetHex()));
entry.push_back(Pair("vout", out.i));
CTxDestination address;
if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address))
{
entry.push_back(Pair("address", CLioncoinAddress(address).ToString()));
if (pwalletMain->mapAddressBook.count(address))
entry.push_back(Pair("account", pwalletMain->mapAddressBook[address].name));
}
entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end())));
if (pk.IsPayToScriptHash())
{
CTxDestination address;
if (ExtractDestination(pk, address))
{
const CScriptID& hash = boost::get<const CScriptID&>(address);
CScript redeemScript;
if (pwalletMain->GetCScript(hash, redeemScript))
entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end())));
}
}
entry.push_back(Pair("amount",ValueFromAmount(nValue)));
entry.push_back(Pair("confirmations",out.nDepth));
results.push_back(entry);
}
return results;
}
#endif
Value createrawtransaction(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 2)
throw runtime_error(
"createrawtransaction [{\"txid\":\"id\",\"vout\":n},...] {\"address\":amount,...}\n"
"\nCreate a transaction spending the given inputs and sending to the given addresses.\n"
"Returns hex-encoded raw transaction.\n"
"Note that the transaction's inputs are not signed, and\n"
"it is not stored in the wallet or transmitted to the network.\n"
"\nArguments:\n"
"1. \"transactions\" (string, required) A json array of json objects\n"
" [\n"
" {\n"
" \"txid\":\"id\", (string, required) The transaction id\n"
" \"vout\":n (numeric, required) The output number\n"
" }\n"
" ,...\n"
" ]\n"
"2. \"addresses\" (string, required) a json object with addresses as keys and amounts as values\n"
" {\n"
" \"address\": x.xxx (numeric, required) The key is the lioncoin address, the value is the btc amount\n"
" ,...\n"
" }\n"
"\nResult:\n"
"\"transaction\" (string) hex string of the transaction\n"
"\nExamples\n"
+ HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"address\\\":0.01}\"")
+ HelpExampleRpc("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"address\\\":0.01}\"")
);
RPCTypeCheck(params, list_of(array_type)(obj_type));
Array inputs = params[0].get_array();
Object sendTo = params[1].get_obj();
CTransaction rawTx;
BOOST_FOREACH(const Value& input, inputs)
{
const Object& o = input.get_obj();
uint256 txid = ParseHashO(o, "txid");
const Value& vout_v = find_value(o, "vout");
if (vout_v.type() != int_type)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing vout key");
int nOutput = vout_v.get_int();
if (nOutput < 0)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, vout must be positive");
CTxIn in(COutPoint(txid, nOutput));
rawTx.vin.push_back(in);
}
set<CLioncoinAddress> setAddress;
BOOST_FOREACH(const Pair& s, sendTo)
{
CLioncoinAddress address(s.name_);
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Lioncoin address: ")+s.name_);
if (setAddress.count(address))
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
setAddress.insert(address);
CScript scriptPubKey;
scriptPubKey.SetDestination(address.Get());
int64_t nAmount = AmountFromValue(s.value_);
CTxOut out(nAmount, scriptPubKey);
rawTx.vout.push_back(out);
}
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss << rawTx;
return HexStr(ss.begin(), ss.end());
}
Value decoderawtransaction(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"decoderawtransaction \"hexstring\"\n"
"\nReturn a JSON object representing the serialized, hex-encoded transaction.\n"
"\nArguments:\n"
"1. \"txid\" (string, required) The transaction hex string\n"
"\nResult:\n"
"{\n"
" \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n"
" \"txid\" : \"id\", (string) The transaction id (same as provided)\n"
" \"version\" : n, (numeric) The version\n"
" \"locktime\" : ttt, (numeric) The lock time\n"
" \"vin\" : [ (array of json objects)\n"
" {\n"
" \"txid\": \"id\", (string) The transaction id\n"
" \"vout\": n, (numeric) The output number\n"
" \"scriptSig\": { (json object) The script\n"
" \"asm\": \"asm\", (string) asm\n"
" \"hex\": \"hex\" (string) hex\n"
" },\n"
" \"sequence\": n (numeric) The script sequence number\n"
" }\n"
" ,...\n"
" ],\n"
" \"vout\" : [ (array of json objects)\n"
" {\n"
" \"value\" : x.xxx, (numeric) The value in btc\n"
" \"n\" : n, (numeric) index\n"
" \"scriptPubKey\" : { (json object)\n"
" \"asm\" : \"asm\", (string) the asm\n"
" \"hex\" : \"hex\", (string) the hex\n"
" \"reqSigs\" : n, (numeric) The required sigs\n"
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
" \"addresses\" : [ (json array of string)\n"
" \"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) lioncoin address\n"
" ,...\n"
" ]\n"
" }\n"
" }\n"
" ,...\n"
" ],\n"
" \"blockhash\" : \"hash\", (string) the block hash\n"
" \"confirmations\" : n, (numeric) The confirmations\n"
" \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n"
" \"blocktime\" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n"
"}\n"
"\nExamples:\n"
+ HelpExampleCli("decoderawtransaction", "\"hexstring\"")
+ HelpExampleRpc("decoderawtransaction", "\"hexstring\"")
);
vector<unsigned char> txData(ParseHexV(params[0], "argument"));
CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);
CTransaction tx;
try {
ssData >> tx;
}
catch (std::exception &e) {
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
}
Object result;
TxToJSON(tx, 0, result);
return result;
}
Value decodescript(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"decodescript \"hex\"\n"
"\nDecode a hex-encoded script.\n"
"\nArguments:\n"
"1. \"hex\" (string) the hex encoded script\n"
"\nResult:\n"
"{\n"
" \"asm\":\"asm\", (string) Script public key\n"
" \"hex\":\"hex\", (string) hex encoded public key\n"
" \"type\":\"type\", (string) The output type\n"
" \"reqSigs\": n, (numeric) The required signatures\n"
" \"addresses\": [ (json array of string)\n"
" \"address\" (string) lioncoin address\n"
" ,...\n"
" ],\n"
" \"p2sh\",\"address\" (string) script address\n"
"}\n"
"\nExamples:\n"
+ HelpExampleCli("decodescript", "\"hexstring\"")
+ HelpExampleRpc("decodescript", "\"hexstring\"")
);
RPCTypeCheck(params, list_of(str_type));
Object r;
CScript script;
if (params[0].get_str().size() > 0){
vector<unsigned char> scriptData(ParseHexV(params[0], "argument"));
script = CScript(scriptData.begin(), scriptData.end());
} else {
// Empty scripts are valid
}
ScriptPubKeyToJSON(script, r, false);
r.push_back(Pair("p2sh", CLioncoinAddress(script.GetID()).ToString()));
return r;
}
Value signrawtransaction(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 4)
throw runtime_error(
"signrawtransaction \"hexstring\" ( [{\"txid\":\"id\",\"vout\":n,\"scriptPubKey\":\"hex\",\"redeemScript\":\"hex\"},...] [\"privatekey1\",...] sighashtype )\n"
"\nSign inputs for raw transaction (serialized, hex-encoded).\n"
"The second optional argument (may be null) is an array of previous transaction outputs that\n"
"this transaction depends on but may not yet be in the block chain.\n"
"The third optional argument (may be null) is an array of base58-encoded private\n"
"keys that, if given, will be the only keys used to sign the transaction.\n"
#ifdef ENABLE_WALLET
+ HelpRequiringPassphrase() + "\n"
#endif
"\nArguments:\n"
"1. \"hexstring\" (string, required) The transaction hex string\n"
"2. \"prevtxs\" (string, optional) An json array of previous dependent transaction outputs\n"
" [ (json array of json objects, or 'null' if none provided)\n"
" {\n"
" \"txid\":\"id\", (string, required) The transaction id\n"
" \"vout\":n, (numeric, required) The output number\n"
" \"scriptPubKey\": \"hex\", (string, required) script key\n"
" \"redeemScript\": \"hex\" (string, required) redeem script\n"
" }\n"
" ,...\n"
" ]\n"
"3. \"privatekeys\" (string, optional) A json array of base58-encoded private keys for signing\n"
" [ (json array of strings, or 'null' if none provided)\n"
" \"privatekey\" (string) private key in base58-encoding\n"
" ,...\n"
" ]\n"
"4. \"sighashtype\" (string, optional, default=ALL) The signature has type. Must be one of\n"
" \"ALL\"\n"
" \"NONE\"\n"
" \"SINGLE\"\n"
" \"ALL|ANYONECANPAY\"\n"
" \"NONE|ANYONECANPAY\"\n"
" \"SINGLE|ANYONECANPAY\"\n"
"\nResult:\n"
"{\n"
" \"hex\": \"value\", (string) The raw transaction with signature(s) (hex-encoded string)\n"
" \"complete\": n (numeric) if transaction has a complete set of signature (0 if not)\n"
"}\n"
"\nExamples:\n"
+ HelpExampleCli("signrawtransaction", "\"myhex\"")
+ HelpExampleRpc("signrawtransaction", "\"myhex\"")
);
RPCTypeCheck(params, list_of(str_type)(array_type)(array_type)(str_type), true);
vector<unsigned char> txData(ParseHexV(params[0], "argument 1"));
CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);
vector<CTransaction> txVariants;
while (!ssData.empty())
{
try {
CTransaction tx;
ssData >> tx;
txVariants.push_back(tx);
}
catch (std::exception &e) {
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
}
}
if (txVariants.empty())
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Missing transaction");
// mergedTx will end up with all the signatures; it
// starts as a clone of the rawtx:
CTransaction mergedTx(txVariants[0]);
bool fComplete = true;
// Fetch previous transactions (inputs):
CCoinsView viewDummy;
CCoinsViewCache view(viewDummy);
{
LOCK(mempool.cs);
CCoinsViewCache &viewChain = *pcoinsTip;
CCoinsViewMemPool viewMempool(viewChain, mempool);
view.SetBackend(viewMempool); // temporarily switch cache backend to db+mempool view
BOOST_FOREACH(const CTxIn& txin, mergedTx.vin) {
const uint256& prevHash = txin.prevout.hash;
CCoins coins;
view.GetCoins(prevHash, coins); // this is certainly allowed to fail
}
view.SetBackend(viewDummy); // switch back to avoid locking mempool for too long
}
bool fGivenKeys = false;
CBasicKeyStore tempKeystore;
if (params.size() > 2 && params[2].type() != null_type)
{
fGivenKeys = true;
Array keys = params[2].get_array();
BOOST_FOREACH(Value k, keys)
{
CLioncoinSecret vchSecret;
bool fGood = vchSecret.SetString(k.get_str());
if (!fGood)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key");
CKey key = vchSecret.GetKey();
tempKeystore.AddKey(key);
}
}
#ifdef ENABLE_WALLET
else
EnsureWalletIsUnlocked();
#endif
// Add previous txouts given in the RPC call:
if (params.size() > 1 && params[1].type() != null_type)
{
Array prevTxs = params[1].get_array();
BOOST_FOREACH(Value& p, prevTxs)
{
if (p.type() != obj_type)
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "expected object with {\"txid'\",\"vout\",\"scriptPubKey\"}");
Object prevOut = p.get_obj();
RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type));
uint256 txid = ParseHashO(prevOut, "txid");
int nOut = find_value(prevOut, "vout").get_int();
if (nOut < 0)
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "vout must be positive");
vector<unsigned char> pkData(ParseHexO(prevOut, "scriptPubKey"));
CScript scriptPubKey(pkData.begin(), pkData.end());
CCoins coins;
if (view.GetCoins(txid, coins)) {
if (coins.IsAvailable(nOut) && coins.vout[nOut].scriptPubKey != scriptPubKey) {
string err("Previous output scriptPubKey mismatch:\n");
err = err + coins.vout[nOut].scriptPubKey.ToString() + "\nvs:\n"+
scriptPubKey.ToString();
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, err);
}
// what todo if txid is known, but the actual output isn't?
}
if ((unsigned int)nOut >= coins.vout.size())
coins.vout.resize(nOut+1);
coins.vout[nOut].scriptPubKey = scriptPubKey;
coins.vout[nOut].nValue = 0; // we don't know the actual output value
view.SetCoins(txid, coins);
// if redeemScript given and not using the local wallet (private keys
// given), add redeemScript to the tempKeystore so it can be signed:
if (fGivenKeys && scriptPubKey.IsPayToScriptHash())
{
RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)("redeemScript",str_type));
Value v = find_value(prevOut, "redeemScript");
if (!(v == Value::null))
{
vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
CScript redeemScript(rsData.begin(), rsData.end());
tempKeystore.AddCScript(redeemScript);
}
}
}
}
#ifdef ENABLE_WALLET
const CKeyStore& keystore = ((fGivenKeys || !pwalletMain) ? tempKeystore : *pwalletMain);
#else
const CKeyStore& keystore = tempKeystore;
#endif
int nHashType = SIGHASH_ALL;
if (params.size() > 3 && params[3].type() != null_type)
{
static map<string, int> mapSigHashValues =
boost::assign::map_list_of
(string("ALL"), int(SIGHASH_ALL))
(string("ALL|ANYONECANPAY"), int(SIGHASH_ALL|SIGHASH_ANYONECANPAY))
(string("NONE"), int(SIGHASH_NONE))
(string("NONE|ANYONECANPAY"), int(SIGHASH_NONE|SIGHASH_ANYONECANPAY))
(string("SINGLE"), int(SIGHASH_SINGLE))
(string("SINGLE|ANYONECANPAY"), int(SIGHASH_SINGLE|SIGHASH_ANYONECANPAY))
;
string strHashType = params[3].get_str();
if (mapSigHashValues.count(strHashType))
nHashType = mapSigHashValues[strHashType];
else
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid sighash param");
}
bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE);
// Sign what we can:
for (unsigned int i = 0; i < mergedTx.vin.size(); i++)
{
CTxIn& txin = mergedTx.vin[i];
CCoins coins;
if (!view.GetCoins(txin.prevout.hash, coins) || !coins.IsAvailable(txin.prevout.n))
{
fComplete = false;
continue;
}
const CScript& prevPubKey = coins.vout[txin.prevout.n].scriptPubKey;
txin.scriptSig.clear();
// Only sign SIGHASH_SINGLE if there's a corresponding output:
if (!fHashSingle || (i < mergedTx.vout.size()))
SignSignature(keystore, prevPubKey, mergedTx, i, nHashType);
// ... and merge in other signatures:
BOOST_FOREACH(const CTransaction& txv, txVariants)
{
txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig);
}
if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx, i, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, 0))
fComplete = false;
}
Object result;
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
ssTx << mergedTx;
result.push_back(Pair("hex", HexStr(ssTx.begin(), ssTx.end())));
result.push_back(Pair("complete", fComplete));
return result;
}
Value sendrawtransaction(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"sendrawtransaction \"hexstring\" ( allowhighfees )\n"
"\nSubmits raw transaction (serialized, hex-encoded) to local node and network.\n"
"\nAlso see createrawtransaction and signrawtransaction calls.\n"
"\nArguments:\n"
"1. \"hexstring\" (string, required) The hex string of the raw transaction)\n"
"2. allowhighfees (boolean, optional, default=false) Allow high fees\n"
"\nResult:\n"
"\"hex\" (string) The transaction hash in hex\n"
"\nExamples:\n"
"\nCreate a transaction\n"
+ HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"") +
"Sign the transaction, and get back the hex\n"
+ HelpExampleCli("signrawtransaction", "\"myhex\"") +
"\nSend the transaction (signed hex)\n"
+ HelpExampleCli("sendrawtransaction", "\"signedhex\"") +
"\nAs a json rpc call\n"
+ HelpExampleRpc("sendrawtransaction", "\"signedhex\"")
);
// parse hex string from parameter
vector<unsigned char> txData(ParseHexV(params[0], "parameter"));
CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);
CTransaction tx;
bool fOverrideFees = false;
if (params.size() > 1)
fOverrideFees = params[1].get_bool();
// deserialize binary data stream
try {
ssData >> tx;
}
catch (std::exception &e) {
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
}
uint256 hashTx = tx.GetHash();
bool fHave = false;
CCoinsViewCache &view = *pcoinsTip;
CCoins existingCoins;
{
fHave = view.GetCoins(hashTx, existingCoins);
if (!fHave) {
// push to local node
CValidationState state;
if (!AcceptToMemoryPool(mempool, state, tx, false, NULL, !fOverrideFees))
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX rejected"); // TODO: report validation state
}
}
if (fHave) {
if (existingCoins.nHeight < 1000000000)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "transaction already in block chain");
// Not in block, but already in the memory pool; will drop
// through to re-relay it.
} else {
SyncWithWallets(hashTx, tx, NULL);
}
RelayTransaction(tx, hashTx);
return hashTx.GetHex();
}
| mit |
raadler/Scrivn | spec/rails_helper.rb | 652 | # This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'spec_helper'
require 'rspec/rails'
require 'shoulda/matchers'
ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!
config.filter_rails_from_backtrace!
end
| mit |
concensus/react-native-ios-concensus | screens/NewPollScreen.js | 929 | import React from 'react';
import { View, ScrollView } from 'react-native';
import ConcensusButton from '../components/ConcensusButton';
import axios from 'axios';
const t = require('tcomb-form-native');
const Form = t.form.Form;
const NewPollScreen = ({ navigation }) => {
function onProposePress() {
navigation.navigate('QRCodeShower');
axios.post('http://4d23f078.ngrok.io/createPoll');
}
return (
<View style={{ padding: 20 }}>
<ScrollView>
<Form type={Poll} />
</ScrollView>
<ConcensusButton label="Propose Motion" onPress={onProposePress} />
</View>
);
};
NewPollScreen.navigationOptions = ({ navigation }) => ({
title: 'Propose a Motion',
});
export default NewPollScreen;
const Poll = t.struct({
subject: t.String,
proposal: t.String,
endsInMinutes: t.Number,
consensusPercentage: t.Number,
});
| mit |
mikescamell/shared-element-transitions | app/src/main/java/com/mikescamell/sharedelementtransitions/recycler_view/recycler_view_to_viewpager/RecyclerViewToViewPagerActivity.java | 652 | package com.mikescamell.sharedelementtransitions.recycler_view.recycler_view_to_viewpager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.mikescamell.sharedelementtransitions.R;
public class RecyclerViewToViewPagerActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragment_to_fragment);
getSupportFragmentManager()
.beginTransaction()
.add(R.id.content, RecyclerViewFragment.newInstance())
.commit();
}
}
| mit |
nachovizzo/AUTONAVx | simulator/autonavx_demo/js/init/editor.js | 330 | define(["ace/ace"], function(ace) {
return function(element) {
var editor = ace.edit(element);
editor.setTheme("ace/theme/eclipse");
editor.getSession().setMode("ace/mode/python");
editor.getSession().setUseSoftTabs(true);
editor.getSession().setTabSize(4);
editor.setShowPrintMargin(false);
return editor;
};
})
| mit |
kanna-lab/kanna-lib-components | lib/index.js | 4495 | /**
* React components for kanna projects.
* @module kanna-lib-components
*/
"use strict";
module.exports = {
/**
* @name KnAccordionArrow
*/
get KnAccordionArrow() { return require('./kn_accordion_arrow'); },
/**
* @name KnAccordionBody
*/
get KnAccordionBody() { return require('./kn_accordion_body'); },
/**
* @name KnAccordionHeader
*/
get KnAccordionHeader() { return require('./kn_accordion_header'); },
/**
* @name KnAccordion
*/
get KnAccordion() { return require('./kn_accordion'); },
/**
* @name KnAnalogClock
*/
get KnAnalogClock() { return require('./kn_analog_clock'); },
/**
* @name KnBody
*/
get KnBody() { return require('./kn_body'); },
/**
* @name KnButton
*/
get KnButton() { return require('./kn_button'); },
/**
* @name KnCheckbox
*/
get KnCheckbox() { return require('./kn_checkbox'); },
/**
* @name KnClock
*/
get KnClock() { return require('./kn_clock'); },
/**
* @name KnContainer
*/
get KnContainer() { return require('./kn_container'); },
/**
* @name KnDesktopShowcase
*/
get KnDesktopShowcase() { return require('./kn_desktop_showcase'); },
/**
* @name KnDigitalClock
*/
get KnDigitalClock() { return require('./kn_digital_clock'); },
/**
* @name KnFaIcon
*/
get KnFaIcon() { return require('./kn_fa_icon'); },
/**
* @name KnFooter
*/
get KnFooter() { return require('./kn_footer'); },
/**
* @name KnHead
*/
get KnHead() { return require('./kn_head'); },
/**
* @name KnHeaderLogo
*/
get KnHeaderLogo() { return require('./kn_header_logo'); },
/**
* @name KnHeaderTabItem
*/
get KnHeaderTabItem() { return require('./kn_header_tab_item'); },
/**
* @name KnHeaderTab
*/
get KnHeaderTab() { return require('./kn_header_tab'); },
/**
* @name KnHeader
*/
get KnHeader() { return require('./kn_header'); },
/**
* @name KnHtml
*/
get KnHtml() { return require('./kn_html'); },
/**
* @name KnIcon
*/
get KnIcon() { return require('./kn_icon'); },
/**
* @name KnImage
*/
get KnImage() { return require('./kn_image'); },
/**
* @name KnIonIcon
*/
get KnIonIcon() { return require('./kn_ion_icon'); },
/**
* @name KnLabel
*/
get KnLabel() { return require('./kn_label'); },
/**
* @name KnLinks
*/
get KnLinks() { return require('./kn_links'); },
/**
* @name KnListItemArrowIcon
*/
get KnListItemArrowIcon() { return require('./kn_list_item_arrow_icon'); },
/**
* @name KnListItemIcon
*/
get KnListItemIcon() { return require('./kn_list_item_icon'); },
/**
* @name KnListItemText
*/
get KnListItemText() { return require('./kn_list_item_text'); },
/**
* @name KnListItem
*/
get KnListItem() { return require('./kn_list_item'); },
/**
* @name KnList
*/
get KnList() { return require('./kn_list'); },
/**
* @name KnMain
*/
get KnMain() { return require('./kn_main'); },
/**
* @name KnMobileShowcase
*/
get KnMobileShowcase() { return require('./kn_mobile_showcase'); },
/**
* @name KnNote
*/
get KnNote() { return require('./kn_note'); },
/**
* @name KnPassword
*/
get KnPassword() { return require('./kn_password'); },
/**
* @name KnRadio
*/
get KnRadio() { return require('./kn_radio'); },
/**
* @name KnRange
*/
get KnRange() { return require('./kn_range'); },
/**
* @name KnShowcase
*/
get KnShowcase() { return require('./kn_showcase'); },
/**
* @name KnSlider
*/
get KnSlider() { return require('./kn_slider'); },
/**
* @name KnSlideshow
*/
get KnSlideshow() { return require('./kn_slideshow'); },
/**
* @name KnSpinner
*/
get KnSpinner() { return require('./kn_spinner'); },
/**
* @name KnTabItem
*/
get KnTabItem() { return require('./kn_tab_item'); },
/**
* @name KnTab
*/
get KnTab() { return require('./kn_tab'); },
/**
* @name KnText
*/
get KnText() { return require('./kn_text'); },
/**
* @name KnThemeStyle
*/
get KnThemeStyle() { return require('./kn_theme_style'); }
}; | mit |
CatUnicornKiller/web-app | app/helpers/date/DateHelper.php | 1928 | <?php
namespace App\Helpers\Date;
use Nette;
/**
* Date and time helper for better work with dates. Functions return special
* DateTimeHolder which contains both textual and typed DateTime.
*/
class DateHelper
{
use Nette\SmartObject;
/**
* Create datetime from the given text if valid, or otherwise return first
* day of current month.
* @param string $text
* @return \App\Helpers\Date\DateTimeHolder
*/
public function createFromDateOrFirstDayOfMonth($text): DateTimeHolder
{
$holder = new DateTimeHolder;
$date = date_create_from_format("j. n. Y", $text);
$holder->typed = $date ? $date : new \DateTime('first day of this month');
$holder->textual = $holder->typed->format("j. n. Y");
return $holder;
}
/**
* Create datetime from the given text if valid, or otherwise return last
* day of current month.
* @param string $text
* @return \App\Helpers\Date\DateTimeHolder
*/
public function createFromDateOrLastDayOfMonth($text): DateTimeHolder
{
$holder = new DateTimeHolder;
$date = date_create_from_format("j. n. Y", $text);
$holder->typed = $date ? $date : new \DateTime('last day of this month');
$holder->textual = $holder->typed->format("j. n. Y");
return $holder;
}
/**
* Create date from given string, if not possible create fallback date (0000-00-00 00:00:00)
* @param string $text
* @return \App\Helpers\Date\DateTimeHolder
*/
public function createDateOrDefault($text): DateTimeHolder
{
$holder = new DateTimeHolder;
try {
$date = new \DateTime($text);
} catch (\Exception $e) {
$date = new \DateTime("0000-00-00 00:00:00");
}
$holder->typed = $date;
$holder->textual = $holder->typed->format("j. n. Y");
return $holder;
}
}
| mit |
goodGid/goodGid.github.io | _posts/2018-10-15-BOJ-15686.md | 2127 | ---
layout: post
title: "[BOJ] 15686. 치킨 배달"
categories: Algorithm
author: goodGid
---
* content
{:toc}
## Problem
Problem URL : **[치킨 배달](https://www.acmicpc.net/problem/15686)**


---
## [1] Answer Code (18. 10. 15)
``` cpp
#include<iostream>
#include<vector>
#include<algorithm>
#define p pair<int,int>
using namespace std;
int n,m;
int map[50][50];
int ans;
int dp[2500][13];
vector<p> house;
vector<p> chicken;
vector<int> pick_idx;
void cal_dist(){
int sum =0;
for(int i=0; i<house.size(); i++){
int pivot = 2e9;
for(int j=0; j<m; j++){
pivot = pivot < dp[i][ pick_idx[j] ] ? pivot : dp[i][ pick_idx[j] ] ;
}
sum += pivot;
}
ans = ans < sum ? ans : sum;
}
void dfs(int idx, int pick_cnt){
if(pick_cnt == m){
cal_dist();
return ;
}
if( idx == chicken.size()){
return ;
}
// pick
pick_idx.push_back(idx);
dfs( idx + 1, pick_cnt + 1 );
pick_idx.pop_back();
// pass
dfs( idx+1, pick_cnt) ;
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
ans = 2e9;
cin >> n >> m;
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
cin >> map[i][j];
if(map[i][j] == 1)
house.push_back(p(i,j));
else if(map[i][j] == 2)
chicken.push_back(p(i,j));
}
}
for(int i=0; i<house.size(); i++){
for(int j=0; j<chicken.size(); j++){
int _sum = 0;
_sum += abs(house[i].first - chicken[j].first);
_sum += abs(house[i].second - chicken[j].second);
dp[i][j] = _sum;
}
}
dfs(0,0);
cout << ans << endl;
return 0;
}
```
### Review
* 삼성 역량 테스트 기출 문제
* 각 집에서 모든 치킨 집 거리에 대해 미리 계산을 한 후 <br> DFS로 치킨 집을 선정하고 <br> 선정한 치킨 집에 대해 집에서 가장 최소가 되는 값들을 구한다. <br> 끝 | mit |
v8-dox/v8-dox.github.io | 6a7e5ce/html/classv8_1_1MicrotasksScope-members.html | 7631 | <!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 v8.9.1: Member List</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 v8.9.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="pages.html"><span>Related Pages</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_1MicrotasksScope.html">MicrotasksScope</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">v8::MicrotasksScope Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html#ad49e24bc69b61d7a67045cf658da1fce">GetCurrentDepth</a>(Isolate *isolate)</td><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html#add7bcfed084afcd0d2729c3ac382145c">IsRunningMicrotasks</a>(Isolate *isolate)</td><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>kDoNotRunMicrotasks</b> enum value (defined in <a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a>)</td><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>kRunMicrotasks</b> enum value (defined in <a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a>)</td><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>MicrotasksScope</b>(Isolate *isolate, Type type) (defined in <a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a>)</td><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>MicrotasksScope</b>(const MicrotasksScope &)=delete (defined in <a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a>)</td><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>operator=</b>(const MicrotasksScope &)=delete (defined in <a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a>)</td><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html#a1995095b585828067d367d5362bef65e">PerformCheckpoint</a>(Isolate *isolate)</td><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Type</b> enum name (defined in <a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a>)</td><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>~MicrotasksScope</b>() (defined in <a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a>)</td><td class="entry"><a class="el" href="classv8_1_1MicrotasksScope.html">v8::MicrotasksScope</a></td><td class="entry"></td></tr>
</table></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>
| mit |
bkahlert/seqan-research | raw/pmsb13/pmsb13-data-20130530/sources/130wu1dgzoqmxyu2/2013-05-01T11-34-38.877+0200/sandbox/my_sandbox/apps/lagan_neu/lagan_neu.cpp | 8171 | #include <iostream>
#include <fstream>
#include <seqan/basic.h>
#include <seqan/index.h>
#include <seqan/seq_io.h>
#include <seqan/sequence.h>
#include <seqan/file.h>
#include <seqan/score.h>
#include <seqan/seeds.h>
#include <seqan/align.h>
using namespace seqan;
seqan::String<Seed<Simple> > get_global_seed_chain(seqan::DnaString seq1, seqan::DnaString seq2, seqan::String<Seed<Simple> > roughGlobalChain, unsigned q){
typedef seqan::Seed<Simple> SSeed;
typedef seqan::SeedSet<Simple> SSeedSet;
SSeed seed;
SSeedSet seedSet;
seqan::String<SSeed> seedChain;
seqan::String<SSeed> improvedGlobalSeedChain;
seqan::DnaString window1 = seqan::infix(seq1, seqan::endPositionH(seedChain[0]), seqan::beginPositionH(seedChain[1]));
seqan::DnaString window2 = seqan::infix(seq2, seqan::endPositionV(seedChain[0]), seqan::beginPositionV(seedChain[1]));
std::cout << "window1: " << window1 << std::endl;
std::cout << "window2: " << window2 << std::endl;
typedef Index< DnaString, IndexQGram<SimpleShape > > qGramIndex;
qGramIndex index(window1);
resize(indexShape(index), q);
Finder<qGramIndex> myFinder(index);
std::cout << length(window2) << std::endl;
for (unsigned i = 0; i < length(window2) - (q - 1); ++i){
DnaString qGram = infix(window2, i, i + q);
std::cout << qGram << std::endl;
while (find(myFinder, qGram)){
std::cout << position(myFinder) << std::endl;
}
clear(myFinder);
}
seqan::chainSeedsGlobally(improvedGlobalSeedChain, seedSet, seqan::SparseChaining());
return improvedGlobalSeedChain;
}
bool readFASTA(char const * path, CharString &id, Dna5String &seq){
std::fstream in(path, std::ios::binary | std::ios::in);
RecordReader<std::fstream, SinglePass<> > reader(in);
if (readRecord(id, seq, reader, Fasta()) == 0){
return true;
}
else{
return false;
}
}
std::string get_file_contents(const char* filepath){
std::ifstream in(filepath, std::ios::in | std::ios::binary);
if (in){
std::string contents;
in.seekg(0, std::ios::end);
int fileLength = in.tellg();
contents.resize(fileLength);
in.seekg(0, std::ios::beg);
in.read(&contents[0], contents.size());
in.close();
return(contents);
}
throw(errno);
}
bool writeSeedPositions(std::vector< std::pair<unsigned, unsigned> > &array1, std::vector< std::pair<unsigned, unsigned> > &array2, const char* filepath){
std::ifstream FileTest(filepath);
if(!FileTest){
return false;
}
FileTest.close();
std::string s;
s = get_file_contents(filepath);
std::string pattern1 = ("Database positions: ");
std::string pattern2 = ("Query positions: ");
std::pair<unsigned, unsigned> startEnd;
std::vector<std::string> patternContainer;
patternContainer.push_back(pattern1);
patternContainer.push_back(pattern2);
for (unsigned j = 0; j < patternContainer.size(); ++j){
unsigned found = s.find(patternContainer[j]);
while (found!=std::string::npos){
std::string temp1 = "";
std::string temp2 = "";
int i = 0;
while (s[found + patternContainer[j].length() + i] != '.'){
temp1 += s[found + patternContainer[j].length() + i];
++i;
}
i += 2;
while(s[found + patternContainer[j].length() + i] != '\n'){
temp2 += s[found + patternContainer[j].length() + i];
++i;
}
std::stringstream as(temp1);
std::stringstream bs(temp2);
int a;
int b;
as >> a;
bs >> b;
startEnd = std::make_pair(a, b);
if (j == 0){
array1.push_back(startEnd);
}
else{
array2.push_back(startEnd);
}
++found;
found = s.find(patternContainer[j], found);
}
}
return true;
}
int main(int argc, char const ** argv){
CharString idOne;
Dna5String seqOne;
CharString idTwo;
Dna5String seqTwo;
std::vector< std::pair<unsigned, unsigned> > seedsPosSeq1;
std::vector< std::pair<unsigned, unsigned> > seedsPosSeq2;
if (!readFASTA(argv[1], idOne, seqOne)){
std::cerr << "error: unable to read first sequence";
return 1;
}
if (!readFASTA(argv[2], idTwo, seqTwo)){
std::cerr << "error: unable to read second sequence";
return 1;
}
if (!writeSeedPositions(seedsPosSeq1, seedsPosSeq2, argv[3])){
std::cerr << "error: STELLAR output file not found";
return 1;
}
typedef Seed<Simple> SSeed;
typedef SeedSet<Simple> SSeedSet;
SSeedSet seedSet;
/*
for (unsigned i = 0; i < seedsPosSeq1.size(); ++i){
std::cout << "Seq1 " << seedsPosSeq1[i].first << '\t' << seedsPosSeq1[i].second << std::endl;
std::cout << "Seq2 " << seedsPosSeq2[i].first << '\t' << seedsPosSeq2[i].second << std::endl;
}
*/
//creation of seeds and adding them to a SeedSet
for (unsigned i = 0; i < seedsPosSeq1.size(); ++i){
SSeed seed(seedsPosSeq1[i].first, seedsPosSeq2[i].first, seedsPosSeq1[i].second, seedsPosSeq2[i].second);
addSeed(seedSet, seed, Single());
}
//std::cout << "Trennlinie" << std::endl;
clear(seedSet);
typedef Iterator<SSeedSet >::Type SetIterator;
for (SetIterator it = begin(seedSet, Standard()); it != end(seedSet, Standard()); ++it){
std::cout << *it;
std::cout << std::endl;
}
/*
typedef Iterator<String<SSeed> > StringIterator;
seqan::String<SSeed> seedChain;
seqan::String<SSeed> seedChain2;
std::vector<unsigned> depthCounter;
chainSeedsGlobally(seedChain, seedSet, seqan::SparseChaining());
depthCounter.push_back(length(seedChain));
unsigned initQGram = 20;
/*while (!depthCounter.empty()){
unsigned q = initQGram; // - (2 * (depthCounter.size() - 1));
seqan::String<SSeed> globalSeedChain;
while(q >= 4){
SSeed seed;
SSeedSet seedSet;
seqan::String<SSeed> seedChain;
seqan::DnaString window1 = seqan::infix(seqOne, seqan::endPositionH(seedChain[0]), seqan::beginPositionH(seedChain[1]));
seqan::DnaString window2 = seqan::infix(seqTwo, seqan::endPositionV(seedChain[0]), seqan::beginPositionV(seedChain[1]));
std::cout << "window1: " << window1 << std::endl;
std::cout << "window2: " << window2 << std::endl;
typedef Index< DnaString, IndexQGram<SimpleShape > > qGramIndex;
qGramIndex index(window1);
resize(indexShape(index), q);
Finder<qGramIndex> myFinder(index);
std::cout << length(window2) << std::endl;
for (unsigned i = 0; i < length(window2) - (q - 1); ++i){
unsigned startPosSeedSeq1;
unsigned startPosSeedSeq2;
unsigned endPosSeedSeq1;
unsigned endPosSeedSeq2;
DnaString qGram = infix(window2, i, i + q);
std::cout << qGram << std::endl;
if (find(myFinder, qGram)){
std::cout << position(myFinder) << std::endl;
addSeed()
}
clear(myFinder);
}
/*
std::cout << front(seedChain) << std::endl;
seqan::append(seedChain2, seedChain[0]);
std::cout << "bla0" << std::endl;
seqan::append(seedChain2, seedChain[1]);
std::cout << length(seedChain2) << std::endl;
seqan::insert(seedChain2, 1, seedChain);
std::cout << "seedChain[3]: " << seedChain[3] << std::endl;
std::cout << "seedChain2[1]: " << seedChain2[1] << std::endl;
std::cout << "length(seedChain2): " << length(seedChain2) << std::endl;
erase(seedChain2, 0);
std::cout << length(seedChain2) << std::endl;
std::cout << "bla2" << std::endl;
}
}
std::cout << "length(seedChain): " << length(seedChain) << std::endl;
std::cout << "seedChain[0]: " << seedChain[0] << std::endl;
std::cout << "seedChain[1]: " << seedChain[1] << std::endl;
std::cout << "seedChain[2]: " << seedChain[2] << std::endl;
/*std::cout << "test2" << std::endl;
Align<Dna5String, ArrayGaps> alignment;
resize(seqan::rows(alignment), 2);
Score<int, Simple> scoringFunction(2, -1, -2);
seqan::assignSource(seqan::row(alignment, 0), seqOne);
seqan::assignSource(seqan::row(alignment, 1), seqTwo);
int result = bandedChainAlignment(alignment, seedChain, scoringFunction, 2);
std::cout << "Score: " << result << std::endl;
std::cout << alignment << std::endl;
*/
/*std::cout << idOne << std::endl << seqOne << std::endl;
std::cout << idTwo << std::endl << seqTwo << std::endl;
for (unsigned i = 0; i < seedsPosSeq1.size(); ++i){
cout << "Seq1 " << seedsPosSeq1[i].first << '\t' << seedsPosSeq1[i].second << endl;
cout << "Seq2 " << seedsPosSeq2[i].first << '\t' << seedsPosSeq2[i].second << endl;
}
*/
return 0;
}
| mit |
dialv/tesisControl | web/bundles/tesiscontroltesis/DataTables-1.10.12/extensions/Buttons/examples/initialisation/className.html | 46339 | <<<<<<< HEAD
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
<title>Buttons example - Class names</title>
<link rel="stylesheet" type="text/css" href="../../../../media/css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css" href="../../css/buttons.dataTables.css">
<link rel="stylesheet" type="text/css" href="../../../../examples/resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../../../../examples/resources/demo.css">
<style type="text/css" class="init">
a.dt-button.red {
color: red;
}
a.dt-button.orange {
color: orange;
}
a.dt-button.green {
color: green;
}
</style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.min.js">
</script>
<script type="text/javascript" language="javascript" src="../../../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../../js/dataTables.buttons.js">
</script>
<script type="text/javascript" language="javascript" src="../../../../examples/resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../../../../examples/resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() {
$('#example').DataTable( {
dom: 'Bfrtip',
buttons: [
{
text: 'Red',
className: 'red'
},
{
text: 'Orange',
className: 'orange'
},
{
text: 'Green',
className: 'green'
}
]
} );
} );
</script>
</head>
<body class="dt-example">
<div class="container">
<section>
<h1>Buttons example <span>Class names</span></h1>
<div class="info">
<p>This example <a href="custom.html">also shows button definition objects</a> being used to describe buttons. In this case we use the <a href=
"//datatables.net/reference/option/buttons.buttons.className"><code class="option" title="Buttons initialisation option">buttons.buttons.className</code></a>
option to specify a custom class name for the button. A little bit of CSS is used to style the buttons - the class names and CSS can of course be adjusted to suit
whatever styling requirements you have.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
</tr>
<tr>
<td>Brielle Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
</tr>
<tr>
<td>Herrod Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
</tr>
<tr>
<td>Rhona Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
</tr>
<tr>
<td>Colleen Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
</tr>
<tr>
<td>Sonya Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
</tr>
<tr>
<td>Jena Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
</tr>
<tr>
<td>Quinn Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
</tr>
<tr>
<td>Charde Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
</tr>
<tr>
<td>Haley Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
</tr>
<tr>
<td>Tatyana Fitzpatrick</td>
<td>Regional Director</td>
<td>London</td>
<td>19</td>
<td>2010/03/17</td>
<td>$385,750</td>
</tr>
<tr>
<td>Michael Silva</td>
<td>Marketing Designer</td>
<td>London</td>
<td>66</td>
<td>2012/11/27</td>
<td>$198,500</td>
</tr>
<tr>
<td>Paul Byrd</td>
<td>Chief Financial Officer (CFO)</td>
<td>New York</td>
<td>64</td>
<td>2010/06/09</td>
<td>$725,000</td>
</tr>
<tr>
<td>Gloria Little</td>
<td>Systems Administrator</td>
<td>New York</td>
<td>59</td>
<td>2009/04/10</td>
<td>$237,500</td>
</tr>
<tr>
<td>Bradley Greer</td>
<td>Software Engineer</td>
<td>London</td>
<td>41</td>
<td>2012/10/13</td>
<td>$132,000</td>
</tr>
<tr>
<td>Dai Rios</td>
<td>Personnel Lead</td>
<td>Edinburgh</td>
<td>35</td>
<td>2012/09/26</td>
<td>$217,500</td>
</tr>
<tr>
<td>Jenette Caldwell</td>
<td>Development Lead</td>
<td>New York</td>
<td>30</td>
<td>2011/09/03</td>
<td>$345,000</td>
</tr>
<tr>
<td>Yuri Berry</td>
<td>Chief Marketing Officer (CMO)</td>
<td>New York</td>
<td>40</td>
<td>2009/06/25</td>
<td>$675,000</td>
</tr>
<tr>
<td>Caesar Vance</td>
<td>Pre-Sales Support</td>
<td>New York</td>
<td>21</td>
<td>2011/12/12</td>
<td>$106,450</td>
</tr>
<tr>
<td>Doris Wilder</td>
<td>Sales Assistant</td>
<td>Sidney</td>
<td>23</td>
<td>2010/09/20</td>
<td>$85,600</td>
</tr>
<tr>
<td>Angelica Ramos</td>
<td>Chief Executive Officer (CEO)</td>
<td>London</td>
<td>47</td>
<td>2009/10/09</td>
<td>$1,200,000</td>
</tr>
<tr>
<td>Gavin Joyce</td>
<td>Developer</td>
<td>Edinburgh</td>
<td>42</td>
<td>2010/12/22</td>
<td>$92,575</td>
</tr>
<tr>
<td>Jennifer Chang</td>
<td>Regional Director</td>
<td>Singapore</td>
<td>28</td>
<td>2010/11/14</td>
<td>$357,650</td>
</tr>
<tr>
<td>Brenden Wagner</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>28</td>
<td>2011/06/07</td>
<td>$206,850</td>
</tr>
<tr>
<td>Fiona Green</td>
<td>Chief Operating Officer (COO)</td>
<td>San Francisco</td>
<td>48</td>
<td>2010/03/11</td>
<td>$850,000</td>
</tr>
<tr>
<td>Shou Itou</td>
<td>Regional Marketing</td>
<td>Tokyo</td>
<td>20</td>
<td>2011/08/14</td>
<td>$163,000</td>
</tr>
<tr>
<td>Michelle House</td>
<td>Integration Specialist</td>
<td>Sidney</td>
<td>37</td>
<td>2011/06/02</td>
<td>$95,400</td>
</tr>
<tr>
<td>Suki Burks</td>
<td>Developer</td>
<td>London</td>
<td>53</td>
<td>2009/10/22</td>
<td>$114,500</td>
</tr>
<tr>
<td>Prescott Bartlett</td>
<td>Technical Author</td>
<td>London</td>
<td>27</td>
<td>2011/05/07</td>
<td>$145,000</td>
</tr>
<tr>
<td>Gavin Cortez</td>
<td>Team Leader</td>
<td>San Francisco</td>
<td>22</td>
<td>2008/10/26</td>
<td>$235,500</td>
</tr>
<tr>
<td>Martena Mccray</td>
<td>Post-Sales support</td>
<td>Edinburgh</td>
<td>46</td>
<td>2011/03/09</td>
<td>$324,050</td>
</tr>
<tr>
<td>Unity Butler</td>
<td>Marketing Designer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/12/09</td>
<td>$85,675</td>
</tr>
<tr>
<td>Howard Hatfield</td>
<td>Office Manager</td>
<td>San Francisco</td>
<td>51</td>
<td>2008/12/16</td>
<td>$164,500</td>
</tr>
<tr>
<td>Hope Fuentes</td>
<td>Secretary</td>
<td>San Francisco</td>
<td>41</td>
<td>2010/02/12</td>
<td>$109,850</td>
</tr>
<tr>
<td>Vivian Harrell</td>
<td>Financial Controller</td>
<td>San Francisco</td>
<td>62</td>
<td>2009/02/14</td>
<td>$452,500</td>
</tr>
<tr>
<td>Timothy Mooney</td>
<td>Office Manager</td>
<td>London</td>
<td>37</td>
<td>2008/12/11</td>
<td>$136,200</td>
</tr>
<tr>
<td>Jackson Bradshaw</td>
<td>Director</td>
<td>New York</td>
<td>65</td>
<td>2008/09/26</td>
<td>$645,750</td>
</tr>
<tr>
<td>Olivia Liang</td>
<td>Support Engineer</td>
<td>Singapore</td>
<td>64</td>
<td>2011/02/03</td>
<td>$234,500</td>
</tr>
<tr>
<td>Bruno Nash</td>
<td>Software Engineer</td>
<td>London</td>
<td>38</td>
<td>2011/05/03</td>
<td>$163,500</td>
</tr>
<tr>
<td>Sakura Yamamoto</td>
<td>Support Engineer</td>
<td>Tokyo</td>
<td>37</td>
<td>2009/08/19</td>
<td>$139,575</td>
</tr>
<tr>
<td>Thor Walton</td>
<td>Developer</td>
<td>New York</td>
<td>61</td>
<td>2013/08/11</td>
<td>$98,540</td>
</tr>
<tr>
<td>Finn Camacho</td>
<td>Support Engineer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/07/07</td>
<td>$87,500</td>
</tr>
<tr>
<td>Serge Baldwin</td>
<td>Data Coordinator</td>
<td>Singapore</td>
<td>64</td>
<td>2012/04/09</td>
<td>$138,575</td>
</tr>
<tr>
<td>Zenaida Frank</td>
<td>Software Engineer</td>
<td>New York</td>
<td>63</td>
<td>2010/01/04</td>
<td>$125,250</td>
</tr>
<tr>
<td>Zorita Serrano</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>56</td>
<td>2012/06/01</td>
<td>$115,000</td>
</tr>
<tr>
<td>Jennifer Acosta</td>
<td>Junior Javascript Developer</td>
<td>Edinburgh</td>
<td>43</td>
<td>2013/02/01</td>
<td>$75,650</td>
</tr>
<tr>
<td>Cara Stevens</td>
<td>Sales Assistant</td>
<td>New York</td>
<td>46</td>
<td>2011/12/06</td>
<td>$145,600</td>
</tr>
<tr>
<td>Hermione Butler</td>
<td>Regional Director</td>
<td>London</td>
<td>47</td>
<td>2011/03/21</td>
<td>$356,250</td>
</tr>
<tr>
<td>Lael Greer</td>
<td>Systems Administrator</td>
<td>London</td>
<td>21</td>
<td>2009/02/27</td>
<td>$103,500</td>
</tr>
<tr>
<td>Jonas Alexander</td>
<td>Developer</td>
<td>San Francisco</td>
<td>30</td>
<td>2010/07/14</td>
<td>$86,500</td>
</tr>
<tr>
<td>Shad Decker</td>
<td>Regional Director</td>
<td>Edinburgh</td>
<td>51</td>
<td>2008/11/13</td>
<td>$183,000</td>
</tr>
<tr>
<td>Michael Bruce</td>
<td>Javascript Developer</td>
<td>Singapore</td>
<td>29</td>
<td>2011/06/27</td>
<td>$183,000</td>
</tr>
<tr>
<td>Donna Snider</td>
<td>Customer Support</td>
<td>New York</td>
<td>27</td>
<td>2011/01/25</td>
<td>$112,000</td>
</tr>
</tbody>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( {
dom: 'Bfrtip',
buttons: [
{
text: 'Red',
className: 'red'
},
{
text: 'Orange',
className: 'orange'
},
{
text: 'Green',
className: 'green'
}
]
} );
} );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul>
<li>
<a href="//code.jquery.com/jquery-1.12.3.min.js">//code.jquery.com/jquery-1.12.3.min.js</a>
</li>
<li>
<a href="../../../../media/js/jquery.dataTables.js">../../../../media/js/jquery.dataTables.js</a>
</li>
<li>
<a href="../../js/dataTables.buttons.js">../../js/dataTables.buttons.js</a>
</li>
</ul>
</div>
<div class="table">
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
</div>
<div class="css">
<div>
<p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
additional CSS used is shown below:</p><code class="multiline language-css">a.dt-button.red {
color: red;
}
a.dt-button.orange {
color: orange;
}
a.dt-button.green {
color: green;
}</code>
</div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../../../media/css/jquery.dataTables.css">../../../../media/css/jquery.dataTables.css</a>
</li>
<li>
<a href="../../css/buttons.dataTables.css">../../css/buttons.dataTables.css</a>
</li>
</ul>
</div>
<div class="ajax">
<p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
loaded.</p>
</div>
<div class="php">
<p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
documentation</a>.</p>
</div>
</div>
</section>
</div>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="./index.html">Basic initialisation</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Basic initialisation</a>
</li>
<li>
<a href="./export.html">File export</a>
</li>
<li>
<a href="./custom.html">Custom button</a>
</li>
<li class="active">
<a href="./className.html">Class names</a>
</li>
<li>
<a href="./keys.html">Keyboard activation</a>
</li>
<li>
<a href="./collections.html">Collections</a>
</li>
<li>
<a href="./collections-sub.html">Multi-level collections</a>
</li>
<li>
<a href="./collections-autoClose.html">Auto close collection</a>
</li>
<li>
<a href="./plugins.html">Plug-ins</a>
</li>
<li>
<a href="./new.html">`new` initialisation</a>
</li>
<li>
<a href="./multiple.html">Multiple button groups</a>
</li>
<li>
<a href="./pageLength.html">Page length</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../html5/index.html">HTML 5 data export</a></h3>
<ul class="toc">
<li>
<a href="../html5/simple.html">HTML5 export buttons</a>
</li>
<li>
<a href="../html5/tsv.html">Tab separated values</a>
</li>
<li>
<a href="../html5/filename.html">File name</a>
</li>
<li>
<a href="../html5/copyi18n.html">Copy button internationalisation</a>
</li>
<li>
<a href="../html5/columns.html">Column selectors</a>
</li>
<li>
<a href="../html5/outputFormat-orthogonal.html">Format output data - orthogonal data</a>
</li>
<li>
<a href="../html5/outputFormat-function.html">Format output data - export options</a>
</li>
<li>
<a href="../html5/excelTextBold.html">Excel - Bold text</a>
</li>
<li>
<a href="../html5/excelCellShading.html">Excel - Cell background</a>
</li>
<li>
<a href="../html5/excelBorder.html">Excel - Customise borders</a>
</li>
<li>
<a href="../html5/pdfMessage.html">PDF - message</a>
</li>
<li>
<a href="../html5/pdfPage.html">PDF - page size and orientation</a>
</li>
<li>
<a href="../html5/pdfImage.html">PDF - image</a>
</li>
<li>
<a href="../html5/pdfOpen.html">PDF - open in new window</a>
</li>
<li>
<a href="../html5/customFile.html">Custom file (JSON)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../flash/index.html">Flash data export</a></h3>
<ul class="toc">
<li>
<a href="../flash/simple.html">Flash export buttons</a>
</li>
<li>
<a href="../flash/tsv.html">Tab separated values</a>
</li>
<li>
<a href="../flash/filename.html">File name</a>
</li>
<li>
<a href="../flash/copyi18n.html">Copy button internationalisation</a>
</li>
<li>
<a href="../flash/pdfMessage.html">PDF message</a>
</li>
<li>
<a href="../flash/pdfPage.html">Page size and orientation</a>
</li>
<li>
<a href="../flash/hidden.html">Hidden initialisation</a>
</li>
<li>
<a href="../flash/swfPath.html">SWF file location</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../column_visibility/index.html">Column visibility</a></h3>
<ul class="toc">
<li>
<a href="../column_visibility/simple.html">Basic column visibility</a>
</li>
<li>
<a href="../column_visibility/layout.html">Multi-column layout</a>
</li>
<li>
<a href="../column_visibility/text.html">Internationalisation</a>
</li>
<li>
<a href="../column_visibility/restore.html">Restore column visibility</a>
</li>
<li>
<a href="../column_visibility/columns.html">Select columns</a>
</li>
<li>
<a href="../column_visibility/columnsToggle.html">Visibility toggle buttons</a>
</li>
<li>
<a href="../column_visibility/columnGroups.html">Column groups</a>
</li>
<li>
<a href="../column_visibility/stateSave.html">State saving</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../print/index.html">Print</a></h3>
<ul class="toc">
<li>
<a href="../print/simple.html">Print button</a>
</li>
<li>
<a href="../print/message.html">Custom message</a>
</li>
<li>
<a href="../print/columns.html">Export options - column selector</a>
</li>
<li>
<a href="../print/select.html">Export options - row selector</a>
</li>
<li>
<a href="../print/autoPrint.html">Disable auto print</a>
</li>
<li>
<a href="../print/customisation.html">Customisation of the print view window</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/enable.html">Enable / disable</a>
</li>
<li>
<a href="../api/text.html">Dynamic text</a>
</li>
<li>
<a href="../api/addRemove.html">Adding and removing buttons dynamically</a>
</li>
<li>
<a href="../api/group.html">Group selection</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation styling</a>
</li>
<li>
<a href="../styling/jqueryui.html">jQuery UI styling</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI styling</a>
</li>
<li>
<a href="../styling/icons.html">Icons</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
=======
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
<title>Buttons example - Class names</title>
<link rel="stylesheet" type="text/css" href="../../../../media/css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css" href="../../css/buttons.dataTables.css">
<link rel="stylesheet" type="text/css" href="../../../../examples/resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../../../../examples/resources/demo.css">
<style type="text/css" class="init">
a.dt-button.red {
color: red;
}
a.dt-button.orange {
color: orange;
}
a.dt-button.green {
color: green;
}
</style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.min.js">
</script>
<script type="text/javascript" language="javascript" src="../../../../media/js/jquery.dataTables.js">
</script>
<script type="text/javascript" language="javascript" src="../../js/dataTables.buttons.js">
</script>
<script type="text/javascript" language="javascript" src="../../../../examples/resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="../../../../examples/resources/demo.js">
</script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() {
$('#example').DataTable( {
dom: 'Bfrtip',
buttons: [
{
text: 'Red',
className: 'red'
},
{
text: 'Orange',
className: 'orange'
},
{
text: 'Green',
className: 'green'
}
]
} );
} );
</script>
</head>
<body class="dt-example">
<div class="container">
<section>
<h1>Buttons example <span>Class names</span></h1>
<div class="info">
<p>This example <a href="custom.html">also shows button definition objects</a> being used to describe buttons. In this case we use the <a href=
"//datatables.net/reference/option/buttons.buttons.className"><code class="option" title="Buttons initialisation option">buttons.buttons.className</code></a>
option to specify a custom class name for the button. A little bit of CSS is used to style the buttons - the class names and CSS can of course be adjusted to suit
whatever styling requirements you have.</p>
</div>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
</tr>
<tr>
<td>Brielle Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
</tr>
<tr>
<td>Herrod Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
</tr>
<tr>
<td>Rhona Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
</tr>
<tr>
<td>Colleen Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
</tr>
<tr>
<td>Sonya Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
</tr>
<tr>
<td>Jena Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
</tr>
<tr>
<td>Quinn Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
</tr>
<tr>
<td>Charde Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
</tr>
<tr>
<td>Haley Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
</tr>
<tr>
<td>Tatyana Fitzpatrick</td>
<td>Regional Director</td>
<td>London</td>
<td>19</td>
<td>2010/03/17</td>
<td>$385,750</td>
</tr>
<tr>
<td>Michael Silva</td>
<td>Marketing Designer</td>
<td>London</td>
<td>66</td>
<td>2012/11/27</td>
<td>$198,500</td>
</tr>
<tr>
<td>Paul Byrd</td>
<td>Chief Financial Officer (CFO)</td>
<td>New York</td>
<td>64</td>
<td>2010/06/09</td>
<td>$725,000</td>
</tr>
<tr>
<td>Gloria Little</td>
<td>Systems Administrator</td>
<td>New York</td>
<td>59</td>
<td>2009/04/10</td>
<td>$237,500</td>
</tr>
<tr>
<td>Bradley Greer</td>
<td>Software Engineer</td>
<td>London</td>
<td>41</td>
<td>2012/10/13</td>
<td>$132,000</td>
</tr>
<tr>
<td>Dai Rios</td>
<td>Personnel Lead</td>
<td>Edinburgh</td>
<td>35</td>
<td>2012/09/26</td>
<td>$217,500</td>
</tr>
<tr>
<td>Jenette Caldwell</td>
<td>Development Lead</td>
<td>New York</td>
<td>30</td>
<td>2011/09/03</td>
<td>$345,000</td>
</tr>
<tr>
<td>Yuri Berry</td>
<td>Chief Marketing Officer (CMO)</td>
<td>New York</td>
<td>40</td>
<td>2009/06/25</td>
<td>$675,000</td>
</tr>
<tr>
<td>Caesar Vance</td>
<td>Pre-Sales Support</td>
<td>New York</td>
<td>21</td>
<td>2011/12/12</td>
<td>$106,450</td>
</tr>
<tr>
<td>Doris Wilder</td>
<td>Sales Assistant</td>
<td>Sidney</td>
<td>23</td>
<td>2010/09/20</td>
<td>$85,600</td>
</tr>
<tr>
<td>Angelica Ramos</td>
<td>Chief Executive Officer (CEO)</td>
<td>London</td>
<td>47</td>
<td>2009/10/09</td>
<td>$1,200,000</td>
</tr>
<tr>
<td>Gavin Joyce</td>
<td>Developer</td>
<td>Edinburgh</td>
<td>42</td>
<td>2010/12/22</td>
<td>$92,575</td>
</tr>
<tr>
<td>Jennifer Chang</td>
<td>Regional Director</td>
<td>Singapore</td>
<td>28</td>
<td>2010/11/14</td>
<td>$357,650</td>
</tr>
<tr>
<td>Brenden Wagner</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>28</td>
<td>2011/06/07</td>
<td>$206,850</td>
</tr>
<tr>
<td>Fiona Green</td>
<td>Chief Operating Officer (COO)</td>
<td>San Francisco</td>
<td>48</td>
<td>2010/03/11</td>
<td>$850,000</td>
</tr>
<tr>
<td>Shou Itou</td>
<td>Regional Marketing</td>
<td>Tokyo</td>
<td>20</td>
<td>2011/08/14</td>
<td>$163,000</td>
</tr>
<tr>
<td>Michelle House</td>
<td>Integration Specialist</td>
<td>Sidney</td>
<td>37</td>
<td>2011/06/02</td>
<td>$95,400</td>
</tr>
<tr>
<td>Suki Burks</td>
<td>Developer</td>
<td>London</td>
<td>53</td>
<td>2009/10/22</td>
<td>$114,500</td>
</tr>
<tr>
<td>Prescott Bartlett</td>
<td>Technical Author</td>
<td>London</td>
<td>27</td>
<td>2011/05/07</td>
<td>$145,000</td>
</tr>
<tr>
<td>Gavin Cortez</td>
<td>Team Leader</td>
<td>San Francisco</td>
<td>22</td>
<td>2008/10/26</td>
<td>$235,500</td>
</tr>
<tr>
<td>Martena Mccray</td>
<td>Post-Sales support</td>
<td>Edinburgh</td>
<td>46</td>
<td>2011/03/09</td>
<td>$324,050</td>
</tr>
<tr>
<td>Unity Butler</td>
<td>Marketing Designer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/12/09</td>
<td>$85,675</td>
</tr>
<tr>
<td>Howard Hatfield</td>
<td>Office Manager</td>
<td>San Francisco</td>
<td>51</td>
<td>2008/12/16</td>
<td>$164,500</td>
</tr>
<tr>
<td>Hope Fuentes</td>
<td>Secretary</td>
<td>San Francisco</td>
<td>41</td>
<td>2010/02/12</td>
<td>$109,850</td>
</tr>
<tr>
<td>Vivian Harrell</td>
<td>Financial Controller</td>
<td>San Francisco</td>
<td>62</td>
<td>2009/02/14</td>
<td>$452,500</td>
</tr>
<tr>
<td>Timothy Mooney</td>
<td>Office Manager</td>
<td>London</td>
<td>37</td>
<td>2008/12/11</td>
<td>$136,200</td>
</tr>
<tr>
<td>Jackson Bradshaw</td>
<td>Director</td>
<td>New York</td>
<td>65</td>
<td>2008/09/26</td>
<td>$645,750</td>
</tr>
<tr>
<td>Olivia Liang</td>
<td>Support Engineer</td>
<td>Singapore</td>
<td>64</td>
<td>2011/02/03</td>
<td>$234,500</td>
</tr>
<tr>
<td>Bruno Nash</td>
<td>Software Engineer</td>
<td>London</td>
<td>38</td>
<td>2011/05/03</td>
<td>$163,500</td>
</tr>
<tr>
<td>Sakura Yamamoto</td>
<td>Support Engineer</td>
<td>Tokyo</td>
<td>37</td>
<td>2009/08/19</td>
<td>$139,575</td>
</tr>
<tr>
<td>Thor Walton</td>
<td>Developer</td>
<td>New York</td>
<td>61</td>
<td>2013/08/11</td>
<td>$98,540</td>
</tr>
<tr>
<td>Finn Camacho</td>
<td>Support Engineer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/07/07</td>
<td>$87,500</td>
</tr>
<tr>
<td>Serge Baldwin</td>
<td>Data Coordinator</td>
<td>Singapore</td>
<td>64</td>
<td>2012/04/09</td>
<td>$138,575</td>
</tr>
<tr>
<td>Zenaida Frank</td>
<td>Software Engineer</td>
<td>New York</td>
<td>63</td>
<td>2010/01/04</td>
<td>$125,250</td>
</tr>
<tr>
<td>Zorita Serrano</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>56</td>
<td>2012/06/01</td>
<td>$115,000</td>
</tr>
<tr>
<td>Jennifer Acosta</td>
<td>Junior Javascript Developer</td>
<td>Edinburgh</td>
<td>43</td>
<td>2013/02/01</td>
<td>$75,650</td>
</tr>
<tr>
<td>Cara Stevens</td>
<td>Sales Assistant</td>
<td>New York</td>
<td>46</td>
<td>2011/12/06</td>
<td>$145,600</td>
</tr>
<tr>
<td>Hermione Butler</td>
<td>Regional Director</td>
<td>London</td>
<td>47</td>
<td>2011/03/21</td>
<td>$356,250</td>
</tr>
<tr>
<td>Lael Greer</td>
<td>Systems Administrator</td>
<td>London</td>
<td>21</td>
<td>2009/02/27</td>
<td>$103,500</td>
</tr>
<tr>
<td>Jonas Alexander</td>
<td>Developer</td>
<td>San Francisco</td>
<td>30</td>
<td>2010/07/14</td>
<td>$86,500</td>
</tr>
<tr>
<td>Shad Decker</td>
<td>Regional Director</td>
<td>Edinburgh</td>
<td>51</td>
<td>2008/11/13</td>
<td>$183,000</td>
</tr>
<tr>
<td>Michael Bruce</td>
<td>Javascript Developer</td>
<td>Singapore</td>
<td>29</td>
<td>2011/06/27</td>
<td>$183,000</td>
</tr>
<tr>
<td>Donna Snider</td>
<td>Customer Support</td>
<td>New York</td>
<td>27</td>
<td>2011/01/25</td>
<td>$112,000</td>
</tr>
</tbody>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
$('#example').DataTable( {
dom: 'Bfrtip',
buttons: [
{
text: 'Red',
className: 'red'
},
{
text: 'Orange',
className: 'orange'
},
{
text: 'Green',
className: 'green'
}
]
} );
} );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul>
<li>
<a href="//code.jquery.com/jquery-1.12.3.min.js">//code.jquery.com/jquery-1.12.3.min.js</a>
</li>
<li>
<a href="../../../../media/js/jquery.dataTables.js">../../../../media/js/jquery.dataTables.js</a>
</li>
<li>
<a href="../../js/dataTables.buttons.js">../../js/dataTables.buttons.js</a>
</li>
</ul>
</div>
<div class="table">
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
</div>
<div class="css">
<div>
<p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
additional CSS used is shown below:</p><code class="multiline language-css">a.dt-button.red {
color: red;
}
a.dt-button.orange {
color: orange;
}
a.dt-button.green {
color: green;
}</code>
</div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="../../../../media/css/jquery.dataTables.css">../../../../media/css/jquery.dataTables.css</a>
</li>
<li>
<a href="../../css/buttons.dataTables.css">../../css/buttons.dataTables.css</a>
</li>
</ul>
</div>
<div class="ajax">
<p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
loaded.</p>
</div>
<div class="php">
<p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
documentation</a>.</p>
</div>
</div>
</section>
</div>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="./index.html">Basic initialisation</a></h3>
<ul class="toc active">
<li>
<a href="./simple.html">Basic initialisation</a>
</li>
<li>
<a href="./export.html">File export</a>
</li>
<li>
<a href="./custom.html">Custom button</a>
</li>
<li class="active">
<a href="./className.html">Class names</a>
</li>
<li>
<a href="./keys.html">Keyboard activation</a>
</li>
<li>
<a href="./collections.html">Collections</a>
</li>
<li>
<a href="./collections-sub.html">Multi-level collections</a>
</li>
<li>
<a href="./collections-autoClose.html">Auto close collection</a>
</li>
<li>
<a href="./plugins.html">Plug-ins</a>
</li>
<li>
<a href="./new.html">`new` initialisation</a>
</li>
<li>
<a href="./multiple.html">Multiple button groups</a>
</li>
<li>
<a href="./pageLength.html">Page length</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../html5/index.html">HTML 5 data export</a></h3>
<ul class="toc">
<li>
<a href="../html5/simple.html">HTML5 export buttons</a>
</li>
<li>
<a href="../html5/tsv.html">Tab separated values</a>
</li>
<li>
<a href="../html5/filename.html">File name</a>
</li>
<li>
<a href="../html5/copyi18n.html">Copy button internationalisation</a>
</li>
<li>
<a href="../html5/columns.html">Column selectors</a>
</li>
<li>
<a href="../html5/outputFormat-orthogonal.html">Format output data - orthogonal data</a>
</li>
<li>
<a href="../html5/outputFormat-function.html">Format output data - export options</a>
</li>
<li>
<a href="../html5/excelTextBold.html">Excel - Bold text</a>
</li>
<li>
<a href="../html5/excelCellShading.html">Excel - Cell background</a>
</li>
<li>
<a href="../html5/excelBorder.html">Excel - Customise borders</a>
</li>
<li>
<a href="../html5/pdfMessage.html">PDF - message</a>
</li>
<li>
<a href="../html5/pdfPage.html">PDF - page size and orientation</a>
</li>
<li>
<a href="../html5/pdfImage.html">PDF - image</a>
</li>
<li>
<a href="../html5/pdfOpen.html">PDF - open in new window</a>
</li>
<li>
<a href="../html5/customFile.html">Custom file (JSON)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../flash/index.html">Flash data export</a></h3>
<ul class="toc">
<li>
<a href="../flash/simple.html">Flash export buttons</a>
</li>
<li>
<a href="../flash/tsv.html">Tab separated values</a>
</li>
<li>
<a href="../flash/filename.html">File name</a>
</li>
<li>
<a href="../flash/copyi18n.html">Copy button internationalisation</a>
</li>
<li>
<a href="../flash/pdfMessage.html">PDF message</a>
</li>
<li>
<a href="../flash/pdfPage.html">Page size and orientation</a>
</li>
<li>
<a href="../flash/hidden.html">Hidden initialisation</a>
</li>
<li>
<a href="../flash/swfPath.html">SWF file location</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../column_visibility/index.html">Column visibility</a></h3>
<ul class="toc">
<li>
<a href="../column_visibility/simple.html">Basic column visibility</a>
</li>
<li>
<a href="../column_visibility/layout.html">Multi-column layout</a>
</li>
<li>
<a href="../column_visibility/text.html">Internationalisation</a>
</li>
<li>
<a href="../column_visibility/restore.html">Restore column visibility</a>
</li>
<li>
<a href="../column_visibility/columns.html">Select columns</a>
</li>
<li>
<a href="../column_visibility/columnsToggle.html">Visibility toggle buttons</a>
</li>
<li>
<a href="../column_visibility/columnGroups.html">Column groups</a>
</li>
<li>
<a href="../column_visibility/stateSave.html">State saving</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../print/index.html">Print</a></h3>
<ul class="toc">
<li>
<a href="../print/simple.html">Print button</a>
</li>
<li>
<a href="../print/message.html">Custom message</a>
</li>
<li>
<a href="../print/columns.html">Export options - column selector</a>
</li>
<li>
<a href="../print/select.html">Export options - row selector</a>
</li>
<li>
<a href="../print/autoPrint.html">Disable auto print</a>
</li>
<li>
<a href="../print/customisation.html">Customisation of the print view window</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/enable.html">Enable / disable</a>
</li>
<li>
<a href="../api/text.html">Dynamic text</a>
</li>
<li>
<a href="../api/addRemove.html">Adding and removing buttons dynamically</a>
</li>
<li>
<a href="../api/group.html">Group selection</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation styling</a>
</li>
<li>
<a href="../styling/jqueryui.html">jQuery UI styling</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI styling</a>
</li>
<li>
<a href="../styling/icons.html">Icons</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
>>>>>>> origin/master
</html> | mit |
36web/blog | _includes/adsense.html | 369 | <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Blog Ads -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-{{site.cfg.adsense_publisher_id}}"
data-ad-slot="{{site.cfg.adsense_unit_no}}"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
| mit |
Andrewcjp/GraphicsEngine | GraphicsEngine/Source/D3D12RHI/RHI/RenderAPIs/D3D12/GPUResource.cpp | 4208 | #include "stdafx.h"
#include "GPUResource.h"
#include <algorithm>
#include "D3D12DeviceContext.h"
CreateChecker(GPUResource);
GPUResource::GPUResource()
{}
GPUResource::GPUResource(ID3D12Resource* Target, D3D12_RESOURCE_STATES InitalState) :GPUResource(Target, InitalState, (D3D12DeviceContext*)RHI::GetDefaultDevice())
{}
GPUResource::GPUResource(ID3D12Resource * Target, D3D12_RESOURCE_STATES InitalState, DeviceContext * device)
{
AddCheckerRef(GPUResource, this);
resource = Target;
NAME_D3D12_OBJECT(Target);
CurrentResourceState = InitalState;
Device = (D3D12DeviceContext*)device;
}
GPUResource::~GPUResource()
{
if (!IsReleased)
{
Release();
}
}
void GPUResource::SetName(LPCWSTR name)
{
resource->SetName(name);
}
void GPUResource::CreateHeap()
{
Block.Heaps.push_back(nullptr);
ID3D12Heap* pHeap = Block.Heaps[0];
int RemainingSize = 1 * TILE_SIZE;
D3D12_HEAP_DESC heapDesc = {};
heapDesc.SizeInBytes = std::min(RemainingSize, MAX_HEAP_SIZE);
heapDesc.Alignment = 0;
heapDesc.Properties.Type = D3D12_HEAP_TYPE_DEFAULT;
heapDesc.Properties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
heapDesc.Properties.MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN;
//
// Tier 1 heaps have restrictions on the type of information that can be stored in
// a heap. To accommodate this, we will retsrict the content to only shader resources.
// The heap cannot store textures that are used as render targets, depth-stencil
// output, or buffers. But this is okay, since we do not use these heaps for those
// purposes.
//
heapDesc.Flags = D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES | D3D12_HEAP_FLAG_DENY_BUFFERS;
//ThrowIfFailed( D3D12RHI::GetDevice()->CreateHeap(&heapDesc, IID_PPV_ARGS(&pHeap)));
}
void GPUResource::Evict()
{
ensure(currentState != eResourceState::Evicted);
ID3D12Pageable* Pageableresource = resource;
ThrowIfFailed(Device->GetDevice()->Evict(1, &Pageableresource));
currentState = eResourceState::Evicted;
}
void GPUResource::MakeResident()
{
ensure(currentState != eResourceState::Resident);
ID3D12Pageable* Pageableresource = resource;
ThrowIfFailed(Device->GetDevice()->MakeResident(1, &Pageableresource));
currentState = eResourceState::Resident;
}
bool GPUResource::IsResident()
{
return (currentState == eResourceState::Resident);
}
GPUResource::eResourceState GPUResource::GetState()
{
return currentState;
}
void GPUResource::SetResourceState(ID3D12GraphicsCommandList* List, D3D12_RESOURCE_STATES newstate)
{
if (newstate != CurrentResourceState)
{
List->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(resource, CurrentResourceState, newstate));
CurrentResourceState = newstate;
TargetState = newstate;
}
}
//todo More Detailed Error checking!
void GPUResource::StartResourceTransition(ID3D12GraphicsCommandList * List, D3D12_RESOURCE_STATES newstate)
{
if (newstate != CurrentResourceState)
{
D3D12_RESOURCE_BARRIER BarrierDesc = {};
BarrierDesc.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
BarrierDesc.Flags = D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY;
BarrierDesc.Transition.StateBefore = CurrentResourceState;
BarrierDesc.Transition.StateAfter = newstate;
BarrierDesc.Transition.pResource = resource;
List->ResourceBarrier(1, &BarrierDesc);
TargetState = newstate;
}
}
void GPUResource::EndResourceTransition(ID3D12GraphicsCommandList * List, D3D12_RESOURCE_STATES newstate)
{
if (newstate != CurrentResourceState)
{
D3D12_RESOURCE_BARRIER BarrierDesc = {};
BarrierDesc.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
BarrierDesc.Flags = D3D12_RESOURCE_BARRIER_FLAG_END_ONLY;
BarrierDesc.Transition.StateBefore = CurrentResourceState;
BarrierDesc.Transition.StateAfter = newstate;
BarrierDesc.Transition.pResource = resource;
List->ResourceBarrier(1, &BarrierDesc);
CurrentResourceState = newstate;
}
}
bool GPUResource::IsTransitioning()
{
return (CurrentResourceState != TargetState);
}
D3D12_RESOURCE_STATES GPUResource::GetCurrentState()
{
return CurrentResourceState;
}
ID3D12Resource * GPUResource::GetResource()
{
return resource;
}
void GPUResource::Release()
{
IRHIResourse::Release();
SafeRelease(resource);
RemoveCheckerRef(GPUResource, this);
}
| mit |
braintree/braintree_android | Card/src/main/java/com/braintreepayments/api/Card.java | 7536 | package com.braintreepayments.api;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.braintreepayments.api.GraphQLConstants.Keys;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Use to construct a card tokenization request.
*/
public class Card extends BaseCard implements Parcelable {
private static final String GRAPHQL_CLIENT_SDK_METADATA_KEY = "clientSdkMetadata";
private static final String MERCHANT_ACCOUNT_ID_KEY = "merchantAccountId";
private static final String AUTHENTICATION_INSIGHT_REQUESTED_KEY = "authenticationInsight";
private static final String AUTHENTICATION_INSIGHT_INPUT_KEY = "authenticationInsightInput";
private String merchantAccountId;
private boolean authenticationInsightRequested;
private boolean shouldValidate;
JSONObject buildJSONForGraphQL() throws BraintreeException, JSONException {
JSONObject base = new JSONObject();
JSONObject input = new JSONObject();
JSONObject variables = new JSONObject();
base.put(GRAPHQL_CLIENT_SDK_METADATA_KEY, buildMetadataJSON());
JSONObject optionsJson = new JSONObject();
optionsJson.put(VALIDATE_KEY, shouldValidate);
input.put(OPTIONS_KEY, optionsJson);
variables.put(Keys.INPUT, input);
if (TextUtils.isEmpty(merchantAccountId) && authenticationInsightRequested) {
throw new BraintreeException("A merchant account ID is required when authenticationInsightRequested is true.");
}
if (authenticationInsightRequested) {
variables.put(AUTHENTICATION_INSIGHT_INPUT_KEY, new JSONObject().put(MERCHANT_ACCOUNT_ID_KEY, merchantAccountId));
}
base.put(Keys.QUERY, getCardTokenizationGraphQLMutation());
base.put(OPERATION_NAME_KEY, "TokenizeCreditCard");
JSONObject creditCard = new JSONObject()
.put(NUMBER_KEY, getNumber())
.put(EXPIRATION_MONTH_KEY, getExpirationMonth())
.put(EXPIRATION_YEAR_KEY, getExpirationYear())
.put(CVV_KEY, getCvv())
.put(CARDHOLDER_NAME_KEY, getCardholderName());
JSONObject billingAddress = new JSONObject()
.put(FIRST_NAME_KEY, getFirstName())
.put(LAST_NAME_KEY, getLastName())
.put(COMPANY_KEY, getCompany())
.put(COUNTRY_CODE_KEY, getCountryCode())
.put(LOCALITY_KEY, getLocality())
.put(POSTAL_CODE_KEY, getPostalCode())
.put(REGION_KEY, getRegion())
.put(STREET_ADDRESS_KEY, getStreetAddress())
.put(EXTENDED_ADDRESS_KEY, getExtendedAddress());
if (billingAddress.length() > 0) {
creditCard.put(BILLING_ADDRESS_KEY, billingAddress);
}
input.put(CREDIT_CARD_KEY, creditCard);
base.put(Keys.VARIABLES, variables);
return base;
}
public Card() {
}
/**
* @param id The merchant account id used to generate the authentication insight.
*/
public void setMerchantAccountId(@Nullable String id) {
merchantAccountId = TextUtils.isEmpty(id) ? null : id;
}
/**
* @param shouldValidate Flag to denote if the associated {@link Card} will be validated. Defaults to false.
* <p>
* Use this flag with caution. Enabling validation may result in adding a card to the Braintree vault.
* The circumstances that determine if a Card will be vaulted are not documented.
*/
public void setShouldValidate(boolean shouldValidate) {
this.shouldValidate = shouldValidate;
}
/**
* @param requested If authentication insight will be requested.
*/
public void setAuthenticationInsightRequested(boolean requested) {
authenticationInsightRequested = requested;
}
/**
* @return The merchant account id used to generate the authentication insight.
*/
@Nullable
public String getMerchantAccountId() {
return merchantAccountId;
}
/**
* @return If authentication insight will be requested.
*/
public boolean isAuthenticationInsightRequested() {
return authenticationInsightRequested;
}
/**
* @return If the associated card will be validated.
*/
public boolean getShouldValidate() {
return shouldValidate;
}
@Override
JSONObject buildJSON() throws JSONException {
JSONObject json = super.buildJSON();
JSONObject paymentMethodNonceJson = json.getJSONObject(CREDIT_CARD_KEY);
JSONObject optionsJson = new JSONObject();
optionsJson.put(VALIDATE_KEY, shouldValidate);
paymentMethodNonceJson.put(OPTIONS_KEY, optionsJson);
if (authenticationInsightRequested) {
json.put(MERCHANT_ACCOUNT_ID_KEY, merchantAccountId);
json.put(AUTHENTICATION_INSIGHT_REQUESTED_KEY, authenticationInsightRequested);
}
return json;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeString(merchantAccountId);
dest.writeByte(shouldValidate ? (byte) 1 : 0);
dest.writeByte(authenticationInsightRequested ? (byte) 1 : 0);
}
protected Card(Parcel in) {
super(in);
merchantAccountId = in.readString();
shouldValidate = in.readByte() > 0;
authenticationInsightRequested = in.readByte() > 0;
}
public static final Creator<Card> CREATOR = new Creator<Card>() {
@Override
public Card createFromParcel(Parcel in) {
return new Card(in);
}
@Override
public Card[] newArray(int size) {
return new Card[size];
}
};
private String getCardTokenizationGraphQLMutation() {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("mutation TokenizeCreditCard($input: TokenizeCreditCardInput!");
if (authenticationInsightRequested) {
stringBuilder.append(", $authenticationInsightInput: AuthenticationInsightInput!");
}
stringBuilder.append(") {" +
" tokenizeCreditCard(input: $input) {" +
" token" +
" creditCard {" +
" bin" +
" brand" +
" expirationMonth" +
" expirationYear" +
" cardholderName" +
" last4" +
" binData {" +
" prepaid" +
" healthcare" +
" debit" +
" durbinRegulated" +
" commercial" +
" payroll" +
" issuingBank" +
" countryOfIssuance" +
" productId" +
" }" +
" }");
if (authenticationInsightRequested) {
stringBuilder.append("" +
" authenticationInsight(input: $authenticationInsightInput) {" +
" customerAuthenticationRegulationEnvironment" +
" }");
}
stringBuilder.append("" +
" }" +
"}");
return stringBuilder.toString();
}
} | mit |
taowenyin/RLXAPF | app/src/main/java/cn/edu/siso/rlxapf/DeviceActivity.java | 995 | package cn.edu.siso.rlxapf;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class DeviceActivity extends AppCompatActivity {
private Button devicePrefOk = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_device);
devicePrefOk = (Button) findViewById(R.id.device_pref_ok);
devicePrefOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(DeviceActivity.this, MainActivity.class);
startActivity(intent);
DeviceActivity.this.finish();
}
});
getSupportFragmentManager().beginTransaction().replace(
R.id.device_pref, new DevicePrefFragment()).commit();
}
}
| mit |
abhisheksoni27/blanketcoffee | client/css/abhishek.css | 262 | .bluisha {
box-shadow: 0px 0px 17px #000;
padding: 0 !important;
background: url('https://lh3.googleusercontent.com/37WRn5tePAwnohEIp5zhcwWpl7eNfzZLsekTrZMr-PE=w1334-h667-no') no-repeat center center;
height: 100vh;
background-size: cover;
}
| mit |
spookandpuff/spooky-core | .bundle/gems/vcr-2.0.0/spec/vcr/test_frameworks/rspec_spec.rb | 2807 | require 'spec_helper'
RSpec.configure do |config|
config.before(:suite) do
VCR.configuration.configure_rspec_metadata!
end
end
describe VCR::RSpec::Metadata, :skip_vcr_reset do
before(:all) { VCR.reset! }
after(:each) { VCR.reset! }
context 'an example group', :vcr do
context 'with a nested example group' do
it 'uses a cassette for any examples' do
VCR.current_cassette.name.split('/').should eq([
'VCR::RSpec::Metadata',
'an example group',
'with a nested example group',
'uses a cassette for any examples'
])
end
end
end
context 'with the cassette name overridden at the example group level', :vcr => { :cassette_name => 'foo' } do
it 'overrides the cassette name for an example' do
VCR.current_cassette.name.should eq('foo')
end
it 'overrides the cassette name for another example' do
VCR.current_cassette.name.should eq('foo')
end
end
it 'allows the cassette name to be overriden', :vcr => { :cassette_name => 'foo' } do
VCR.current_cassette.name.should eq('foo')
end
it 'allows the cassette options to be set', :vcr => { :match_requests_on => [:method] } do
VCR.current_cassette.match_requests_on.should eq([:method])
end
end
describe VCR::RSpec::Macros do
extend described_class
describe '#use_vcr_cassette' do
def self.perform_test(context_name, expected_cassette_name, *args, &block)
context context_name do
after(:each) do
if example.metadata[:test_ejection]
VCR.current_cassette.should be_nil
end
end
use_vcr_cassette(*args)
it 'ejects the cassette in an after hook', :test_ejection do
VCR.current_cassette.should be_a(VCR::Cassette)
end
it "creates a cassette named '#{expected_cassette_name}" do
VCR.current_cassette.name.should eq(expected_cassette_name)
end
module_eval(&block) if block
end
end
perform_test 'when called with an explicit name', 'explicit_name', 'explicit_name'
perform_test 'when called with an explicit name and some options', 'explicit_name', 'explicit_name', :match_requests_on => [:method, :host] do
it 'uses the provided cassette options' do
VCR.current_cassette.match_requests_on.should eq([:method, :host])
end
end
perform_test 'when called with nothing', 'VCR::RSpec::Macros/#use_vcr_cassette/when called with nothing'
perform_test 'when called with some options', 'VCR::RSpec::Macros/#use_vcr_cassette/when called with some options', :match_requests_on => [:method, :host] do
it 'uses the provided cassette options' do
VCR.current_cassette.match_requests_on.should eq([:method, :host])
end
end
end
end
| mit |
psd401/psd-computer-management | app/styles/bootstrap.css | 97558 | /*!
* Bootstrap v2.0.3
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
display: block;
}
audio,
canvas,
video {
display: inline-block;
*display: inline;
*zoom: 1;
}
audio:not([controls]) {
display: none;
}
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
a:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
a:hover,
a:active {
outline: 0;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
max-width: 100%;
vertical-align: middle;
border: 0;
-ms-interpolation-mode: bicubic;
}
button,
input,
select,
textarea {
margin: 0;
font-size: 100%;
vertical-align: middle;
}
button,
input {
*overflow: visible;
line-height: normal;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
padding: 0;
border: 0;
}
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
cursor: pointer;
-webkit-appearance: button;
}
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-decoration,
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none;
}
textarea {
overflow: auto;
vertical-align: top;
}
.clearfix {
*zoom: 1;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both;
}
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.input-block-level {
display: block;
width: 100%;
min-height: 28px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
body {
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
line-height: 18px;
color: #333333;
background-color: #ffffff;
}
a {
color: #0088cc;
text-decoration: none;
}
a:hover {
color: #005580;
text-decoration: underline;
}
.row {
margin-left: -20px;
*zoom: 1;
}
.row:before,
.row:after {
display: table;
content: "";
}
.row:after {
clear: both;
}
[class*="span"] {
float: left;
margin-left: 20px;
}
.container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 940px;
}
.span12 {
width: 940px;
}
.span11 {
width: 860px;
}
.span10 {
width: 780px;
}
.span9 {
width: 700px;
}
.span8 {
width: 620px;
}
.span7 {
width: 540px;
}
.span6 {
width: 460px;
}
.span5 {
width: 380px;
}
.span4 {
width: 300px;
}
.span3 {
width: 220px;
}
.span2 {
width: 140px;
}
.span1 {
width: 60px;
}
.offset12 {
margin-left: 980px;
}
.offset11 {
margin-left: 900px;
}
.offset10 {
margin-left: 820px;
}
.offset9 {
margin-left: 740px;
}
.offset8 {
margin-left: 660px;
}
.offset7 {
margin-left: 580px;
}
.offset6 {
margin-left: 500px;
}
.offset5 {
margin-left: 420px;
}
.offset4 {
margin-left: 340px;
}
.offset3 {
margin-left: 260px;
}
.offset2 {
margin-left: 180px;
}
.offset1 {
margin-left: 100px;
}
.row-fluid {
width: 100%;
*zoom: 1;
}
.row-fluid:before,
.row-fluid:after {
display: table;
content: "";
}
.row-fluid:after {
clear: both;
}
.row-fluid [class*="span"] {
display: block;
width: 100%;
min-height: 28px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
float: left;
margin-left: 2.127659574%;
*margin-left: 2.0744680846382977%;
}
.row-fluid [class*="span"]:first-child {
margin-left: 0;
}
.row-fluid .span12 {
width: 99.99999998999999%;
*width: 99.94680850063828%;
}
.row-fluid .span11 {
width: 91.489361693%;
*width: 91.4361702036383%;
}
.row-fluid .span10 {
width: 82.97872339599999%;
*width: 82.92553190663828%;
}
.row-fluid .span9 {
width: 74.468085099%;
*width: 74.4148936096383%;
}
.row-fluid .span8 {
width: 65.95744680199999%;
*width: 65.90425531263828%;
}
.row-fluid .span7 {
width: 57.446808505%;
*width: 57.3936170156383%;
}
.row-fluid .span6 {
width: 48.93617020799999%;
*width: 48.88297871863829%;
}
.row-fluid .span5 {
width: 40.425531911%;
*width: 40.3723404216383%;
}
.row-fluid .span4 {
width: 31.914893614%;
*width: 31.8617021246383%;
}
.row-fluid .span3 {
width: 23.404255317%;
*width: 23.3510638276383%;
}
.row-fluid .span2 {
width: 14.89361702%;
*width: 14.8404255306383%;
}
.row-fluid .span1 {
width: 6.382978723%;
*width: 6.329787233638298%;
}
.container {
margin-right: auto;
margin-left: auto;
*zoom: 1;
}
.container:before,
.container:after {
display: table;
content: "";
}
.container:after {
clear: both;
}
.container-fluid {
padding-right: 20px;
padding-left: 20px;
*zoom: 1;
}
.container-fluid:before,
.container-fluid:after {
display: table;
content: "";
}
.container-fluid:after {
clear: both;
}
p {
margin: 0 0 9px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
line-height: 18px;
}
p small {
font-size: 11px;
color: #999999;
}
.lead {
margin-bottom: 18px;
font-size: 20px;
font-weight: 200;
line-height: 27px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
font-family: inherit;
font-weight: bold;
color: inherit;
text-rendering: optimizelegibility;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small {
font-weight: normal;
color: #999999;
}
h1 {
font-size: 30px;
line-height: 36px;
}
h1 small {
font-size: 18px;
}
h2 {
font-size: 24px;
line-height: 36px;
}
h2 small {
font-size: 18px;
}
h3 {
font-size: 18px;
line-height: 27px;
}
h3 small {
font-size: 14px;
}
h4,
h5,
h6 {
line-height: 18px;
}
h4 {
font-size: 14px;
}
h4 small {
font-size: 12px;
}
h5 {
font-size: 12px;
}
h6 {
font-size: 11px;
color: #999999;
text-transform: uppercase;
}
.page-header {
padding-bottom: 17px;
margin: 18px 0;
border-bottom: 1px solid #eeeeee;
}
.page-header h1 {
line-height: 1;
}
ul,
ol {
padding: 0;
margin: 0 0 9px 25px;
}
ul ul,
ul ol,
ol ol,
ol ul {
margin-bottom: 0;
}
ul {
list-style: disc;
}
ol {
list-style: decimal;
}
li {
line-height: 18px;
}
ul.unstyled,
ol.unstyled {
margin-left: 0;
list-style: none;
}
dl {
margin-bottom: 18px;
}
dt,
dd {
line-height: 18px;
}
dt {
font-weight: bold;
line-height: 17px;
}
dd {
margin-left: 9px;
}
.dl-horizontal dt {
float: left;
width: 120px;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dl-horizontal dd {
margin-left: 130px;
}
hr {
margin: 18px 0;
border: 0;
border-top: 1px solid #eeeeee;
border-bottom: 1px solid #ffffff;
}
strong {
font-weight: bold;
}
em {
font-style: italic;
}
.muted {
color: #999999;
}
abbr[title] {
cursor: help;
border-bottom: 1px dotted #ddd;
}
abbr.initialism {
font-size: 90%;
text-transform: uppercase;
}
blockquote {
padding: 0 0 0 15px;
margin: 0 0 18px;
border-left: 5px solid #eeeeee;
}
blockquote p {
margin-bottom: 0;
font-size: 16px;
font-weight: 300;
line-height: 22.5px;
}
blockquote small {
display: block;
line-height: 18px;
color: #999999;
}
blockquote small:before {
content: '\2014 \00A0';
}
blockquote.pull-right {
float: right;
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
}
blockquote.pull-right p,
blockquote.pull-right small {
text-align: right;
}
q:before,
q:after,
blockquote:before,
blockquote:after {
content: "";
}
address {
display: block;
margin-bottom: 18px;
font-style: normal;
line-height: 18px;
}
small {
font-size: 100%;
}
cite {
font-style: normal;
}
code,
pre {
padding: 0 3px 2px;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
code {
padding: 2px 4px;
color: #d14;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
}
pre {
display: block;
padding: 8.5px;
margin: 0 0 9px;
font-size: 12.025px;
line-height: 18px;
word-break: break-all;
word-wrap: break-word;
white-space: pre;
white-space: pre-wrap;
background-color: #f5f5f5;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
pre.prettyprint {
margin-bottom: 18px;
}
pre code {
padding: 0;
color: inherit;
background-color: transparent;
border: 0;
}
.pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
form {
margin: 0 0 18px;
}
fieldset {
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 27px;
font-size: 19.5px;
line-height: 36px;
color: #333333;
border: 0;
border-bottom: 1px solid #eee;
}
legend small {
font-size: 13.5px;
color: #999999;
}
label,
input,
button,
select,
textarea {
font-size: 13px;
font-weight: normal;
line-height: 18px;
}
input,
button,
select,
textarea {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
label {
display: block;
margin-bottom: 5px;
color: #333333;
}
input,
textarea,
select,
.uneditable-input {
display: inline-block;
width: 210px;
height: 18px;
padding: 4px;
margin-bottom: 9px;
font-size: 13px;
line-height: 18px;
color: #555555;
background-color: #ffffff;
border: 1px solid #cccccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.uneditable-textarea {
width: auto;
height: auto;
}
label input,
label textarea,
label select {
display: block;
}
input[type="image"],
input[type="checkbox"],
input[type="radio"] {
width: auto;
height: auto;
padding: 0;
margin: 3px 0;
*margin-top: 0;
/* IE7 */
line-height: normal;
cursor: pointer;
background-color: transparent;
border: 0 \9;
/* IE9 and down */
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
input[type="image"] {
border: 0;
}
input[type="file"] {
width: auto;
padding: initial;
line-height: initial;
background-color: #ffffff;
background-color: initial;
border: initial;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
input[type="button"],
input[type="reset"],
input[type="submit"] {
width: auto;
height: auto;
}
select,
input[type="file"] {
height: 28px;
/* In IE7, the height of the select element cannot be changed by height, only font-size */
*margin-top: 4px;
/* For IE7, add top margin to align select with labels */
line-height: 28px;
}
input[type="file"] {
line-height: 18px \9;
}
select {
width: 220px;
background-color: #ffffff;
}
select[multiple],
select[size] {
height: auto;
}
input[type="image"] {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
textarea {
height: auto;
}
input[type="hidden"] {
display: none;
}
.radio,
.checkbox {
min-height: 18px;
padding-left: 18px;
}
.radio input[type="radio"],
.checkbox input[type="checkbox"] {
float: left;
margin-left: -18px;
}
.controls > .radio:first-child,
.controls > .checkbox:first-child {
padding-top: 5px;
}
.radio.inline,
.checkbox.inline {
display: inline-block;
padding-top: 5px;
margin-bottom: 0;
vertical-align: middle;
}
.radio.inline + .radio.inline,
.checkbox.inline + .checkbox.inline {
margin-left: 10px;
}
input,
textarea {
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-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 linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-ms-transition: border linear 0.2s, box-shadow linear 0.2s;
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
}
input:focus,
textarea:focus {
border-color: rgba(82, 168, 236, 0.8);
outline: 0;
outline: thin dotted \9;
/* IE6-9 */
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
}
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus,
select:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.input-mini {
width: 60px;
}
.input-small {
width: 90px;
}
.input-medium {
width: 150px;
}
.input-large {
width: 210px;
}
.input-xlarge {
width: 270px;
}
.input-xxlarge {
width: 530px;
}
input[class*="span"],
select[class*="span"],
textarea[class*="span"],
.uneditable-input[class*="span"],
.row-fluid input[class*="span"],
.row-fluid select[class*="span"],
.row-fluid textarea[class*="span"],
.row-fluid .uneditable-input[class*="span"] {
float: none;
margin-left: 0;
}
input,
textarea,
.uneditable-input {
margin-left: 0;
}
input.span12, textarea.span12, .uneditable-input.span12 {
width: 930px;
}
input.span11, textarea.span11, .uneditable-input.span11 {
width: 850px;
}
input.span10, textarea.span10, .uneditable-input.span10 {
width: 770px;
}
input.span9, textarea.span9, .uneditable-input.span9 {
width: 690px;
}
input.span8, textarea.span8, .uneditable-input.span8 {
width: 610px;
}
input.span7, textarea.span7, .uneditable-input.span7 {
width: 530px;
}
input.span6, textarea.span6, .uneditable-input.span6 {
width: 450px;
}
input.span5, textarea.span5, .uneditable-input.span5 {
width: 370px;
}
input.span4, textarea.span4, .uneditable-input.span4 {
width: 290px;
}
input.span3, textarea.span3, .uneditable-input.span3 {
width: 210px;
}
input.span2, textarea.span2, .uneditable-input.span2 {
width: 130px;
}
input.span1, textarea.span1, .uneditable-input.span1 {
width: 50px;
}
input[disabled],
select[disabled],
textarea[disabled],
input[readonly],
select[readonly],
textarea[readonly] {
cursor: not-allowed;
background-color: #eeeeee;
border-color: #ddd;
}
input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"][readonly],
input[type="checkbox"][readonly] {
background-color: transparent;
}
.control-group.warning > label,
.control-group.warning .help-block,
.control-group.warning .help-inline {
color: #c09853;
}
.control-group.warning input,
.control-group.warning select,
.control-group.warning textarea {
color: #c09853;
border-color: #c09853;
}
.control-group.warning input:focus,
.control-group.warning select:focus,
.control-group.warning textarea:focus {
border-color: #a47e3c;
-webkit-box-shadow: 0 0 6px #dbc59e;
-moz-box-shadow: 0 0 6px #dbc59e;
box-shadow: 0 0 6px #dbc59e;
}
.control-group.warning .input-prepend .add-on,
.control-group.warning .input-append .add-on {
color: #c09853;
background-color: #fcf8e3;
border-color: #c09853;
}
.control-group.error > label,
.control-group.error .help-block,
.control-group.error .help-inline {
color: #b94a48;
}
.control-group.error input,
.control-group.error select,
.control-group.error textarea {
color: #b94a48;
border-color: #b94a48;
}
.control-group.error input:focus,
.control-group.error select:focus,
.control-group.error textarea:focus {
border-color: #953b39;
-webkit-box-shadow: 0 0 6px #d59392;
-moz-box-shadow: 0 0 6px #d59392;
box-shadow: 0 0 6px #d59392;
}
.control-group.error .input-prepend .add-on,
.control-group.error .input-append .add-on {
color: #b94a48;
background-color: #f2dede;
border-color: #b94a48;
}
.control-group.success > label,
.control-group.success .help-block,
.control-group.success .help-inline {
color: #468847;
}
.control-group.success input,
.control-group.success select,
.control-group.success textarea {
color: #468847;
border-color: #468847;
}
.control-group.success input:focus,
.control-group.success select:focus,
.control-group.success textarea:focus {
border-color: #356635;
-webkit-box-shadow: 0 0 6px #7aba7b;
-moz-box-shadow: 0 0 6px #7aba7b;
box-shadow: 0 0 6px #7aba7b;
}
.control-group.success .input-prepend .add-on,
.control-group.success .input-append .add-on {
color: #468847;
background-color: #dff0d8;
border-color: #468847;
}
input:focus:required:invalid,
textarea:focus:required:invalid,
select:focus:required:invalid {
color: #b94a48;
border-color: #ee5f5b;
}
input:focus:required:invalid:focus,
textarea:focus:required:invalid:focus,
select:focus:required:invalid:focus {
border-color: #e9322d;
-webkit-box-shadow: 0 0 6px #f8b9b7;
-moz-box-shadow: 0 0 6px #f8b9b7;
box-shadow: 0 0 6px #f8b9b7;
}
.form-actions {
padding: 17px 20px 18px;
margin-top: 18px;
margin-bottom: 18px;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
*zoom: 1;
}
.form-actions:before,
.form-actions:after {
display: table;
content: "";
}
.form-actions:after {
clear: both;
}
.uneditable-input {
overflow: hidden;
white-space: nowrap;
cursor: not-allowed;
background-color: #ffffff;
border-color: #eee;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
}
:-moz-placeholder {
color: #999999;
}
::-webkit-input-placeholder {
color: #999999;
}
.help-block,
.help-inline {
color: #555555;
}
.help-block {
display: block;
margin-bottom: 9px;
}
.help-inline {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
vertical-align: middle;
padding-left: 5px;
}
.input-prepend,
.input-append {
margin-bottom: 5px;
}
.input-prepend input,
.input-append input,
.input-prepend select,
.input-append select,
.input-prepend .uneditable-input,
.input-append .uneditable-input {
position: relative;
margin-bottom: 0;
*margin-left: 0;
vertical-align: middle;
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.input-prepend input:focus,
.input-append input:focus,
.input-prepend select:focus,
.input-append select:focus,
.input-prepend .uneditable-input:focus,
.input-append .uneditable-input:focus {
z-index: 2;
}
.input-prepend .uneditable-input,
.input-append .uneditable-input {
border-left-color: #ccc;
}
.input-prepend .add-on,
.input-append .add-on {
display: inline-block;
width: auto;
height: 18px;
min-width: 16px;
padding: 4px 5px;
font-weight: normal;
line-height: 18px;
text-align: center;
text-shadow: 0 1px 0 #ffffff;
vertical-align: middle;
background-color: #eeeeee;
border: 1px solid #ccc;
}
.input-prepend .add-on,
.input-append .add-on,
.input-prepend .btn,
.input-append .btn {
margin-left: -1px;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.input-prepend .active,
.input-append .active {
background-color: #a9dba9;
border-color: #46a546;
}
.input-prepend .add-on,
.input-prepend .btn {
margin-right: -1px;
}
.input-prepend .add-on:first-child,
.input-prepend .btn:first-child {
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.input-append input,
.input-append select,
.input-append .uneditable-input {
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.input-append .uneditable-input {
border-right-color: #ccc;
border-left-color: #eee;
}
.input-append .add-on:last-child,
.input-append .btn:last-child {
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.input-prepend.input-append input,
.input-prepend.input-append select,
.input-prepend.input-append .uneditable-input {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.input-prepend.input-append .add-on:first-child,
.input-prepend.input-append .btn:first-child {
margin-right: -1px;
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.input-prepend.input-append .add-on:last-child,
.input-prepend.input-append .btn:last-child {
margin-left: -1px;
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.search-query {
padding-right: 14px;
padding-right: 4px \9;
padding-left: 14px;
padding-left: 4px \9;
/* IE7-8 doesn't have border-radius, so don't indent the padding */
margin-bottom: 0;
-webkit-border-radius: 14px;
-moz-border-radius: 14px;
border-radius: 14px;
}
.form-search input,
.form-inline input,
.form-horizontal input,
.form-search textarea,
.form-inline textarea,
.form-horizontal textarea,
.form-search select,
.form-inline select,
.form-horizontal select,
.form-search .help-inline,
.form-inline .help-inline,
.form-horizontal .help-inline,
.form-search .uneditable-input,
.form-inline .uneditable-input,
.form-horizontal .uneditable-input,
.form-search .input-prepend,
.form-inline .input-prepend,
.form-horizontal .input-prepend,
.form-search .input-append,
.form-inline .input-append,
.form-horizontal .input-append {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
margin-bottom: 0;
}
.form-search .hide,
.form-inline .hide,
.form-horizontal .hide {
display: none;
}
.form-search label,
.form-inline label {
display: inline-block;
}
.form-search .input-append,
.form-inline .input-append,
.form-search .input-prepend,
.form-inline .input-prepend {
margin-bottom: 0;
}
.form-search .radio,
.form-search .checkbox,
.form-inline .radio,
.form-inline .checkbox {
padding-left: 0;
margin-bottom: 0;
vertical-align: middle;
}
.form-search .radio input[type="radio"],
.form-search .checkbox input[type="checkbox"],
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
float: left;
margin-right: 3px;
margin-left: 0;
}
.control-group {
margin-bottom: 9px;
}
legend + .control-group {
margin-top: 18px;
-webkit-margin-top-collapse: separate;
}
.form-horizontal .control-group {
margin-bottom: 18px;
*zoom: 1;
}
.form-horizontal .control-group:before,
.form-horizontal .control-group:after {
display: table;
content: "";
}
.form-horizontal .control-group:after {
clear: both;
}
.form-horizontal .control-label {
float: left;
width: 140px;
padding-top: 5px;
text-align: right;
}
.form-horizontal .controls {
*display: inline-block;
*padding-left: 20px;
margin-left: 160px;
*margin-left: 0;
}
.form-horizontal .controls:first-child {
*padding-left: 160px;
}
.form-horizontal .help-block {
margin-top: 9px;
margin-bottom: 0;
}
.form-horizontal .form-actions {
padding-left: 160px;
}
table {
max-width: 100%;
background-color: transparent;
border-collapse: collapse;
border-spacing: 0;
}
.table {
width: 100%;
margin-bottom: 18px;
}
.table th,
.table td {
padding: 8px;
line-height: 18px;
text-align: left;
vertical-align: top;
border-top: 1px solid #dddddd;
}
.table th {
font-weight: bold;
}
.table thead th {
vertical-align: bottom;
}
.table caption + thead tr:first-child th,
.table caption + thead tr:first-child td,
.table colgroup + thead tr:first-child th,
.table colgroup + thead tr:first-child td,
.table thead:first-child tr:first-child th,
.table thead:first-child tr:first-child td {
border-top: 0;
}
.table tbody + tbody {
border-top: 2px solid #dddddd;
}
.table-condensed th,
.table-condensed td {
padding: 4px 5px;
}
.table-bordered {
border: 1px solid #dddddd;
border-collapse: separate;
*border-collapse: collapsed;
border-left: 0;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.table-bordered th,
.table-bordered td {
border-left: 1px solid #dddddd;
}
.table-bordered caption + thead tr:first-child th,
.table-bordered caption + tbody tr:first-child th,
.table-bordered caption + tbody tr:first-child td,
.table-bordered colgroup + thead tr:first-child th,
.table-bordered colgroup + tbody tr:first-child th,
.table-bordered colgroup + tbody tr:first-child td,
.table-bordered thead:first-child tr:first-child th,
.table-bordered tbody:first-child tr:first-child th,
.table-bordered tbody:first-child tr:first-child td {
border-top: 0;
}
.table-bordered thead:first-child tr:first-child th:first-child,
.table-bordered tbody:first-child tr:first-child td:first-child {
-webkit-border-top-left-radius: 4px;
border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
}
.table-bordered thead:first-child tr:first-child th:last-child,
.table-bordered tbody:first-child tr:first-child td:last-child {
-webkit-border-top-right-radius: 4px;
border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
}
.table-bordered thead:last-child tr:last-child th:first-child,
.table-bordered tbody:last-child tr:last-child td:first-child {
-webkit-border-radius: 0 0 0 4px;
-moz-border-radius: 0 0 0 4px;
border-radius: 0 0 0 4px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
}
.table-bordered thead:last-child tr:last-child th:last-child,
.table-bordered tbody:last-child tr:last-child td:last-child {
-webkit-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
}
.table-striped tbody tr:nth-child(odd) td,
.table-striped tbody tr:nth-child(odd) th {
background-color: #f9f9f9;
}
.table tbody tr:hover td,
.table tbody tr:hover th {
background-color: #f5f5f5;
}
table .span1 {
float: none;
width: 44px;
margin-left: 0;
}
table .span2 {
float: none;
width: 124px;
margin-left: 0;
}
table .span3 {
float: none;
width: 204px;
margin-left: 0;
}
table .span4 {
float: none;
width: 284px;
margin-left: 0;
}
table .span5 {
float: none;
width: 364px;
margin-left: 0;
}
table .span6 {
float: none;
width: 444px;
margin-left: 0;
}
table .span7 {
float: none;
width: 524px;
margin-left: 0;
}
table .span8 {
float: none;
width: 604px;
margin-left: 0;
}
table .span9 {
float: none;
width: 684px;
margin-left: 0;
}
table .span10 {
float: none;
width: 764px;
margin-left: 0;
}
table .span11 {
float: none;
width: 844px;
margin-left: 0;
}
table .span12 {
float: none;
width: 924px;
margin-left: 0;
}
table .span13 {
float: none;
width: 1004px;
margin-left: 0;
}
table .span14 {
float: none;
width: 1084px;
margin-left: 0;
}
table .span15 {
float: none;
width: 1164px;
margin-left: 0;
}
table .span16 {
float: none;
width: 1244px;
margin-left: 0;
}
table .span17 {
float: none;
width: 1324px;
margin-left: 0;
}
table .span18 {
float: none;
width: 1404px;
margin-left: 0;
}
table .span19 {
float: none;
width: 1484px;
margin-left: 0;
}
table .span20 {
float: none;
width: 1564px;
margin-left: 0;
}
table .span21 {
float: none;
width: 1644px;
margin-left: 0;
}
table .span22 {
float: none;
width: 1724px;
margin-left: 0;
}
table .span23 {
float: none;
width: 1804px;
margin-left: 0;
}
table .span24 {
float: none;
width: 1884px;
margin-left: 0;
}
[class^="icon-"],
[class*=" icon-"] {
display: inline-block;
width: 14px;
height: 14px;
*margin-right: .3em;
line-height: 14px;
vertical-align: text-top;
background-image: url("../images/glyphicons-halflings.png");
background-position: 14px 14px;
background-repeat: no-repeat;
}
[class^="icon-"]:last-child,
[class*=" icon-"]:last-child {
*margin-left: 0;
}
.icon-white {
background-image: url("../images/glyphicons-halflings-white.png");
}
.icon-glass {
background-position: 0 0;
}
.icon-music {
background-position: -24px 0;
}
.icon-search {
background-position: -48px 0;
}
.icon-envelope {
background-position: -72px 0;
}
.icon-heart {
background-position: -96px 0;
}
.icon-star {
background-position: -120px 0;
}
.icon-star-empty {
background-position: -144px 0;
}
.icon-user {
background-position: -168px 0;
}
.icon-film {
background-position: -192px 0;
}
.icon-th-large {
background-position: -216px 0;
}
.icon-th {
background-position: -240px 0;
}
.icon-th-list {
background-position: -264px 0;
}
.icon-ok {
background-position: -288px 0;
}
.icon-remove {
background-position: -312px 0;
}
.icon-zoom-in {
background-position: -336px 0;
}
.icon-zoom-out {
background-position: -360px 0;
}
.icon-off {
background-position: -384px 0;
}
.icon-signal {
background-position: -408px 0;
}
.icon-cog {
background-position: -432px 0;
}
.icon-trash {
background-position: -456px 0;
}
.icon-home {
background-position: 0 -24px;
}
.icon-file {
background-position: -24px -24px;
}
.icon-time {
background-position: -48px -24px;
}
.icon-road {
background-position: -72px -24px;
}
.icon-download-alt {
background-position: -96px -24px;
}
.icon-download {
background-position: -120px -24px;
}
.icon-upload {
background-position: -144px -24px;
}
.icon-inbox {
background-position: -168px -24px;
}
.icon-play-circle {
background-position: -192px -24px;
}
.icon-repeat {
background-position: -216px -24px;
}
.icon-refresh {
background-position: -240px -24px;
}
.icon-list-alt {
background-position: -264px -24px;
}
.icon-lock {
background-position: -287px -24px;
}
.icon-flag {
background-position: -312px -24px;
}
.icon-headphones {
background-position: -336px -24px;
}
.icon-volume-off {
background-position: -360px -24px;
}
.icon-volume-down {
background-position: -384px -24px;
}
.icon-volume-up {
background-position: -408px -24px;
}
.icon-qrcode {
background-position: -432px -24px;
}
.icon-barcode {
background-position: -456px -24px;
}
.icon-tag {
background-position: 0 -48px;
}
.icon-tags {
background-position: -25px -48px;
}
.icon-book {
background-position: -48px -48px;
}
.icon-bookmark {
background-position: -72px -48px;
}
.icon-print {
background-position: -96px -48px;
}
.icon-camera {
background-position: -120px -48px;
}
.icon-font {
background-position: -144px -48px;
}
.icon-bold {
background-position: -167px -48px;
}
.icon-italic {
background-position: -192px -48px;
}
.icon-text-height {
background-position: -216px -48px;
}
.icon-text-width {
background-position: -240px -48px;
}
.icon-align-left {
background-position: -264px -48px;
}
.icon-align-center {
background-position: -288px -48px;
}
.icon-align-right {
background-position: -312px -48px;
}
.icon-align-justify {
background-position: -336px -48px;
}
.icon-list {
background-position: -360px -48px;
}
.icon-indent-left {
background-position: -384px -48px;
}
.icon-indent-right {
background-position: -408px -48px;
}
.icon-facetime-video {
background-position: -432px -48px;
}
.icon-picture {
background-position: -456px -48px;
}
.icon-pencil {
background-position: 0 -72px;
}
.icon-map-marker {
background-position: -24px -72px;
}
.icon-adjust {
background-position: -48px -72px;
}
.icon-tint {
background-position: -72px -72px;
}
.icon-edit {
background-position: -96px -72px;
}
.icon-share {
background-position: -120px -72px;
}
.icon-check {
background-position: -144px -72px;
}
.icon-move {
background-position: -168px -72px;
}
.icon-step-backward {
background-position: -192px -72px;
}
.icon-fast-backward {
background-position: -216px -72px;
}
.icon-backward {
background-position: -240px -72px;
}
.icon-play {
background-position: -264px -72px;
}
.icon-pause {
background-position: -288px -72px;
}
.icon-stop {
background-position: -312px -72px;
}
.icon-forward {
background-position: -336px -72px;
}
.icon-fast-forward {
background-position: -360px -72px;
}
.icon-step-forward {
background-position: -384px -72px;
}
.icon-eject {
background-position: -408px -72px;
}
.icon-chevron-left {
background-position: -432px -72px;
}
.icon-chevron-right {
background-position: -456px -72px;
}
.icon-plus-sign {
background-position: 0 -96px;
}
.icon-minus-sign {
background-position: -24px -96px;
}
.icon-remove-sign {
background-position: -48px -96px;
}
.icon-ok-sign {
background-position: -72px -96px;
}
.icon-question-sign {
background-position: -96px -96px;
}
.icon-info-sign {
background-position: -120px -96px;
}
.icon-screenshot {
background-position: -144px -96px;
}
.icon-remove-circle {
background-position: -168px -96px;
}
.icon-ok-circle {
background-position: -192px -96px;
}
.icon-ban-circle {
background-position: -216px -96px;
}
.icon-arrow-left {
background-position: -240px -96px;
}
.icon-arrow-right {
background-position: -264px -96px;
}
.icon-arrow-up {
background-position: -289px -96px;
}
.icon-arrow-down {
background-position: -312px -96px;
}
.icon-share-alt {
background-position: -336px -96px;
}
.icon-resize-full {
background-position: -360px -96px;
}
.icon-resize-small {
background-position: -384px -96px;
}
.icon-plus {
background-position: -408px -96px;
}
.icon-minus {
background-position: -433px -96px;
}
.icon-asterisk {
background-position: -456px -96px;
}
.icon-exclamation-sign {
background-position: 0 -120px;
}
.icon-gift {
background-position: -24px -120px;
}
.icon-leaf {
background-position: -48px -120px;
}
.icon-fire {
background-position: -72px -120px;
}
.icon-eye-open {
background-position: -96px -120px;
}
.icon-eye-close {
background-position: -120px -120px;
}
.icon-warning-sign {
background-position: -144px -120px;
}
.icon-plane {
background-position: -168px -120px;
}
.icon-calendar {
background-position: -192px -120px;
}
.icon-random {
background-position: -216px -120px;
}
.icon-comment {
background-position: -240px -120px;
}
.icon-magnet {
background-position: -264px -120px;
}
.icon-chevron-up {
background-position: -288px -120px;
}
.icon-chevron-down {
background-position: -313px -119px;
}
.icon-retweet {
background-position: -336px -120px;
}
.icon-shopping-cart {
background-position: -360px -120px;
}
.icon-folder-close {
background-position: -384px -120px;
}
.icon-folder-open {
background-position: -408px -120px;
}
.icon-resize-vertical {
background-position: -432px -119px;
}
.icon-resize-horizontal {
background-position: -456px -118px;
}
.icon-hdd {
background-position: 0 -144px;
}
.icon-bullhorn {
background-position: -24px -144px;
}
.icon-bell {
background-position: -48px -144px;
}
.icon-certificate {
background-position: -72px -144px;
}
.icon-thumbs-up {
background-position: -96px -144px;
}
.icon-thumbs-down {
background-position: -120px -144px;
}
.icon-hand-right {
background-position: -144px -144px;
}
.icon-hand-left {
background-position: -168px -144px;
}
.icon-hand-up {
background-position: -192px -144px;
}
.icon-hand-down {
background-position: -216px -144px;
}
.icon-circle-arrow-right {
background-position: -240px -144px;
}
.icon-circle-arrow-left {
background-position: -264px -144px;
}
.icon-circle-arrow-up {
background-position: -288px -144px;
}
.icon-circle-arrow-down {
background-position: -312px -144px;
}
.icon-globe {
background-position: -336px -144px;
}
.icon-wrench {
background-position: -360px -144px;
}
.icon-tasks {
background-position: -384px -144px;
}
.icon-filter {
background-position: -408px -144px;
}
.icon-briefcase {
background-position: -432px -144px;
}
.icon-fullscreen {
background-position: -456px -144px;
}
.dropup,
.dropdown {
position: relative;
}
.dropdown-toggle {
*margin-bottom: -3px;
}
.dropdown-toggle:active,
.open .dropdown-toggle {
outline: 0;
}
.caret {
display: inline-block;
width: 0;
height: 0;
vertical-align: top;
border-top: 4px solid #000000;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
content: "";
opacity: 0.3;
filter: alpha(opacity=30);
}
.dropdown .caret {
margin-top: 8px;
margin-left: 2px;
}
.dropdown:hover .caret,
.open .caret {
opacity: 1;
filter: alpha(opacity=100);
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 4px 0;
margin: 1px 0 0;
list-style: none;
background-color: #ffffff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
*border-right-width: 2px;
*border-bottom-width: 2px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
.dropdown-menu .divider {
*width: 100%;
height: 1px;
margin: 8px 1px;
*margin: -5px 0 5px;
overflow: hidden;
background-color: #e5e5e5;
border-bottom: 1px solid #ffffff;
}
.dropdown-menu a {
display: block;
padding: 3px 15px;
clear: both;
font-weight: normal;
line-height: 18px;
color: #333333;
white-space: nowrap;
}
.dropdown-menu li > a:hover,
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover {
color: #ffffff;
text-decoration: none;
background-color: #0088cc;
}
.open {
*z-index: 1000;
}
.open .dropdown-menu {
display: block;
}
.pull-right .dropdown-menu {
right: 0;
left: auto;
}
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
border-top: 0;
border-bottom: 4px solid #000000;
content: "\2191";
}
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 1px;
}
.typeahead {
margin-top: 2px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #eee;
border: 1px solid rgba(0, 0, 0, 0.05);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-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-large {
padding: 24px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
.well-small {
padding: 9px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.fade {
opacity: 0;
filter: alpha(opacity=0);
-webkit-transition: opacity 0.15s linear;
-moz-transition: opacity 0.15s linear;
-ms-transition: opacity 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
.fade.in {
opacity: 1;
filter: alpha(opacity=100);
}
.collapse {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height 0.35s ease;
-moz-transition: height 0.35s ease;
-ms-transition: height 0.35s ease;
-o-transition: height 0.35s ease;
transition: height 0.35s ease;
}
.collapse.in {
height: auto;
}
.close {
float: right;
font-size: 20px;
font-weight: bold;
line-height: 18px;
color: #000000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
}
.close:hover {
color: #000000;
text-decoration: none;
cursor: pointer;
opacity: 0.4;
filter: alpha(opacity=40);
}
button.close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.btn {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
padding: 4px 10px 4px;
margin-bottom: 0;
font-size: 13px;
line-height: 18px;
*line-height: 20px;
color: #333333;
text-align: center;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
cursor: pointer;
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(top, #ffffff, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #e6e6e6;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
border: 1px solid #cccccc;
*border: 0;
border-bottom-color: #b3b3b3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
*margin-left: .3em;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
}
.btn:hover,
.btn:active,
.btn.active,
.btn.disabled,
.btn[disabled] {
background-color: #e6e6e6;
*background-color: #d9d9d9;
}
.btn:active,
.btn.active {
background-color: #cccccc \9;
}
.btn:first-child {
*margin-left: 0;
}
.btn:hover {
color: #333333;
text-decoration: none;
background-color: #e6e6e6;
*background-color: #d9d9d9;
/* Buttons in IE7 don't get borders, so darken on hover */
background-position: 0 -15px;
-webkit-transition: background-position 0.1s linear;
-moz-transition: background-position 0.1s linear;
-ms-transition: background-position 0.1s linear;
-o-transition: background-position 0.1s linear;
transition: background-position 0.1s linear;
}
.btn:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.btn.active,
.btn:active {
background-color: #e6e6e6;
background-color: #d9d9d9 \9;
background-image: none;
outline: 0;
-webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
-moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
}
.btn.disabled,
.btn[disabled] {
cursor: default;
background-color: #e6e6e6;
background-image: none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.btn-large {
padding: 9px 14px;
font-size: 15px;
line-height: normal;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.btn-large [class^="icon-"] {
margin-top: 1px;
}
.btn-small {
padding: 5px 9px;
font-size: 11px;
line-height: 16px;
}
.btn-small [class^="icon-"] {
margin-top: -1px;
}
.btn-mini {
padding: 2px 6px;
font-size: 11px;
line-height: 14px;
}
.btn-primary,
.btn-primary:hover,
.btn-warning,
.btn-warning:hover,
.btn-danger,
.btn-danger:hover,
.btn-success,
.btn-success:hover,
.btn-info,
.btn-info:hover,
.btn-inverse,
.btn-inverse:hover {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.btn-primary.active,
.btn-warning.active,
.btn-danger.active,
.btn-success.active,
.btn-info.active,
.btn-inverse.active {
color: rgba(255, 255, 255, 0.75);
}
.btn {
border-color: #ccc;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
}
.btn-primary {
background-color: #0074cc;
background-image: -moz-linear-gradient(top, #0088cc, #0055cc);
background-image: -ms-linear-gradient(top, #0088cc, #0055cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc));
background-image: -webkit-linear-gradient(top, #0088cc, #0055cc);
background-image: -o-linear-gradient(top, #0088cc, #0055cc);
background-image: linear-gradient(top, #0088cc, #0055cc);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);
border-color: #0055cc #0055cc #003580;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #0055cc;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary.active,
.btn-primary.disabled,
.btn-primary[disabled] {
background-color: #0055cc;
*background-color: #004ab3;
}
.btn-primary:active,
.btn-primary.active {
background-color: #004099 \9;
}
.btn-warning {
background-color: #faa732;
background-image: -moz-linear-gradient(top, #fbb450, #f89406);
background-image: -ms-linear-gradient(top, #fbb450, #f89406);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
background-image: -o-linear-gradient(top, #fbb450, #f89406);
background-image: linear-gradient(top, #fbb450, #f89406);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);
border-color: #f89406 #f89406 #ad6704;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #f89406;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-warning:hover,
.btn-warning:active,
.btn-warning.active,
.btn-warning.disabled,
.btn-warning[disabled] {
background-color: #f89406;
*background-color: #df8505;
}
.btn-warning:active,
.btn-warning.active {
background-color: #c67605 \9;
}
.btn-danger {
background-color: #da4f49;
background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
background-image: -ms-linear-gradient(top, #ee5f5b, #bd362f);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
background-image: linear-gradient(top, #ee5f5b, #bd362f);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);
border-color: #bd362f #bd362f #802420;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #bd362f;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-danger:hover,
.btn-danger:active,
.btn-danger.active,
.btn-danger.disabled,
.btn-danger[disabled] {
background-color: #bd362f;
*background-color: #a9302a;
}
.btn-danger:active,
.btn-danger.active {
background-color: #942a25 \9;
}
.btn-success {
background-color: #5bb75b;
background-image: -moz-linear-gradient(top, #62c462, #51a351);
background-image: -ms-linear-gradient(top, #62c462, #51a351);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
background-image: -webkit-linear-gradient(top, #62c462, #51a351);
background-image: -o-linear-gradient(top, #62c462, #51a351);
background-image: linear-gradient(top, #62c462, #51a351);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);
border-color: #51a351 #51a351 #387038;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #51a351;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-success:hover,
.btn-success:active,
.btn-success.active,
.btn-success.disabled,
.btn-success[disabled] {
background-color: #51a351;
*background-color: #499249;
}
.btn-success:active,
.btn-success.active {
background-color: #408140 \9;
}
.btn-info {
background-color: #49afcd;
background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
background-image: -ms-linear-gradient(top, #5bc0de, #2f96b4);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
background-image: linear-gradient(top, #5bc0de, #2f96b4);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0);
border-color: #2f96b4 #2f96b4 #1f6377;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #2f96b4;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-info:hover,
.btn-info:active,
.btn-info.active,
.btn-info.disabled,
.btn-info[disabled] {
background-color: #2f96b4;
*background-color: #2a85a0;
}
.btn-info:active,
.btn-info.active {
background-color: #24748c \9;
}
.btn-inverse {
background-color: #414141;
background-image: -moz-linear-gradient(top, #555555, #222222);
background-image: -ms-linear-gradient(top, #555555, #222222);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));
background-image: -webkit-linear-gradient(top, #555555, #222222);
background-image: -o-linear-gradient(top, #555555, #222222);
background-image: linear-gradient(top, #555555, #222222);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);
border-color: #222222 #222222 #000000;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #222222;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-inverse:hover,
.btn-inverse:active,
.btn-inverse.active,
.btn-inverse.disabled,
.btn-inverse[disabled] {
background-color: #222222;
*background-color: #151515;
}
.btn-inverse:active,
.btn-inverse.active {
background-color: #080808 \9;
}
button.btn,
input[type="submit"].btn {
*padding-top: 2px;
*padding-bottom: 2px;
}
button.btn::-moz-focus-inner,
input[type="submit"].btn::-moz-focus-inner {
padding: 0;
border: 0;
}
button.btn.btn-large,
input[type="submit"].btn.btn-large {
*padding-top: 7px;
*padding-bottom: 7px;
}
button.btn.btn-small,
input[type="submit"].btn.btn-small {
*padding-top: 3px;
*padding-bottom: 3px;
}
button.btn.btn-mini,
input[type="submit"].btn.btn-mini {
*padding-top: 1px;
*padding-bottom: 1px;
}
.btn-group {
position: relative;
*zoom: 1;
*margin-left: .3em;
}
.btn-group:before,
.btn-group:after {
display: table;
content: "";
}
.btn-group:after {
clear: both;
}
.btn-group:first-child {
*margin-left: 0;
}
.btn-group + .btn-group {
margin-left: 5px;
}
.btn-toolbar {
margin-top: 9px;
margin-bottom: 9px;
}
.btn-toolbar .btn-group {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
}
.btn-group > .btn {
position: relative;
float: left;
margin-left: -1px;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.btn-group > .btn:first-child {
margin-left: 0;
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
border-bottom-left-radius: 4px;
}
.btn-group > .btn:last-child,
.btn-group > .dropdown-toggle {
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
border-bottom-right-radius: 4px;
}
.btn-group > .btn.large:first-child {
margin-left: 0;
-webkit-border-top-left-radius: 6px;
-moz-border-radius-topleft: 6px;
border-top-left-radius: 6px;
-webkit-border-bottom-left-radius: 6px;
-moz-border-radius-bottomleft: 6px;
border-bottom-left-radius: 6px;
}
.btn-group > .btn.large:last-child,
.btn-group > .large.dropdown-toggle {
-webkit-border-top-right-radius: 6px;
-moz-border-radius-topright: 6px;
border-top-right-radius: 6px;
-webkit-border-bottom-right-radius: 6px;
-moz-border-radius-bottomright: 6px;
border-bottom-right-radius: 6px;
}
.btn-group > .btn:hover,
.btn-group > .btn:focus,
.btn-group > .btn:active,
.btn-group > .btn.active {
z-index: 2;
}
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
.btn-group > .dropdown-toggle {
padding-left: 8px;
padding-right: 8px;
-webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
-moz-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
*padding-top: 4px;
*padding-bottom: 4px;
}
.btn-group > .btn-mini.dropdown-toggle {
padding-left: 5px;
padding-right: 5px;
}
.btn-group > .btn-small.dropdown-toggle {
*padding-top: 4px;
*padding-bottom: 4px;
}
.btn-group > .btn-large.dropdown-toggle {
padding-left: 12px;
padding-right: 12px;
}
.btn-group.open .dropdown-toggle {
background-image: none;
-webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
-moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
}
.btn-group.open .btn.dropdown-toggle {
background-color: #e6e6e6;
}
.btn-group.open .btn-primary.dropdown-toggle {
background-color: #0055cc;
}
.btn-group.open .btn-warning.dropdown-toggle {
background-color: #f89406;
}
.btn-group.open .btn-danger.dropdown-toggle {
background-color: #bd362f;
}
.btn-group.open .btn-success.dropdown-toggle {
background-color: #51a351;
}
.btn-group.open .btn-info.dropdown-toggle {
background-color: #2f96b4;
}
.btn-group.open .btn-inverse.dropdown-toggle {
background-color: #222222;
}
.btn .caret {
margin-top: 7px;
margin-left: 0;
}
.btn:hover .caret,
.open.btn-group .caret {
opacity: 1;
filter: alpha(opacity=100);
}
.btn-mini .caret {
margin-top: 5px;
}
.btn-small .caret {
margin-top: 6px;
}
.btn-large .caret {
margin-top: 6px;
border-left-width: 5px;
border-right-width: 5px;
border-top-width: 5px;
}
.dropup .btn-large .caret {
border-bottom: 5px solid #000000;
border-top: 0;
}
.btn-primary .caret,
.btn-warning .caret,
.btn-danger .caret,
.btn-info .caret,
.btn-success .caret,
.btn-inverse .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
opacity: 0.75;
filter: alpha(opacity=75);
}
.alert {
padding: 8px 35px 8px 14px;
margin-bottom: 18px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
background-color: #fcf8e3;
border: 1px solid #fbeed5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
color: #c09853;
}
.alert-heading {
color: inherit;
}
.alert .close {
position: relative;
top: -2px;
right: -21px;
line-height: 18px;
}
.alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #468847;
}
.alert-danger,
.alert-error {
background-color: #f2dede;
border-color: #eed3d7;
color: #b94a48;
}
.alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #3a87ad;
}
.alert-block {
padding-top: 14px;
padding-bottom: 14px;
}
.alert-block > p,
.alert-block > ul {
margin-bottom: 0;
}
.alert-block p + p {
margin-top: 5px;
}
.nav {
margin-left: 0;
margin-bottom: 18px;
list-style: none;
}
.nav > li > a {
display: block;
}
.nav > li > a:hover {
text-decoration: none;
background-color: #eeeeee;
}
.nav > .pull-right {
float: right;
}
.nav .nav-header {
display: block;
padding: 3px 15px;
font-size: 11px;
font-weight: bold;
line-height: 18px;
color: #999999;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
text-transform: uppercase;
}
.nav li + .nav-header {
margin-top: 9px;
}
.nav-list {
padding-left: 15px;
padding-right: 15px;
margin-bottom: 0;
}
.nav-list > li > a,
.nav-list .nav-header {
margin-left: -15px;
margin-right: -15px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.nav-list > li > a {
padding: 3px 15px;
}
.nav-list > .active > a,
.nav-list > .active > a:hover {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
background-color: #0088cc;
}
.nav-list [class^="icon-"] {
margin-right: 2px;
}
.nav-list .divider {
*width: 100%;
height: 1px;
margin: 8px 1px;
*margin: -5px 0 5px;
overflow: hidden;
background-color: #e5e5e5;
border-bottom: 1px solid #ffffff;
}
.nav-tabs,
.nav-pills {
*zoom: 1;
}
.nav-tabs:before,
.nav-pills:before,
.nav-tabs:after,
.nav-pills:after {
display: table;
content: "";
}
.nav-tabs:after,
.nav-pills:after {
clear: both;
}
.nav-tabs > li,
.nav-pills > li {
float: left;
}
.nav-tabs > li > a,
.nav-pills > li > a {
padding-right: 12px;
padding-left: 12px;
margin-right: 2px;
line-height: 14px;
}
.nav-tabs {
border-bottom: 1px solid #ddd;
}
.nav-tabs > li {
margin-bottom: -1px;
}
.nav-tabs > li > a {
padding-top: 8px;
padding-bottom: 8px;
line-height: 18px;
border: 1px solid transparent;
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
}
.nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #dddddd;
}
.nav-tabs > .active > a,
.nav-tabs > .active > a:hover {
color: #555555;
background-color: #ffffff;
border: 1px solid #ddd;
border-bottom-color: transparent;
cursor: default;
}
.nav-pills > li > a {
padding-top: 8px;
padding-bottom: 8px;
margin-top: 2px;
margin-bottom: 2px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.nav-pills > .active > a,
.nav-pills > .active > a:hover {
color: #ffffff;
background-color: #0088cc;
}
.nav-stacked > li {
float: none;
}
.nav-stacked > li > a {
margin-right: 0;
}
.nav-tabs.nav-stacked {
border-bottom: 0;
}
.nav-tabs.nav-stacked > li > a {
border: 1px solid #ddd;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.nav-tabs.nav-stacked > li:first-child > a {
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
}
.nav-tabs.nav-stacked > li:last-child > a {
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
.nav-tabs.nav-stacked > li > a:hover {
border-color: #ddd;
z-index: 2;
}
.nav-pills.nav-stacked > li > a {
margin-bottom: 3px;
}
.nav-pills.nav-stacked > li:last-child > a {
margin-bottom: 1px;
}
.nav-tabs .dropdown-menu {
-webkit-border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
}
.nav-pills .dropdown-menu {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.nav-tabs .dropdown-toggle .caret,
.nav-pills .dropdown-toggle .caret {
border-top-color: #0088cc;
border-bottom-color: #0088cc;
margin-top: 6px;
}
.nav-tabs .dropdown-toggle:hover .caret,
.nav-pills .dropdown-toggle:hover .caret {
border-top-color: #005580;
border-bottom-color: #005580;
}
.nav-tabs .active .dropdown-toggle .caret,
.nav-pills .active .dropdown-toggle .caret {
border-top-color: #333333;
border-bottom-color: #333333;
}
.nav > .dropdown.active > a:hover {
color: #000000;
cursor: pointer;
}
.nav-tabs .open .dropdown-toggle,
.nav-pills .open .dropdown-toggle,
.nav > li.dropdown.open.active > a:hover {
color: #ffffff;
background-color: #999999;
border-color: #999999;
}
.nav li.dropdown.open .caret,
.nav li.dropdown.open.active .caret,
.nav li.dropdown.open a:hover .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
opacity: 1;
filter: alpha(opacity=100);
}
.tabs-stacked .open > a:hover {
border-color: #999999;
}
.tabbable {
*zoom: 1;
}
.tabbable:before,
.tabbable:after {
display: table;
content: "";
}
.tabbable:after {
clear: both;
}
.tab-content {
overflow: auto;
}
.tabs-below > .nav-tabs,
.tabs-right > .nav-tabs,
.tabs-left > .nav-tabs {
border-bottom: 0;
}
.tab-content > .tab-pane,
.pill-content > .pill-pane {
display: none;
}
.tab-content > .active,
.pill-content > .active {
display: block;
}
.tabs-below > .nav-tabs {
border-top: 1px solid #ddd;
}
.tabs-below > .nav-tabs > li {
margin-top: -1px;
margin-bottom: 0;
}
.tabs-below > .nav-tabs > li > a {
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
.tabs-below > .nav-tabs > li > a:hover {
border-bottom-color: transparent;
border-top-color: #ddd;
}
.tabs-below > .nav-tabs > .active > a,
.tabs-below > .nav-tabs > .active > a:hover {
border-color: transparent #ddd #ddd #ddd;
}
.tabs-left > .nav-tabs > li,
.tabs-right > .nav-tabs > li {
float: none;
}
.tabs-left > .nav-tabs > li > a,
.tabs-right > .nav-tabs > li > a {
min-width: 74px;
margin-right: 0;
margin-bottom: 3px;
}
.tabs-left > .nav-tabs {
float: left;
margin-right: 19px;
border-right: 1px solid #ddd;
}
.tabs-left > .nav-tabs > li > a {
margin-right: -1px;
-webkit-border-radius: 4px 0 0 4px;
-moz-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
.tabs-left > .nav-tabs > li > a:hover {
border-color: #eeeeee #dddddd #eeeeee #eeeeee;
}
.tabs-left > .nav-tabs .active > a,
.tabs-left > .nav-tabs .active > a:hover {
border-color: #ddd transparent #ddd #ddd;
*border-right-color: #ffffff;
}
.tabs-right > .nav-tabs {
float: right;
margin-left: 19px;
border-left: 1px solid #ddd;
}
.tabs-right > .nav-tabs > li > a {
margin-left: -1px;
-webkit-border-radius: 0 4px 4px 0;
-moz-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
}
.tabs-right > .nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #eeeeee #dddddd;
}
.tabs-right > .nav-tabs .active > a,
.tabs-right > .nav-tabs .active > a:hover {
border-color: #ddd #ddd #ddd transparent;
*border-left-color: #ffffff;
}
.navbar {
*position: relative;
*z-index: 2;
overflow: visible;
margin-bottom: 18px;
}
.navbar-inner {
min-height: 40px;
padding-left: 20px;
padding-right: 20px;
background-color: #2c2c2c;
background-image: -moz-linear-gradient(top, #333333, #222222);
background-image: -ms-linear-gradient(top, #333333, #222222);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));
background-image: -webkit-linear-gradient(top, #333333, #222222);
background-image: -o-linear-gradient(top, #333333, #222222);
background-image: linear-gradient(top, #333333, #222222);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
-moz-box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
}
.nav-collapse.collapse {
height: auto;
}
.navbar {
color: #999999;
}
.navbar .brand:hover {
text-decoration: none;
}
.navbar .brand {
float: left;
display: block;
padding: 8px 20px 12px;
margin-left: -20px;
font-size: 20px;
font-weight: 200;
line-height: 1;
color: #999999;
}
.navbar .navbar-text {
margin-bottom: 0;
line-height: 40px;
}
.navbar .navbar-link {
color: #999999;
}
.navbar .navbar-link:hover {
color: #ffffff;
}
.navbar .btn,
.navbar .btn-group {
margin-top: 5px;
}
.navbar .btn-group .btn {
margin: 0;
}
.navbar-form {
margin-bottom: 0;
*zoom: 1;
}
.navbar-form:before,
.navbar-form:after {
display: table;
content: "";
}
.navbar-form:after {
clear: both;
}
.navbar-form input,
.navbar-form select,
.navbar-form .radio,
.navbar-form .checkbox {
margin-top: 5px;
}
.navbar-form input,
.navbar-form select {
display: inline-block;
margin-bottom: 0;
}
.navbar-form input[type="image"],
.navbar-form input[type="checkbox"],
.navbar-form input[type="radio"] {
margin-top: 3px;
}
.navbar-form .input-append,
.navbar-form .input-prepend {
margin-top: 6px;
white-space: nowrap;
}
.navbar-form .input-append input,
.navbar-form .input-prepend input {
margin-top: 0;
}
.navbar-search {
position: relative;
float: left;
margin-top: 6px;
margin-bottom: 0;
}
.navbar-search .search-query {
padding: 4px 9px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
font-weight: normal;
line-height: 1;
color: #ffffff;
background-color: #626262;
border: 1px solid #151515;
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
-webkit-transition: none;
-moz-transition: none;
-ms-transition: none;
-o-transition: none;
transition: none;
}
.navbar-search .search-query:-moz-placeholder {
color: #cccccc;
}
.navbar-search .search-query::-webkit-input-placeholder {
color: #cccccc;
}
.navbar-search .search-query:focus,
.navbar-search .search-query.focused {
padding: 5px 10px;
color: #333333;
text-shadow: 0 1px 0 #ffffff;
background-color: #ffffff;
border: 0;
-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
outline: 0;
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
margin-bottom: 0;
}
.navbar-fixed-top .navbar-inner,
.navbar-fixed-bottom .navbar-inner {
padding-left: 0;
padding-right: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 940px;
}
.navbar-fixed-top {
top: 0;
}
.navbar-fixed-bottom {
bottom: 0;
}
.navbar .nav {
position: relative;
left: 0;
display: block;
float: left;
margin: 0 10px 0 0;
}
.navbar .nav.pull-right {
float: right;
}
.navbar .nav > li {
display: block;
float: left;
}
.navbar .nav > li > a {
float: none;
padding: 9px 10px 11px;
line-height: 19px;
color: #999999;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.navbar .btn {
display: inline-block;
padding: 4px 10px 4px;
margin: 5px 5px 6px;
line-height: 18px;
}
.navbar .btn-group {
margin: 0;
padding: 5px 5px 6px;
}
.navbar .nav > li > a:hover {
background-color: transparent;
color: #ffffff;
text-decoration: none;
}
.navbar .nav .active > a,
.navbar .nav .active > a:hover {
color: #ffffff;
text-decoration: none;
background-color: #222222;
}
.navbar .divider-vertical {
height: 40px;
width: 1px;
margin: 0 9px;
overflow: hidden;
background-color: #222222;
border-right: 1px solid #333333;
}
.navbar .nav.pull-right {
margin-left: 10px;
margin-right: 0;
}
.navbar .btn-navbar {
display: none;
float: right;
padding: 7px 10px;
margin-left: 5px;
margin-right: 5px;
background-color: #2c2c2c;
background-image: -moz-linear-gradient(top, #333333, #222222);
background-image: -ms-linear-gradient(top, #333333, #222222);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));
background-image: -webkit-linear-gradient(top, #333333, #222222);
background-image: -o-linear-gradient(top, #333333, #222222);
background-image: linear-gradient(top, #333333, #222222);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
border-color: #222222 #222222 #000000;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #222222;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);
box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);
}
.navbar .btn-navbar:hover,
.navbar .btn-navbar:active,
.navbar .btn-navbar.active,
.navbar .btn-navbar.disabled,
.navbar .btn-navbar[disabled] {
background-color: #222222;
*background-color: #151515;
}
.navbar .btn-navbar:active,
.navbar .btn-navbar.active {
background-color: #080808 \9;
}
.navbar .btn-navbar .icon-bar {
display: block;
width: 18px;
height: 2px;
background-color: #f5f5f5;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.btn-navbar .icon-bar + .icon-bar {
margin-top: 3px;
}
.navbar .dropdown-menu:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
top: -7px;
left: 9px;
}
.navbar .dropdown-menu:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #ffffff;
position: absolute;
top: -6px;
left: 10px;
}
.navbar-fixed-bottom .dropdown-menu:before {
border-top: 7px solid #ccc;
border-top-color: rgba(0, 0, 0, 0.2);
border-bottom: 0;
bottom: -7px;
top: auto;
}
.navbar-fixed-bottom .dropdown-menu:after {
border-top: 6px solid #ffffff;
border-bottom: 0;
bottom: -6px;
top: auto;
}
.navbar .nav li.dropdown .dropdown-toggle .caret,
.navbar .nav li.dropdown.open .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.navbar .nav li.dropdown.active .caret {
opacity: 1;
filter: alpha(opacity=100);
}
.navbar .nav li.dropdown.open > .dropdown-toggle,
.navbar .nav li.dropdown.active > .dropdown-toggle,
.navbar .nav li.dropdown.open.active > .dropdown-toggle {
background-color: transparent;
}
.navbar .nav li.dropdown.active > .dropdown-toggle:hover {
color: #ffffff;
}
.navbar .pull-right .dropdown-menu,
.navbar .dropdown-menu.pull-right {
left: auto;
right: 0;
}
.navbar .pull-right .dropdown-menu:before,
.navbar .dropdown-menu.pull-right:before {
left: auto;
right: 12px;
}
.navbar .pull-right .dropdown-menu:after,
.navbar .dropdown-menu.pull-right:after {
left: auto;
right: 13px;
}
.breadcrumb {
padding: 7px 14px;
margin: 0 0 18px;
list-style: none;
background-color: #fbfbfb;
background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5);
background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5));
background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5);
background-image: -o-linear-gradient(top, #ffffff, #f5f5f5);
background-image: linear-gradient(top, #ffffff, #f5f5f5);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);
border: 1px solid #ddd;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: inset 0 1px 0 #ffffff;
-moz-box-shadow: inset 0 1px 0 #ffffff;
box-shadow: inset 0 1px 0 #ffffff;
}
.breadcrumb li {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
text-shadow: 0 1px 0 #ffffff;
}
.breadcrumb .divider {
padding: 0 5px;
color: #999999;
}
.breadcrumb .active a {
color: #333333;
}
.pagination {
height: 36px;
margin: 18px 0;
}
.pagination ul {
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
*zoom: 1;
margin-left: 0;
margin-bottom: 0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.pagination li {
display: inline;
}
.pagination a {
float: left;
padding: 0 14px;
line-height: 34px;
text-decoration: none;
border: 1px solid #ddd;
border-left-width: 0;
}
.pagination a:hover,
.pagination .active a {
background-color: #f5f5f5;
}
.pagination .active a {
color: #999999;
cursor: default;
}
.pagination .disabled span,
.pagination .disabled a,
.pagination .disabled a:hover {
color: #999999;
background-color: transparent;
cursor: default;
}
.pagination li:first-child a {
border-left-width: 1px;
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.pagination li:last-child a {
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.pagination-centered {
text-align: center;
}
.pagination-right {
text-align: right;
}
.pager {
margin-left: 0;
margin-bottom: 18px;
list-style: none;
text-align: center;
*zoom: 1;
}
.pager:before,
.pager:after {
display: table;
content: "";
}
.pager:after {
clear: both;
}
.pager li {
display: inline;
}
.pager a {
display: inline-block;
padding: 5px 14px;
background-color: #fff;
border: 1px solid #ddd;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
.pager a:hover {
text-decoration: none;
background-color: #f5f5f5;
}
.pager .next a {
float: right;
}
.pager .previous a {
float: left;
}
.pager .disabled a,
.pager .disabled a:hover {
color: #999999;
background-color: #fff;
cursor: default;
}
.modal-open .dropdown-menu {
z-index: 2050;
}
.modal-open .dropdown.open {
*z-index: 2050;
}
.modal-open .popover {
z-index: 2060;
}
.modal-open .tooltip {
z-index: 2070;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000000;
}
.modal-backdrop.fade {
opacity: 0;
}
.modal-backdrop,
.modal-backdrop.fade.in {
opacity: 0.8;
filter: alpha(opacity=80);
}
.modal {
position: fixed;
top: 50%;
left: 50%;
z-index: 1050;
overflow: auto;
width: 560px;
margin: -250px 0 0 -280px;
background-color: #ffffff;
border: 1px solid #999;
border: 1px solid rgba(0, 0, 0, 0.3);
*border: 1px solid #999;
/* IE6-7 */
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
}
.modal.fade {
-webkit-transition: opacity .3s linear, top .3s ease-out;
-moz-transition: opacity .3s linear, top .3s ease-out;
-ms-transition: opacity .3s linear, top .3s ease-out;
-o-transition: opacity .3s linear, top .3s ease-out;
transition: opacity .3s linear, top .3s ease-out;
top: -25%;
}
.modal.fade.in {
top: 50%;
}
.modal-header {
padding: 9px 15px;
border-bottom: 1px solid #eee;
}
.modal-header .close {
margin-top: 2px;
}
.modal-body {
overflow-y: auto;
max-height: 400px;
padding: 15px;
}
.modal-form {
margin-bottom: 0;
}
.modal-footer {
padding: 14px 15px 15px;
margin-bottom: 0;
text-align: right;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
-webkit-box-shadow: inset 0 1px 0 #ffffff;
-moz-box-shadow: inset 0 1px 0 #ffffff;
box-shadow: inset 0 1px 0 #ffffff;
*zoom: 1;
}
.modal-footer:before,
.modal-footer:after {
display: table;
content: "";
}
.modal-footer:after {
clear: both;
}
.modal-footer .btn + .btn {
margin-left: 5px;
margin-bottom: 0;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.tooltip {
position: absolute;
z-index: 1020;
display: block;
visibility: visible;
padding: 5px;
font-size: 11px;
opacity: 0;
filter: alpha(opacity=0);
}
.tooltip.in {
opacity: 0.8;
filter: alpha(opacity=80);
}
.tooltip.top {
margin-top: -2px;
}
.tooltip.right {
margin-left: 2px;
}
.tooltip.bottom {
margin-top: 2px;
}
.tooltip.left {
margin-left: -2px;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #000000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #000000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #000000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #000000;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
text-decoration: none;
background-color: #000000;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
padding: 5px;
}
.popover.top {
margin-top: -5px;
}
.popover.right {
margin-left: 5px;
}
.popover.bottom {
margin-top: 5px;
}
.popover.left {
margin-left: -5px;
}
.popover.top .arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #000000;
}
.popover.right .arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #000000;
}
.popover.bottom .arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #000000;
}
.popover.left .arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #000000;
}
.popover .arrow {
position: absolute;
width: 0;
height: 0;
}
.popover-inner {
padding: 3px;
width: 280px;
overflow: hidden;
background: #000000;
background: rgba(0, 0, 0, 0.8);
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
}
.popover-title {
padding: 9px 15px;
line-height: 1;
background-color: #f5f5f5;
border-bottom: 1px solid #eee;
-webkit-border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
border-radius: 3px 3px 0 0;
}
.popover-content {
padding: 14px;
background-color: #ffffff;
-webkit-border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
}
.popover-content p,
.popover-content ul,
.popover-content ol {
margin-bottom: 0;
}
.thumbnails {
margin-left: -20px;
list-style: none;
*zoom: 1;
}
.thumbnails:before,
.thumbnails:after {
display: table;
content: "";
}
.thumbnails:after {
clear: both;
}
.row-fluid .thumbnails {
margin-left: 0;
}
.thumbnails > li {
float: left;
margin-bottom: 18px;
margin-left: 20px;
}
.thumbnail {
display: block;
padding: 4px;
line-height: 1;
border: 1px solid #ddd;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
}
a.thumbnail:hover {
border-color: #0088cc;
-webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
-moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
}
.thumbnail > img {
display: block;
max-width: 100%;
margin-left: auto;
margin-right: auto;
}
.thumbnail .caption {
padding: 9px;
}
.label,
.badge {
font-size: 10.998px;
font-weight: bold;
line-height: 14px;
color: #ffffff;
vertical-align: baseline;
white-space: nowrap;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #999999;
}
.label {
padding: 1px 4px 2px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.badge {
padding: 1px 9px 2px;
-webkit-border-radius: 9px;
-moz-border-radius: 9px;
border-radius: 9px;
}
a.label:hover,
a.badge:hover {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.label-important,
.badge-important {
background-color: #b94a48;
}
.label-important[href],
.badge-important[href] {
background-color: #953b39;
}
.label-warning,
.badge-warning {
background-color: #f89406;
}
.label-warning[href],
.badge-warning[href] {
background-color: #c67605;
}
.label-success,
.badge-success {
background-color: #468847;
}
.label-success[href],
.badge-success[href] {
background-color: #356635;
}
.label-info,
.badge-info {
background-color: #3a87ad;
}
.label-info[href],
.badge-info[href] {
background-color: #2d6987;
}
.label-inverse,
.badge-inverse {
background-color: #333333;
}
.label-inverse[href],
.badge-inverse[href] {
background-color: #1a1a1a;
}
@-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;
}
}
@-ms-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 {
overflow: hidden;
height: 18px;
margin-bottom: 18px;
background-color: #f7f7f7;
background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9);
background-image: -ms-linear-gradient(top, #f5f5f5, #f9f9f9);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));
background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9);
background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9);
background-image: linear-gradient(top, #f5f5f5, #f9f9f9);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0);
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.progress .bar {
width: 0%;
height: 18px;
color: #ffffff;
font-size: 12px;
text-align: center;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #0e90d2;
background-image: -moz-linear-gradient(top, #149bdf, #0480be);
background-image: -ms-linear-gradient(top, #149bdf, #0480be);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));
background-image: -webkit-linear-gradient(top, #149bdf, #0480be);
background-image: -o-linear-gradient(top, #149bdf, #0480be);
background-image: linear-gradient(top, #149bdf, #0480be);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0);
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-moz-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-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: width 0.6s ease;
-moz-transition: width 0.6s ease;
-ms-transition: width 0.6s ease;
-o-transition: width 0.6s ease;
transition: width 0.6s ease;
}
.progress-striped .bar {
background-color: #149bdf;
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: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-webkit-background-size: 40px 40px;
-moz-background-size: 40px 40px;
-o-background-size: 40px 40px;
background-size: 40px 40px;
}
.progress.active .bar {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-moz-animation: progress-bar-stripes 2s linear infinite;
-ms-animation: progress-bar-stripes 2s linear infinite;
-o-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
.progress-danger .bar {
background-color: #dd514c;
background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));
background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
background-image: linear-gradient(top, #ee5f5b, #c43c35);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);
}
.progress-danger.progress-striped .bar {
background-color: #ee5f5b;
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: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-success .bar {
background-color: #5eb95e;
background-image: -moz-linear-gradient(top, #62c462, #57a957);
background-image: -ms-linear-gradient(top, #62c462, #57a957);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));
background-image: -webkit-linear-gradient(top, #62c462, #57a957);
background-image: -o-linear-gradient(top, #62c462, #57a957);
background-image: linear-gradient(top, #62c462, #57a957);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);
}
.progress-success.progress-striped .bar {
background-color: #62c462;
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: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-info .bar {
background-color: #4bb1cf;
background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);
background-image: -ms-linear-gradient(top, #5bc0de, #339bb9);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));
background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);
background-image: -o-linear-gradient(top, #5bc0de, #339bb9);
background-image: linear-gradient(top, #5bc0de, #339bb9);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);
}
.progress-info.progress-striped .bar {
background-color: #5bc0de;
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: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-warning .bar {
background-color: #faa732;
background-image: -moz-linear-gradient(top, #fbb450, #f89406);
background-image: -ms-linear-gradient(top, #fbb450, #f89406);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
background-image: -o-linear-gradient(top, #fbb450, #f89406);
background-image: linear-gradient(top, #fbb450, #f89406);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);
}
.progress-warning.progress-striped .bar {
background-color: #fbb450;
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: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.accordion {
margin-bottom: 18px;
}
.accordion-group {
margin-bottom: 2px;
border: 1px solid #e5e5e5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.accordion-heading {
border-bottom: 0;
}
.accordion-heading .accordion-toggle {
display: block;
padding: 8px 15px;
}
.accordion-toggle {
cursor: pointer;
}
.accordion-inner {
padding: 9px 15px;
border-top: 1px solid #e5e5e5;
}
.carousel {
position: relative;
margin-bottom: 18px;
line-height: 1;
}
.carousel-inner {
overflow: hidden;
width: 100%;
position: relative;
}
.carousel .item {
display: none;
position: relative;
-webkit-transition: 0.6s ease-in-out left;
-moz-transition: 0.6s ease-in-out left;
-ms-transition: 0.6s ease-in-out left;
-o-transition: 0.6s ease-in-out left;
transition: 0.6s ease-in-out left;
}
.carousel .item > img {
display: block;
line-height: 1;
}
.carousel .active,
.carousel .next,
.carousel .prev {
display: block;
}
.carousel .active {
left: 0;
}
.carousel .next,
.carousel .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel .next {
left: 100%;
}
.carousel .prev {
left: -100%;
}
.carousel .next.left,
.carousel .prev.right {
left: 0;
}
.carousel .active.left {
left: -100%;
}
.carousel .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 40%;
left: 15px;
width: 40px;
height: 40px;
margin-top: -20px;
font-size: 60px;
font-weight: 100;
line-height: 30px;
color: #ffffff;
text-align: center;
background: #222222;
border: 3px solid #ffffff;
-webkit-border-radius: 23px;
-moz-border-radius: 23px;
border-radius: 23px;
opacity: 0.5;
filter: alpha(opacity=50);
}
.carousel-control.right {
left: auto;
right: 15px;
}
.carousel-control:hover {
color: #ffffff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
.carousel-caption {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 10px 15px 5px;
background: #333333;
background: rgba(0, 0, 0, 0.75);
}
.carousel-caption h4,
.carousel-caption p {
color: #ffffff;
}
.hero-unit {
padding: 60px;
margin-bottom: 30px;
background-color: #eeeeee;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
.hero-unit h1 {
margin-bottom: 0;
font-size: 60px;
line-height: 1;
color: inherit;
letter-spacing: -1px;
}
.hero-unit p {
font-size: 18px;
font-weight: 200;
line-height: 27px;
color: inherit;
}
.pull-right {
float: right;
}
.pull-left {
float: left;
}
.hide {
display: none;
}
.show {
display: block;
}
.invisible {
visibility: hidden;
} | mit |
OAuth2-Framework/oauth2-framework | tests/Component/ClientRule/ApplicationTypeParameterRuleTest.php | 2505 | <?php
declare(strict_types=1);
namespace OAuth2Framework\Tests\Component\ClientRule;
use InvalidArgumentException;
use OAuth2Framework\Component\ClientRule\ApplicationTypeParametersRule;
use OAuth2Framework\Component\ClientRule\RuleHandler;
use OAuth2Framework\Component\Core\Client\ClientId;
use OAuth2Framework\Component\Core\DataBag\DataBag;
use OAuth2Framework\Tests\Component\OAuth2TestCase;
/**
* @internal
*/
final class ApplicationTypeParameterRuleTest extends OAuth2TestCase
{
/**
* @test
*/
public function applicationTypeParameterRuleSetAsDefault(): void
{
$clientId = ClientId::create('CLIENT_ID');
$commandParameters = DataBag::create([]);
$rule = new ApplicationTypeParametersRule();
$validatedParameters = $rule->handle($clientId, $commandParameters, DataBag::create([]), $this->getCallable());
static::assertTrue($validatedParameters->has('application_type'));
static::assertSame('web', $validatedParameters->get('application_type'));
}
/**
* @test
*/
public function applicationTypeParameterRuleDefineInParameters(): void
{
$clientId = ClientId::create('CLIENT_ID');
$commandParameters = DataBag::create([
'application_type' => 'native',
]);
$rule = new ApplicationTypeParametersRule();
$validatedParameters = $rule->handle($clientId, $commandParameters, DataBag::create([]), $this->getCallable());
static::assertTrue($validatedParameters->has('application_type'));
static::assertSame('native', $validatedParameters->get('application_type'));
}
/**
* @test
*/
public function applicationTypeParameterRule(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('The parameter "application_type" must be either "native" or "web".');
$clientId = ClientId::create('CLIENT_ID');
$commandParameters = DataBag::create([
'application_type' => 'foo',
]);
$rule = new ApplicationTypeParametersRule();
$rule->handle($clientId, $commandParameters, DataBag::create([]), $this->getCallable());
}
private function getCallable(): RuleHandler
{
return new RuleHandler(function (
ClientId $clientId,
DataBag $commandParameters,
DataBag $validatedParameters
): DataBag {
return $validatedParameters;
});
}
}
| mit |
jdhunterae/eloquent_js | ch03/su03-bean_counting.js | 343 | function countBs(string) {
return countChar(string, "B");
}
function countChar(string, ch) {
var counted = 0;
for (var i = 0; i < string.length; i++) {
if (string.charAt(i) == ch)
counted += 1;
}
return counted;
}
console.log(countBs("BBC"));
// -> 2
console.log(countChar("kakkerlak", "k"));
// -> 4
| mit |
dvt32/cpp-journey | Java/Unsorted/21.05.2015.14.36.java | 793 | // dvt
/* 1. Да се напише if-конструкция,
* която изчислява стойността на две целочислени променливи и
* разменя техните стойности,
* ако стойността на първата променлива е по-голяма от втората.
*/
package myJava;
import java.util.Scanner;
public class dvt {
public static void main(String[] args) {
Scanner read = new Scanner(System.in);
int a, b, temp;
System.out.print("a = "); a = read.nextInt();
System.out.print("b = "); b = read.nextInt();
if (a > b){
temp = a;
a = b;
b = temp;
System.out.println(
"a > b! The values have been switched!\n"
+ "a = " + a + " b = " + b);
}
}
}
| mit |
RealGeeks/django-cache-purge-hooks | runtests.sh | 99 | #!/usr/bin/env bash
PYTHONPATH=. DJANGO_SETTINGS_MODULE=sampleproject.settings py.test --create-db
| mit |
dymx101/DYMEpubToPlistConverter | DYMEpubToPlistConverter/DYMEpubToPlistConverter/DYMEPubChapterFile.h | 477 | //
// DYMEPubChapterFile.h
// DYMEpubToPlistConverter
//
// Created by Dong Yiming on 15/11/13.
// Copyright © 2015年 Dong Yiming. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DYMEPubChapterFile : NSObject
@property (nonatomic, copy) NSString *chapterID;
@property (nonatomic, copy) NSString *href;
@property (nonatomic, copy) NSString *mediaType;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *content;
@end
| mit |
anba/es6draft | src/test/scripts/suite262/language/expressions/call/tco-cross-realm-class-construct.js | 1776 | /*
* Copyright (c) André Bargull
* Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms.
*
* <https://github.com/anba/es6draft>
*/
/*---
id: sec-function-calls-runtime-semantics-evaluation
info: Check TypeError is thrown from correct realm with tco-call to class constructor from class [[Construct]] invocation.
description: >
12.3.4.3 Runtime Semantics: EvaluateDirectCall( func, thisValue, arguments, tailPosition )
...
4. If tailPosition is true, perform PrepareForTailCall().
5. Let result be Call(func, thisValue, argList).
6. Assert: If tailPosition is true, the above call will not return here, but instead evaluation will continue as if the following return has already occurred.
7. Assert: If result is not an abrupt completion, then Type(result) is an ECMAScript language type.
8. Return result.
9.2.1 [[Call]] ( thisArgument, argumentsList)
...
2. If F.[[FunctionKind]] is "classConstructor", throw a TypeError exception.
3. Let callerContext be the running execution context.
4. Let calleeContext be PrepareForOrdinaryCall(F, undefined).
5. Assert: calleeContext is now the running execution context.
...
features: [tail-call-optimization, class]
---*/
// - The class constructor call is in a valid tail-call position, which means PrepareForTailCall is performed.
// - The function call returns from `otherRealm` and proceeds the tail-call in this realm.
// - Calling the class constructor throws a TypeError from the current realm, that means this realm and not `otherRealm`.
var code = "(class { constructor() { return (class {})(); } });";
var otherRealm = $262.createRealm();
var tco = otherRealm.evalScript(code);
assert.throws(TypeError, function() {
new tco();
});
| mit |
rootulp/school | mobile_apps/assignment6_rootulp/RootulpJsonA/app/src/main/java/com/rootulp/rootulpjsona/picPage.java | 2172 | package com.rootulp.rootulpjsona;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import java.io.InputStream;
public class picPage extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pic_page);
Intent local = getIntent();
Bundle localBundle = local.getExtras();
artist selected = (artist) localBundle.getSerializable("selected");
String imageURL = selected.getImageURL();
new DownloadImageTask((ImageView) findViewById(R.id.painting)).execute(imageURL);
}
private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
ImageView bmImage;
public DownloadImageTask(ImageView bmImage) {
this.bmImage = bmImage;
}
protected Bitmap doInBackground(String... urls) {
String urldisplay = urls[0];
Bitmap mIcon11 = null;
try {
InputStream in = new java.net.URL(urldisplay).openStream();
mIcon11 = BitmapFactory.decodeStream(in);
} catch (Exception e) {
Log.e("Error", e.getMessage());
e.printStackTrace();
}
return mIcon11;
}
protected void onPostExecute(Bitmap result) {
bmImage.setImageBitmap(result);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_pic_page, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| mit |
bruno-cadorette/IFT232Projet | GameBuilder/BuilderControl/ResourcesControl.xaml.cs | 911 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace GameBuilder.BuilderControl
{
/// <summary>
/// Interaction logic for ResourcesSelector.xaml
/// </summary>
public partial class ResourcesBuilder : UserControl
{
public string Header
{
get
{
return ResourcesBox.Header.ToString();
}
set
{
ResourcesBox.Header = value;
}
}
public ResourcesBuilder()
{
InitializeComponent();
}
}
}
| mit |
jdwil/xsd-tool | src/Event/FoundAnyAttributeEvent.php | 190 | <?php
declare(strict_types=1);
namespace JDWil\Xsd\Event;
/**
* Class FoundAnyAttributeEvent
* @package JDWil\Xsd\Event
*/
class FoundAnyAttributeEvent extends AbstractXsdNodeEvent
{
} | mit |
fkoessler/fat_free_crm | app/models/polymorphic/fat_free_crm/avatar.rb | 2377 | # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
# == Schema Information
#
# Table name: avatars
#
# id :integer not null, primary key
# user_id :integer
# entity_id :integer
# entity_type :string(255)
# image_file_size :integer
# image_file_name :string(255)
# image_content_type :string(255)
# created_at :datetime
# updated_at :datetime
#
class FatFreeCRM::Avatar < ActiveRecord::Base
STYLES = { large: "75x75#", medium: "50x50#", small: "25x25#", thumb: "16x16#" }.freeze
belongs_to :user
belongs_to :entity, polymorphic: true, class_name: 'FatFreeCRM::Entity'
# We want to store avatars in separate directories based on entity type
# (i.e. /avatar/User/, /avatars/Lead/, etc.), so we are adding :entity_type
# interpolation to the Paperclip::Interpolations module. Also, Paperclip
# doesn't seem to care preserving styles hash so we must use STYLES.dup.
#----------------------------------------------------------------------------
Paperclip::Interpolations.module_eval do
def entity_type(attachment, _style_name = nil)
attachment.instance.entity_type
end
end
has_attached_file :image, styles: STYLES.dup, url: "/avatars/:entity_type/:id/:style_:filename", default_url: "/assets/avatar.jpg"
validates_attachment :image, presence: true,
content_type: { content_type: %w(image/jpeg image/jpg image/png image/gif) }
# Convert STYLE symbols to 'w x h' format for Gravatar and Rails
# e.g. Avatar.size_from_style(:size => :large) -> '75x75'
# Allow options to contain :width and :height override keys
#----------------------------------------------------------------------------
def self.size_from_style!(options)
if options[:width] && options[:height]
options[:size] = [:width, :height].map { |d| options[d] }.join("x")
elsif FatFreeCRM::Avatar::STYLES.keys.include?(options[:size])
options[:size] = FatFreeCRM::Avatar::STYLES[options[:size]].sub(/\#\z/, '')
end
options
end
ActiveSupport.run_load_hooks(:fat_free_crm_avatar, self)
end
| mit |
adnanaziz/epicode | java/src/main/java/com/epi/RabinKarp.java | 3435 | // Copyright (c) 2015 Elements of Programming Interviews. All rights reserved.
package com.epi;
import java.util.Random;
public class RabinKarp {
// @include
// Returns the index of the first character of the substring if found, -1
// otherwise.
public static int rabinKarp(String t, String s) {
if (s.length() > t.length()) {
return -1; // s is not a substring of t.
}
final int BASE = 26;
int tHash = 0, sHash = 0; // Hash codes for the substring of t and s.
int powerS = 1; // BASE^|s|.
for (int i = 0; i < s.length(); i++) {
powerS = i > 0 ? powerS * BASE : 1;
tHash = tHash * BASE + t.charAt(i);
sHash = sHash * BASE + s.charAt(i);
}
for (int i = s.length(); i < t.length(); i++) {
// Checks the two substrings are actually equal or not, to protect
// against hash collision.
if (tHash == sHash && t.substring(i - s.length(), i).equals(s)) {
return i - s.length(); // Found a match.
}
// Uses rolling hash to compute the new hash code.
tHash -= t.charAt(i - s.length()) * powerS;
tHash = tHash * BASE + t.charAt(i);
}
// Tries to match s and t.substring(t.length() - s.length()).
if (tHash == sHash && t.substring(t.length() - s.length()).equals(s)) {
return t.length() - s.length();
}
return -1; // s is not a substring of t.
}
// @exclude
private static int checkAnswer(String t, String s) {
for (int i = 0; i + s.length() - 1 < t.length(); ++i) {
boolean find = true;
for (int j = 0; j < s.length(); ++j) {
if (t.charAt(i + j) != s.charAt(j)) {
find = false;
break;
}
}
if (find) {
return i;
}
}
return -1; // No matching.
}
private static String randString(int len) {
Random r = new Random();
StringBuilder ret = new StringBuilder(len);
while (len-- > 0) {
ret.append((char)(r.nextInt(26) + 'a'));
}
return ret.toString();
}
private static void smallTest() {
assert(rabinKarp("GACGCCA", "CGC") == 2);
assert(rabinKarp("GATACCCATCGAGTCGGATCGAGT", "GAG") == 10);
assert(rabinKarp("FOOBARWIDGET", "WIDGETS") == -1);
assert(rabinKarp("A", "A") == 0);
assert(rabinKarp("A", "B") == -1);
assert(rabinKarp("A", "") == 0);
assert(rabinKarp("ADSADA", "") == 0);
assert(rabinKarp("", "A") == -1);
assert(rabinKarp("", "AAA") == -1);
assert(rabinKarp("A", "AAA") == -1);
assert(rabinKarp("AA", "AAA") == -1);
assert(rabinKarp("AAA", "AAA") == 0);
assert(rabinKarp("BAAAA", "AAA") == 1);
assert(rabinKarp("BAAABAAAA", "AAA") == 1);
assert(rabinKarp("BAABBAABAAABS", "AAA") == 8);
assert(rabinKarp("BAABBAABAAABS", "AAAA") == -1);
assert(rabinKarp("FOOBAR", "BAR") > 0);
}
public static void main(String args[]) {
smallTest();
if (args.length == 2) {
String t = args[0];
String s = args[1];
System.out.println("t = " + t);
System.out.println("s = " + s);
assert(checkAnswer(t, s) == rabinKarp(t, s));
} else {
Random r = new Random();
for (int times = 0; times < 10000; ++times) {
String t = randString(r.nextInt(1000) + 1);
String s = randString(r.nextInt(20) + 1);
System.out.println("t = " + t);
System.out.println("s = " + s);
assert(checkAnswer(t, s) == rabinKarp(t, s));
}
}
}
}
| mit |
kimbirkelund/SekhmetSerialization | trunk/src/Sekhmet.Serialization/CachingObjectContextFactory.cs | 3112 | using System;
using System.Collections.Generic;
using Sekhmet.Serialization.Utility;
namespace Sekhmet.Serialization
{
public class CachingObjectContextFactory : IObjectContextFactory
{
private readonly IInstantiator _instantiator;
private readonly ReadWriteLock _lock = new ReadWriteLock();
private readonly IDictionary<Type, ObjectContextInfo> _mapActualTypeToContextInfo = new Dictionary<Type, ObjectContextInfo>();
private readonly IObjectContextInfoFactory _objectContextInfoFactory;
private readonly IObjectContextFactory _recursionFactory;
public CachingObjectContextFactory(IInstantiator instantiator, IObjectContextInfoFactory objectContextInfoFactory, IObjectContextFactory recursionFactory)
{
if (instantiator == null)
throw new ArgumentNullException("instantiator");
if (objectContextInfoFactory == null)
throw new ArgumentNullException("objectContextInfoFactory");
if (recursionFactory == null)
throw new ArgumentNullException("recursionFactory");
_instantiator = instantiator;
_objectContextInfoFactory = objectContextInfoFactory;
_recursionFactory = recursionFactory;
}
public IObjectContext CreateForDeserialization(IMemberContext targetMember, Type targetType, IAdviceRequester adviceRequester)
{
ObjectContextInfo contextInfo = GetContextInfo(targetType, adviceRequester);
object target = _instantiator.Create(targetType, adviceRequester);
if (target == null)
throw new ArgumentException("Unable to create instance of '" + targetType + "' for member '" + targetMember + "'.");
return contextInfo.CreateFor(target);
}
public IObjectContext CreateForSerialization(IMemberContext sourceMember, object source, IAdviceRequester adviceRequester)
{
if (source == null)
return null;
ObjectContextInfo contextInfo = GetContextInfo(source.GetType(), adviceRequester);
return contextInfo.CreateFor(source);
}
private ObjectContextInfo CreateContextInfo(Type actualType, IAdviceRequester adviceRequester)
{
return _objectContextInfoFactory.Create(_recursionFactory, actualType, adviceRequester);
}
private ObjectContextInfo GetContextInfo(Type actualType, IAdviceRequester adviceRequester)
{
ObjectContextInfo contextInfo;
using (_lock.EnterReadScope())
_mapActualTypeToContextInfo.TryGetValue(actualType, out contextInfo);
if (contextInfo == null)
{
using (_lock.EnterWriteScope())
{
if (!_mapActualTypeToContextInfo.TryGetValue(actualType, out contextInfo))
_mapActualTypeToContextInfo[actualType] = contextInfo = CreateContextInfo(actualType, adviceRequester);
}
}
return contextInfo;
}
}
} | mit |
KarlHeitmann/Programa-Clinico | spec/routing/diagnoses_routing_spec.rb | 1050 | require "rails_helper"
RSpec.describe DiagnosesController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(:get => "/diagnoses").to route_to("diagnoses#index")
end
it "routes to #new" do
expect(:get => "/diagnoses/new").to route_to("diagnoses#new")
end
it "routes to #show" do
expect(:get => "/diagnoses/1").to route_to("diagnoses#show", :id => "1")
end
it "routes to #edit" do
expect(:get => "/diagnoses/1/edit").to route_to("diagnoses#edit", :id => "1")
end
it "routes to #create" do
expect(:post => "/diagnoses").to route_to("diagnoses#create")
end
it "routes to #update via PUT" do
expect(:put => "/diagnoses/1").to route_to("diagnoses#update", :id => "1")
end
it "routes to #update via PATCH" do
expect(:patch => "/diagnoses/1").to route_to("diagnoses#update", :id => "1")
end
it "routes to #destroy" do
expect(:delete => "/diagnoses/1").to route_to("diagnoses#destroy", :id => "1")
end
end
end
| mit |
prg-titech/ikra-ruby | lib/resources/cuda/kernel.cpp | 238 |
__global__ void /*{kernel_name}*/(/*{parameters}*/)
{
int _tid_ = threadIdx.x + blockIdx.x * blockDim.x;
if (_tid_ < /*{num_threads}*/)
{
/*{execution}*/
_result_[_tid_] = /*{block_invocation}*/;
}
}
| mit |
kormik/manager | tests/Api/Package/PackageTest.php | 4765 | <?php
/*
* This file is part of the puli/manager package.
*
* (c) Bernhard Schussek <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Puli\Manager\Tests\Api\Package;
use Exception;
use PHPUnit_Framework_TestCase;
use Puli\Manager\Api\Environment;
use Puli\Manager\Api\Package\InstallInfo;
use Puli\Manager\Api\Package\Package;
use Puli\Manager\Api\Package\PackageFile;
use Puli\Manager\Api\Package\PackageState;
use RuntimeException;
use Webmozart\Expression\Expr;
/**
* @since 1.0
*
* @author Bernhard Schussek <[email protected]>
*/
class PackageTest extends PHPUnit_Framework_TestCase
{
public function testUsePackageNameFromPackageFile()
{
$packageFile = new PackageFile('vendor/name');
$package = new Package($packageFile, '/path');
$this->assertSame('vendor/name', $package->getName());
}
public function testUsePackageNameFromInstallInfo()
{
$packageFile = new PackageFile();
$installInfo = new InstallInfo('vendor/name', '/path');
$package = new Package($packageFile, '/path', $installInfo);
$this->assertSame('vendor/name', $package->getName());
}
public function testPreferPackageNameFromInstallInfo()
{
$packageFile = new PackageFile('vendor/package-file');
$installInfo = new InstallInfo('vendor/install-info', '/path');
$package = new Package($packageFile, '/path', $installInfo);
$this->assertSame('vendor/install-info', $package->getName());
}
public function testNameIsNullIfNoneSetAndNoInstallInfoGiven()
{
$packageFile = new PackageFile();
$package = new Package($packageFile, '/path');
$this->assertNull($package->getName());
}
public function testEnabledIfFound()
{
$packageFile = new PackageFile('vendor/name');
$package = new Package($packageFile, __DIR__);
$this->assertSame(PackageState::ENABLED, $package->getState());
}
public function testNotFoundIfNotFound()
{
$packageFile = new PackageFile('vendor/name');
$package = new Package($packageFile, __DIR__.'/foobar');
$this->assertSame(PackageState::NOT_FOUND, $package->getState());
}
public function testNotLoadableIfLoadErrors()
{
$packageFile = new PackageFile('vendor/name');
$package = new Package($packageFile, __DIR__, null, array(
new RuntimeException('Could not load package'),
));
$this->assertSame(PackageState::NOT_LOADABLE, $package->getState());
}
public function testCreatePackageWithoutPackageFileNorInstallInfo()
{
$package = new Package(null, '/path', null, array(new Exception()));
$this->assertNull($package->getName());
}
public function testMatch()
{
$packageFile = new PackageFile('vendor/name');
$package = new Package($packageFile, __DIR__);
$this->assertFalse($package->match(Expr::same('foobar', Package::NAME)));
$this->assertTrue($package->match(Expr::same('vendor/name', Package::NAME)));
$this->assertFalse($package->match(Expr::same('/path/foo', Package::INSTALL_PATH)));
$this->assertTrue($package->match(Expr::same(__DIR__, Package::INSTALL_PATH)));
$this->assertFalse($package->match(Expr::same(PackageState::NOT_LOADABLE, Package::STATE)));
$this->assertTrue($package->match(Expr::same(PackageState::ENABLED, Package::STATE)));
$this->assertFalse($package->match(Expr::same('webmozart', Package::INSTALLER)));
// Packages without install info (= the root package) are assumed to be
// installed in the production environment
$this->assertTrue($package->match(Expr::same(Environment::PROD, Package::ENVIRONMENT)));
$installInfo = new InstallInfo('vendor/install-info', '/path');
$installInfo->setInstallerName('webmozart');
$packageWithInstallInfo = new Package($packageFile, __DIR__, $installInfo);
$this->assertFalse($packageWithInstallInfo->match(Expr::same('foobar', Package::INSTALLER)));
$this->assertTrue($packageWithInstallInfo->match(Expr::same('webmozart', Package::INSTALLER)));
$this->assertTrue($packageWithInstallInfo->match(Expr::notsame(Environment::DEV, Package::ENVIRONMENT)));
$installInfo2 = new InstallInfo('vendor/install-info', '/path');
$installInfo2->setEnvironment(Environment::DEV);
$packageWithInstallInfo2 = new Package($packageFile, __DIR__, $installInfo2);
$this->assertTrue($packageWithInstallInfo2->match(Expr::same(Environment::DEV, Package::ENVIRONMENT)));
}
}
| mit |
ursky/metaWRAP | bin/metawrap-scripts/sam_to_fastq.py | 173 | #!/usr/bin/env python2.7
import sys
for line in open(sys.argv[1]):
cut=line.split('\t')
if len(cut)<11: continue
print ">"+cut[0]
print cut[9]
print "+"
print cut[10]
| mit |
ExpandiumSAS/cxxutils | sources/include/cxxu/cxxu/type_traits.hpp | 890 | #ifndef __CXXU_TYPE_TRAITS_H__
#define __CXXU_TYPE_TRAITS_H__
#include <type_traits>
#include <memory>
namespace cxxu {
template <typename T>
struct is_shared_ptr_helper : std::false_type
{
typedef T element_type;
static
element_type& deref(element_type& e)
{ return e; }
static
const element_type& deref(const element_type& e)
{ return e; }
};
template <typename T>
struct is_shared_ptr_helper<std::shared_ptr<T>> : std::true_type
{
typedef typename std::remove_cv<T>::type element_type;
typedef std::shared_ptr<element_type> ptr_type;
static
element_type& deref(ptr_type& p)
{ return *p; }
static
const element_type& deref(const ptr_type& p)
{ return *p; }
};
template <typename T>
struct is_shared_ptr
: is_shared_ptr_helper<typename std::remove_cv<T>::type>
{};
} // namespace cxxu
#endif // __CXXU_TYPE_TRAITS_H__
| mit |
AndreiBiruk/DPM | src/main/java/by/itransition/dpm/service/BookService.java | 1653 | package by.itransition.dpm.service;
import by.itransition.dpm.dao.BookDao;
import by.itransition.dpm.dao.UserDao;
import by.itransition.dpm.entity.Book;
import by.itransition.dpm.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class BookService {
@Autowired
private BookDao bookDao;
@Autowired
private UserDao userDao;
@Autowired
private UserService userService;
public void setBookDao(BookDao bookDao) {
this.bookDao = bookDao;
}
public void setUserDao(UserDao userDao) {
this.userDao = userDao;
}
@Transactional
public void addBook(Book book){
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String name = authentication.getName();
User user = userDao.getUserByLogin(name);
book.setUser(user);
bookDao.saveBook(book);
userService.addBook(user, book);
}
@Transactional
public List<Book> getAllBooks() {
return bookDao.getAllBooks();
}
@Transactional
public List<Book> getUserBooks(User user) {
return user.getBooks();
}
@Transactional
public void deleteBookById(Integer id) {
bookDao.deleteBookById(id);
}
@Transactional
public Book getBookById (Integer id){
return bookDao.getBookById(id);
}
}
| mit |
czuger/haute_tension | work/raw_data/pretre_jean_adorateurs_mal/daa931d1d025cc6e01cae4c69445f3823df6e84f4690e8461ce2df0bf4593a92.html | 66141 |
<scri
<!DOCTYPE html>
<html lang="fr" itemscope="" itemtype="http://schema.org/Blog">
<head> <script>
if (window.parent !== window) {
if (typeof btoa !== "function") {
window.btoa = function (input) {
var str = String(input);
for (var block, charCode, idx = 0, map = chars, output = ''; str.charAt(idx | 0) || (map = '=', idx % 1); output += map.charAt(63 & block >> 8 - idx % 1 * 8)) {
charCode = str.charCodeAt(idx += 3/4)
block = block << 8 | charCode
}
return output
}
}
var re = /^(?:https?:)?(?:\/\/)?([^\/\?]+)/i
var res = re.exec(document.referrer)
var domain = res[1]
var forbidden = ["aGVsbG8ubGFuZA==","Y3Vpc2luZS5sYW5k","cmVjZXR0ZS5sYW5k","cmVjZXR0ZXMubGFuZA==",]
if (forbidden.indexOf(btoa(domain)) > -1) {
document.location = document.location.origin + "/system/noframed"
}
}
</script>
<link rel="stylesheet" href="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/css/ob-style.css?v2.39.3.0" />
<link rel="stylesheet" href="//assets.over-blog-kiwi.com/b/blog/build/soundplayer.2940b52.css" />
<!-- Forked theme from id 60 - last modified : 2017-02-23T08:01:21+01:00 -->
<!-- shortcut:[Meta] -->
<!-- title -->
<!-- Title -->
<title>333 - Le Site dont vous êtes le Héros</title>
<!-- metas description, keyword, robots -->
<!-- Metas -->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="author" content="" />
<meta property="og:site_name" content="Le Site dont vous êtes le Héros" />
<meta property="og:title" content="333 - Le Site dont vous êtes le Héros" />
<meta name="twitter:title" content="333 - Le Site dont vous êtes le Héros" />
<meta name="description" content="Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du palier. A demi plongé dans le sommeil, vous ne savez..." />
<meta property="og:description" content="Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du palier. A demi plongé dans le sommeil, vous ne savez..." />
<meta name="twitter:description" content="Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du..." />
<meta property="og:locale" content="fr_FR" />
<meta property="og:url" content="http://lesitedontvousetesleheros.overblog.com/333-70" />
<meta name="twitter:url" content="http://lesitedontvousetesleheros.overblog.com/333-70" />
<meta property="og:type" content="article" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@overblog" />
<meta name="twitter:creator" content="@" />
<meta property="fb:app_id" content="284865384904712" />
<!-- Robots -->
<meta name="robots" content="index,follow" />
<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss" />
<!-- Analytics -->
<!-- shortcut:[Options] -->
</script>ll" group="shares" />
<!-- shortcut:[Includes] -->
<!-- favicon -->
<!-- Metas -->
<link rel="shortcut icon" type="image/x-icon" href="http://fdata.over-blog.net/99/00/00/01/img/favicon.ico" />
<link rel="icon" type="image/png" href="http://fdata.over-blog.net/99/00/00/01/img/favicon.png" />
<link rel="apple-touch-icon" href="http://fdata.over-blog.net/99/00/00/01/img/mobile-favicon.png" />
<!-- SEO -->
<!-- includes -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href='http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700' rel='stylesheet' type='text/css'>
<!-- Fonts -->
<link href='http://fonts.googleapis.com/css?family=Carter+One' rel='stylesheet' type='text/css'>
<!-- Fancybox -->
<link rel="stylesheet" type="text/css" href="http://assets.over-blog-kiwi.com/themes/jquery/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<style type="text/css">
/*** RESET ***/
.clearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}
.clearfix {display: inline-block;} /* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
* {margin:0; padding:0;}
body {background-color: #000; color: #fff; font-family: 'PT Sans Caption', sans-serif; font-size: 12px;}
a {text-decoration: none;}
h1,
h2,
h3,
h4,
h5,
h6 { font-weight:normal;}
img {border:none;}
.box li {list-style:none;}
#cl_1_0 ul,
#cl_1_0 ol {margin-left: 0; padding-left: 25px;}
.visuallyhidden,
.ob-form-subscription label {
position: absolute;
overflow: hidden;
clip: rect(0 0 0 0);
height: 1px; width: 1px;
margin: -1px; padding: 0; border: 0;
}
/*** General ***/
.ln {clear: both;}
#ln_2 {padding-bottom: 20px;}
.cl {float:left;}
.clear {clear:both;}
.list-title {font-size: 24px; margin: 10px 0 10px 10px; text-shadow: 1px 1px 1px #000;}
/*** Structure ***/
#cl_0_0 {margin-bottom:0; width:100%;}
#cl_1_0 {display:inline; padding:0 12px 0 0; width:630px; }
#cl_1_1 {display:inline; padding:0; width:308px;}
#cl_2_0 {margin-top: 30px; width: 100%;}
#global {margin:0px auto; width:950px;}
.header {margin: 110px 0 20px; text-align:left;}
.avatar,
#top{
display: inline-block;
vertical-align: middle;
}
.avatar{
margin-right: 10px;
}
#top .title {font-family: Carter One, cusrive; font-size: 60px; left: 0; letter-spacing: 2px; line-height: 60px; text-shadow: 0 5px 5px #333; text-transform: uppercase;}
#top .description {font-family: Carter One, cusrive; font-size:60px; font-size: 20px; letter-spacing: 2px; text-shadow: 0 2px 1px #333;}
article {margin-bottom: 35px;}
/** Article **/
.article,
.page{
background: #141414;
background: rgba(20,20,20,0.9);
border: 2px solid #333;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
padding: 10px;
}
.noresult{
margin-bottom: 20px;
}
.beforeArticle {margin-bottom: 10px;}
.divTitreArticle .post-title,
.divPageTitle .post-title,
.special h3 {border-bottom: 1px solid; font-size: 30px; letter-spacing:2px; margin-bottom: 10px; padding-bottom:5px; word-wrap: break-word;}
.contenuArticle, .pageContent {padding-top:10px;}
.contenuArticle p,
.pageContent p .contenuArticle ol,
.contenuArticle ul {font-size: 14px; line-height: 22px; padding-bottom: 8px;}
.ob-repost {background: #222; border: 1px solid #2A2A2A; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; font-weight: bold; margin: 1em 0; text-align: center;}
.ob-repost p {font-size: 12px; line-height: normal; padding: 0;}
.ob-repost .ob-link {text-decoration: underline;}
/* Sections */
.ob-section-text,
.ob-section-images,
.ob-section-video,
.ob-section-audio,
.ob-section-quote,
.ob-secton-map {width: 600px;}
/* Medias */
.ob-video iframe,
.ob-video object,
.ob-section-images .ob-slideshow,
.ob-slideshow img, .ob-section-map .ob-map {
width: 600px;
}
.ob-video iframe{
border: 0;
}
.ob-video object {
max-height: 345px;
}
.ob-section-audio .obsoundplayer .obsoundplayername {
height: 31px;
width: 200px;
overflow: hidden;
}
/* Section texte */
.ob-text h3,
.ob-text h4,
.ob-text h5 {margin: 15px 0 5px;}
.ob-text h3 {font-size: 18px; line-height: 18px;}
.ob-text h4 {font-size: 16px; line-height: 16px;}
.ob-text h5 {font-size: 14px; font-weight: bold; line-height: 14px;}
.ob-text pre {width: 600px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -webkit-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; overflow: auto;}
/* Section image */
.ob-media-left {margin-right: 30px;}
.ob-media-right {margin-left: 30px; max-width: 100%;}
.ob-row-1-col img {width: 100%;}
.ob-row-2-col img {width: 50%; margin-top: 0; margin-bottom: 0;}
.ob-row-3-col img {width: 200px; margin-top: 0; margin-bottom: 0;}
/* Section map */
.ob-map div {color: #282924;}
/* Section HTML */
.ob-section-html iframe,
.ob-section-html embed,
.ob-section-html object {max-width: 100%;}
/* Section file */
.ob-section-file .ob-ctn {background: #222; border: none; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); display: block; max-width: 100%;}
.ob-section-file .ob-ctn a.ob-link,
.ob-section-file .ob-c a.ob-link:visited {color: #FFF; text-decoration: underline; max-width: 521px;}
.ob-section-file .ob-ctn a.ob-link:hover {color: #FFF; text-decoration: none;}
/* Section Quote */
.ob-section-quote {background: #222; border: none; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); margin-bottom: 20px; width: 100%;}
.ob-section-quote .ob-quote p {color: #FFF; min-height: 20px;}
.ob-section-quote .ob-quote p:before {color: #444; margin: 20px 0 0 -85px;}
.ob-section-quote .ob-quote p:after {color: #444; margin: 80px 0 0;}
.ob-section-quote p.ob-author,
.ob-section-quote p.ob-source {background: #444; font-size: 14px; font-style: italic; margin: 25px 0 0; max-height: 22px; max-width: 517px; overflow: hidden; padding-bottom: 0\9; position: relative; text-overflow: ellipsis; white-space: nowrap; z-index: 11;}
/* Section Link */
.ob-section-link .ob-ctn {background: #222; border: none; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);}
.ob-section-link .ob-media-left {margin: 0;}
.ob-section-link p.ob-url {background: #444; margin: 0; max-height: 20px; max-width: 395px;}
.ob-section-link p.ob-title {color: #FFF; margin-bottom: 0; margin-left: 20px;}
.ob-section-link p.ob-snippet {color: #FFF; margin-bottom: 10px; margin-left: 20px; margin-top: 0;}
.ob-section-link p.ob-title .ob-link {color: #FFF; max-height: 42px; overflow: hidden;}
.ob-section-link p.ob-snippet {margin-bottom: 35px; max-height: 40px; overflow: hidden;}
.ob-section-link .ob-img {float: left; width: 170px;}
.ob-section-link .ob-desc {margin-top: 5px;}
/* Description */
.contenuArticle .ob-desc {font-size: 13px; font-style: italic;}
/* twitter box */
.ob-section .twitter-tweet-rendered {max-width: 100% !important;}
.ob-section .twt-border {max-width: 100% !important;}
/* Share buttons */
.afterArticle {background: #141414; border: 2px solid #333; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px; margin: 10px 0; -moz-opacity: 0.9; -webkit-opacity: 0.9; -o-opacity: 0.9; -ms-opacity: 0.9; opacity: 0.9; padding: 9px 13px 8px; position: relative; width: 600px; z-index: 1;/* iframe Facebook */}
.share h3,
.item-comments h3 {margin-bottom: 10px; font-size: 16px; line-height: 16px;}
.google-share,
.twitter-share,
.facebook-share,
.ob-share {float: left;}
.facebook-share {width: 105px;}
.ob-share {margin-top: -2px;}
.comment-number {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; display: block; float: right; font-weight: bold; line-height: 17px; padding: 2px 7px; text-align: center;}
.item-comments {
}
/* Contact */
.ob-contact .ob-form {margin-bottom: 80px;}
.ob-contact .ob-form-field {margin: 5px 0 0 80px;}
.ob-label {width: 20%; font-size: 14px;}
.ob-captcha .ob-input-text{
margin-left: 20%;
}
.ob-input-submit,
.ob-error {margin-left: 31%;}
.box-content .ob-input-submit,
.box-content .ob-error {margin-left: 20%;}
.ob-input-text,
.ob-input-email,
.ob-input-textarea {padding: 6px 0; border: 2px solid #333; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px;}
.ob-input-submit {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; display: block; font-weight: bold; line-height: 17px; margin-top: 5px; padding: 2px 7px; text-align: center;}
.ob-form + a {display: block; text-align: center;}
/** Sidebar **/
.box {background: #141414; border: 2px solid #333; margin-bottom:10px; -moz-opacity: 0.9; -webkit-opacity: 0.9; -o-opacity: 0.9; -ms-opacity: 0.9; opacity: 0.9; padding:10px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px;}
.box{/* ie6 hack */_background:#000;}
.box-titre h3 {border-bottom: 1px solid; font-family: Carter One; font-size: 20px; letter-spacing: 1px; margin-bottom: 10px; padding-bottom: 2px; text-shadow: 1px 1px 1px black; text-transform: uppercase;}
.box-content {font-size: 14px; line-height:18px;}
.box-content strong {font-weight:normal;}
.box-footer {display:none;}
/* Sidebar > About */
.profile .avatar {float: left; margin-right: 10px;}
.profile .avatar img {background: #333; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; -moz-opacity: 0.8; -webkit-opacity: 0.8; -o-opacity: 0.8; -ms-opacity: 0.8; opacity: 0.8; padding: 3px; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;}
.profile .avatar img:hover {-moz-opacity: 1; -webkit-opacity: 1; -o-opacity: 1; -ms-opacity: 1; opacity: 1;}
.profile .blog-owner-nickname {font-style: italic; display: block; margin-top: 10px; text-align: right;}
/* Sidebar > Search */
.search form {position:relative;}
.search form input {border: 2px solid #333; -moz-border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px; border-radius: 3px; color: #676767; padding: 5px 0; width: 70%;}
.search form button {border: 0; -moz-border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px; border-radius: 3px; cursor: pointer; font-weight: bold; padding: 5px 0; width: 13%;}
/* Sidebar > Subscribe */
.ob-form-subscription .ob-form-field{
display: inline-block;
}
.ob-form-subscription .ob-form-field input{
width: 170px;
}
.ob-form-subscription .ob-input-submit{
display: inline-block;
margin:0;
}
/* Sidebar > Last Posts */
.last li {float: left;}
.last ul:hover img {-moz-opacity: 0.7; -webkit-opacity: 0.7; -o-opacity: 0.7; -ms-opacity: 0.7; opacity: 0.7; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;}
.last ul img {background: #333; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; margin-bottom: 5px; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;}
.last li.left img {margin-right: 8px;}
.last ul img:hover {-moz-opacity: 1; -webkit-opacity: 1; -o-opacity: 1; -ms-opacity: 1; opacity: 1; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;}
/* Sidebar > Tags */
.tags li {
border-bottom: 1px solid #222;
margin: 10px 0;
padding: 10px 0;
word-wrap:break-word;
}
.tags li a {font-size: 16px;}
.tags .number {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; float: right; font-weight: bold; line-height: 17px; margin-top: -2px; padding: 2px 7px; text-align: center;}
/* Sidebar > Follow me */
.follow li {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; display: block; float: left; height: 83px; text-indent: -9999999%; width: 83px;}
.follow li a {background: url("http://assets.over-blog-kiwi.com/themes/5/images/follow-me.png") no-repeat; display: block; height: 100%; width: 100%;}
.follow .facebook-follow {margin-right: 10px;}
.follow .facebook-follow:hover {background: #3b5999; border-color: #3b5999;}
.follow .facebook-follow a {background-position: center 18px;}
.follow .twitter-follow {margin-right: 10px;}
.follow .twitter-follow:hover {background: #04bff2; border-color: #04bff2;}
.follow .twitter-follow a {background-position: center -74px;}
.follow .rss-follow:hover {background: #ff8604; border-color: #ff8604;}
.follow .rss-follow a {background-position: center -166px;}
/* Sidebar > Archives */
.plustext {font-size: 16px;}
.arch_month {margin-left: 20px;}
.arch_month li {border-bottom: 1px solid #222; margin: 10px 0; padding: 10px 0;}
.archives .number {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; float: right; font-weight: bold; line-height: 17px; margin-top: -2px; padding: 2px 7px; text-align: center;}
.share > div{
float:left;
height:20px;
margin-right:28px;
}
.share .google-share{
margin-right: 0;
}
.share iframe{
border:none;
width:100px;
}
/** Pagination **/
.pagination {
margin: 30px auto 20px; width: 600px;
font-size: 14px; padding: 2px 0;
}
.pagination a {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-o-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
float: right;
line-height: 17px;
margin-top: -2px;
padding: 2px 7px;
text-align: center;
text-transform: uppercase;
}
.pagination .previous {float: left;}
.pagination .next {float: right;}
.ob-pagination{
margin: 20px 0;
text-align: center;
}
.ob-page{
display: inline-block;
margin: 0 1px;
padding: 2px 7px;
}
.ob-page-link{
border-radius: 4px;
}
/** Credits **/
.credits {display: block; margin: 20px 0; text-align: center; text-shadow: 1px 1px 1px #000;}
/**************
** ob-footer **
**************/
.ob-footer{
padding-bottom: 10px;
}
body.withDisplay{
background-position: 50% 68px;
}
#cl_1_1 .ads{
margin-bottom: 10px;
padding: 2px;
-moz-opacity: 0.9;
-webkit-opacity: 0.9;
-o-opacity: 0.9;
-ms-opacity: 0.9;
opacity: 0.9;
}
.ads{
background: #141414;
border: 2px solid #333;
border-radius: 2px;
margin: 0 auto;
}
.ads-600x250{
padding: 10px;
text-align: center;
}
.ads-728x90{
height: 90px;
width: 728px;
}
.ads-468x60{
height: 60px;
width: 468px;
}
.ads-468x60 + .before_articles,
.afterArticle + .ads-468x60{
margin-top:35px;
}
.ads-300x250{
height: 250px;
width: 300px;
}
.ads-600x250 div{
float: left;
}
.ads-300{
text-align: center;
}
/*****************
** Top articles **
*****************/
.ob-top-posts h2{
font-size: 35px;
}
.ob-top-article{
margin-bottom: 20px;
}
.ob-top-article h3{
line-height: normal;
}
/*** Themes ***/
/** JUNGLE **/
/* BACKGROUND */
body {background-image: url("http://img.over-blog-kiwi.com/0/24/52/97/201311/ob_5cf972_lesitedontvousetesleheros.jpg"); background-attachment: fixed; background-position: center center; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;background-repeat: no-repeat;}
/* TOP */
#top .title a,
#top .title a:visited {color: #9bb1c5;}
#top .title a:hover,
#top .description {color: #fff;}
/* POSTS */
.beforeArticle .tags a,
.beforeArticle .tags a:visited {color: #9bb1c5;}
.beforeArticle .tags a:hover {color: #fff;}
.post-title,
.special h3 {border-bottom-color: #1e3249;}
.post-title a,
.post-title a:visited,
.special h3,
.ob-text h3,
.ob-text h4,
.ob-text h5 {color: #9bb1c5;}
.post-title a:hover {color: #fff;}
.contenuArticle a,
.contenuArticle a:visited,
.readmore a {color: #9bb1c5;}
.contenuArticle a:hover,
.readmore a:hover {color: #fff;}
/* Section file */
.ob-section-file .ob-ctn a.ob-link,
.ob-section-file .ob-c a.ob-link:visited,
.ob-section-file .ob-ctn a.ob-link:hover {color: #9bb1c5;}
/* Section Quote */
.ob-section-quote p.ob-author,
.ob-section-quote p.ob-source,
.ob-section-quote p.ob-author .ob-link,
.ob-section-quote p.ob-author .ob-link:visited,
.ob-section-quote p.ob-source .ob-link,
.ob-section-quote p.ob-source .ob-link:visited {color: #9bb1c5;}
.ob-section-quote p.ob-author:hover,
.ob-section-quote p.ob-source:hover,
.ob-section-quote p.ob-author .ob-link:hover,
.ob-section-quote p.ob-source .ob-link:hover {color: #fff;}
/* Section Link */
.ob-section-link p.ob-url ,
.ob-section-link p.ob-url .ob-link,
.ob-section-link p.ob-url .ob-link,
.ob-section-link p.ob-url .ob-link {color: #9bb1c5;}
.ob-section-link p.ob-url .ob-link:hover {color: #fff;}
/* SIDEBAR */
.box-titre h3 {border-bottom-color: #254870; color: #fff;}
.box-content strong {color:#bebebe;}
.box-content a,
.box-content a:visited,
.ob-footer a,
.ob-footer a:visited{color: #9bb1c5;}
.box-content a:hover,
.ob-footer a:hover{color: #fff;}
.archives .number,
.box-content form button,
.comment-number,
.follow li,
.ob-input-submit,
.pagination a,
.ob-page-link,
.tags .number {
background: #2e5fa4; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzJlNWZhNCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjY1JSIgc3RvcC1jb2xvcj0iIzIyNDA2ZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(top, #2e5fa4 0%, #22406d 65%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e5fa4), color-stop(65%,#22406d)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #2e5fa4 0%,#22406d 65%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #2e5fa4 0%,#22406d 65%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #2e5fa4 0%,#22406d 65%); /* IE10+ */
background: linear-gradient(to bottom, #2e5fa4 0%,#22406d 65%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2e5fa4', endColorstr='#22406d',GradientType=0 ); /* IE6-8 */
border: 1px solid #2d5eab; color: #fff; text-shadow: 1px 1px 1px #141414;}
.box-content form button:active,
.comment-number:active,
.ob-input-submit:active,
.pagination a:active,
.ob-page-link:active{background: #22406d; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIzNSUiIHN0b3AtY29sb3I9IiMyMjQwNmQiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjMmU1ZmE0IiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
background: -moz-linear-gradient(top, #22406d 35%, #2e5fa4 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(35%,#22406d), color-stop(100%,#2e5fa4)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #22406d 35%,#2e5fa4 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #22406d 35%,#2e5fa4 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #22406d 35%,#2e5fa4 100%); /* IE10+ */
background: linear-gradient(to bottom, #22406d 35%,#2e5fa4 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22406d', endColorstr='#2e5fa4',GradientType=0 ); /* IE6-8 */
}
.blog-owner-nickname {color: #254870;}
/* CREDITS */
.credits a,
.credits a:visited {color: #fff;}
.credits a:hover {color: #9bb1c5;}
</style>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/ads.js?v2.39.3.0"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-5354236-47', {
cookieDomain: 'lesitedontvousetesleheros.overblog.com',
cookieExpires: 31536000,
name: 'ob',
allowLinker: true
});
ga('ob.require', 'displayfeatures');
ga('ob.require', 'linkid', 'linkid.js');
ga('ob.set', 'anonymizeIp', true);
ga('ob.set', 'dimension1', '__ads_loaded__' in window ? '1' : '0');
ga('ob.set', 'dimension2', 'fr');
ga('ob.set', 'dimension3', 'BS');
ga('ob.set', 'dimension4', 'literature-comics-poetry');
ga('ob.set', 'dimension5', '1');
ga('ob.set', 'dimension6', '0');
ga('ob.set', 'dimension7', '0');
ga('ob.set', 'dimension10', '245297');
ga('ob.set', 'dimension11', '1');
ga('ob.set', 'dimension12', '1');
ga('ob.set', 'dimension13', '1');
ga('ob.send', 'pageview');
</script>
<script>
var obconnected = 0
var obconnectedblog = 0
var obtimestamp = 0
function isConnected(connected, connected_owner, timestamp) {
obconnected = connected
obconnectedblog = connected_owner
obtimestamp = timestamp
if (obconnected) {
document.querySelector('html').className += ' ob-connected'
}
if (obconnectedblog) {
document.querySelector('html').className += ' ob-connected-blog'
}
}
</script>
<script src="//connect.over-blog.com/ping/245297/isConnected"></script>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/h.js?v2.39.3.0"></script>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/repost.js?v2.39.3.0"></script>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/slideshow.js?v2.39.3.0"></script>
<script src="//assets.over-blog-kiwi.com/b/blog/build/soundplayer.2940b52.js"></script>
<script>
var OB = OB || {};
OB.isPost = true;
</script>
<script src="//assets.over-blog-kiwi.com/blog/js/index.js?v2.39.3.0"></script>
<script src="https://assets.over-blog-kiwi.com/ads/js/appconsent.bundle.min.js"></script>
<!-- DFP -->
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var useSSL = 'https:' == document.location.protocol;
var gads = document.createElement('script');
var node = document.getElementsByTagName('script')[0];
gads.async = true;
gads.type = 'text/javascript';
gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';
node.parentNode.insertBefore(gads, node);
})();
</script>
<!-- DFP -->
<script>
googletag.cmd.push(function() {
googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [728,90], '_13ed3ef')
.set('adsense_background_color','#111111')
.set('adsense_border_color','#111111')
.set('adsense_text_color','#9bb1c5')
.set('adsense_link_color','#ffffff')
.set('adsense_url_color','#9bb1c5')
.addService(googletag.pubads());
});
googletag.cmd.push(function() {
googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [300,250], '_30f3350')
.set('adsense_background_color','#111111')
.set('adsense_border_color','#111111')
.set('adsense_text_color','#9bb1c5')
.set('adsense_link_color','#ffffff')
.set('adsense_url_color','#9bb1c5')
.addService(googletag.pubads());
});
googletag.cmd.push(function() {
googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [300,250], '_6d67124')
.set('adsense_background_color','#111111')
.set('adsense_border_color','#111111')
.set('adsense_text_color','#9bb1c5')
.set('adsense_link_color','#ffffff')
.set('adsense_url_color','#9bb1c5')
.addService(googletag.pubads());
});
googletag.cmd.push(function() {
googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [[300,250],[300,600]], '_bb9b0bf')
.set('adsense_background_color','#111111')
.set('adsense_border_color','#111111')
.set('adsense_text_color','#9bb1c5')
.set('adsense_link_color','#ffffff')
.set('adsense_url_color','#9bb1c5')
.addService(googletag.pubads());
});
googletag.cmd.push(function() {
googletag.defineOutOfPageSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', '_2c08e5b')
.setTargeting('Slot', 'interstitial')
.setTargeting('Sliding', 'Both')
.addService(googletag.pubads());
});
googletag.cmd.push(function() {
googletag.defineOutOfPageSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', '_3883585')
.setTargeting('Slot', 'pop')
.addService(googletag.pubads());
});
</script>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogpdafront/prebid.js?v2.39.3.0" async></script>
<script>
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});
function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}
var PREBID_TIMEOUT = 2000;
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.enableAnalytics({
provider: 'ga',
options: {
global: 'ga',
enableDistribution: false,
sampling: 0.01
}
});
pbjs.setConfig({
userSync: {
enabledBidders: ['rubicon'],
iframeEnabled: false
} ,
consentManagement: {
cmpApi: 'iab',
timeout: 2500,
allowAuctionWithoutConsent: true
}
});
pbjs.bidderSettings = {
standard: {
adserverTargeting: [{
key: "hb_bidder",
val: function(bidResponse) {
return bidResponse.bidderCode;
}
}, {
key: "hb_adid",
val: function(bidResponse) {
return bidResponse.adId;
}
}, {
key: "custom_bid_price",
val: function(bidResponse) {
var cpm = bidResponse.cpm;
if (cpm < 1.00) {
return (Math.floor(cpm * 20) / 20).toFixed(2);
} else if (cpm < 5.00) {
return (Math.floor(cpm * 10) / 10).toFixed(2);
} else if (cpm < 10.00) {
return (Math.floor(cpm * 5) / 5).toFixed(2);
} else if (cpm < 20.00) {
return (Math.floor(cpm * 2) / 2).toFixed(2);
} else if (cpm < 50.00) {
return (Math.floor(cpm * 1) / 1).toFixed(2);
} else if (cpm < 100.00) {
return (Math.floor(cpm * 0.2) / 0.2).toFixed(2);
} else if (cpm < 300.00) {
return (Math.floor(cpm * 0.04) / 0.04).toFixed(2);
} else {
return '300.00';
}
}
}]
}
};
});
setTimeout(sendAdserverRequest, PREBID_TIMEOUT);
</script>
<script>
pbjs.que.push(function() {
var adUnits = [];
adUnits.push({
code: '_13ed3ef',
sizes: [[728,90]],
bids: [
{
bidder: 'appnexusAst',
params: {
placementId: 6542403,
},
},
{
bidder: 'rubicon',
params: {
accountId: 16072,
siteId: 119536,
zoneId: 775434,
},
},
]
})
adUnits.push({
code: '_30f3350',
sizes: [[300,250]],
bids: [
{
bidder: 'appnexusAst',
params: {
placementId: 6531816,
},
},
{
bidder: 'rubicon',
params: {
accountId: 16072,
siteId: 119536,
zoneId: 775488,
},
},
]
})
adUnits.push({
code: '_6d67124',
sizes: [[300,250]],
bids: [
{
bidder: 'appnexusAst',
params: {
placementId: 6531817,
},
},
{
bidder: 'rubicon',
params: {
accountId: 16072,
siteId: 119536,
zoneId: 775490,
},
},
]
})
adUnits.push({
code: '_bb9b0bf',
sizes: [[300,250],[300,600]],
bids: [
{
bidder: 'appnexusAst',
params: {
placementId: 6542408,
},
},
{
bidder: 'rubicon',
params: {
accountId: 16072,
siteId: 119536,
zoneId: 775484,
},
},
]
})
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: function(bidResponses) {
sendAdserverRequest();
}
});
});
</script>
<script>
try {
googletag.cmd.push(function() {
// DFP Global Targeting
googletag.pubads().setTargeting('Rating', 'BS');
googletag.pubads().setTargeting('Disused', 'Yes');
googletag.pubads().setTargeting('Adult', 'No');
googletag.pubads().setTargeting('Category', 'literature-comics-poetry');
googletag.pubads().enableSingleRequest();
googletag.pubads().collapseEmptyDivs();
googletag.enableServices();
});
}
catch(e) {}
</script>
<!-- DFP -->
<script>
var _eStat_Whap_loaded=0;
</script>
<script src="//w.estat.com/js/whap.js"></script>
<script>
if(_eStat_Whap_loaded) {
eStatWhap.serial("800000207013");
eStatWhap.send();
}
</script>
<script src="https://cdn.tradelab.fr/tag/208269514b.js" async></script>
</head>
<body class="withDisplay" >
<div class="ob-ShareBar ob-ShareBar--dark js-ob-ShareBar">
<div class="ob-ShareBar-container ob-ShareBar-container--left">
<a href="https://www.over-blog.com" class="ob-ShareBar-branding">
<img class="ob-ShareBar-brandingImg" src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/images/shareicon-branding-ob--dark.png?v2.39.3.0" alt="Overblog">
</a>
</div>
<div class="ob-ShareBar-container ob-ShareBar-container--right">
<a href="#" data-href="https://www.facebook.com/sharer/sharer.php?u={referer}" title=" facebook"="FACEBOOK"|trans }}"" class="ob-ShareBar-share ob-ShareBar-share--facebook"></a>
<a href="#" data-href="https://twitter.com/intent/tweet?url={referer}&text={title}" title=" twitter"="TWITTER"|trans }}"" class="ob-ShareBar-share ob-ShareBar-share--twitter"></a>
<a href="#" data-href="#" title=" pinterest"="PINTEREST"|trans }}"" class="ob-ShareBar-share ob-ShareBar-share--pinterest js-ob-ShareBar-share--pinterest"></a>
<form action="/search" method="post" accept-charset="utf-8" class="ob-ShareBar-search">
<input type="text" name="q" value="" class="ob-ShareBar-input" placeholder="Rechercher">
<button class="ob-ShareBar-submit"></button>
</form>
<a href="https://admin.over-blog.com/245297/write/29340435" class="ob-ShareBar-edit ob-ShareBar--connected-blog">
<span>Editer l'article</span>
</a>
<a class="js-ob-ShareBar-follow ob-ShareBar--connected ob-ShareBar-follow" href="https://admin.over-blog.com/_follow/245297" target="_blank" rel="nofollow">
Suivre ce blog
</a>
<a href="https://admin.over-blog.com/245297" class="ob-ShareBar-admin ob-ShareBar--connected">
<img src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/images/lock-alt-dark.svg?v2.39.3.0" class="ob-ShareBar-lock">
<span>Administration</span>
</a>
<a href="https://connect.over-blog.com/fr/login" class="ob-ShareBar-login ob-ShareBar--notconnected">
<img src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/images/lock-alt-dark.svg?v2.39.3.0" class="ob-ShareBar-lock">
<span>Connexion</span>
</a>
<a href="https://connect.over-blog.com/fr/signup" class="ob-ShareBar-create ob-ShareBar--notconnected">
<span class="ob-ShareBar-plus">+</span>
<span>Créer mon blog</span>
</a>
<span class="ob-ShareBar-toggle ob-ShareBar-toggle--hide js-ob-ShareBar-toggle"></span>
</div>
</div>
<div class="ob-ShareBar ob-ShareBar--minified js-ob-ShareBar--minified">
<div class="ob-ShareBar-container">
<span class="ob-ShareBar-toggle ob-ShareBar-toggle--show js-ob-ShareBar-toggle"></span>
</div>
</div>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/sharebar.js?v2.39.3.0"></script>
<script>
var postTitle = "333"
socialShare(document.querySelector('.ob-ShareBar-share--facebook'), postTitle)
socialShare(document.querySelector('.ob-ShareBar-share--twitter'), postTitle)
</script> <!-- Init Facebook script -->
<div id="fb-root"></div>
<div class="ads ads-728x90">
<div id='_13ed3ef'><script>
try {
if (!window.__13ed3ef) {
window.__13ed3ef = true;
googletag.cmd.push(function() { googletag.display('_13ed3ef'); });
}
} catch(e) {}
</script></div> </div>
<div id="global">
<div id="ln_0" class="ln">
<div id="cl_0_0" class="cl">
<div class="column_content">
<div class="header">
<div id="top">
<h1 class="title">
<a href="http://lesitedontvousetesleheros.overblog.com" class="topLien" title="Lecture des livres dont vous êtes le héros">Le Site dont vous êtes le Héros</a>
</h1>
<p class="description">Lecture des livres dont vous êtes le héros</p>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</div>
<div id="ln_1" class="ln">
<div id="cl_1_0" class="cl">
<div class="column_content">
<div>
<!-- Title -->
<!-- list posts -->
<article>
<div class="article">
<div class="option beforeArticle">
<div class="date">
Publié le
<time datetime="2013-06-12T20:57:28+02:00">12 Juin 2013</time>
</div>
<span class="tags">
</span>
</div>
<div class="divTitreArticle">
<h2 class="post-title">
<a href="http://lesitedontvousetesleheros.overblog.com/333-70" class="titreArticle" title="Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du palier. A demi plongé dans le sommeil, vous ne savez...">
333
</a>
</h2>
</div>
<div class="contenuArticle">
<div class="ob-sections">
<div class="ob-section ob-section-text">
<div class="ob-text">
<p>Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du palier. A demi plongé dans le sommeil, vous ne savez trop si quelqu'un essaie de pousser votre porte ou si votre imagination tend à la paranoïa obsessionnelle. Que faire ?</p><p><a href="http://lesitedontvousetesleheros.overblog.com/372-16">Ouvrir la porte pour en avoir le cœur net ?</a></p><p><a href="http://lesitedontvousetesleheros.overblog.com/393-86">Vous poster en embuscade pour surprendre un éventuel visiteur ?</a><em> </em></p><p><a href="http://lesitedontvousetesleheros.overblog.com/245-18">Ignorer tout ceci et dormir ?</a><em> </em></p>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<!-- Share buttons + comments -->
<div class="afterArticle">
<div class="clear"></div>
<!-- Pagination -->
<div class="pagination clearfix">
<a href="http://lesitedontvousetesleheros.overblog.com/332-28" title="332" class="previous">← 332</a>
<a href="http://lesitedontvousetesleheros.overblog.com/334-18" title="334" class="next">334 →</a>
</div>
<!-- Comments -->
</div>
</article>
</div>
<div class="ads ads-600x250 clearfix">
<div id='_30f3350'><script>
try {
if (!window.__30f3350) {
window.__30f3350 = true;
googletag.cmd.push(function() { googletag.display('_30f3350'); });
}
} catch(e) {}
</script></div> <div id='_6d67124'><script>
try {
if (!window.__6d67124) {
window.__6d67124 = true;
googletag.cmd.push(function() { googletag.display('_6d67124'); });
}
} catch(e) {}
</script></div> </div>
<!-- Pagination -->
</div>
</div>
<div id="cl_1_1" class="cl">
<div class="column_content">
<div class="box freeModule">
<div class="box-titre">
<h3><span></span></h3>
</div>
<div class="box-content">
<div><script src="http://h1.flashvortex.com/display.php?id=2_1391984427_52721_435_0_468_60_8_1_13" type="text/javascript"></script></div>
</div>
</div>
<!-- Search -->
<div class="ads ads-300">
<div id='_bb9b0bf'><script>
try {
if (!window.__bb9b0bf) {
window.__bb9b0bf = true;
googletag.cmd.push(function() { googletag.display('_bb9b0bf'); });
}
} catch(e) {}
</script></div> </div>
<!-- Navigation -->
<div class="box blogroll">
<div class="box-titre">
<h3>
<span>Liens</span>
</h3>
</div>
<div class="box-content">
<ul class="list">
<li>
<a href="http://www.lesitedontvousetesleheros.fr/liste-des-series" target="_blank">
LISTE DES SERIES
</a>
</li>
<li>
<a href="http://www.lesitedontvousetesleheros.fr/2017/02/autres-livres-dont-vous-etes-le-heros-chez-divers-editeurs.html" target="_blank">
AUTRES LIVRES DONT VOUS ETES LE HEROS
</a>
</li>
</ul>
</div>
</div>
<p class="credits">
Hébergé par <a href="http://www.over-blog.com" target="_blank">Overblog</a>
</p>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://assets.over-blog-kiwi.com/themes/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script>
$(document).ready(function() {
// Fancybox
$(".ob-section-images a, .ob-link-img").attr("rel", "fancybox");
$("a[rel=fancybox]").fancybox({
'overlayShow' : true,
'transitionIn' : 'fadin',
'transitionOut' : 'fadin',
'type' : 'image'
});
});
// Twitter share + tweets
!function(d,s,id){
var js, fjs = d.getElementsByTagName(s)[0];
if(!d.getElementById(id)){
js = d.createElement(s);
js.id = id;
js.src = "//platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);
}
}(document,"script","twitter-wjs");
// Google + button
window.___gcfg = {lang: 'fr'};
(function() {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
</script>
<script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/print.js?v2.39.3.0"></script>
<script>
var postTitle = "333"
printPost(postTitle)
</script>
<div class="ob-footer" id="legals" >
<ul>
<li class="ob-footer-item"><a href="https://www.over-blog.com/" target="_blank">Créer un blog gratuit sur Overblog</a></li>
<li class="ob-footer-item"><a href="/top">Top articles</a></li>
<li class="ob-footer-item"><a href="/contact">Contact</a></li>
<li class="ob-footer-item"><a href="https://www.over-blog.com/abuse/245297"> Signaler un abus </a></li>
<li class="ob-footer-item"><a href="https://www.over-blog.com/terms-of-use" target="_blank">C.G.U.</a></li>
<li class="ob-footer-item"><a href="https://www.over-blog.com/features/earn-money.html" target="_blank">Rémunération en droits d'auteur</a></li>
<li class="ob-footer-item"><a href="https://www.over-blog.com/features/premium.html" target="_blank">Offre Premium</a></li>
<li class="ob-footer-item"><a href="https://www.over-blog.com/cookies" target="_blank">Cookies et données personnelles</a></li>
</ul>
</div>
<div id='_2c08e5b'><script>
googletag.cmd.push(function() { googletag.display('_2c08e5b'); });
</script></div><div id='_3883585'><script>
googletag.cmd.push(function() { googletag.display('_3883585'); });
</script></div>
<!-- End Google Tag Manager -->
<script>
dataLayer = [{
'category' : 'Literature, Comics & Poetry',
'rating' : 'BS',
'unused' : 'Yes',
'adult' : 'No',
'pda' : 'No',
'hasAds' : 'Yes',
'lang' : 'fr',
'adblock' : '__ads_loaded__' in window ? 'No' : 'Yes'
}];
</script>
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-KJ6B85"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>
googletag.cmd.push(function() {
(function(w,d,s,l,i){
w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});
var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KJ6B85');
});
</script>
<!-- Begin comScore Tag -->
<script>
var _comscore = _comscore || [];
_comscore.push({ c1: "2", c2: "6035191" });
(function() {
var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true;
s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js";
el.parentNode.insertBefore(s, el);
})();
</script>
<noscript>
<img src="http://b.scorecardresearch.com/p?c1=2&c2=6035191&cv=2.0&cj=1" />
</noscript>
<!-- End comScore Tag -->
<!-- Begin Mediamétrie Tag -->
<script>
function _eStat_Whap_loaded_func(){
eStatWhap.serial("800000207013");
eStatWhap.send();
}
(function() {
var myscript = document.createElement('script');
myscript.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'w.estat.com/js/whap.js';
myscript.setAttribute('async', 'true');
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(myscript, s);
})();
</script>
<!-- End Mediamétrie Tag -->
<script>
(function() {
var alreadyAccept = getCookie('wbCookieNotifier');
if(alreadyAccept != 1) showWbCookieNotifier();
window.closeWbCookieNotifier = function() {
setCookie('wbCookieNotifier', 1, 730);
window.document.getElementById("ob-cookies").style.display = "none";
}
function showWbCookieNotifier(){
var el = document.createElement("div");
var bo = document.body;
el.id = "ob-cookies";
el.className = "__wads_no_click ob-cookies";
var p = document.createElement("p");
p.className = "ob-cookies-content";
p.innerHTML = "En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies. Ces derniers assurent le bon fonctionnement de nos services, d'outils d'analyse et l’affichage de publicités pertinentes. <a class='ob-cookies-link' href='https://www.over-blog.com/cookies' target='_blank'>En savoir plus et agir</a> sur les cookies. <span class='ob-cookies-button' onclick='closeWbCookieNotifier()'>J'accepte</span>"
document.body.appendChild(el); el.appendChild(p);
window.wbCookieNotifier = el;
}
function setCookie(e,t,n,d){var r=new Date;r.setDate(r.getDate()+n);var i=escape(t)+(n==null?"":"; expires="+r.toUTCString())+(d==null?"":"; domain="+d)+";path=/";document.cookie=e+"="+i}
function getCookie(e){var t,n,r,i=document.cookie.split(";");for(t=0;t<i.length;t++){n=i[t].substr(0,i[t].indexOf("="));r=i[t].substr(i[t].indexOf("=")+1);n=n.replace(/^\s+|\s+$/g,"");if(n==e){return unescape(r)}}}
})();
</script>
</body>
</html>
| mit |
MadDeveloper/easy.js | src/bundles/role/doc/role.doc.js | 2414 | /**
* getRoles - get all roles
*
* @api {get} /roles Get all roles
* @apiName GetRoles
* @apiGroup Role
*
*
* @apiSuccess {Array[Role]} raw Return table of roles
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 200 OK
* [
* {
* "id": 1,
* "name": "Administrator",
* "slug": "administrator"
* }
* ]
*
* @apiUse InternalServerError
*/
/**
* createRole - create new role
*
* @api {post} /roles Create a role
* @apiName CreateRole
* @apiGroup Role
* @apiPermission admin
*
* @apiParam {String} name Name of new role
* @apiParam {String} slug Slug from name of new role
*
* @apiSuccess (Created 201) {Number} id Id of new role
* @apiSuccess (Created 201) {String} name Name of new role
* @apiSuccess (Created 201) {String} slug Slug of new role
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 201 Created
* {
* "id": 3,
* "name": "Custom",
* "slug": "custom"
* }
*
* @apiUse BadRequest
* @apiUse InternalServerError
*/
/**
* getRole - get role by id
*
* @api {get} /roles/:id Get role by id
* @apiName GetRole
* @apiGroup Role
*
* @apiSuccess {Number} id Id of role
* @apiSuccess {String} name Name of role
* @apiSuccess {String} slug Slug of role
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 200 OK
* {
* "id": 2,
* "name": "User",
* "slug": "user"
* }
*
* @apiUse NotFound
* @apiUse InternalServerError
*/
/**
* updateRole - update role
*
* @api {put} /roles/:id Update role from id
* @apiName UpdateRole
* @apiGroup Role
* @apiPermission admin
*
*
* @apiParam {String} name New role name
* @apiParam {String} slug New role slug
*
* @apiSuccess {Number} id Id of role
* @apiSuccess {String} name Name of role
* @apiSuccess {String} slug Slug of role
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 200 OK
* {
* "id": 3,
* "name": "Customer",
* "slug": "customer"
* }
*
* @apiUse NotFound
* @apiUse BadRequest
* @apiUse InternalServerError
*/
/**
* deleteRole - delete role
*
* @api {delete} /roles/:id Delete role from id
* @apiName DeleteRole
* @apiGroup Role
* @apiPermission admin
*
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 204 No Content
*
* @apiUse NotFound
* @apiUse BadRequest
* @apiUse InternalServerError
*/
| mit |
fantasticfears/icu4r | ext/icu/icu_spoof_checker.c | 9203 | #include "icu.h"
#include "unicode/uspoof.h"
#define GET_SPOOF_CHECKER(_data) icu_spoof_checker_data* _data; \
TypedData_Get_Struct(self, icu_spoof_checker_data, &icu_spoof_checker_type, _data)
VALUE rb_cICU_SpoofChecker;
VALUE rb_mChecks;
VALUE rb_mRestrictionLevel;
typedef struct {
VALUE rb_instance;
USpoofChecker* service;
} icu_spoof_checker_data;
static void spoof_checker_free(void* _this)
{
icu_spoof_checker_data* this = _this;
uspoof_close(this->service);
}
static size_t spoof_checker_memsize(const void* _)
{
return sizeof(icu_spoof_checker_data);
}
static const rb_data_type_t icu_spoof_checker_type = {
"icu/spoof_checker",
{NULL, spoof_checker_free, spoof_checker_memsize,},
0, 0,
RUBY_TYPED_FREE_IMMEDIATELY,
};
VALUE spoof_checker_alloc(VALUE self)
{
icu_spoof_checker_data* this;
return TypedData_Make_Struct(self, icu_spoof_checker_data, &icu_spoof_checker_type, this);
}
VALUE spoof_checker_initialize(VALUE self)
{
GET_SPOOF_CHECKER(this);
this->rb_instance = self;
this->service = FALSE;
UErrorCode status = U_ZERO_ERROR;
this->service = uspoof_open(&status);
if (U_FAILURE(status)) {
icu_rb_raise_icu_error(status);
}
return self;
}
static inline VALUE spoof_checker_get_restriction_level_internal(const icu_spoof_checker_data* this)
{
URestrictionLevel level = uspoof_getRestrictionLevel(this->service);
return INT2NUM(level);
}
VALUE spoof_checker_get_restriction_level(VALUE self)
{
GET_SPOOF_CHECKER(this);
return spoof_checker_get_restriction_level_internal(this);
}
VALUE spoof_checker_set_restriction_level(VALUE self, VALUE level)
{
GET_SPOOF_CHECKER(this);
uspoof_setRestrictionLevel(this->service, NUM2INT(level));
return spoof_checker_get_restriction_level_internal(this);
}
static inline VALUE spoof_checker_get_checks_internal(const icu_spoof_checker_data* this)
{
UErrorCode status = U_ZERO_ERROR;
int32_t checks = uspoof_getChecks(this->service, &status);
if (U_FAILURE(status)) {
icu_rb_raise_icu_error(status);
}
return INT2NUM(checks);
}
VALUE spoof_checker_get_checks(VALUE self)
{
GET_SPOOF_CHECKER(this);
return spoof_checker_get_checks_internal(this);
}
VALUE spoof_checker_set_checks(VALUE self, VALUE checks)
{
GET_SPOOF_CHECKER(this);
UErrorCode status = U_ZERO_ERROR;
uspoof_setChecks(this->service, NUM2INT(checks), &status);
if (U_FAILURE(status)) {
icu_rb_raise_icu_error(status);
}
return spoof_checker_get_checks_internal(this);
}
VALUE spoof_checker_confusable(VALUE self, VALUE str_a, VALUE str_b)
{
StringValue(str_a);
StringValue(str_b);
GET_SPOOF_CHECKER(this);
VALUE tmp_a = icu_ustring_from_rb_str(str_a);
VALUE tmp_b = icu_ustring_from_rb_str(str_b);
UErrorCode status = U_ZERO_ERROR;
int32_t result = uspoof_areConfusable(this->service,
icu_ustring_ptr(tmp_a),
icu_ustring_len(tmp_a),
icu_ustring_ptr(tmp_b),
icu_ustring_len(tmp_b),
&status);
return INT2NUM(result);
}
VALUE spoof_checker_get_skeleton(VALUE self, VALUE str)
{
StringValue(str);
GET_SPOOF_CHECKER(this);
VALUE in = icu_ustring_from_rb_str(str);
VALUE out = icu_ustring_init_with_capa_enc(icu_ustring_capa(in), ICU_RUBY_ENCODING_INDEX);
int retried = FALSE;
int32_t len_bytes;
UErrorCode status = U_ZERO_ERROR;
do {
// UTF-8 version does the conversion internally so we relies on UChar version here!
len_bytes = uspoof_getSkeleton(this->service, 0 /* deprecated */,
icu_ustring_ptr(in), icu_ustring_len(in),
icu_ustring_ptr(out), icu_ustring_capa(out),
&status);
if (!retried && status == U_BUFFER_OVERFLOW_ERROR) {
retried = TRUE;
icu_ustring_resize(out, len_bytes + RUBY_C_STRING_TERMINATOR_SIZE);
status = U_ZERO_ERROR;
} else if (U_FAILURE(status)) {
icu_rb_raise_icu_error(status);
} else { // retried == true && U_SUCCESS(status)
break;
}
} while (retried);
return icu_ustring_to_rb_enc_str_with_len(out, len_bytes);
}
VALUE spoof_checker_check(VALUE self, VALUE rb_str)
{
StringValue(rb_str);
GET_SPOOF_CHECKER(this);
UErrorCode status = U_ZERO_ERROR;
int32_t result = 0;
// TODO: Migrate to uspoof_check2UTF8 once it's not draft
if (icu_is_rb_str_as_utf_8(rb_str)) {
result = uspoof_checkUTF8(this->service,
RSTRING_PTR(rb_str),
RSTRING_LENINT(rb_str),
NULL,
&status);
} else {
VALUE in = icu_ustring_from_rb_str(rb_str);
// TODO: Migrate to uspoof_check once it's not draft
result = uspoof_check(this->service,
icu_ustring_ptr(in),
icu_ustring_len(in),
NULL,
&status);
}
if (U_FAILURE(status)) {
icu_rb_raise_icu_error(status);
}
return INT2NUM(result);
}
static const char* k_checks_name = "@checks";
VALUE spoof_checker_available_checks(VALUE klass)
{
VALUE iv = rb_iv_get(klass, k_checks_name);
if (NIL_P(iv)) {
iv = rb_hash_new();
rb_hash_aset(iv, ID2SYM(rb_intern("single_script_confusable")), INT2NUM(USPOOF_SINGLE_SCRIPT_CONFUSABLE));
rb_hash_aset(iv, ID2SYM(rb_intern("mixed_script_confusable")), INT2NUM(USPOOF_MIXED_SCRIPT_CONFUSABLE));
rb_hash_aset(iv, ID2SYM(rb_intern("whole_script_confusable")), INT2NUM(USPOOF_WHOLE_SCRIPT_CONFUSABLE));
rb_hash_aset(iv, ID2SYM(rb_intern("confusable")), INT2NUM(USPOOF_CONFUSABLE));
// USPOOF_ANY_CASE deprecated in 58
rb_hash_aset(iv, ID2SYM(rb_intern("restriction_level")), INT2NUM(USPOOF_RESTRICTION_LEVEL));
// USPOOF_SINGLE_SCRIPT deprecated in 51
rb_hash_aset(iv, ID2SYM(rb_intern("invisible")), INT2NUM(USPOOF_INVISIBLE));
rb_hash_aset(iv, ID2SYM(rb_intern("char_limit")), INT2NUM(USPOOF_CHAR_LIMIT));
rb_hash_aset(iv, ID2SYM(rb_intern("mixed_numbers")), INT2NUM(USPOOF_MIXED_NUMBERS));
rb_hash_aset(iv, ID2SYM(rb_intern("all_checks")), INT2NUM(USPOOF_ALL_CHECKS));
rb_hash_aset(iv, ID2SYM(rb_intern("aux_info")), INT2NUM(USPOOF_AUX_INFO));
rb_iv_set(klass, k_checks_name, iv);
}
return iv;
}
static const char* k_restriction_level_name = "@restriction_levels";
VALUE spoof_checker_available_restriction_levels(VALUE klass)
{
VALUE iv = rb_iv_get(klass, k_restriction_level_name);
if (NIL_P(iv)) {
iv = rb_hash_new();
rb_hash_aset(iv, ID2SYM(rb_intern("ascii")), INT2NUM(USPOOF_ASCII));
rb_hash_aset(iv, ID2SYM(rb_intern("single_script_restrictive")), INT2NUM(USPOOF_SINGLE_SCRIPT_RESTRICTIVE));
rb_hash_aset(iv, ID2SYM(rb_intern("highly_restrictive")), INT2NUM(USPOOF_HIGHLY_RESTRICTIVE));
rb_hash_aset(iv, ID2SYM(rb_intern("moderately_restrictive")), INT2NUM(USPOOF_MODERATELY_RESTRICTIVE));
rb_hash_aset(iv, ID2SYM(rb_intern("minimally_restrictive")), INT2NUM(USPOOF_MINIMALLY_RESTRICTIVE));
rb_hash_aset(iv, ID2SYM(rb_intern("unrestrictive")), INT2NUM(USPOOF_UNRESTRICTIVE));
rb_hash_aset(iv, ID2SYM(rb_intern("restriction_level_mask")), INT2NUM(USPOOF_RESTRICTION_LEVEL_MASK));
rb_hash_aset(iv, ID2SYM(rb_intern("undefined_restrictive")), INT2NUM(USPOOF_UNDEFINED_RESTRICTIVE));
rb_iv_set(klass, k_restriction_level_name, iv);
}
return iv;
}
void init_icu_spoof_checker(void)
{
rb_cICU_SpoofChecker = rb_define_class_under(rb_mICU, "SpoofChecker", rb_cObject);
rb_define_singleton_method(rb_cICU_SpoofChecker, "available_checks", spoof_checker_available_checks, 0);
rb_define_singleton_method(rb_cICU_SpoofChecker, "available_restriction_levels", spoof_checker_available_restriction_levels, 0);
rb_define_alloc_func(rb_cICU_SpoofChecker, spoof_checker_alloc);
rb_define_method(rb_cICU_SpoofChecker, "initialize", spoof_checker_initialize, 0);
rb_define_method(rb_cICU_SpoofChecker, "restriction_level", spoof_checker_get_restriction_level, 0);
rb_define_method(rb_cICU_SpoofChecker, "restriction_level=", spoof_checker_set_restriction_level, 1);
rb_define_method(rb_cICU_SpoofChecker, "check", spoof_checker_check, 1);
rb_define_method(rb_cICU_SpoofChecker, "checks", spoof_checker_get_checks, 0);
rb_define_method(rb_cICU_SpoofChecker, "checks=", spoof_checker_set_checks, 1);
rb_define_method(rb_cICU_SpoofChecker, "confusable?", spoof_checker_confusable, 2);
rb_define_method(rb_cICU_SpoofChecker, "get_skeleton", spoof_checker_get_skeleton, 1);
}
#undef DEFINE_SPOOF_ENUM_CONST
#undef GET_SPOOF_CHECKER
/* vim: set expandtab sws=4 sw=4: */
| mit |
binhbat/binhbat.github.io | _drafts/1/it/_posts/2016-08-08-227_q7t1.md | 99 | ---
layout: sieutv
title: it 227
tags: [ittv]
thumb_re: q7t1227
---
{% include q7t1 key="227" %}
| mit |
webkom/jubileum.abakus.no | pages/index.js | 1320 | import { Component } from 'react';
import format from '../components/format';
import parse from 'date-fns/parse';
import getDay from 'date-fns/get_day';
import Media from 'react-media';
import Page from '../layouts/Page';
import TimelineView from '../components/TimelineView';
import ListView from '../components/ListView';
import db from '../events';
export default class extends Component {
static async getInitialProps({ query }) {
const response = db
.map((event, id) => ({
...event,
id
}))
.filter((event) => {
if (!query.day) {
return true;
}
return getDay(event.startsAt) === parseInt(query.day, 10);
});
const events = await Promise.resolve(response);
return {
events: events.reduce((groupedByDay, event) => {
const day = format(event.startsAt, 'dddd');
groupedByDay[day] = [...(groupedByDay[day] || []), event];
return groupedByDay;
}, {})
};
}
render() {
return (
<Page title="Arrangementer">
<Media
query="(max-width: 799px)"
>
{(matches) => {
const Component = matches ? ListView : TimelineView;
return <Component events={this.props.events} />;
}}
</Media>
</Page>
);
}
}
| mit |
tokka2/tokka2.github.io | _posts/2016-06-11-elecom-hdd-usb3-2tb-white-hd-hd-sg2.0u3wh-d-nttx-6980.md | 1478 | ---
title: エレコム 3.5インチ外付けHDD/USB3.0/2.0TB/ホワイト HD-SG2.0U3WH-Dが特価6,980円!送料無料!
author: 激安・格安・特価情報ツウ
layout: post
date: 2016-06-10 23:00:10
permalink: /pc/elecom-hdd-usb3-2tb-white-hd-hd-sg2.0u3wh-d-nttx-6980.html
categories:
- 外付けHDD
---
<div class="img-bg2 img_L">
<a href="//px.a8.net/svt/ejp?a8mat=ZYP6S+8IMA3E+S1Q+BWGDT&a8ejpredirect=//nttxstore.jp/_II_EL15275362" target="_blank"><img border="0" alt="エレコム 3.5インチ外付けHDD/USB3.0/2.0TB/ホワイト HD-SG2.0U3WH-D" src="//image.nttxstore.jp/l2_images/E/EL/EL15275362.jpg" data-recalc-dims="1" /></a>
</div>
### エレコム 3.5インチ外付けHDD/USB3.0/2.0TB/ホワイト HD-SG2.0U3WH-D
<!--more-->
* 対応パソコン:標準でUSB3.0またはUSB2.0ポートを搭載したパソコンおよびAppleMacシリーズ
* 対応OS:Windows10、8.1、8、7/MacOSX10.11、10.10、10.9、10.8
* 容量:2TB
* PC電源連動:○
<br clear="all" />7,980円(税込)+期間限定:1,000円割引 = 激安特価 <span class="tokka-price"><strong>8,980</strong></span> 円(税込)**送料無料**
<価格比較サイト最安値 他店: 7,980円>
NTT-Xにて激安特価情報を見る: <span class="fs150p"><a href="//px.a8.net/svt/ejp?a8mat=ZYP6S+8IMA3E+S1Q+BWGDT&a8ejpredirect=//nttxstore.jp/_II_EL15275362" target="_blank">エレコム 3.5インチ外付けHDD/USB3.0/2.0TB/ホワイト HD-SG2.0U3WH-D</a></span>
| mit |
vlad3489/ExampleOfCode | README.md | 229 | ### Explanation:
[home.js](https://github.com/vlad3489/ExampleOfCode/blob/master/home.js) - fragment code from project "Moe Misto"
[opening.js](https://github.com/vlad3489/ExampleOfCode/blob/master/opening.cs) - code from game
| mit |
Mathias9807/Vulkan-Demo | src/main.c | 1993 | /*
* Simple Vulkan application
*
* Copyright (c) 2016 by Mathias Johansson
*
* This code is licensed under the MIT license
* https://opensource.org/licenses/MIT
*/
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "util/vulkan.h"
#include "util/window.h"
int main() {
// Create an instance of vulkan
createInstance("Vulkan");
setupDebugging();
getDevice();
openWindow();
createCommandPool();
createCommandBuffer();
prepRender();
beginCommands();
VkClearColorValue clearColor = {
.uint32 = {1, 0, 0, 1}
};
VkImageMemoryBarrier preImageBarrier = {
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL,
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
| VK_IMAGE_USAGE_TRANSFER_DST_BIT,
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
| VK_IMAGE_USAGE_TRANSFER_DST_BIT,
VK_IMAGE_LAYOUT_UNDEFINED,
VK_IMAGE_LAYOUT_GENERAL, queueFam,
queueFam, swapImages[nextImage],
swapViewInfos[nextImage].subresourceRange
};
vkCmdPipelineBarrier(
comBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_TRANSFER_BIT,
0, 0, NULL, 0, NULL, 1, &preImageBarrier
);
vkCmdClearColorImage(
comBuffer, swapImages[nextImage], VK_IMAGE_LAYOUT_GENERAL,
&clearColor, 1, &swapViewInfos[nextImage].subresourceRange
);
VkImageMemoryBarrier postImageBarrier = {
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL,
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
| VK_IMAGE_USAGE_TRANSFER_DST_BIT,
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
| VK_IMAGE_USAGE_TRANSFER_DST_BIT,
VK_IMAGE_LAYOUT_GENERAL,
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, VK_QUEUE_FAMILY_IGNORED,
VK_QUEUE_FAMILY_IGNORED, swapImages[nextImage],
swapViewInfos[nextImage].subresourceRange
};
vkCmdPipelineBarrier(
comBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
0, 0, NULL, 0, NULL, 1, &postImageBarrier
);
endCommands();
submitCommandBuffer();
tickWindow();
sleep(3);
// DESTROY
destroyInstance();
quitWindow();
return 0;
}
| mit |
gamejolt/gamejolt | src/_common/game/package/purchase-modal/purchase-modal.service.ts | 761 | import { defineAsyncComponent } from 'vue';
import { showModal } from '../../../modal/modal.service';
import { User } from '../../../user/user.model';
import { GameBuild } from '../../build/build.model';
import { Game } from '../../game.model';
import { GamePackage } from '../package.model';
interface GamePackagePurchaseModalOptions {
game: Game;
package: GamePackage;
build: GameBuild | null;
fromExtraSection: boolean;
partnerKey?: string;
partner?: User;
}
export class GamePackagePurchaseModal {
static async show(options: GamePackagePurchaseModalOptions) {
return await showModal<void>({
modalId: 'GamePackagePurchase',
component: defineAsyncComponent(() => import('./purchase-modal.vue')),
size: 'sm',
props: options,
});
}
}
| mit |
lgcarrier/APEXFramework | 5.2.3/Database/Constraints/AFW_04_CONTX_ETEND_FK1.sql | 200 | SET DEFINE OFF;
ALTER TABLE AFW_04_CONTX_ETEND ADD (
CONSTRAINT AFW_04_CONTX_ETEND_FK1
FOREIGN KEY (REF_CONTX)
REFERENCES AFW_04_CONTX (REF_FIL_ARIAN)
ON DELETE CASCADE
ENABLE VALIDATE)
/
| mit |
gazzlab/LSL-gazzlab-branch | liblsl/external/lslboost/asio/detail/win_iocp_socket_recvfrom_op.hpp | 4108 | //
// detail/win_iocp_socket_recvfrom_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.lslboost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP
#define BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <lslboost/asio/detail/config.hpp>
#if defined(BOOST_ASIO_HAS_IOCP)
#include <lslboost/utility/addressof.hpp>
#include <lslboost/asio/detail/bind_handler.hpp>
#include <lslboost/asio/detail/buffer_sequence_adapter.hpp>
#include <lslboost/asio/detail/fenced_block.hpp>
#include <lslboost/asio/detail/handler_alloc_helpers.hpp>
#include <lslboost/asio/detail/handler_invoke_helpers.hpp>
#include <lslboost/asio/detail/operation.hpp>
#include <lslboost/asio/detail/socket_ops.hpp>
#include <lslboost/asio/error.hpp>
#include <lslboost/asio/detail/push_options.hpp>
namespace lslboost {
namespace asio {
namespace detail {
template <typename MutableBufferSequence, typename Endpoint, typename Handler>
class win_iocp_socket_recvfrom_op : public operation
{
public:
BOOST_ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_recvfrom_op);
win_iocp_socket_recvfrom_op(Endpoint& endpoint,
socket_ops::weak_cancel_token_type cancel_token,
const MutableBufferSequence& buffers, Handler& handler)
: operation(&win_iocp_socket_recvfrom_op::do_complete),
endpoint_(endpoint),
endpoint_size_(static_cast<int>(endpoint.capacity())),
cancel_token_(cancel_token),
buffers_(buffers),
handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
{
}
int& endpoint_size()
{
return endpoint_size_;
}
static void do_complete(io_service_impl* owner, operation* base,
const lslboost::system::error_code& result_ec,
std::size_t bytes_transferred)
{
lslboost::system::error_code ec(result_ec);
// Take ownership of the operation object.
win_iocp_socket_recvfrom_op* o(
static_cast<win_iocp_socket_recvfrom_op*>(base));
ptr p = { lslboost::addressof(o->handler_), o, o };
BOOST_ASIO_HANDLER_COMPLETION((o));
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
// Check whether buffers are still valid.
if (owner)
{
buffer_sequence_adapter<lslboost::asio::mutable_buffer,
MutableBufferSequence>::validate(o->buffers_);
}
#endif // defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
socket_ops::complete_iocp_recvfrom(o->cancel_token_, ec);
// Record the size of the endpoint returned by the operation.
o->endpoint_.resize(o->endpoint_size_);
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
// with the handler. Consequently, a local copy of the handler is required
// to ensure that any owning sub-object remains valid until after we have
// deallocated the memory here.
detail::binder2<Handler, lslboost::system::error_code, std::size_t>
handler(o->handler_, ec, bytes_transferred);
p.h = lslboost::addressof(handler.handler_);
p.reset();
// Make the upcall if required.
if (owner)
{
fenced_block b(fenced_block::half);
BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
lslboost_asio_handler_invoke_helpers::invoke(handler, handler.handler_);
BOOST_ASIO_HANDLER_INVOCATION_END;
}
}
private:
Endpoint& endpoint_;
int endpoint_size_;
socket_ops::weak_cancel_token_type cancel_token_;
MutableBufferSequence buffers_;
Handler handler_;
};
} // namespace detail
} // namespace asio
} // namespace lslboost
#include <lslboost/asio/detail/pop_options.hpp>
#endif // defined(BOOST_ASIO_HAS_IOCP)
#endif // BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP
| mit |
cedesk/cedesk.github.io | pages/references.md | 2748 | ---
layout: page
subheadline: "The software is and was used in research on concurrent conceptual design of complex systems"
title: "References"
teaser:
categories:
tags:
header: no
permalink: "/references/"
---
### CERA 2017
The tool CEDESK and a processguide for concurrent conceptual design is descibed in a paper in a special issue of the [Journal on Concurrent Engineering Research and Applications](http://journals.sagepub.com/home/cer).
Knoll, Dominik, and Alessandro Golkar. 2016. “A Coordination Method for Concurrent Design and a Collaboration Tool for Parametric System Models.” In SECESA 2016, Madrid, 1–11. [doi:10.1177/1063293X17732374](http://journals.sagepub.com/doi/abs/10.1177/1063293X17732374).
The release of CEDESK as open source software was covered by [Skoltech News](http://www.skoltech.ru/en/2017/08/skoltech-research-team-releases-cutting-edge-concurrent-engineering-software/).
### PLM Conference 2017
The data structures and conceptual modeling approach was presented at the Annual [PLM Conference](http://www.plm-conference.org), in Seville, July 2017.
Fortin, Clément, Grant Mcsorley, Dominik Knoll, Alessandro Golkar, and Ralina Tsykunova. 2017. “Study of Data Structures and Tools for the Concurrent Conceptual Design of Complex Space Systems.” In IFIP 14th International Conference on Product Lifecycle Management 9-12 July 2017, Seville, Spain. Seville. [doi:10.1007/978-3-319-72905-3_53](https://doi.org/10.1007/978-3-319-72905-3_53).
### SECESA 2016
CEDESK was first presented on the [Systems Engineering and Concurrent Engineering for Space Applications](http://www.esa.int/Our_Activities/Space_Engineering_Technology/CDF/Systems_and_Concurrent_Engineering_for_Space_Applications_SECESA_2016) conference held 5-7 October 2016 in Madrid.
Presentation slides available at [ResearchGate](https://www.researchgate.net/publication/318641101_A_coordination_method_for_concurrent_design_and_a_collaboration_tool_for_parametric_system_models).
Our successful presentation was covered by [Skoltech News](http://www.skoltech.ru/en/2016/11/the-paper-of-skoltech-phd-student-is-one-of-the-top-10-at-the-secesa-2016-conference-of-the-european-space-agency/).
### INCOSE Symposium 2016
We have developed a concurrent design laboratory at the Skolkovo Institute of Science and Technology where CEDESK is being developed. Our learnings from the process were presented at the [INCOSE Symosium 2016](http://www.incose.org/symp2016/home).
Golkar, A. (2016), Lessons learnt in the development of a Concurrent Engineering Infrastructure. INCOSE International Symposium, 26: 1759–1769. [doi:10.1002/j.2334-5837.2016.00259.x](http://onlinelibrary.wiley.com/doi/10.1002/j.2334-5837.2016.00259.x/abstract)
| mit |
tadzik/rakudobrew | lib/Rakudobrew/ShellHook/Sh.pm | 1246 | package Rakudobrew::ShellHook::Sh;
use strict;
use warnings;
use 5.010;
use File::Spec::Functions qw(catdir splitpath);
use FindBin qw($RealBin $RealScript);
use Rakudobrew::Variables;
use Rakudobrew::Tools;
use Rakudobrew::VersionHandling;
use Rakudobrew::ShellHook;
use Rakudobrew::Build;
sub get_init_code {
my $path = $ENV{PATH};
$path = Rakudobrew::ShellHook::clean_path($path, $RealBin);
$path = "$RealBin:$path";
if (get_brew_mode() eq 'env') {
if (get_global_version() && get_global_version() ne 'system') {
$path = join(':', get_bin_paths(get_global_version()), $path);
}
}
else { # get_brew_mode() eq 'shim'
$path = join(':', $shim_dir, $path);
}
return <<EOT;
export PATH="$path"
$brew_name() {
command $brew_name internal_hooked "\$@" &&
eval "`command $brew_name internal_shell_hook Sh post_call_eval "\$@"`"
}
EOT
}
sub post_call_eval {
Rakudobrew::ShellHook::print_shellmod_code('Sh', @_);
}
sub get_path_setter_code {
my $path = shift;
return "export PATH=\"$path\"";
}
sub get_shell_setter_code {
my $version = shift;
return "export $env_var=\"$version\"";
}
sub get_shell_unsetter_code {
return "unset $env_var";
}
1;
| mit |
Subsets and Splits