text stringlengths 2 1.04M | meta dict |
|---|---|
import TestBase from '../testbase';
TestBase.init();
import Asset from '../model/asset';
import { AssetService, EventType as AssetServiceEventType } from './asset-service';
import TestDispose from '../../node_modules/gs-tools/src/testing/test-dispose';
import { KEY_INDEX } from './asset-service';
describe('asset.AssetService', () => {
let assetService;
let mockStorageService;
beforeEach(() => {
mockStorageService = jasmine.createSpyObj(
'StorageService',
['getItem', 'removeItem', 'setItem']);
assetService = new AssetService(mockStorageService);
TestDispose.add(assetService);
});
describe('deleteAsset', () => {
const ASSET = { id: 'ID' };
beforeEach(() => {
mockStorageService.getItem.and.returnValue([]);
assetService.saveAsset(ASSET);
mockStorageService.setItem.calls.reset();
});
it('should update the storage with the new data and clear the cache', () => {
assetService.deleteAsset(ASSET);
expect(mockStorageService.setItem).toHaveBeenCalledWith(KEY_INDEX, []);
expect(mockStorageService.removeItem).toHaveBeenCalledWith(ASSET.id);
expect(assetService.assets).toEqual({});
});
it('should do nothing if the asset cannot be found', () => {
assetService.deleteAsset({ id: 'id' });
expect(mockStorageService.setItem).not.toHaveBeenCalled();
});
});
describe('hasAssets', () => {
it('should return true if there are assets in local storage', () => {
mockStorageService.getItem.and.returnValue(['a']);
expect(assetService.hasAssets()).toEqual(true);
});
it('should return false if there are no assets in local storage', () => {
mockStorageService.getItem.and.returnValue([]);
expect(assetService.hasAssets()).toEqual(false);
});
});
describe('get assets', () => {
let asset;
beforeEach(() => {
asset = new Asset('test');
});
it('should return the assets stored locally', () => {
mockStorageService.getItem.and.callFake((id: string) => {
if (id === KEY_INDEX) {
return [asset.id];
} else if (id === asset.id) {
return asset;
}
});
expect(assetService.assets).toEqual({ [asset.id]: asset });
});
it('should cache the data', () => {
mockStorageService.getItem.and.callFake((id: string) => {
if (id === KEY_INDEX) {
return [asset.id];
} else if (id === asset.id) {
return asset;
}
});
let assets = assetService.assets;
// Now call again.
mockStorageService.getItem.calls.reset();
expect(assetService.assets).toEqual(assets);
expect(mockStorageService.getItem).not.toHaveBeenCalled();
});
});
describe('getAsset', () => {
let asset1;
let asset2;
beforeEach(() => {
asset1 = new Asset('asset1');
asset2 = new Asset('asset2');
let data = {
[asset1.id]: asset1,
[asset2.id]: asset2,
[KEY_INDEX]: [asset1.id, asset2.id],
};
mockStorageService.getItem.and.callFake((id: string) => data[id]);
});
it('should return the correct asset', () => {
expect(assetService.getAsset(asset2.id)).toEqual(asset2);
});
it('should return null if the asset does not exist', () => {
expect(assetService.getAsset('non-existent')).toEqual(null);
});
});
describe('saveAsset', () => {
let $mdToastBuilder;
let asset;
beforeEach(() => {
asset = new Asset('test');
$mdToastBuilder = jasmine.createSpyBuilder('$mdToastBuilder', ['position', 'textContent']);
});
it('should update the storage', () => {
mockStorageService.getItem.and.returnValue([]);
spyOn(assetService, 'dispatch');
assetService.saveAsset(asset);
expect(mockStorageService.setItem).toHaveBeenCalledWith(KEY_INDEX, [asset.id]);
expect(mockStorageService.setItem).toHaveBeenCalledWith(asset.id, asset);
expect(assetService.dispatch).toHaveBeenCalledWith(AssetServiceEventType.SAVED, asset);
});
it('should invalidate the cache', () => {
mockStorageService.getItem.and.callFake((id: string) => {
if (id === KEY_INDEX) {
return [asset.id];
} else if (id === asset.id) {
return asset;
}
});
let assets = assetService.assets;
let newAsset = new Asset('test2');
assetService.saveAsset(newAsset);
mockStorageService.getItem.calls.reset();
mockStorageService.getItem.and.callFake((id: string) => {
if (id === KEY_INDEX) {
return <any> ([newAsset.id]);
} else if (id === newAsset.id) {
return newAsset;
}
});
expect(assetService.assets).not.toEqual(assets);
expect(mockStorageService.getItem).toHaveBeenCalled();
});
it('should not add duplicated ID', () => {
mockStorageService.getItem.and.returnValue([asset.id]);
assetService.saveAsset(asset);
expect(mockStorageService.setItem).not.toHaveBeenCalledWith(KEY_INDEX, jasmine.any(Array));
});
});
});
| {
"content_hash": "9209b2cb836a43984363cd6879b33193",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 97,
"avg_line_length": 29.63005780346821,
"alnum_prop": 0.6094420600858369,
"repo_name": "garysoed/protocard",
"id": "1c57f3fef2e8bce08ff0c879194747ed887cee50",
"size": "5126",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/asset/asset-service_test.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6001"
},
{
"name": "HTML",
"bytes": "3036"
},
{
"name": "JavaScript",
"bytes": "16381"
},
{
"name": "Shell",
"bytes": "50"
},
{
"name": "TypeScript",
"bytes": "302881"
}
],
"symlink_target": ""
} |
ActiveRecord::Schema.define :version => 0 do
create_table "command_statuses", :force => true do |t|
t.string "key", :limit => 100
t.string "status", :limit => 50
t.integer "total_count"
t.integer "success_count"
t.string "message"
t.datetime "created_at"
t.datetime "updated_at"
t.string "failed_instance"
end
create_table "dummies", :force => true do |t|
t.integer "kind"
t.string "name"
end
end
| {
"content_hash": "e7c64a1ca9688bfaaa38de6d0bafc5ee",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 56,
"avg_line_length": 28.11764705882353,
"alnum_prop": 0.5878661087866108,
"repo_name": "ggordon/command_status_apparatus",
"id": "940d45e314448198f6ad3b0227e40bb508339fd0",
"size": "478",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/schema.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "9780"
}
],
"symlink_target": ""
} |
package com.facebook.buck.jvm.java.abi;
import com.facebook.buck.javacd.model.AbiGenerationMode;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
public abstract class StubJarEntry {
@Nullable
static StubJarEntry of(
LibraryReader input,
Path path,
AbiGenerationMode compatibilityMode,
boolean isKotlinModule,
Map<String, List<String>> inlineFunctions)
throws IOException {
if (isStubbableResource(input, path)) {
return StubJarResourceEntry.of(input, path);
} else if (input.isClass(path)) {
return StubJarClassEntry.of(input, path, compatibilityMode, isKotlinModule, inlineFunctions);
}
return null;
}
public abstract void write(StubJarWriter writer);
public abstract List<String> getInlineMethods();
private static boolean isStubbableResource(LibraryReader input, Path path) {
return input.isResource(path);
}
}
| {
"content_hash": "6ef811b0cd3911d532d66c3789f9592b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 99,
"avg_line_length": 26.756756756756758,
"alnum_prop": 0.7383838383838384,
"repo_name": "JoelMarcey/buck",
"id": "02bd1ba328f7954e8c42d119ecf135d29025a1c6",
"size": "1606",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "src/com/facebook/buck/jvm/java/abi/StubJarEntry.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "579"
},
{
"name": "Batchfile",
"bytes": "2093"
},
{
"name": "C",
"bytes": "255521"
},
{
"name": "C#",
"bytes": "237"
},
{
"name": "C++",
"bytes": "10992"
},
{
"name": "CSS",
"bytes": "54863"
},
{
"name": "D",
"bytes": "1017"
},
{
"name": "Go",
"bytes": "16819"
},
{
"name": "Groovy",
"bytes": "3362"
},
{
"name": "HTML",
"bytes": "6115"
},
{
"name": "Haskell",
"bytes": "895"
},
{
"name": "IDL",
"bytes": "385"
},
{
"name": "Java",
"bytes": "19430296"
},
{
"name": "JavaScript",
"bytes": "932672"
},
{
"name": "Kotlin",
"bytes": "2079"
},
{
"name": "Lex",
"bytes": "2731"
},
{
"name": "Makefile",
"bytes": "1816"
},
{
"name": "Matlab",
"bytes": "47"
},
{
"name": "OCaml",
"bytes": "4384"
},
{
"name": "Objective-C",
"bytes": "138150"
},
{
"name": "Objective-C++",
"bytes": "34"
},
{
"name": "PowerShell",
"bytes": "244"
},
{
"name": "Prolog",
"bytes": "858"
},
{
"name": "Python",
"bytes": "1786899"
},
{
"name": "Roff",
"bytes": "1109"
},
{
"name": "Rust",
"bytes": "3618"
},
{
"name": "Scala",
"bytes": "4906"
},
{
"name": "Shell",
"bytes": "49876"
},
{
"name": "Smalltalk",
"bytes": "3355"
},
{
"name": "Standard ML",
"bytes": "15"
},
{
"name": "Swift",
"bytes": "6897"
},
{
"name": "Thrift",
"bytes": "26256"
},
{
"name": "Yacc",
"bytes": "323"
}
],
"symlink_target": ""
} |
<?php
/**
* ddOnlineStoreProduct actions.
*
* @package ddOnlineStorePlugin
* @subpackage ddOnlineStoreProduct
* @author Diego Damico <songecko@gmail.com>
*/
class ddOnlineStoreProductActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
// sorting
if($request->getParameter('sort') && $this->isValidSortColumn($request->getParameter('sort')))
{
$this->setSort(array($request->getParameter('sort'), $request->getParameter('sort_type')));
}
// pager
if($request->getParameter('page'))
{
$this->setPage($request->getParameter('page'));
}else
{
$this->setPage(1);
}
$this->pager = $this->getPager();
$this->sort = $this->getSort();
$this->attributes = array('includeSort' => true, 'route_name' => 'localized_homepage');
}
public function executeFilter(sfWebRequest $request)
{
$this->setPage(1);
if ($request->hasParameter('_reset'))
{
$this->setFilters(array());
$this->redirect('@online_store_admin_product');
}
$this->filters = $this->configuration->getFilterForm($this->getFilters());
$this->filters->bind($request->getParameter($this->filters->getName()));
if ($this->filters->isValid())
{
$this->setFilters($this->filters->getValues());
$this->redirect('@online_store_admin_product');
}
$this->pager = $this->getPager();
$this->sort = $this->getSort();
$this->setTemplate('index');
}
protected function getFilters()
{
return $this->getUser()->getAttribute('ddOnlineStoreProduct.filters', array(), 'product_module');
}
protected function setFilters(array $filters)
{
return $this->getUser()->setAttribute('ddOnlineStoreProduct.filters', $filters, 'product_module');
}
protected function getPager()
{
$pager = new sfDoctrinePager('Product', 16);
$pager->setQuery($this->buildQuery());
$pager->setPage($this->getPage());
$pager->init();
return $pager;
}
protected function setPage($page)
{
$this->getUser()->setAttribute('ddOnlineStoreProduct.page', $page, 'product_module');
}
protected function getPage()
{
return $this->getUser()->getAttribute('ddOnlineStoreProduct.page', 1, 'product_module');
}
/**
* @return Doctrine_Query
*/
protected function buildQuery()
{
//Filters
if (null === $this->filters)
{
$this->filters = new ProductFormFilter($this->getFilters(), array());
}
$this->filters->setTableMethod('');
$query = $this->filters->buildQuery($this->getFilters());
//Sort
$this->addSortQuery($query);
return $query;
}
protected function addSortQuery($query)
{
if (array(null, null) == ($sort = $this->getSort()))
{
return;
}
if (!in_array(strtolower($sort[1]), array('asc', 'desc')))
{
$sort[1] = 'asc';
}
$query->addOrderBy($sort[0] . ' ' . $sort[1]);
}
protected function getSort()
{
if (null !== $sort = $this->getUser()->getAttribute('ddOnlineStoreProduct.sort', null, 'product_module'))
{
return $sort;
}
$this->setSort(array('is_featured', 'desc'));
return $this->getUser()->getAttribute('ddOnlineStoreProduct.sort', null, 'product_module');
}
protected function setSort(array $sort)
{
if (null !== $sort[0] && null === $sort[1])
{
$sort[1] = 'asc';
}
$this->getUser()->setAttribute('ddOnlineStoreProduct.sort', $sort, 'product_module');
}
protected function isValidSortColumn($column)
{
return ProductTable::getInstance()->hasColumn($column);
}
}
| {
"content_hash": "50cb5d836c5eff8c43ca9380f7e00d1e",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 107,
"avg_line_length": 22.651315789473685,
"alnum_prop": 0.6479814115596864,
"repo_name": "Symfony-Plugins/ddOnlineStorePlugin",
"id": "521229497345bb0625a797c40405b76c078037d7",
"size": "3443",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/ddOnlineStoreProduct/actions/actions.class.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "33839"
},
{
"name": "PHP",
"bytes": "51440"
}
],
"symlink_target": ""
} |
A customizable rule-based application that accepts standardized, but flexible, JSON statements. Based on those statements, the Event Alerts system sends out notices on an instant or summarized basis.
@todo
## Installation
Lifecycle Activity Alerts can be installed with [Composer](http://getcomposer.org)
by adding it as a dependency to your project's composer.json file.
```json
{
"require": {
"jasonevans1/lifecycle-activity-alerts": "*"
}
}
```
Please refer to [Composer's documentation](https://github.com/composer/composer/blob/master/doc/00-intro.md#introduction)
for more detailed installation and usage instructions.
## Usage
@todo
| {
"content_hash": "23c5557d0e11e1913c942fe57f46a771",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 199,
"avg_line_length": 28.82608695652174,
"alnum_prop": 0.7571644042232277,
"repo_name": "jasonevans1/lifecycle-activity-alerts",
"id": "f0495061ccbd15649902932a64ebff12a8ed7b47",
"size": "692",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "430071"
},
{
"name": "Perl",
"bytes": "2808"
}
],
"symlink_target": ""
} |
layout: page
title: "Kyle Mcelroy"
comments: true
description: "blanks"
keywords: "Kyle Mcelroy,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
font-family: "Bebas Neue";
src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
}
h1.Bebas {
font-family: "Bebas Neue", Verdana, Tahoma;
}
</style>
</head>
#### TEACHING INFORMATION
**College**: College of Arts and Sciences
**Classes taught**: PHYS 1010, PHYS 2020, PHYS 2130, PHYS 2150, PHYS 2210, PHYS 3210, PHYS 3310, PHYS 3330, PHYS 3340, PHYS 4340, PHYS 4430
#### PHYS 1010: Physics of Everyday Life 1
**Terms taught**: Fall 2014
**Instructor rating**: 5.07
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 3.1
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 2.35
**Standard deviation in workload** (raw): 0.0
#### PHYS 2020: General Physics 2
**Terms taught**: Fall 2012
**Instructor rating**: 5.88
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 2.88
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 3.16
**Standard deviation in workload** (raw): 0.0
#### PHYS 2130: General Physics 3
**Terms taught**: Spring 2011, Spring 2012
**Instructor rating**: 4.7
**Standard deviation in instructor rating**: 0.14
**Average grade** (4.0 scale): 2.87
**Standard deviation in grades** (4.0 scale): 0.08
**Average workload** (raw): 2.92
**Standard deviation in workload** (raw): 0.0
#### PHYS 2150: EXPERIMENTAL PHYSICS
**Terms taught**: Fall 2009
**Instructor rating**: 0.0
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 3.07
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 0.0
**Standard deviation in workload** (raw): 0.0
#### PHYS 2210: Classical Mechanics and Mathematical Methods 1
**Terms taught**: Spring 2013, Spring 2014
**Instructor rating**: 5.02
**Standard deviation in instructor rating**: 0.05
**Average grade** (4.0 scale): 2.92
**Standard deviation in grades** (4.0 scale): 0.16
**Average workload** (raw): 3.28
**Standard deviation in workload** (raw): 0.13
#### PHYS 3210: Classical Mechanics and Mathematical Methods 2
**Terms taught**: Spring 2015
**Instructor rating**: 4.51
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 3.01
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 3.6
**Standard deviation in workload** (raw): 0.0
#### PHYS 3310: Principles of Electricity and Magnetism 1
**Terms taught**: Spring 2016
**Instructor rating**: 4.59
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 2.86
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 3.84
**Standard deviation in workload** (raw): 0.0
#### PHYS 3330: ELECTRONICS PHYS SCIENCE
**Terms taught**: Fall 2007, Fall 2008
**Instructor rating**: 4.97
**Standard deviation in instructor rating**: 0.14
**Average grade** (4.0 scale): 3.39
**Standard deviation in grades** (4.0 scale): 0.03
**Average workload** (raw): 2.24
**Standard deviation in workload** (raw): 0.81
#### PHYS 3340: INTRO/RSCH/OPTICAL PHYS
**Terms taught**: Spring 2007, Spring 2008
**Instructor rating**: 0.0
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 3.35
**Standard deviation in grades** (4.0 scale): 0.08
**Average workload** (raw): 0.0
**Standard deviation in workload** (raw): 0.0
#### PHYS 4340: INTRO-SOLID STATE PHYSIC
**Terms taught**: Spring 2009, Spring 2010
**Instructor rating**: 4.38
**Standard deviation in instructor rating**: 0.38
**Average grade** (4.0 scale): 2.94
**Standard deviation in grades** (4.0 scale): 0.13
**Average workload** (raw): 3.08
**Standard deviation in workload** (raw): 0.17
#### PHYS 4430: Advanced Laboratory
**Terms taught**: Fall 2015
**Instructor rating**: 0.0
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 3.81
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 0.0
**Standard deviation in workload** (raw): 0.0
| {
"content_hash": "e5d481834bc2f0825b2600ce5303746d",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 139,
"avg_line_length": 22.044554455445546,
"alnum_prop": 0.6795418818773861,
"repo_name": "nikhilrajaram/nikhilrajaram.github.io",
"id": "2d86e67b9cad198b7a12b3c305c090b1ff4ffa8f",
"size": "4457",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "instructors/Kyle_Mcelroy.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15727"
},
{
"name": "HTML",
"bytes": "48339721"
},
{
"name": "Python",
"bytes": "9692"
},
{
"name": "Ruby",
"bytes": "5940"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_80) on Wed Oct 12 20:49:58 CEST 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.apache.flume.sink.kite.policy.RetryPolicy (Apache Flume 1.7.0 API)</title>
<meta name="date" content="2016-10-12">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.flume.sink.kite.policy.RetryPolicy (Apache Flume 1.7.0 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/apache/flume/sink/kite/policy/RetryPolicy.html" title="class in org.apache.flume.sink.kite.policy">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/flume/sink/kite/policy/class-use/RetryPolicy.html" target="_top">Frames</a></li>
<li><a href="RetryPolicy.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.flume.sink.kite.policy.RetryPolicy" class="title">Uses of Class<br>org.apache.flume.sink.kite.policy.RetryPolicy</h2>
</div>
<div class="classUseContainer">No usage of org.apache.flume.sink.kite.policy.RetryPolicy</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/apache/flume/sink/kite/policy/RetryPolicy.html" title="class in org.apache.flume.sink.kite.policy">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/flume/sink/kite/policy/class-use/RetryPolicy.html" target="_top">Frames</a></li>
<li><a href="RetryPolicy.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2009-2016 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>
| {
"content_hash": "be9c0999c512c94336fc0fddecc2eb1e",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 153,
"avg_line_length": 39.15384615384615,
"alnum_prop": 0.6086007421960271,
"repo_name": "wangchuande/apache-flume-1.7.0",
"id": "b9cb7cf4e7a62ce0a4cd75a79a484d16a4fabe72",
"size": "4581",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "docs/apidocs/org/apache/flume/sink/kite/policy/class-use/RetryPolicy.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "936"
},
{
"name": "PowerShell",
"bytes": "14176"
},
{
"name": "Shell",
"bytes": "12491"
}
],
"symlink_target": ""
} |
<?xml version='1.0' encoding='utf-8'?>
<!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' lang='en' xml:lang='en'>
<head>
<meta http-equiv='Content-type' content='application/xhtml+xml; charset=utf-8' />
<title>pipeline_system_deleter</title>
<style type="text/css">
body {margin: 2em; font-family: arial, verdana, sans-serif;}
</style>
</head>
<body>
<h1 class="title">Transformer documentation: <em>pipeline_system_deleter</em></h1>
<div id="toc" class="toc">
<ul>
<li><a href="#purpose">Transformer Purpose</a></li>
<li><a href="#inputReqs">Input Requirements</a></li>
<li><a href="#output">Output</a>
<ul>
<li><a href="#success">On success</a></li>
<li><a href="#failure">On error</a></li>
</ul>
</li>
<li><a href="#config">Configuration/Customization</a>
<ul>
<li><a href="#params">Parameters (tdf)</a></li>
<li><a href="#extConfig">Extended configurability</a></li>
</ul>
</li>
<li><a href="#future">Further development</a></li>
<li><a href="#dependencies">Dependencies</a></li>
<li><a href="#owner">Author</a></li>
<li><a href="#licensing">Licensing</a></li>
</ul>
</div>
<h2 id="purpose">Transformer Purpose</h2>
<p>Delete resources on the file system. Typically used to clean up temporary files created during Job execution.</p>
<h2 id="inputReqs">Input Requirements</h2>
<p>One pathspec of a file or a directory.</p>
<h2 id="output">Output</h2>
<p>Nothing.</p>
<h3 id="success">On success</h3>
<p>The file, or the directory and all its descendants, deleted.</p>
<h3 id="failure">On error</h3>
<p>On deletion failure, this transformer will send an error message, but still return true.</p>
<h2 id="config">Configuration/Customization</h2>
<h3 id="params">Parameters (tdf)</h3>
<dl id="paramslist">
<dt>input</dt>
<dd>path spec of resource to delete</dd>
<dt>active</dt>
<dd>Boolean on/off - used to allow users to activate/deactivate deletion.</dd>
</dl>
<h3 id="extConfig">Extended configurability</h3>
<p>None at time of writing</p>
<h2 id="future">Further development</h2>
<p>None at time of writing</p>
<h2 id="dependencies">Dependencies</h2>
<h2 id="owner">Author</h2>
<p>Markus Gylling</p>
<h2 id="licensing">Licensing</h2>
<p>LGPL</p>
</body>
</html> | {
"content_hash": "f723c860f870fd3e8db560935755987b",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 121,
"avg_line_length": 30.155844155844157,
"alnum_prop": 0.6770025839793282,
"repo_name": "sensusaps/RoboBraille.Web.API",
"id": "bb37a7a03de10aae232842615988070e845e8c24",
"size": "2322",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WorkingDirectory/DaisyPipeline/doc/transformers/pipeline_system_deleter.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "109"
},
{
"name": "Batchfile",
"bytes": "300"
},
{
"name": "C#",
"bytes": "1239445"
},
{
"name": "CSS",
"bytes": "67060"
},
{
"name": "HTML",
"bytes": "1830352"
},
{
"name": "JavaScript",
"bytes": "848822"
},
{
"name": "Python",
"bytes": "867517"
},
{
"name": "Shell",
"bytes": "1422"
},
{
"name": "Smalltalk",
"bytes": "3"
},
{
"name": "TeX",
"bytes": "462500"
},
{
"name": "XSLT",
"bytes": "555256"
}
],
"symlink_target": ""
} |
using System;
namespace Thinktecture.IdentityServer.MongoDb
{
/// <summary>
/// This attribute is used to represent a string value
/// for a value in an enum.
/// </summary>
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
public class StringValueAttribute : Attribute, IAttribute<string>
{
#region Constructor
/// <summary>
/// Constructor used to init a StringValue Attribute
/// </summary>
/// <param name="value"></param>
public StringValueAttribute(string value)
{
_value = value;
}
#endregion Constructor
/// <summary>
/// Holds the currency symbol for a value in an enum.
/// </summary>
public string Value
{
get { return _value; }
}
/// <summary>
/// Holds the stringvalue for a value in an enum.
/// </summary>
private readonly string _value;
}
}
| {
"content_hash": "a9e6c8ce37b0b316cbf0a108e57e6fa3",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 86,
"avg_line_length": 25.15,
"alnum_prop": 0.5646123260437376,
"repo_name": "jornfilho/IdentityServer3.MongoDb",
"id": "a86abd871f89fb738fb0e3d276c56d7610f49962",
"size": "1616",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Source/Core.MongoDb/Config/Attribute/StringValueAttribute.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "76980"
}
],
"symlink_target": ""
} |
//
// AsyncVoidMethodBuilder.cs
//
// Authors:
// Marek Safar <marek.safar@gmail.com>
//
// Copyright (C) 2011 Novell, Inc (http://www.novell.com)
// Copyright (C) 2011 Xamarin, Inc (http://www.xamarin.com)
//
// 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.
//
#if NET_4_5
using System.Threading;
namespace System.Runtime.CompilerServices
{
public struct AsyncVoidMethodBuilder
{
static readonly SynchronizationContext null_context = new SynchronizationContext ();
readonly SynchronizationContext context;
IAsyncStateMachine stateMachine;
private AsyncVoidMethodBuilder (SynchronizationContext context)
{
this.context = context;
this.stateMachine = null;
}
public void AwaitOnCompleted<TAwaiter, TStateMachine> (ref TAwaiter awaiter, ref TStateMachine stateMachine)
where TAwaiter : INotifyCompletion
where TStateMachine : IAsyncStateMachine
{
var action = new Action (stateMachine.MoveNext);
awaiter.OnCompleted (action);
}
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine> (ref TAwaiter awaiter, ref TStateMachine stateMachine)
where TAwaiter : ICriticalNotifyCompletion
where TStateMachine : IAsyncStateMachine
{
var action = new Action (stateMachine.MoveNext);
awaiter.UnsafeOnCompleted (action);
}
public static AsyncVoidMethodBuilder Create ()
{
var ctx = SynchronizationContext.Current ?? null_context;
ctx.OperationStarted ();
return new AsyncVoidMethodBuilder (ctx);
}
public void SetException (Exception exception)
{
if (exception == null)
throw new ArgumentNullException ("exception");
try {
context.Post (l => { throw (Exception) l; }, exception);
} finally {
SetResult ();
}
}
public void SetStateMachine (IAsyncStateMachine stateMachine)
{
if (stateMachine == null)
throw new ArgumentNullException ("stateMachine");
if (this.stateMachine != null)
throw new InvalidOperationException ("The state machine was previously set");
this.stateMachine = stateMachine;
}
public void SetResult ()
{
context.OperationCompleted ();
}
public void Start<TStateMachine> (ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine
{
if (stateMachine == null)
throw new ArgumentNullException ("stateMachine");
stateMachine.MoveNext ();
}
}
}
#endif | {
"content_hash": "3de567eab78630d821b9bcb18037cd5b",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 122,
"avg_line_length": 34.37837837837838,
"alnum_prop": 0.6540880503144654,
"repo_name": "couchbasedeps/dotnet-tpl35",
"id": "7f7b7e493d44175f15fd5b650ad8fa8e585c516c",
"size": "3818",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "System.Runtime.CompilerServices/AsyncVoidMethodBuilder.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "417450"
}
],
"symlink_target": ""
} |
import { Task } from "../../src/models";
/**
* Mock implementation of the performSentimentAnalysis method, with a default
* mock implementation that returns a success result.
*/
export const mockPerformSentimentAnalysis = jest
.fn()
.mockImplementation((input: string) => {
return Promise.resolve({
taskName: Task.SENTIMENT,
output: {
score: 0.75,
magnitude: 0.9,
},
});
});
/**
* Mock implementation of the performTextClassification method, with a default
* mock implementation that returns a success result.
*/
export const mockPerformTextClassification = jest
.fn()
.mockImplementation((input: string) => {
return Promise.resolve({
taskName: Task.CLASSIFICATION,
output: ["/Internet & Telecom/Mobile & Wireless"],
});
});
/**
* Mock implementation of the performEntityExtraction method, with a default
* mock implementation that returns a success result.
*/
export const mockPerformEntityExtraction = jest
.fn()
.mockImplementation((input: string) => {
return Promise.resolve({
taskName: Task.ENTITY,
output: {
LOCATION: ["Paris"],
EVENT: ["World cup"],
},
});
});
/**
* Mock implementation of the NlpTaskHandler class.
*/
export const NlpTaskHandlerMock = jest.fn().mockImplementation(() => {
return {
performSentimentAnalysis: mockPerformSentimentAnalysis,
performTextClassification: mockPerformTextClassification,
performEntityExtraction: mockPerformEntityExtraction,
};
});
| {
"content_hash": "c74fc7f3b8d1f50131a53503939fb065",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 26.033898305084747,
"alnum_prop": 0.6790364583333334,
"repo_name": "FirebaseExtended/firestore-nlp-extension",
"id": "c3904e514e310dae91be580bc373704f0817c3b9",
"size": "2131",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "functions/__tests__/mocks/nlpTaskHandlerMocks.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "708"
},
{
"name": "TypeScript",
"bytes": "86572"
}
],
"symlink_target": ""
} |
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details.
*/
#include "2wm.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
/* extern */
void *
emallocz(unsigned int size) {
void *res = calloc(1, size);
if(!res)
eprint("fatal: could not malloc() %u bytes\n", size);
return res;
}
void
eprint(const char *errstr, ...) {
va_list ap;
va_start(ap, errstr);
vfprintf(stderr, errstr, ap);
va_end(ap);
exit(EXIT_FAILURE);
}
void
spawn(Arg *arg) {
static char *shell = NULL;
if(!shell && !(shell = getenv("SHELL")))
shell = "/bin/sh";
if(!arg->cmd)
return;
/* The double-fork construct avoids zombie processes and keeps the code
* clean from stupid signal handlers. */
if(fork() == 0) {
if(fork() == 0) {
if(dpy)
close(ConnectionNumber(dpy));
setsid();
execl(shell, shell, "-c", arg->cmd, (char *)NULL);
fprintf(stderr, "2wm: execl '%s -c %s'", shell, arg->cmd);
perror(" failed");
}
exit(0);
}
wait(0);
}
| {
"content_hash": "8297dc42304b5936d85ed76322245ddd",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 72,
"avg_line_length": 19.64814814814815,
"alnum_prop": 0.6211121583411876,
"repo_name": "DrItanium/2wmr",
"id": "b1eab58bef395d8f772f43c447c66a9642d963a7",
"size": "1061",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "util.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "33232"
}
],
"symlink_target": ""
} |
module uiRenderer {
type Id = string;
type RowTokeyFn = (row:{[key:string]: any}) => string;
interface Element extends microReact.Element {
__elemId:string
}
interface UiWarning {
element: string
row: any[]
warning: string
}
api.ixer.addIndex("ui parent to elements", "uiElement", Indexing.create.collector(["uiElement: parent"]));
api.ixer.addIndex("ui element to attributes", "uiAttribute", Indexing.create.collector(["uiAttribute: element"]));
api.ixer.addIndex("ui element to attribute bindings", "uiAttributeBinding", Indexing.create.collector(["uiAttributeBinding: element"]));
export class UiRenderer {
public warnings:UiWarning[] = [];
constructor(public renderer:microReact.Renderer) {
}
render(roots:(Id|Element)[]):UiWarning[] {
let elems = this.compile(roots);
this.renderer.render(elems);
let warnings = this.warnings;
this.warnings = [];
return warnings;
}
// @NOTE: In the interests of performance, roots will not be checked for ancestry --
// instead of being a noop, specifying a child of a root as another root results in undefined behavior.
// If this becomes a problem, it can be changed in the loop that initially populates compiledElements.
compile(roots:(Id|Element)[]):microReact.Element[] {
let elementToChildren = api.ixer.index("ui parent to elements", true);
let elementToAttrs = api.ixer.index("ui element to attributes", true);
let elementToAttrBindings = api.ixer.index("ui element to attribute bindings", true);
let stack:Element[] = [];
let compiledElements:microReact.Element[] = [];
let compiledKeys:{[id:string]: string} = {};
let keyToRow:{[key:string]: any} = {};
for(let root of roots) {
if(typeof root === "object") {
compiledElements.push(<Element>root);
} else if(typeof root === "string") {
let fact = api.ixer.selectOne("uiElement", {element: root});
let elem:Element = {__elemId: root, id: root};
if(fact && fact["uiElement: parent"]) {
elem.parent = fact["uiElement: parent"];
}
compiledElements.push(elem);
stack.push(elem);
}
}
while(stack.length > 0) {
let elem = stack.shift();
let elemId = elem.__elemId;
let fact = api.ixer.selectOne("uiElement", {element: elemId});
if(!fact) { continue; }
let attrs = elementToAttrs[elemId];
let boundAttrs = elementToAttrBindings[elemId];
let children = elementToChildren[elemId];
let elems = [elem];
let binding = api.ixer.selectOne("uiElementBinding", {element: elemId});
if(binding) {
// If the element is bound, it must be repeated for each row.
var boundView = binding["uiElementBinding: view"];
var rowToKey = this.generateRowToKeyFn(boundView);
let key = compiledKeys[elem.id];
var boundRows = this.getBoundRows(boundView, key);
elems = [];
let ix = 0;
for(let row of boundRows) {
// We need an id unique per row for bound elements.
elems.push({t: elem.t, parent: elem.id, id: `${elem.id}.${ix}`, __elemId: elemId});
keyToRow[rowToKey(row)] = row;
ix++;
}
}
let rowIx = 0;
for(let elem of elems) {
// Get bound key and rows if applicable.
let row, key;
if(binding) {
row = boundRows[rowIx];
key = rowToKey(row);
} else {
key = compiledKeys[elem.id];
row = keyToRow[key];
}
// Handle meta properties.
elem.t = fact["uiElement: tag"];
// Handle static properties.
let properties = [];
if(attrs) {
for(let attr of attrs) {
let {"uiAttribute: property": prop, "uiAttribute: value": val} = attr;
properties.push(prop);
elem[prop] = val;
}
}
// Handle bound properties.
if(boundAttrs) {
for(let attr of boundAttrs) {
let {"uiAttributeBinding: property": prop, "uiAttributeBinding: field": field} = attr;
properties.push(prop);
elem[prop] = row[field];
}
}
// Prep children and add them to the stack.
if(children) {
elem.children = [];
for(let child of children) {
let childId = child["uiElement: element"];
let childElem = {__elemId: childId, id: `${elem.id}__${childId}`};
compiledKeys[childElem.id] = key;
elem.children.push(childElem);
stack.push(childElem);
}
}
// Handle compiled element tags.
let elementCompiler = elementCompilers[elem.t];
if(elementCompiler) {
try {
elementCompiler(elem);
} catch(err) {
let warning = {element: elem.id, row, warning: err.message};
if(!api.ixer.selectOne("uiWarning", warning)) {
this.warnings.push(warning);
}
elem["message"] = warning.warning;
elem["element"] = warning.element;
ui.uiError(<any> elem);
}
}
rowIx++;
}
if(binding) {
elem.children = elems;
}
}
return compiledElements;
}
// Generate a unique key for the given row based on the structure of the given view.
generateRowToKeyFn(viewId:Id):RowTokeyFn {
var keys = api.ixer.getKeys(viewId);
if(keys.length > 1) {
return (row:{}) => {
return `${viewId}: ${keys.map((key) => row[key]).join(",")}`;
};
} else if(keys.length > 0) {
return (row:{}) => {
return `${viewId}: ${row[keys[0]]}`;
}
} else {
return (row:{}) => `${viewId}: ${JSON.stringify(row)}`;
}
}
// Get only the rows of view matching the key (if specified) or all rows from the view if not.
getBoundRows(viewId:Id, key?:any): any[] {
var keys = api.ixer.getKeys(viewId);
if(key && keys.length === 1) {
return api.ixer.select(viewId, {[api.code.name(keys[0])]: key});
} else if(key && keys.length > 0) {
let rowToKey = this.generateRowToKeyFn(viewId);
return api.ixer.select(viewId, {}).filter((row) => rowToKey(row) === key);
} else {
return api.ixer.select(viewId, {});
}
}
}
export type ElementCompiler = (elem:microReact.Element) => void;
export var elementCompilers:{[tag:string]: ElementCompiler} = {
chart: (elem:ui.ChartElement) => {
elem.pointLabels = (elem.pointLabels) ? [<any>elem.pointLabels] : elem.pointLabels;
elem.ydata = (elem.ydata) ? [<any>elem.ydata] : [];
elem.xdata = (elem.xdata) ? [<any>elem.xdata] : elem.xdata;
ui.chart(elem);
}
};
export function addElementCompiler(tag:string, compiler:ElementCompiler) {
if(elementCompilers[tag]) {
throw new Error(`Refusing to overwrite existing compilfer for tag: "${tag}"`);
}
elementCompilers[tag] = compiler;
}
} | {
"content_hash": "7ad7d891675d9c5223b1ce87aad3c7a9",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 138,
"avg_line_length": 35.49514563106796,
"alnum_prop": 0.562363238512035,
"repo_name": "pel-daniel/Eve",
"id": "f64bdce4eff39c50ac95fab2b8790b6b90d31ad3",
"size": "7425",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ui/src/uiRenderer.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "45850"
},
{
"name": "HTML",
"bytes": "43241"
},
{
"name": "Rust",
"bytes": "144033"
},
{
"name": "Shell",
"bytes": "10764"
},
{
"name": "TypeScript",
"bytes": "467737"
}
],
"symlink_target": ""
} |
package net.ichigotake.android.yancha.app.chat;
import android.util.Log;
import org.json.JSONObject;
import io.socket.IOAcknowledge;
import io.socket.IOCallback;
import io.socket.SocketIOException;
public class SocketIoCallback implements IOCallback {
private final String LOG_TAG = "SocketIoCallback";
private final SocketIoEventListener listener;
public SocketIoCallback(SocketIoEventListener listener) {
this.listener = listener;
}
@Override
public void onDisconnect() {
Log.d(LOG_TAG, "disconnect");
listener.onResponse(SocketIoEvent.DISCONNECT, "");
}
@Override
public void onConnect() {
Log.d(LOG_TAG, "onConnect");
listener.onResponse(SocketIoEvent.CONNECT, "");
}
@Override
public void onMessage(String s, IOAcknowledge ioAcknowledge) {
Log.d(LOG_TAG, "onMessage: " + s);
}
@Override
public void onMessage(JSONObject jsonObject, IOAcknowledge ioAcknowledge) {
Log.d(LOG_TAG, "onMessage: " + jsonObject);
}
@Override
public void on(String s, IOAcknowledge ioAcknowledge, Object... objects) {
Log.d(LOG_TAG, "on" + s);
String response = objects != null ? objects[0].toString() : "";
listener.onResponse(SocketIoEvent.dispatch(s), response);
}
@Override
public void onError(SocketIOException e) {
Log.e(LOG_TAG, "error", e);
}
}
| {
"content_hash": "26f0a633b5d122427fe45e6b4e393063",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 79,
"avg_line_length": 26.35185185185185,
"alnum_prop": 0.6661981728742095,
"repo_name": "ichigotake/Android-Yancha",
"id": "5d2c5c7e63e2bd66b687985d727971ab1178023d",
"size": "1423",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "app/src/main/java/net/ichigotake/android/yancha/app/chat/SocketIoCallback.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "4602"
},
{
"name": "IDL",
"bytes": "394"
},
{
"name": "Java",
"bytes": "56526"
}
],
"symlink_target": ""
} |
https://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=7292
| {
"content_hash": "ec7d3819bd7982815b5f85c551727156",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 61,
"avg_line_length": 62,
"alnum_prop": 0.7903225806451613,
"repo_name": "andrewdefries/ToxCast",
"id": "6ee593cf252a15eefd3ea9b53adf21feabc3d4a4",
"size": "62",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Figure4/Tox21_PCIDs/PCID_7292.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C++",
"bytes": "3350"
},
{
"name": "R",
"bytes": "51115"
},
{
"name": "Shell",
"bytes": "7248"
}
],
"symlink_target": ""
} |
package org.apache.geode.cache.client;
import org.apache.geode.cache.*;
/**
* Each enum represents a predefined {@link RegionAttributes} in a {@link ClientCache}. These enum
* values can be used to create regions using a {@link ClientRegionFactory} obtained by calling
* {@link ClientCache#createClientRegionFactory(ClientRegionShortcut)}.
* <p>
* Another way to use predefined region attributes is in cache.xml by setting the refid attribute on
* a region element or region-attributes element to the string of each value.
*
* @since GemFire 6.5
*/
public enum ClientRegionShortcut {
/**
* A PROXY region has no local state and forwards all operations to a server. The actual
* RegionAttributes for a PROXY set the {@link DataPolicy} to {@link DataPolicy#EMPTY}.
*/
PROXY,
/**
* A CACHING_PROXY region has local state but can also send operations to a server. If the local
* state is not found then the operation is sent to the server and the local state is updated to
* contain the server result. The actual RegionAttributes for a CACHING_PROXY set the
* {@link DataPolicy} to {@link DataPolicy#NORMAL}.
*/
CACHING_PROXY,
/**
* A CACHING_PROXY_HEAP_LRU region has local state but can also send operations to a server. If
* the local state is not found then the operation is sent to the server and the local state is
* updated to contain the server result. It will also destroy entries once it detects that the
* java vm is running low of memory. The actual RegionAttributes for a CACHING_PROXY_HEAP_LRU set
* the {@link DataPolicy} to {@link DataPolicy#NORMAL}. and {@link EvictionAttributes} are set to
* {@link EvictionAlgorithm#LRU_HEAP} with {@link EvictionAction#LOCAL_DESTROY}.
*/
CACHING_PROXY_HEAP_LRU,
/**
* A CACHING_PROXY_OVERFLOW region has local state but can also send operations to a server. If
* the local state is not found then the operation is sent to the server and the local state is
* updated to contain the server result. It will also move the values of entries to disk once it
* detects that the java vm is running low of memory. The actual RegionAttributes for a
* CACHING_PROXY_OVERFLOW set the {@link DataPolicy} to {@link DataPolicy#NORMAL}. and
* {@link EvictionAttributes} are set to {@link EvictionAlgorithm#LRU_HEAP} with
* {@link EvictionAction#OVERFLOW_TO_DISK}.
*/
CACHING_PROXY_OVERFLOW,
/**
* A LOCAL region only has local state and never sends operations to a server. The actual
* RegionAttributes for a LOCAL region set the {@link DataPolicy} to {@link DataPolicy#NORMAL}.
*/
LOCAL,
/**
* A LOCAL_PERSISTENT region only has local state and never sends operations to a server but it
* does write its state to disk and can recover that state when the region is created. The actual
* RegionAttributes for a LOCAL_PERSISTENT region set the {@link DataPolicy} to
* {@link DataPolicy#PERSISTENT_REPLICATE}.
*/
LOCAL_PERSISTENT,
/**
* A LOCAL_HEAP_LRU region only has local state and never sends operations to a server. It will
* also destroy entries once it detects that the java vm is running low of memory. The actual
* RegionAttributes for a LOCAL_HEAP_LRU region set the {@link DataPolicy} to
* {@link DataPolicy#NORMAL} and {@link EvictionAttributes} are set to
* {@link EvictionAlgorithm#LRU_HEAP} with {@link EvictionAction#LOCAL_DESTROY}.
*/
LOCAL_HEAP_LRU,
/**
* A LOCAL_OVERFLOW region only has local state and never sends operations to a server. It will
* also move the values of entries to disk once it detects that the java vm is running low of
* memory. The actual RegionAttributes for a LOCAL_OVERFLOW region set the {@link DataPolicy} to
* {@link DataPolicy#NORMAL} and {@link EvictionAttributes} are set to
* {@link EvictionAlgorithm#LRU_HEAP} with {@link EvictionAction#OVERFLOW_TO_DISK}.
*/
LOCAL_OVERFLOW,
/**
* A LOCAL_PERSISTENT_OVERFLOW region only has local state and never sends operations to a server
* but it does write its state to disk and can recover that state when the region is created. It
* will also remove the values of entries from memory once it detects that the java vm is running
* low of memory. The actual RegionAttributes for a LOCAL_PERSISTENT_OVERFLOW region set the
* {@link DataPolicy} to {@link DataPolicy#PERSISTENT_REPLICATE} and {@link EvictionAttributes}
* are set to {@link EvictionAlgorithm#LRU_HEAP} with {@link EvictionAction#OVERFLOW_TO_DISK}.
*/
LOCAL_PERSISTENT_OVERFLOW
}
| {
"content_hash": "7be4a39d390db9ae4ae359e6b1893fc8",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 100,
"avg_line_length": 51.337078651685395,
"alnum_prop": 0.7353906762967827,
"repo_name": "pivotal-amurmann/geode",
"id": "ec37b5109ce45c65ee28a3582bd03db2620e9f44",
"size": "5358",
"binary": false,
"copies": "5",
"ref": "refs/heads/develop",
"path": "geode-core/src/main/java/org/apache/geode/cache/client/ClientRegionShortcut.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "106707"
},
{
"name": "Groovy",
"bytes": "2928"
},
{
"name": "HTML",
"bytes": "4012081"
},
{
"name": "Java",
"bytes": "27165660"
},
{
"name": "JavaScript",
"bytes": "1781013"
},
{
"name": "Protocol Buffer",
"bytes": "9658"
},
{
"name": "Ruby",
"bytes": "6677"
},
{
"name": "Shell",
"bytes": "21474"
}
],
"symlink_target": ""
} |
Rule Types and Configuration Options
************************************
Examples of several types of rule configuration can be found in the example_rules folder.
.. _commonconfig:
Rule Configuration Cheat Sheet
==============================
<<<<<<< HEAD
+--------------------------------------------------------------------------------------------------------------------------------+
| FOR ALL RULES |
+===================================================+===========+====================================================+===========+
| ``es_host`` (string) | | ``buffer_time`` (time) | Optional |
+---------------------------------------------------+ +----------------------------------------------------+ +
| ``es_port`` (number) | Required | ``query_delay`` (time) | |
+---------------------------------------------------+-----------+----------------------------------------------------+ +
| ``use_ssl`` (boolean, no default) | Optional | ``max_query_size`` (int, default 100k) | |
+---------------------------------------------------+ +----------------------------------------------------+ +
| ``es_username`` (string, no default) | | ``filter`` (DSL filter, empty default) | |
+---------------------------------------------------+ +----------------------------------------------------+ +
| ``es_password`` (string, no default) | | ``include`` (list of strs) | |
+---------------------------------------------------+-----------+----------------------------------------------------+ +
| ``index`` (string) | Required | ``top_count_keys`` (list of strs) | |
+---------------------------------------------------+-----------+----------------------------------------------------+ +
| ``use_strftime_index`` (boolean) | Optional | ``top_count_number`` (int, default 5) | |
+---------------------------------------------------+-----------+----------------------------------------------------+ +
| ``name`` (string) | Required |``raw_count_keys`` (boolean, default T) | |
+---------------------------------------------------+ +----------------------------------------------------+ +
| ``type`` (string) | |``generate_kibana_link`` (boolean, default F) | |
+---------------------------------------------------+ +----------------------------------------------------+ +
| ``alert`` (string) | |``kibana_dashboard`` (string, default from es_host) | |
+---------------------------------------------------+-----------+----------------------------------------------------+ +
|``aggregation`` (time, no default) | Optional |``use_kibana_dashboard`` (string, no default) | |
+---------------------------------------------------+ +----------------------------------------------------+ +
| ``realert`` (time, default: 1 min) | |``use_local_time`` (boolean, default T) | |
+---------------------------------------------------+ +----------------------------------------------------+ +
|``exponential_realert`` (time, no default) | |``match_enhancements`` (list of strs, no default) | |
+---------------------------------------------------+ +----------------------------------------------------+ +
|``kibana4_start_timedelta`` (time, default: 10 min)| |``kibana4_end_timedelta`` (time, default: 10 min) | |
+---------------------------------------------------+-----------+----------------------------------------------------+-----------+
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
| RULE TYPE | Any | Blacklist | Whitelist | Change | Frequency | Spike | Flatline |New_term|
+================================================+=====+===========+===========+========+===========+=======+==========+========+
| ``compare_key`` (string, no default) | | Req | Req | Req | | | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``blacklist`` (list of strs, no default) | | Req | | | | | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``whitelist`` (list of strs, no default) | | | Req | | | | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
| ``ignore_null`` (boolean, no default) | | | Req | Req | | | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
| ``query_key`` (string, no default) | | | | Req | Opt | Opt | | Req |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
| ``timeframe`` (time, no default) | | | | Opt | Req | Req | Req | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
| ``num_events`` (int, no default) | | | | | Req | | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``use_count_query`` (boolean, no default) | | | | | Opt | Opt | Opt | |
| | | | | | | | | |
|``doc_type`` (string, no default) | | | | | | | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``use_terms_query`` (boolean, no default) | | | | | Opt | Opt | | Opt |
| | | | | | | | | |
|``doc_type`` (string, no default) | | | | | | | | |
| | | | | | | | | |
|``query_key`` (string, no default) | | | | | | | | |
| | | | | | | | | |
|``terms_size`` (int, default 50) | | | | | | | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
| ``spike_height`` (int, no default) | | | | | | Req | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``spike_type`` ([up|down|both], no default) | | | | | | Req | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``alert_on_new_data`` (boolean, default F) | | | | | | Opt | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``threshold_ref`` (int, no default) | | | | | | Opt | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``threshold_cur`` (int, no default) | | | | | | Opt | | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``threshold`` (int, no default) | | | | | | | Req | |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``fields`` (string, no default) | | | | | | | | Req |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``terms_window_size`` (time, default 30 days) | | | | | | | | Opt |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
|``alert_on_missing_fields`` (boolean, default F)| | | | | | | | Opt |
+------------------------------------------------+-----+-----------+-----------+--------+-----------+-------+----------+--------+
Common Configuration Options
============================
Every file that ends in ``.yaml`` in the ``rules_folder`` will be run by default.
The following configuration settings are common to all types of rules:
Required Settings
~~~~~~~~~~~~~~~~~
``es_host``: The hostname of the Elasticsearch cluster the rule will use to query. (Required, string, no default)
``es_port``: The port of the Elasticsearch cluster. (Required, number, no default)
``use_ssl``: Optional; whether or not to connect to ``es_host`` using SSL; set to ``True`` or ``False``.
``es_username``: Optional; basic-auth username for connecting to ``es_host``.
``es_password``: Optional; basic-auth password for connecting to ``es_host``.
``es_url_prefix``: Optional; URL prefix for the Elasticsearch endpoint.
``index``: The name of the index that will be searched. Wildcards can be used here, such as:
``index: my-index-*`` which will match ``my-index-2014-10-05``. You can also use a format string containing
``%Y`` for year, ``%m`` for month, and ``%d`` for day. To use this, you must also set ``use_strftime_index`` to true. (Required, string, no default)
``use_strftime_index``: If this is true, ElastAlert will format the index using datetime.strftime for each query.
See https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior for more details.
If a query spans multiple days, the formatted indexes will be concatenated with commas. This is useful
as narrowing the number of indexes searched, compared to using a wildcard, may be significantly faster. For example, if ``index`` is
``logstash-%Y.%m.%d``, the query url will be similar to ``elasticsearch.example.com/logstash-2015.02.03/...`` or
``elasticsearch.example.com/logstash-2015.02.03,logstash-2015.02.04/...``.
``name``: The name of the rule. This must be unique across all rules. The name will be used in
alerts and used as a key when writing and reading search metadata back from Elasticsearch. (Required, string, no default)
``type``: The ``RuleType`` to use. This may either be one of the built in rule types, see :ref:`Rule Types <ruletypes>` section below for more information,
or loaded from a module. For loading from a module, the type should be specified as ``module.file.RuleName``. (Required, string, no default)
``alert``: The ``Alerter`` type to use. This may be one of the built in alerts, see :ref:`Alert Types <alerts>` section below for more information,
or loaded from a module. For loading from a module, the alert should be specified as ``module.file.AlertName``. (Required, string, no default)
Optional Settings
~~~~~~~~~~~~~~~~~
``aggregation``: This option allows you to aggregate multiple matches together into one alert. Every time a match is found,
ElastAlert will wait for the ``aggregation`` period, and send all of the matches that have occurred in that time for a particular
rule together. For example,
``aggregation: hours: 2``
means that if one match occurred at 12:00, another at 1:00, and a third at 2:30, one
alert would be sent at 2:00, containing the first two matches, and another at 4:30, containing the third match plus any additional matches
occurring before 4:30. This can be very useful if you expect a large number of matches and only want a periodic report. (Optional, time, default none)
``realert``: This option allows you to ignore repeating alerts for a period of time. If the rule uses a ``query_key``, this option
will be applied on a per key basis. All matches for a given rule, or for matches with the same ``query_key``, will be ignored for
the given time. All matches with a missing ``query_key`` will be grouped together using a value of ``_missing``.
This is applied to the time the alert is sent, not to the time of the event. It defaults to one minute, which means
that if ElastAlert is run over a large time period which triggers many matches, only the first alert will be sent by default. If you want
every alert, set realert to 0 minutes. (Optional, time, default 1 minute)
``exponential_realert``: This option causes the value of ``realert`` to exponentially increase while alerts continue to fire. If set,
the value of ``exponential_realert`` is the maximum ``realert`` will increase to. If the time between alerts is less than twice ``realert``,
``realert`` will double. For example, if ``realert: minutes: 10`` and ``exponential_realert: hours: 1``, an alerts fires at 1:00 and another
at 1:15, the next alert will not be until at least 1:35. If another alert fires between 1:35 and 2:15, ``realert`` will increase to the
1 hour maximum. If more than 2 hours elapse before the next alert, ``realert`` will go back down. Note that alerts that are ignored (e.g.
one that occurred at 1:05) would not change ``realert``. (Optional, time, no default)
``buffer_time``: This options allows the rule to override the ``buffer_time`` global setting defined in config.yaml. (Optional, time)
``query_delay``: This option will cause ElastAlert to subtract a time delta from every query, causing the rule to run with a delay.
This is useful if the data is Elasticsearch doesn't get indexed immediately. (Optional, time)
``max_query_size``: The maximum number of documents that will be downloaded from Elasticsearch in a single query. If you
expect a large number of results, consider using ``use_count_query`` for the rule. If this
limit is reached, a warning will be logged but ElastAlert will continue without downloading more results. This setting will
override a global ``max_query_size``. (Optional, int, default 100,000)
``filter``: A list of Elasticsearch query DSL filters that is used to query Elasticsearch. ElastAlert will query Elasticsearch using the format
``{'filtered': {'and': [config.filter]}}`` with an additional timestamp range filter.
All of the results of querying with these filters are passed to the ``RuleType`` for analysis.
For more information writing filters, see :ref:`Writing Filters <writingfilters>`. (Required, Elasticsearch query DSL, no default)
``include``: A list of terms that should be included in query results and passed to rule types and alerts. '@timestamp', ``query_key``,
``compare_key``, and ``top_count_keys`` are automatically included, if present. (Optional, list of strings)
``top_count_keys``: A list of fields. ElastAlert will perform a terms query for the top X most common values for each of the fields,
where X is 5 by default, or ``top_count_number`` if it exists.
For example, if ``num_events`` is 100, and ``top_count_keys`` is ``- "username"``, the alert will say how many of the 100 events
have each username, for the top 5 usernames. When this is computed, the time range used is from ``timeframe`` before the most recent event
to 10 minutes past the most recent event. Because ElastAlert uses an aggregation query to compute this, it will attempt to use the
field name plus ".raw" to count unanalyzed terms. To turn this off, set ``raw_count_keys`` to false.
``top_count_number``: The number of terms to list if ``top_count_keys`` is set. (Optional, integer, default 5)
``raw_count_keys``: If true, all fields in ``top_count_keys`` will have ``.raw`` appended to them. (Optional, boolean, default true)
``generate_kibana_link``: This option is for Kibana 3 only.
If true, ElastAlert will generate a temporary Kibana dashboard and include a link to it in alerts. The dashboard
consists of an events over time graph and a table with ``include`` fields selected in the table. If the rule uses ``query_key``, the
dashboard will also contain a filter for the ``query_key`` of the alert. The dashboard schema will
be uploaded to the kibana-int index as a temporary dashboard. (Optional, boolean, default False)
``kibana_url``: The url to access Kibana. This will be used if ``generate_kibana_link`` or
``use_kibana_dashboard`` is true. If not specified, a URL will be constructed using ``es_host`` and ``es_port``.
(Optional, string, default ``http://<es_host>:<es_port>/_plugin/kibana/``)
``use_kibana_dashboard``: The name of a Kibana 3 dashboard to link to. Instead of generating a dashboard from a template,
ElastAlert can use an existing dashboard. It will set the time range on the dashboard to around the match time,
upload it as a temporary dashboard, add a filter to the ``query_key`` of the alert if applicable,
and put the url to the dashboard in the alert. (Optional, string, no default)
``use_kibana4_dashboard``: A link to a Kibana 4 dashboard. For example, "https://kibana.example.com/#/dashboard/My-Dashboard".
This will set the time setting on the dashboard from the match time minus the timeframe, to 10 minutes after the match time.
Note that this does not support filtering by ``query_key`` like Kibana 3.
``kibana4_start_timedelta``: Defaults to 10 minutes. This option allows you to specify the start time for the generated kibana4 dashboard.
This value is added in front of the event. For example,
``kibana4_start_timedelta: minutes: 2``
``kibana4_end_timedelta``: Defaults to 10 minutes. This option allows you to specify the end time for the generated kibana4 dashboard.
This value is added in back of the event. For example,
``kibana4_end_timedelta: minutes: 2``
``use_local_time``: Whether to convert timestamps to the local time zone in alerts. If false, timestamps will
be converted to UTC, which is what ElastAlert uses internally. (Optional, boolean, default true)
``match_enhancements``: A list of enhancement modules to use with this rule. An enhancement module is a subclass of enhancements.BaseEnhancement
that will be given the match dictionary and can modify it before it is passed to the alerter. The enhancements should be specified as
``module.file.EnhancementName``. See :ref:`Enhancements` for more information. (Optional, list of strings, no default)
``query_key``: Having a query key means that realert time will be counted separately for each unique value of ``query_key``. For rule types which
count documents, such as spike, frequency and flatline, it also means that these counts will be independent for each unique value of ``query_key``.
For example, if ``query_key`` is set to ``username`` and ``realert`` is set, and an alert triggers on a document with ``{'username': 'bob'}``,
additional alerts for ``{'username': 'bob'}`` will be ignored while other usernames will trigger alerts. Documents which are missing the
``query_key`` will be grouped together. A list of fields may also be used, which will create a compound query key. This compound key is
treated as if it were a single field whose value is the component values, or "None", joined by commas. A new field with the key
"field1,field2,etc" will be created in each document and may conflict with existing fields of the same name.
Some rules and alerts require additional options, which also go in the top level of the rule configuration file.
.. _testing :
Testing Your Rule
====================
Once you've written a rule configuration, you will want to validate it. To do so, you can either run ElastAlert in debug mode,
or use ``elastalert-test-rule``, which is a script that makes various aspects of testing easier.
It can:
- Check that the configuration file loaded successfully.
- Check that the Elasticsearch filter parses.
- Run against the last X day(s) and the show the number of hits that match your filter.
- Show the available terms in one of the results.
- Save documents returned to a JSON file.
- Run ElastAlert using either a JSON file or actual results from Elasticsearch.
- Print out debug alerts or trigger real alerts.
- Check that, if they exist, the primary_key, compare_key and include terms are in the results.
- Show what metadata documents would be written to ``elastalert_status``.
Without any optional arguments, it will run ElastAlert over the last 24 hours and print out any alerts that would have occurred.
Here is an example test run which triggered an alert:
.. code-block:: console
$ elastalert-test-rule my_rules/rule1.yaml
Successfully Loaded Example rule1
Got 105 hits from the last 1 day
Available terms in first hit:
@timestamp
field1
field2
...
Included term this_field_doesnt_exist may be missing or null
INFO:root:Queried rule Example rule1 from 6-16 15:21 PDT to 6-17 15:21 PDT: 105 hits
INFO:root:Alert for Example rule1 at 2015-06-16T23:53:12Z:
INFO:root:Example rule1
At least 50 events occurred between 6-16 18:30 PDT and 6-16 20:30 PDT
field1:
value1: 25
value2: 25
@timestamp: 2015-06-16T20:30:04-07:00
field1: value1
field2: something
Would have written the following documents to elastalert_status:
silence - {'rule_name': 'Example rule1', '@timestamp': datetime.datetime( ... ), 'exponent': 0, 'until':
datetime.datetime( ... )}
elastalert_status - {'hits': 105, 'matches': 1, '@timestamp': datetime.datetime( ... ), 'rule_name': 'Example rule1',
'starttime': datetime.datetime( ... ), 'endtime': datetime.datetime( ... ), 'time_taken': 3.1415926}
Note that everything between "Alert for Example rule1 at ..." and "Would have written the following ..." is the exact text body that an alert would have.
See the section below on alert content for more details.
Also note that datetime objects are converted to ISO8601 timestamps when uploaded to Elasticsearch. See :ref:`the section on metadata <metadata>` for more details.
Other options include:
``--schema-only``: Only perform schema validation on the file. It will not load modules or query Elasticsearch. This may catch invalid YAML
and missing or misconfigured fields.
``--count-only``: Only find the number of matching documents and list available fields. ElastAlert will not be run and documents will not be downloaded.
``--days N``: Instead of the default 1 day, query N days. For selecting more specific time ranges, you must run ElastAlert itself and use ``--start``
and ``--end``.
``--save-json FILE``: Save all documents downloaded to a file as JSON. This is useful if you wish to modify data while testing or do offline
testing in conjunction with ``--data FILE``. A maximum of 10,000 documents will be downloaded.
``--data FILE``: Use a JSON file as a data source instead of Elasticsearch. The file should be a single list containing objects,
rather than objects on separate lines. Note than this uses mock functions which mimic some Elasticsearch query methods and is not
guarenteed to have the exact same results as with Elasticsearch. For example, analyzed string fields may behave differently.
``--alert``: Trigger real alerts instead of the debug (logging text) alert.
.. note::
Results from running this script may not always be the same as if an actual ElastAlert instance was running. Some rule types, such as spike
and flatline require a minimum elapsed time before they begin alerting, based on their timeframe. In addition, use_count_query and
use_terms_query rely on run_every to determine their resolution. This script uses a fixed 5 minute window, which is the same as the default.
.. _ruletypes:
Rule Types
===========
The various ``RuleType`` classes, defined in ``elastalert/ruletypes.py``, form the main logic behind ElastAlert. An instance
is held in memory for each rule, passed all of the data returned by querying Elasticsearch with a given filter, and generates
matches based on that data.
To select a rule type, set the ``type`` option to the name of the rule type in the rule configuration file:
``type: <rule type>``
Any
~~~
``any``: The any rule will match everything. Every hit that the query returns will generate an alert.
Blacklist
~~~~~~~~~
``blacklist``: The blacklist rule will check a certain field against a blacklist, and match if it is in the blacklist.
This rule requires two additional options:
``compare_key``: The name of the field to use to compare to the blacklist. If the field is null, those events will be ignored.
``blacklist``: A list of blacklisted values. The ``compare_key`` term must be equal to one of these values for it to match.
Whitelist
~~~~~~~~~
``whitelist``: Similar to ``blacklist``, this rule will compare a certain field to a whitelist, and match if the list does not contain
the term.
This rule requires three additional options:
``compare_key``: The name of the field to use to compare to the whitelist.
``ignore_null``: If true, events without a ``compare_key`` field will not match.
``whitelist``: A list of whitelisted values. The ``compare_key`` term must be in this list or else it will match.
Change
~~~~~~
For an example configuration file using this rule type, look at ``example_rules/example_change.yaml``.
``change``: This rule will monitor a certain field and match if that field changes. The field
must change with respect to the last event with the same ``query_key``.
This rule requires three additional options:
``compare_key``: The name of the field to monitor for changes.
``ignore_null``: If true, events without a ``compare_key`` field will not count as changed.
``query_key``: This rule is applied on a per-``query_key`` basis. This field must be present in all of
the events that are checked.
There is also an optional field:
``timeframe``: The maximum time between changes. After this time period, ElastAlert will forget the old value
of the ``compare_key`` field.
Frequency
~~~~~~~~~
For an example configuration file using this rule type, look at ``example_rules/example_frequency.yaml``.
``frequency``: This rule matches when there are at least a certain number of events in a given time frame. This
may be counted on a per-``query_key`` basis.
This rule requires two additional options:
``num_events``: The number of events which will trigger an alert.
``timeframe``: The time that ``num_events`` must occur within.
Optional:
``use_count_query``: If true, ElastAlert will poll elasticsearch using the count api, and not download all of the matching documents. This is
useful is you care only about numbers and not the actual data. It should also be used if you expect a large number of query hits, in the order
of tens of thousands or more. ``doc_type`` must be set to use this.
``doc_type``: Specify the ``_type`` of document to search for. This must be present if ``use_count_query`` or ``use_terms_query`` is set.
``use_terms_query``: If true, ElastAlert will make an aggregation query against Elasticsearch to get counts of documents matching
each unique value of ``query_key``. This must be used with ``query_key`` and ``doc_type``. This will only return a maximum of ``terms_size``,
default 50, unique terms.
``terms_size``: When used with ``use_terms_query``, this is the maximum number of terms returned per query. Default is 50.
``query_key``: Counts of documents will be stored independently for each value of ``query_key``. Only ``num_events`` documents,
all with the same value of ``query_key``, will trigger an alert.
Spike
~~~~~~
``spike``: This rule matches when the volume of events during a given time period is ``spike_height`` times larger or smaller
than during the previous time period. It uses two sliding windows to compare the current and reference frequency
of events. We will call this two windows "reference" and "current".
This rule requires three additional options:
``spike_height``: The ratio of number of events in the last ``timeframe`` to the previous ``timeframe`` that when hit
will trigger an alert.
``spike_type``: Either 'up', 'down' or 'both'. 'Up' meaning the rule will only match when the number of events is ``spike_height`` times
higher. 'Down' meaning the reference number is ``spike_height`` higher than the current number. 'Both' will match either.
``timeframe``: The rule will average out the rate of events over this time period. For example, ``hours: 1`` means that the 'current'
window will span from present to one hour ago, and the 'reference' window will span from one hour ago to two hours ago. The rule
will not be active until the time elapsed from the first event is at least two timeframes. This is to prevent an alert being triggered
before a baseline rate has been established. This can be overridden using ``alert_on_new_data``.
Optional:
``threshold_ref``: The minimum number of events that must exist in the reference window for an alert to trigger. For example, if
``spike_height: 3`` and ``threshold_ref: 10``, than the 'reference' window must contain at least 10 events and the 'current' window at
least three times that for an alert to be triggered.
``threshold_cur``: The minimum number of events that must exist in the current window for an alert to trigger. For example, if
``spike_height: 3`` and ``threshold_cur: 60``, then an alert will occur if the current window has more than 60 events and
the reference window has less than a third as many.
To illustrate the use of ``threshold_ref``, ``threshold_cur``, ``alert_on_new_data``, ``timeframe`` and ``spike_height`` together,
consider the following examples::
" Alert if at least 15 events occur within two hours and less than a quarter of that number occurred within the previous two hours. "
timeframe: hours: 2
spike_height: 4
spike_type: up
threshold_cur: 15
hour1: 5 events (ref: 0, cur: 5) - No alert because (a) threshold_cur not met, (b) ref window not filled
hour2: 5 events (ref: 0, cur: 10) - No alert because (a) threshold_cur not met, (b) ref window not filled
hour3: 10 events (ref: 5, cur: 15) - No alert because (a) spike_height not met, (b) ref window not filled
hour4: 35 events (ref: 10, cur: 45) - Alert because (a) spike_height met, (b) threshold_cur met, (c) ref window filled
hour1: 20 events (ref: 0, cur: 20) - No alert because ref window not filled
hour2: 21 events (ref: 0, cur: 41) - No alert because ref window not filled
hour3: 19 events (ref: 20, cur: 40) - No alert because (a) spike_height not met, (b) ref window not filled
hour4: 23 events (ref: 41, cur: 42) - No alert because spike_height not met
hour1: 10 events (ref: 0, cur: 10) - No alert because (a) threshold_cur not met, (b) ref window not filled
hour2: 0 events (ref: 0, cur: 10) - No alert because (a) threshold_cur not met, (b) ref window not filled
hour3: 0 events (ref: 10, cur: 0) - No alert because (a) threshold_cur not met, (b) ref window not filled, (c) spike_height not met
hour4: 30 events (ref: 10, cur: 30) - No alert because spike_height not met
hour5: 5 events (ref: 0, cur: 35) - Alert because (a) spike_height met, (b) threshold_cur met, (c) ref window filled
" Alert if at least 5 events occur within two hours, and twice as many events occur within the next two hours. "
timeframe: hours: 2
spike_height: 2
spike_type: up
threshold_ref: 5
hour1: 20 events (ref: 0, cur: 20) - No alert because (a) threshold_ref not met, (b) ref window not filled
hour2: 100 events (ref: 0, cur: 120) - No alert because (a) threshold_ref not met, (b) ref window not filled
hour3: 100 events (ref: 20, cur: 200) - No alert because ref window not filled
hour4: 100 events (ref: 120, cur: 200) - No alert because spike_height not met
hour1: 0 events (ref: 0, cur: 0) - No alert because (a) threshold_ref not met, (b) ref window not filled
hour1: 20 events (ref: 0, cur: 20) - No alert because (a) threshold_ref not met, (b) ref window not filled
hour2: 100 events (ref: 0, cur: 120) - No alert because (a) threshold_ref not met, (b) ref window not filled
hour3: 100 events (ref: 20, cur: 200) - Alert because (a) spike_height met, (b) threshold_ref met, (c) ref window filled
hour1: 1 events (ref: 0, cur: 1) - No alert because (a) threshold_ref not met, (b) ref window not filled
hour2: 2 events (ref: 0, cur: 3) - No alert because (a) threshold_ref not met, (b) ref window not filled
hour3: 2 events (ref: 1, cur: 4) - No alert because (a) threshold_ref not met, (b) ref window not filled
hour4: 1000 events (ref: 3, cur: 1002) - No alert because threshold_ref not met
hour5: 2 events (ref: 4, cur: 1002) - No alert because threshold_ref not met
hour6: 4 events: (ref: 1002, cur: 6) - No alert because spike_height not met
hour1: 1000 events (ref: 0, cur: 1000) - No alert because (a) threshold_ref not met, (b) ref window not filled
hour2: 0 events (ref: 0, cur: 1000) - No alert because (a) threshold_ref not met, (b) ref window not filled
hour3: 0 events (ref: 1000, cur: 0) - No alert because (a) spike_height not met, (b) ref window not filled
hour4: 0 events (ref: 1000, cur: 0) - No alert because spike_height not met
hour5: 1000 events (ref: 0, cur: 1000) - No alert because threshold_ref not met
hour6: 1050 events (ref: 0, cur: 2050)- No alert because threshold_ref not met
hour7: 1075 events (ref: 1000, cur: 2125) Alert because (a) spike_height met, (b) threshold_ref met, (c) ref window filled
" Alert if at least 100 events occur within two hours and less than a fifth of that number occurred in the previous two hours. "
timeframe: hours: 2
spike_height: 5
spike_type: up
threshold_cur: 100
hour1: 1000 events (ref: 0, cur: 1000) - No alert because ref window not filled
hour1: 2 events (ref: 0, cur: 2) - No alert because (a) threshold_cur not met, (b) ref window not filled
hour2: 1 events (ref: 0, cur: 3) - No alert because (a) threshold_cur not met, (b) ref window not filled
hour3: 20 events (ref: 2, cur: 21) - No alert because (a) threshold_cur not met, (b) ref window not filled
hour4: 81 events (ref: 3, cur: 101) - Alert because (a) spike_height met, (b) threshold_cur met, (c) ref window filled
hour1: 10 events (ref: 0, cur: 10) - No alert because (a) threshold_cur not met, (b) ref window not filled
hour2: 20 events (ref: 0, cur: 30) - No alert because (a) threshold_cur not met, (b) ref window not filled
hour3: 40 events (ref: 10, cur: 60) - No alert because (a) threshold_cur not met, (b) ref window not filled
hour4: 80 events (ref: 30, cur: 120) - No alert because spike_height not met
hour5: 200 events (ref: 60, cur: 280) - No alert because spike_height not met
``alert_on_new_data``: This option is only used if ``query_key`` is set. When this is set to true, any new ``query_key`` encountered may
trigger an immediate alert. When set to false, baseline must be established for each new ``query_key`` value, and then subsequent spikes may
cause alerts. Baseline is established after ``timeframe`` has elapsed twice since first occurrence.
``use_count_query``: If true, ElastAlert will poll elasticsearch using the count api, and not download all of the matching documents. This is
useful is you care only about numbers and not the actual data. It should also be used if you expect a large number of query hits, in the order
of tens of thousands or more. ``doc_type`` must be set to use this.
``doc_type``: Specify the ``_type`` of document to search for. This must be present if ``use_count_query`` or ``use_terms_query`` is set.
``use_terms_query``: If true, ElastAlert will make an aggregation query against Elasticsearch to get counts of documents matching
each unique value of ``query_key``. This must be used with ``query_key`` and ``doc_type``. This will only return a maximum of ``terms_size``,
default 50, unique terms.
``terms_size``: When used with ``use_terms_query``, this is the maximum number of terms returned per query. Default is 50.
``query_key``: Counts of documents will be stored independently for each value of ``query_key``.
Flatline
~~~~~~~~
``flatline``: This rule matches when the total number of events is under a given ``threshold`` for a time period.
This rule requires two additional options:
``threshold``: The minimum number of events for an alert not to be triggered.
``timeframe``: The time period that must contain less than ``threshold`` events.
Optional:
``use_count_query``: If true, ElastAlert will poll Elasticsearch using the count api, and not download all of the matching documents. This is
useful is you care only about numbers and not the actual data. It should also be used if you expect a large number of query hits, in the order
of tens of thousands or more. ``doc_type`` must be set to use this.
``doc_type``: Specify the ``_type`` of document to search for. This must be present if ``use_count_query`` or ``use_terms_query`` is set.
``use_terms_query``: If true, ElastAlert will make an aggregation query against Elasticsearch to get counts of documents matching
each unique value of ``query_key``. This must be used with ``query_key`` and ``doc_type``. This will only return a maximum of ``terms_size``,
default 50, unique terms.
``terms_size``: When used with ``use_terms_query``, this is the maximum number of terms returned per query. Default is 50.
``query_key``: With flatline rule, ``query_key`` means that an alert will be triggered if any value of ``query_key`` has been seen at least once
and then falls below the threshold.
New Term
~~~~~~~~
``new_term``: This rule matches when a new value appears in a field that has never been seen before. When ElastAlert starts, it will
use an aggregation query to gather all known terms for a list of fields.
This rule requires one additional option:
``fields``: A list of fields to monitor for new terms.
Optional:
``terms_window_size``: The amount of time used for the initial query to find existing terms. No term that has occurred within this time frame
will trigger an alert. The default is 30 days.
``alert_on_missing_field``: Whether or not to alert when a field is missing from a document. The default is false.
``use_terms_query``: If true, ElastAlert will use aggregation queries to get terms instead of regular search queries. This is faster
than regular searching if there is a large number of documents. If this is used, you may only specify a single field, and must also set
``query_key`` to that field. Also, note that ``terms_size`` (the number of buckets returned per query) defaults to 50. This means
that if a new term appears but there are at least 50 terms which appear more frequently, it will not be found.
.. _alerts:
Alerts
========
Each rule may have any number of alerts attached to it. Alerts are subclasses of ``Alerter`` and are passed
a dictionary, or list of dictionaries, from ElastAlert which contain relevant information. They are configured
in the rule configuration file similarly to rule types.
To set the alerts for a rule, set the ``alert`` option to the name of the alert, or a list of the names of alerts:
``alert: email``
or
.. code-block:: yaml
alert:
- email
- jira
E-mail subject or JIRA issue summary can also be customized by adding an ``alert_subject`` that contains a custom summary.
It can be further formatted using standard Python formatting syntax::
alert_subject: "Issue {0} occurred at {1}"
The arguments for the formatter will be fed from the matched objects related to the alert.
The field names whose values will be used as the arguments can be passed with ``alert_subject_args``::
alert_subject_args:
- issue.name
- "@timestamp"
It is mandatory to enclose the ``@timestamp`` field in quotes since in YAML format a token cannot begin with the ``@`` character. Not using the quotation marks will trigger a YAML parse error.
In case the rule matches multiple objects in the index, only the first match is used to populate the arguments for the formatter.
If the field(s) mentioned in the arguments list are missing, the email alert will have the text ``<MISSING VALUE>`` in place of its expected value.
Alert Content
~~~~~~~~~~~~~~~
There are several ways to format the body text of the various types of events. In EBNF::
rule_name = name
alert_text = alert_text
ruletype_text = Depends on type
top_counts_header = top_count_key, ":"
top_counts_value = Value, ": ", Count
top_counts = top_counts_header, LF, top_counts_value
field_values = Field, ": ", Value
Similarly to ``alert_subject``, ``alert_text`` can be further formatted using standard Python formatting syntax.
The field names whose values will be used as the arguments can be passed with ``alert_text_args``.
By default::
body = rule_name
[alert_text]
ruletype_text
{top_counts}
{field_values}
With ``alert_text_type: alert_text_only``::
body = rule_name
alert_text
With ``alert_text_type: exclude_fields``::
body = rule_name
[alert_text]
ruletype_text
{top_counts}
ruletype_text is the string returned by RuleType.get_match_str.
field_values will contain every key value pair included in the results from Elasticsearch. These fields include "@timestamp" (or the value of ``timestamp_field``),
every key in ``included``, every key in ``top_count_keys``, ``query_key``, and ``compare_key``. If the alert spans multiple events, these values may
come from an individual event, usually the one which triggers the alert.
Command
~~~~~~~
The command alert allows you to execute an arbitrary command and pass arguments or stdin from the match. Arguments to the command can use
Python format string syntax to access parts of the match. The alerter will open a subprocess and optionally pass the match, as JSON, to
the stdin of the process.
This alert requires one option:
``command``: A list of arguments to execute or a string to execute. If in list format, the first argument is the name of the program to execute. If passing a
string, the command will be executed through the shell. The command string or args will be formatted using Python's % string format syntax with the
match passed the format argument. This means that a field can be accessed with ``%(field_name)s``.
Optional:
``pipe_match_json``: If true, the match will be converted to JSON and passed to stdin of the command. Note that this will cause ElastAlert to block
until the command exits or sends an EOF to stdout.
Example usage::
alert:
- command
command: ["/bin/send_alert", "--username", "%(username)s"]
.. warning::
Executing commmands with untrusted data can make it vulnerable to shell injection! If you use formatted data in
your command, it is highly recommended that you use a args list format instead of a shell string.
Email
~~~~~
This alert will send an email. It connects to an smtp server located at ``smtp_host``, or localhost by default.
This alert requires one additional option:
``email``: An address or list of addresses to sent the alert to.
Optional:
``smtp_host``: The SMTP host to use, defaults to localhost.
``smtp_ssl``: Connect the SMTP host using SSL, defaults to ``false``.
``smtp_auth_file``: The path to a file which contains SMTP authentication credentials. It should be YAML formatted and contain
two fields, ``user`` and ``password``. If this is not present, no authentication will be attempted.
``email_reply_to``: This sets the Reply-To header in the email. By default, the from address is ElastAlert@ and the domain will be set
by the smtp server.
``from_addr``: This sets the From header in the email. By default, the from address is ElastAlert@ and the domain will be set
by the smtp server.
``cc``: This adds the CC emails to the list of recipients. By default, this is left empty.
``bcc``: This adds the BCC emails to the list of recipients but does not show up in the email message. By default, this is left empty.
Jira
~~~~~
The JIRA alerter will open a ticket on jira whenever an alert is triggered. You must have a service account for ElastAlert to connect with.
The credentials of the service account are loaded from a separate file. The ticket number will be written to the alert pipeline, and if it
is followed by an email alerter, a link will be included in the email.
This alert requires four additional options:
``jira_server``: The hostname of the JIRA server.
``jira_project``: The project to open the ticket under.
``jira_issuetype``: The type of issue that the ticket will be filed as. Note that this is case sensitive.
``jira_account_file``: The path to the file which contains JIRA account credentials.
For an example JIRA account file, see ``example_rules/jira_acct.yaml``. The account file is also yaml formatted and must contain two fields:
``user``: The username.
``password``: The password.
Optional:
``jira_component``: The name of the component to set the ticket to.
``jira_label``: The label to add to the JIRA ticket.
``jira_priority``: The index of the priority to set the issue to. In the JIRA dropdown for priorities, 0 would represent the first priority,
1 the 2nd, etc.
``jira_bump_tickets``: If true, ElastAlert search for existing tickets newer than ``jira_max_age`` and comment on the ticket with
information about the alert instead of opening another ticket. ElastAlert finds the existing ticket by searching by summary. If the
summary has changed or contains special characters, it may fail to find the ticket. If you are using a custom ``alert_subject``,
the two summaries must be exact matches. Defaults to false.
``jira_max_age``: If ``jira_bump_tickets`` is true, the maximum age of a ticket, in days, such that ElastAlert will comment on the ticket
instead of opening a new one. Default is 30 days.
``jira_bump_not_in_statuses``: If ``jira_bump_tickets`` is true, a list of statuses the ticket must **not** be in for ElastAlert to comment on
the ticket instead of opening a new one. For example, to prevent comments being added to resolved or closed tickets, set this to 'Resolved'
and 'Closed'. This option should not be set if the ``jira_bump_in_statuses`` option is set.
Example usage::
jira_bump_not_in_statuses:
- Resolved
- Closed
``jira_bump_in_statuses``: If ``jira_bump_tickets`` is true, a list of statuses the ticket *must be in* for ElastAlert to comment on
the ticket instead of opening a new one. For example, to only comment on 'Open' tickets -- and thus not 'In Progress', 'Analyzing',
'Resolved', etc. tickets -- set this to 'Open'. This option should not be set if the ``jira_bump_not_in_statuses`` option is set.
Example usage::
jira_bump_in_statuses:
- Open
Debug
~~~~~~
The debug alerter will log the alert information using the Python logger at the info level.
| {
"content_hash": "96b68864584ca859536d433ba2226c31",
"timestamp": "",
"source": "github",
"line_count": 816,
"max_line_length": 192,
"avg_line_length": 60.10049019607843,
"alnum_prop": 0.6051139839321398,
"repo_name": "thomdixon/elastalert",
"id": "16b9b8248c482c76361f2852de66a9de94e88a5e",
"size": "49042",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/source/ruletypes.rst",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "365"
},
{
"name": "Python",
"bytes": "225195"
}
],
"symlink_target": ""
} |
using namespace llvm;
raw_ostream::~raw_ostream() {
// raw_ostream's subclasses should take care to flush the buffer
// in their destructors.
assert(OutBufCur == OutBufStart &&
"raw_ostream destructor called with non-empty buffer!");
if (BufferMode == InternalBuffer)
delete [] OutBufStart;
// If there are any pending errors, report them now. Clients wishing
// to avoid llvm_report_error calls should check for errors with
// has_error() and clear the error flag with clear_error() before
// destructing raw_ostream objects which may have errors.
if (Error)
llvm_report_error("IO failure on output stream.");
}
// An out of line virtual method to provide a home for the class vtable.
void raw_ostream::handle() {}
size_t raw_ostream::preferred_buffer_size() const {
// BUFSIZ is intended to be a reasonable default.
return BUFSIZ;
}
void raw_ostream::SetBuffered() {
// Ask the subclass to determine an appropriate buffer size.
if (size_t Size = preferred_buffer_size())
SetBufferSize(Size);
else
// It may return 0, meaning this stream should be unbuffered.
SetUnbuffered();
}
void raw_ostream::SetBufferAndMode(char *BufferStart, size_t Size,
BufferKind Mode) {
assert(((Mode == Unbuffered && BufferStart == 0 && Size == 0) ||
(Mode != Unbuffered && BufferStart && Size)) &&
"stream must be unbuffered or have at least one byte");
// Make sure the current buffer is free of content (we can't flush here; the
// child buffer management logic will be in write_impl).
assert(GetNumBytesInBuffer() == 0 && "Current buffer is non-empty!");
if (BufferMode == InternalBuffer)
delete [] OutBufStart;
OutBufStart = BufferStart;
OutBufEnd = OutBufStart+Size;
OutBufCur = OutBufStart;
BufferMode = Mode;
assert(OutBufStart <= OutBufEnd && "Invalid size!");
}
raw_ostream &raw_ostream::operator<<(unsigned long N) {
// Zero is a special case.
if (N == 0)
return *this << '0';
char NumberBuffer[20];
char *EndPtr = NumberBuffer+sizeof(NumberBuffer);
char *CurPtr = EndPtr;
while (N) {
*--CurPtr = '0' + char(N % 10);
N /= 10;
}
return write(CurPtr, EndPtr-CurPtr);
}
raw_ostream &raw_ostream::operator<<(long N) {
if (N < 0) {
*this << '-';
N = -N;
}
return this->operator<<(static_cast<unsigned long>(N));
}
raw_ostream &raw_ostream::operator<<(unsigned long long N) {
// Output using 32-bit div/mod when possible.
if (N == static_cast<unsigned long>(N))
return this->operator<<(static_cast<unsigned long>(N));
char NumberBuffer[20];
char *EndPtr = NumberBuffer+sizeof(NumberBuffer);
char *CurPtr = EndPtr;
while (N) {
*--CurPtr = '0' + char(N % 10);
N /= 10;
}
return write(CurPtr, EndPtr-CurPtr);
}
raw_ostream &raw_ostream::operator<<(long long N) {
if (N < 0) {
*this << '-';
N = -N;
}
return this->operator<<(static_cast<unsigned long long>(N));
}
raw_ostream &raw_ostream::write_hex(unsigned long long N) {
// Zero is a special case.
if (N == 0)
return *this << '0';
char NumberBuffer[20];
char *EndPtr = NumberBuffer+sizeof(NumberBuffer);
char *CurPtr = EndPtr;
while (N) {
uintptr_t x = N % 16;
*--CurPtr = (x < 10 ? '0' + x : 'a' + x - 10);
N /= 16;
}
return write(CurPtr, EndPtr-CurPtr);
}
raw_ostream &raw_ostream::write_escaped(StringRef Str) {
for (unsigned i = 0, e = Str.size(); i != e; ++i) {
unsigned char c = Str[i];
switch (c) {
case '\\':
*this << '\\' << '\\';
break;
case '\t':
*this << '\\' << 't';
break;
case '\n':
*this << '\\' << 'n';
break;
case '"':
*this << '\\' << '"';
break;
default:
if (std::isprint(c)) {
*this << c;
break;
}
// Always expand to a 3-character octal escape.
*this << '\\';
*this << char('0' + ((c >> 6) & 7));
*this << char('0' + ((c >> 3) & 7));
*this << char('0' + ((c >> 0) & 7));
}
}
return *this;
}
raw_ostream &raw_ostream::operator<<(const void *P) {
*this << '0' << 'x';
return write_hex((uintptr_t) P);
}
raw_ostream &raw_ostream::operator<<(double N) {
return this->operator<<(format("%e", N));
}
void raw_ostream::flush_nonempty() {
assert(OutBufCur > OutBufStart && "Invalid call to flush_nonempty.");
size_t Length = OutBufCur - OutBufStart;
OutBufCur = OutBufStart;
write_impl(OutBufStart, Length);
}
raw_ostream &raw_ostream::write(unsigned char C) {
// Group exceptional cases into a single branch.
if (BUILTIN_EXPECT(OutBufCur >= OutBufEnd, false)) {
if (BUILTIN_EXPECT(!OutBufStart, false)) {
if (BufferMode == Unbuffered) {
write_impl(reinterpret_cast<char*>(&C), 1);
return *this;
}
// Set up a buffer and start over.
SetBuffered();
return write(C);
}
flush_nonempty();
}
*OutBufCur++ = C;
return *this;
}
raw_ostream &raw_ostream::write(const char *Ptr, size_t Size) {
// Group exceptional cases into a single branch.
if (BUILTIN_EXPECT(OutBufCur+Size > OutBufEnd, false)) {
if (BUILTIN_EXPECT(!OutBufStart, false)) {
if (BufferMode == Unbuffered) {
write_impl(Ptr, Size);
return *this;
}
// Set up a buffer and start over.
SetBuffered();
return write(Ptr, Size);
}
// Write out the data in buffer-sized blocks until the remainder
// fits within the buffer.
do {
size_t NumBytes = OutBufEnd - OutBufCur;
copy_to_buffer(Ptr, NumBytes);
flush_nonempty();
Ptr += NumBytes;
Size -= NumBytes;
} while (OutBufCur+Size > OutBufEnd);
}
copy_to_buffer(Ptr, Size);
return *this;
}
void raw_ostream::copy_to_buffer(const char *Ptr, size_t Size) {
assert(Size <= size_t(OutBufEnd - OutBufCur) && "Buffer overrun!");
// Handle short strings specially, memcpy isn't very good at very short
// strings.
switch (Size) {
case 4: OutBufCur[3] = Ptr[3]; // FALL THROUGH
case 3: OutBufCur[2] = Ptr[2]; // FALL THROUGH
case 2: OutBufCur[1] = Ptr[1]; // FALL THROUGH
case 1: OutBufCur[0] = Ptr[0]; // FALL THROUGH
case 0: break;
default:
memcpy(OutBufCur, Ptr, Size);
break;
}
OutBufCur += Size;
}
// Formatted output.
raw_ostream &raw_ostream::operator<<(const format_object_base &Fmt) {
// If we have more than a few bytes left in our output buffer, try
// formatting directly onto its end.
size_t NextBufferSize = 127;
size_t BufferBytesLeft = OutBufEnd - OutBufCur;
if (BufferBytesLeft > 3) {
size_t BytesUsed = Fmt.print(OutBufCur, BufferBytesLeft);
// Common case is that we have plenty of space.
if (BytesUsed <= BufferBytesLeft) {
OutBufCur += BytesUsed;
return *this;
}
// Otherwise, we overflowed and the return value tells us the size to try
// again with.
NextBufferSize = BytesUsed;
}
// If we got here, we didn't have enough space in the output buffer for the
// string. Try printing into a SmallVector that is resized to have enough
// space. Iterate until we win.
SmallVector<char, 128> V;
while (1) {
V.resize(NextBufferSize);
// Try formatting into the SmallVector.
size_t BytesUsed = Fmt.print(V.data(), NextBufferSize);
// If BytesUsed fit into the vector, we win.
if (BytesUsed <= NextBufferSize)
return write(V.data(), BytesUsed);
// Otherwise, try again with a new size.
assert(BytesUsed > NextBufferSize && "Didn't grow buffer!?");
NextBufferSize = BytesUsed;
}
}
/// indent - Insert 'NumSpaces' spaces.
raw_ostream &raw_ostream::indent(unsigned NumSpaces) {
static const char Spaces[] = " "
" "
" ";
// Usually the indentation is small, handle it with a fastpath.
if (NumSpaces < array_lengthof(Spaces))
return write(Spaces, NumSpaces);
while (NumSpaces) {
unsigned NumToWrite = std::min(NumSpaces,
(unsigned)array_lengthof(Spaces)-1);
write(Spaces, NumToWrite);
NumSpaces -= NumToWrite;
}
return *this;
}
//===----------------------------------------------------------------------===//
// Formatted Output
//===----------------------------------------------------------------------===//
// Out of line virtual method.
void format_object_base::home() {
}
//===----------------------------------------------------------------------===//
// raw_fd_ostream
//===----------------------------------------------------------------------===//
/// raw_fd_ostream - Open the specified file for writing. If an error
/// occurs, information about the error is put into ErrorInfo, and the
/// stream should be immediately destroyed; the string will be empty
/// if no error occurred.
raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo,
unsigned Flags) : pos(0) {
assert(Filename != 0 && "Filename is null");
// Verify that we don't have both "append" and "excl".
assert((!(Flags & F_Excl) || !(Flags & F_Append)) &&
"Cannot specify both 'excl' and 'append' file creation flags!");
ErrorInfo.clear();
// Handle "-" as stdout.
if (Filename[0] == '-' && Filename[1] == 0) {
FD = STDOUT_FILENO;
// If user requested binary then put stdout into binary mode if
// possible.
if (Flags & F_Binary)
sys::Program::ChangeStdoutToBinary();
ShouldClose = false;
return;
}
int OpenFlags = O_WRONLY|O_CREAT;
#ifdef O_BINARY
if (Flags & F_Binary)
OpenFlags |= O_BINARY;
#endif
if (Flags & F_Append)
OpenFlags |= O_APPEND;
else
OpenFlags |= O_TRUNC;
if (Flags & F_Excl)
OpenFlags |= O_EXCL;
FD = open(Filename, OpenFlags, 0664);
if (FD < 0) {
ErrorInfo = "Error opening output file '" + std::string(Filename) + "'";
ShouldClose = false;
} else {
ShouldClose = true;
}
}
raw_fd_ostream::~raw_fd_ostream() {
if (FD < 0) return;
flush();
if (ShouldClose)
if (::close(FD) != 0)
error_detected();
}
void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) {
assert (FD >= 0 && "File already closed.");
pos += Size;
if (::write(FD, Ptr, Size) != (ssize_t) Size)
error_detected();
}
void raw_fd_ostream::close() {
assert (ShouldClose);
ShouldClose = false;
flush();
if (::close(FD) != 0)
error_detected();
FD = -1;
}
uint64_t raw_fd_ostream::seek(uint64_t off) {
flush();
pos = ::lseek(FD, off, SEEK_SET);
if (pos != off)
error_detected();
return pos;
}
size_t raw_fd_ostream::preferred_buffer_size() const {
#if !defined(_MSC_VER) && !defined(__MINGW32__) // Windows has no st_blksize.
assert(FD >= 0 && "File not yet open!");
struct stat statbuf;
if (fstat(FD, &statbuf) != 0)
return 0;
// If this is a terminal, don't use buffering. Line buffering
// would be a more traditional thing to do, but it's not worth
// the complexity.
if (S_ISCHR(statbuf.st_mode) && isatty(FD))
return 0;
// Return the preferred block size.
return statbuf.st_blksize;
#endif
return raw_ostream::preferred_buffer_size();
}
raw_ostream &raw_fd_ostream::changeColor(enum Colors colors, bool bold,
bool bg) {
if (sys::Process::ColorNeedsFlush())
flush();
const char *colorcode =
(colors == SAVEDCOLOR) ? sys::Process::OutputBold(bg)
: sys::Process::OutputColor(colors, bold, bg);
if (colorcode) {
size_t len = strlen(colorcode);
write(colorcode, len);
// don't account colors towards output characters
pos -= len;
}
return *this;
}
raw_ostream &raw_fd_ostream::resetColor() {
if (sys::Process::ColorNeedsFlush())
flush();
const char *colorcode = sys::Process::ResetColor();
if (colorcode) {
size_t len = strlen(colorcode);
write(colorcode, len);
// don't account colors towards output characters
pos -= len;
}
return *this;
}
bool raw_fd_ostream::is_displayed() const {
return sys::Process::FileDescriptorIsDisplayed(FD);
}
//===----------------------------------------------------------------------===//
// raw_stdout/err_ostream
//===----------------------------------------------------------------------===//
// Set buffer settings to model stdout and stderr behavior.
// Set standard error to be unbuffered by default.
raw_stdout_ostream::raw_stdout_ostream():raw_fd_ostream(STDOUT_FILENO, false) {}
raw_stderr_ostream::raw_stderr_ostream():raw_fd_ostream(STDERR_FILENO, false,
true) {}
// An out of line virtual method to provide a home for the class vtable.
void raw_stdout_ostream::handle() {}
void raw_stderr_ostream::handle() {}
/// outs() - This returns a reference to a raw_ostream for standard output.
/// Use it like: outs() << "foo" << "bar";
raw_ostream &llvm::outs() {
static raw_stdout_ostream S;
return S;
}
/// errs() - This returns a reference to a raw_ostream for standard error.
/// Use it like: errs() << "foo" << "bar";
raw_ostream &llvm::errs() {
static raw_stderr_ostream S;
return S;
}
/// nulls() - This returns a reference to a raw_ostream which discards output.
raw_ostream &llvm::nulls() {
static raw_null_ostream S;
return S;
}
//===----------------------------------------------------------------------===//
// raw_string_ostream
//===----------------------------------------------------------------------===//
raw_string_ostream::~raw_string_ostream() {
flush();
}
void raw_string_ostream::write_impl(const char *Ptr, size_t Size) {
OS.append(Ptr, Size);
}
//===----------------------------------------------------------------------===//
// raw_svector_ostream
//===----------------------------------------------------------------------===//
// The raw_svector_ostream implementation uses the SmallVector itself as the
// buffer for the raw_ostream. We guarantee that the raw_ostream buffer is
// always pointing past the end of the vector, but within the vector
// capacity. This allows raw_ostream to write directly into the correct place,
// and we only need to set the vector size when the data is flushed.
raw_svector_ostream::raw_svector_ostream(SmallVectorImpl<char> &O) : OS(O) {
// Set up the initial external buffer. We make sure that the buffer has at
// least 128 bytes free; raw_ostream itself only requires 64, but we want to
// make sure that we don't grow the buffer unnecessarily on destruction (when
// the data is flushed). See the FIXME below.
OS.reserve(OS.size() + 128);
SetBuffer(OS.end(), OS.capacity() - OS.size());
}
raw_svector_ostream::~raw_svector_ostream() {
// FIXME: Prevent resizing during this flush().
flush();
}
/// resync - This is called when the SmallVector we're appending to is changed
/// outside of the raw_svector_ostream's control. It is only safe to do this
/// if the raw_svector_ostream has previously been flushed.
void raw_svector_ostream::resync() {
assert(GetNumBytesInBuffer() == 0 && "Didn't flush before mutating vector");
if (OS.capacity() - OS.size() < 64)
OS.reserve(OS.capacity() * 2);
SetBuffer(OS.end(), OS.capacity() - OS.size());
}
void raw_svector_ostream::write_impl(const char *Ptr, size_t Size) {
// If we're writing bytes from the end of the buffer into the smallvector, we
// don't need to copy the bytes, just commit the bytes because they are
// already in the right place.
if (Ptr == OS.end()) {
assert(OS.size() + Size <= OS.capacity() && "Invalid write_impl() call!");
OS.set_size(OS.size() + Size);
} else {
assert(GetNumBytesInBuffer() == 0 &&
"Should be writing from buffer if some bytes in it");
// Otherwise, do copy the bytes.
OS.append(Ptr, Ptr+Size);
}
// Grow the vector if necessary.
if (OS.capacity() - OS.size() < 64)
OS.reserve(OS.capacity() * 2);
// Update the buffer position.
SetBuffer(OS.end(), OS.capacity() - OS.size());
}
uint64_t raw_svector_ostream::current_pos() const {
return OS.size();
}
StringRef raw_svector_ostream::str() {
flush();
return StringRef(OS.begin(), OS.size());
}
//===----------------------------------------------------------------------===//
// raw_null_ostream
//===----------------------------------------------------------------------===//
raw_null_ostream::~raw_null_ostream() {
#ifndef NDEBUG
// ~raw_ostream asserts that the buffer is empty. This isn't necessary
// with raw_null_ostream, but it's better to have raw_null_ostream follow
// the rules than to change the rules just for raw_null_ostream.
flush();
#endif
}
void raw_null_ostream::write_impl(const char *Ptr, size_t Size) {
}
uint64_t raw_null_ostream::current_pos() const {
return 0;
}
| {
"content_hash": "e9c4b5b0c64e2b421f27b647c28b00d8",
"timestamp": "",
"source": "github",
"line_count": 579,
"max_line_length": 80,
"avg_line_length": 29.22279792746114,
"alnum_prop": 0.5900118203309692,
"repo_name": "wrmsr/lljvm",
"id": "071c924d91952f1a50d74025dc187d5cc58f82ec",
"size": "18117",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "thirdparty/llvm/lib/Support/raw_ostream.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "4870"
},
{
"name": "C++",
"bytes": "91265"
},
{
"name": "Java",
"bytes": "149125"
},
{
"name": "Lua",
"bytes": "177"
},
{
"name": "Makefile",
"bytes": "21245"
},
{
"name": "Python",
"bytes": "8641"
},
{
"name": "Shell",
"bytes": "218"
}
],
"symlink_target": ""
} |
function getPipelines() {
var queryUrl = location.protocol + '//' + document.domain + ":8080/gamecraftpipelinemanager/api/pipelines?size=65536";
var pipelinesList = "";
$.ajax
({
type: "GET",
url: queryUrl,
async: false,
contentType: "application/json",
beforeSend: function (xhr) {
// set header if JWT is set
if (sessionStorage.getItem("token")) {
xhr.setRequestHeader("Authorization", "Bearer " + sessionStorage.getItem("token"));
}
},
headers: {
'Content-Type': 'application/json'
},
success: function (data) {
pipelinesList = data;
}
});
return pipelinesList;
}
function getPipeline(id) {
return getPipelines().filter(
function(data){ return data.id == id }
)[0];
}
function addPipeline(pipelineName,pipelineDescription,pipelineProjectId,pipelineProjectName,pipelineDropboxAppKey,pipelineDropboxToken,pipelineEngineCompilerPath,pipelineEngineCompilerArguments,pipelineFtpAddress,pipelineFtpUsername,pipelineFtpPassword,pipelineFtpPort,pipelineNotificatorType,pipelineNotificatorDetails,
pipelinePublicationService,pipelineRepositoryAddress,pipelineRepositoryPassword,pipelineRepositoryType,pipelineRepositoryUsername,pipelineRepositoryBranch,pipelineScheduleCronJob,pipelineScheduleType,pipelineNotificatorRecipient) {
var queryUrl = location.protocol + '//' + document.domain + ":8080/gamecraftpipelinemanager/api/pipelines/";
var data = {
pipelineName: pipelineName,
pipelineDescription: pipelineDescription,
pipelineProjectId: pipelineProjectId,
pipelineProjectName: pipelineProjectName,
pipelineDropboxAppKey: pipelineDropboxAppKey,
pipelineDropboxToken: pipelineDropboxToken,
pipelineEngineCompilerArguments: pipelineEngineCompilerArguments,
pipelineEngineCompilerPath: pipelineEngineCompilerPath,
pipelineFtpAddress: pipelineFtpAddress,
pipelineFtpPassword: pipelineFtpPassword,
pipelineFtpPort: pipelineFtpPort,
pipelineFtpUsername: pipelineFtpUsername,
pipelineNotificatorDetails: pipelineNotificatorDetails,
pipelineNotificatorType: pipelineNotificatorType,
pipelinePublicationService: pipelinePublicationService,
pipelineRepositoryAddress: pipelineRepositoryAddress,
pipelineRepositoryPassword: pipelineRepositoryPassword,
pipelineRepositoryType: pipelineRepositoryType,
pipelineRepositoryUsername: pipelineRepositoryUsername,
pipelineRepositoryBranch: pipelineRepositoryBranch,
pipelineScheduleCronJob: pipelineScheduleCronJob,
pipelineScheduleType: pipelineScheduleType,
pipelineStatus: "IDLE",
pipelineNotificatorRecipient: pipelineNotificatorRecipient
};
$.ajax
({
type: "POST",
url: queryUrl,
async: false,
data: JSON.stringify(data),
contentType: "application/json",
beforeSend: function (xhr) {
// set header if JWT is set
if (sessionStorage.getItem("token")) {
xhr.setRequestHeader("Authorization", "Bearer " + sessionStorage.getItem("token"));
}
},
headers: {
'Content-Type': 'application/json'
},
success: function (data) {
alert("Pipeline created!");
},
error: function (data) {
alert(JSON.stringify(data));
}
});
}
function updatePipeline(pipelineId, pipelineName,pipelineDescription,pipelineProjectId,pipelineProjectName,pipelineDropboxAppKey,pipelineDropboxToken,pipelineEngineCompilerPath,pipelineEngineCompilerArguments,pipelineFtpAddress,pipelineFtpUsername,pipelineFtpPassword,pipelineFtpPort,pipelineNotificatorType,pipelineNotificatorDetails,
pipelinePublicationService,pipelineRepositoryAddress,pipelineRepositoryPassword,pipelineRepositoryType,pipelineRepositoryUsername,pipelineRepositoryBranch,pipelineScheduleCronJob,pipelineScheduleType,pipelineStatus,pipelineNotificatorRecipient) {
var queryUrl = location.protocol + '//' + document.domain + ":8080/gamecraftpipelinemanager/api/pipelines/";
var data = {
id: pipelineId,
pipelineName: pipelineName,
pipelineDescription: pipelineDescription,
pipelineProjectId: pipelineProjectId,
pipelineProjectName: pipelineProjectName,
pipelineDropboxAppKey: pipelineDropboxAppKey,
pipelineDropboxToken: pipelineDropboxToken,
pipelineEngineCompilerArguments: pipelineEngineCompilerArguments,
pipelineEngineCompilerPath: pipelineEngineCompilerPath,
pipelineFtpAddress: pipelineFtpAddress,
pipelineFtpPassword: pipelineFtpPassword,
pipelineFtpPort: pipelineFtpPort,
pipelineFtpUsername: pipelineFtpUsername,
pipelineNotificatorDetails: pipelineNotificatorDetails,
pipelineNotificatorType: pipelineNotificatorType,
pipelinePublicationService: pipelinePublicationService,
pipelineRepositoryAddress: pipelineRepositoryAddress,
pipelineRepositoryPassword: pipelineRepositoryPassword,
pipelineRepositoryType: pipelineRepositoryType,
pipelineRepositoryUsername: pipelineRepositoryUsername,
pipelineRepositoryBranch: pipelineRepositoryBranch,
pipelineScheduleCronJob: pipelineScheduleCronJob,
pipelineScheduleType: pipelineScheduleType,
pipelineStatus: pipelineStatus,
pipelineNotificatorRecipient: pipelineNotificatorRecipient
};
$.ajax
({
type: "PUT",
url: queryUrl,
async: false,
data: JSON.stringify(data),
contentType: "application/json",
beforeSend: function (xhr) {
// set header if JWT is set
if (sessionStorage.getItem("token")) {
xhr.setRequestHeader("Authorization", "Bearer " + sessionStorage.getItem("token"));
}
},
headers: {
'Content-Type': 'application/json'
},
success: function (data) {
alert("Pipeline updated!");
},
error: function (data) {
alert(JSON.stringify(data));
}
});
}
function deletePipeline(pipelineId) {
var queryUrl = location.protocol + '//' + document.domain + ":8080/gamecraftpipelinemanager/api/pipelines/" + pipelineId;
$.ajax
({
type: "DELETE",
url: queryUrl,
async: false,
contentType: "application/json",
beforeSend: function (xhr) {
// set header if JWT is set
if (sessionStorage.getItem("token")) {
xhr.setRequestHeader("Authorization", "Bearer " + sessionStorage.getItem("token"));
}
},
headers: {
'Content-Type': 'application/json'
},
success: function (data) {
alert("Pipeline deleted!");
},
error: function (data) {
alert(JSON.stringify(data));
}
});
}
function executePipeline(pipelineId) {
var queryUrl = location.protocol + '//' + document.domain + ":8080/gamecraftpipelinemanager/api/pipelines/" + pipelineId + "/execute";
$.ajax
({
type: "GET",
url: queryUrl,
async: false,
contentType: "application/json",
beforeSend: function (xhr) {
// set header if JWT is set
if (sessionStorage.getItem("token")) {
xhr.setRequestHeader("Authorization", "Bearer " + sessionStorage.getItem("token"));
}
},
headers: {
'Content-Type': 'application/json'
},
success: function (data) {
alert("Pipeline executed!");
},
error: function (data) {
alert(JSON.stringify(data));
}
});
}
function stopPipeline(pipelineId) {
var queryUrl = location.protocol + '//' + document.domain + ":8080/gamecraftpipelinemanager/api/pipelines/" + pipelineId + "/stop";
$.ajax
({
type: "GET",
url: queryUrl,
async: false,
contentType: "application/json",
beforeSend: function (xhr) {
// set header if JWT is set
if (sessionStorage.getItem("token")) {
xhr.setRequestHeader("Authorization", "Bearer " + sessionStorage.getItem("token"));
}
},
headers: {
'Content-Type': 'application/json'
},
success: function (data) {
alert("Pipeline stopped!");
},
error: function (data) {
alert(JSON.stringify(data));
}
});
}
function deletePipelinesAssociatedToProject(projectId) {
var pipelines = getPipelines();
jQuery.each(pipelines, function(i, pipeline) {
if (pipeline.pipelineProjectId == projectId) {
var queryUrl = location.protocol + '//' + document.domain + ":8080/gamecraftpipelinemanager/api/pipelines/" + pipeline.id;
$.ajax
({
type: "DELETE",
url: queryUrl,
async: false,
contentType: "application/json",
beforeSend: function (xhr) {
// set header if JWT is set
if (sessionStorage.getItem("token")) {
xhr.setRequestHeader("Authorization", "Bearer " + sessionStorage.getItem("token"));
}
},
headers: {
'Content-Type': 'application/json'
},
success: function (data) {
},
error: function (data) {
alert(JSON.stringify(data));
}
});
}
});
}
| {
"content_hash": "dd3d438d2cd900332dccbded97f23f26",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 335,
"avg_line_length": 38.333333333333336,
"alnum_prop": 0.6327603640040445,
"repo_name": "iMartinezMateu/gamecraft",
"id": "d00c092950e3f7d24b70ab02df5256b2afcdde3e",
"size": "9890",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "gamecraft-ui/src/main/resources/static/js/pipeline_operations.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "859"
},
{
"name": "CSS",
"bytes": "159197"
},
{
"name": "Dockerfile",
"bytes": "6073"
},
{
"name": "Gherkin",
"bytes": "179"
},
{
"name": "HTML",
"bytes": "650193"
},
{
"name": "Java",
"bytes": "3048026"
},
{
"name": "JavaScript",
"bytes": "114242"
},
{
"name": "Scala",
"bytes": "57845"
},
{
"name": "Shell",
"bytes": "853"
},
{
"name": "TypeScript",
"bytes": "761582"
}
],
"symlink_target": ""
} |
/**
*
*/
package org.openforis.collect.designer.viewmodel;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import org.openforis.collect.designer.form.ModelVersionFormObject;
import org.openforis.collect.designer.form.SurveyObjectFormObject;
import org.openforis.collect.designer.util.MessageUtil;
import org.openforis.collect.manager.SurveyManager;
import org.openforis.collect.model.CollectSurvey;
import org.openforis.idm.metamodel.CodeList;
import org.openforis.idm.metamodel.CodeListItem;
import org.openforis.idm.metamodel.EntityDefinition;
import org.openforis.idm.metamodel.ModelVersion;
import org.openforis.idm.metamodel.NodeDefinition;
import org.openforis.idm.metamodel.Schema;
import org.openforis.idm.metamodel.VersionableSurveyObject;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.Binder;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.ContextParam;
import org.zkoss.bind.annotation.ContextType;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.util.resource.Labels;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Window;
/**
*
* @author S. Ricci
*
*/
public class VersioningVM extends SurveyObjectPopUpVM<ModelVersion> {
@WireVariable
private SurveyManager surveyManager;
private Window confirmDeletePopUp;
@Override
@Init(superclass=false)
public void init() {
super.init();
}
@Override
protected List<ModelVersion> getItemsInternal() {
CollectSurvey survey = getSurvey();
List<ModelVersion> versions = survey.getSortedVersions();
return versions;
}
protected ModelVersion createItemInstance() {
ModelVersion instance = survey.createModelVersion();
return instance;
}
@Override
protected void addNewItemToSurvey() {
CollectSurvey survey = getSurvey();
survey.addVersion(editedItem);
}
@Override
protected void deleteItemFromSurvey(ModelVersion item) {
CollectSurvey survey = getSurvey();
surveyManager.removeVersion(survey, item);
dispatchVersionsUpdatedCommand();
}
@Command
public void deleteVersioning(@BindingParam("item") final ModelVersion item) {
List<VersionableSurveyObject> references = getReferences(item);
if ( references.isEmpty() ) {
super.deleteItem(item);
} else {
String title = Labels.getLabel("survey.versioning.delete.confirm_title");
String message = Labels.getLabel("survey.versioning.delete.confirm_in_use");
confirmDeletePopUp = SurveyErrorsPopUpVM.openPopUp(title, message,
references, new MessageUtil.CompleteConfirmHandler() {
@Override
public void onOk() {
performDeleteItem(item);
closeConfirmDeletePopUp();
}
@Override
public void onCancel() {
closeConfirmDeletePopUp();
}
});
}
}
@Override
protected String getConfirmDeleteMessageKey() {
return "survey.versioning.delete.confirm_message";
}
protected void closeConfirmDeletePopUp() {
closePopUp(confirmDeletePopUp);
confirmDeletePopUp = null;
}
@Override
protected void moveSelectedItemInSurvey(int indexTo) {
CollectSurvey survey = getSurvey();
survey.moveVersion(selectedItem, indexTo);
}
@Override
protected SurveyObjectFormObject<ModelVersion> createFormObject() {
return new ModelVersionFormObject();
}
@Override
@Command
@NotifyChange({"editedItem","selectedItem"})
public void applyChanges(@ContextParam(ContextType.BINDER) Binder binder) {
super.applyChanges(binder);
dispatchVersionsUpdatedCommand();
}
protected List<VersionableSurveyObject> getReferences(ModelVersion version) {
List<VersionableSurveyObject> referencesInSchema = getReferencesInSchema(version);
List<VersionableSurveyObject> referencesInCodeLists = getReferencesInCodeLists(version);
List<VersionableSurveyObject> result = new ArrayList<VersionableSurveyObject>();
result.addAll(referencesInSchema);
result.addAll(referencesInCodeLists);
return result;
}
protected List<VersionableSurveyObject> getReferencesInSchema(ModelVersion version) {
List<VersionableSurveyObject> references = new ArrayList<VersionableSurveyObject>();
Schema schema = survey.getSchema();
List<EntityDefinition> rootEntities = schema.getRootEntityDefinitions();
Stack<NodeDefinition> stack = new Stack<NodeDefinition>();
stack.addAll(rootEntities);
while ( ! stack.isEmpty() ) {
NodeDefinition defn = stack.pop();
if (isVersionInUse(version, defn) ) {
references.add(defn);
}
if ( defn instanceof EntityDefinition ) {
stack.addAll(((EntityDefinition) defn).getChildDefinitions());
}
}
return references;
}
protected List<VersionableSurveyObject> getReferencesInCodeLists(ModelVersion version) {
List<VersionableSurveyObject> references = new ArrayList<VersionableSurveyObject>();
List<CodeList> codeLists = survey.getCodeLists();
for (CodeList codeList : codeLists) {
if ( isVersionInUse(version, codeList) ) {
references.add(codeList);
}
if ( ! codeList.isExternal() ) {
List<CodeListItem> items = codeList.getItems();
Stack<CodeListItem> itemsStack = new Stack<CodeListItem>();
itemsStack.addAll(items);
while ( ! itemsStack.isEmpty() ) {
CodeListItem item = itemsStack.pop();
if ( isVersionInUse(version, item) ) {
references.add(item);
}
itemsStack.addAll(item.getChildItems());
}
}
}
return references;
}
protected boolean isVersionInUse(ModelVersion version, VersionableSurveyObject object) {
ModelVersion sinceVersion = object.getSinceVersion();
ModelVersion deprecatedVersion = object.getDeprecatedVersion();
return version.equals(sinceVersion) || version.equals(deprecatedVersion);
}
private void dispatchVersionsUpdatedCommand() {
BindUtils.postGlobalCommand(null, null, VERSIONS_UPDATED_GLOBAL_COMMAND, null);
}
@Override
protected void dispatchChangesAppliedCommand(boolean ignoreUnsavedChanges) {
postCloseVersioningManagerPopUpCommand();
}
@Override
protected void dispatchChangesCancelledCommand() {
postCloseVersioningManagerPopUpCommand();
}
private void postCloseVersioningManagerPopUpCommand() {
BindUtils.postGlobalCommand(null, null, "closeVersioningManagerPopUp", null);
}
}
| {
"content_hash": "22f37c6ac63298da7ffbd2f6dbf9e475",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 90,
"avg_line_length": 32.118811881188115,
"alnum_prop": 0.7453760789149199,
"repo_name": "openforis/collect",
"id": "17923b080f456f5b39daaf849d3669a8b1b6bc3b",
"size": "6488",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "collect-server/src/main/java/org/openforis/collect/designer/viewmodel/VersioningVM.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2032"
},
{
"name": "CSS",
"bytes": "492878"
},
{
"name": "HTML",
"bytes": "55093"
},
{
"name": "Java",
"bytes": "6027874"
},
{
"name": "JavaScript",
"bytes": "5049757"
},
{
"name": "Less",
"bytes": "60736"
},
{
"name": "SCSS",
"bytes": "310370"
},
{
"name": "Shell",
"bytes": "515"
},
{
"name": "TSQL",
"bytes": "1199"
},
{
"name": "XSLT",
"bytes": "8150"
}
],
"symlink_target": ""
} |
<?php
/**
* Created by PhpStorm.
* User: maksim.d
* Date: 12/4/15
* Time: 03:11
*/
namespace frontend\models\game\characters\base\interfaces;
use frontend\models\game\base\BeeTypesInterface;
use frontend\models\game\base\GetHoneyPoolInterface;
use frontend\models\game\base\GetPlayerInterface;
interface BeeInterface extends CharacterInterface, GetPlayerInterface, BeeTypesInterface, GetHoneyPoolInterface
{
public function setId($id);
public function getId();
} | {
"content_hash": "90a8eea3be7b0dc6f4ad1cd0299a9259",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 111,
"avg_line_length": 23.95,
"alnum_prop": 0.7766179540709812,
"repo_name": "macseem/bee-game",
"id": "dc0ece206b39aba351df4846860a3ceb4a1ae88d",
"size": "479",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/models/game/characters/base/interfaces/BeeInterface.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1026"
},
{
"name": "CSS",
"bytes": "4606"
},
{
"name": "HTML",
"bytes": "843791"
},
{
"name": "PHP",
"bytes": "121763"
}
],
"symlink_target": ""
} |
<?php
// @codingStandardsIgnoreFile
namespace Magento\Cookie\Test\Unit\Model\Config\Backend;
use Magento\Framework\Session\Config\Validator\CookiePathValidator;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
class PathTest extends \PHPUnit_Framework_TestCase
{
/** @var \PHPUnit_Framework_MockObject_MockObject | CookiePathValidator */
private $validatorMock;
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Module\ModuleResource */
private $resourceMock;
/** @var \Magento\Cookie\Model\Config\Backend\Path */
private $model;
protected function setUp()
{
$this->validatorMock = $this->getMockBuilder('Magento\Framework\Session\Config\Validator\CookiePathValidator')
->disableOriginalConstructor()
->getMock();
$this->resourceMock = $this->getMockBuilder('Magento\Framework\Module\ModuleResource')
->disableOriginalConstructor()
->getMock();
$objectManager = new ObjectManager($this);
$this->model = $objectManager->getObject('Magento\Cookie\Model\Config\Backend\Path',
[
'configValidator' => $this->validatorMock,
'resource' => $this->resourceMock
]
);
}
/**
* Method is not publicly accessible, so it must be called through parent
*
* @expectedException \Magento\Framework\Exception\LocalizedException
* @expectedExceptionMessage Invalid cookie path
*/
public function testBeforeSaveException()
{
$invalidCookiePath = 'invalid path';
$this->validatorMock->expects($this->once())
->method('isValid')
->with($invalidCookiePath)
->willReturn(false);
// Must throw exception
$this->model->setValue($invalidCookiePath)->beforeSave();
}
/**
* Method is not publicly accessible, so it must be called through parent
*
* No assertions exist because the purpose of the test is to make sure that no
* exception gets thrown
*/
public function testBeforeSaveNoException()
{
$validCookiePath = 1;
$this->validatorMock->expects($this->once())
->method('isValid')
->with($validCookiePath)
->willReturn(true);
$this->resourceMock->expects($this->any())->method('addCommitCallback')->willReturnSelf();
// Must not throw exception
$this->model->setValue($validCookiePath)->beforeSave();
}
/**
* Method is not publicly accessible, so it must be called through parent
*
* Empty string should not be sent to validator
*/
public function testBeforeSaveEmptyString()
{
$validCookiePath = '';
$this->validatorMock->expects($this->never())
->method('isValid');
$this->resourceMock->expects($this->any())->method('addCommitCallback')->willReturnSelf();
// Must not throw exception
$this->model->setValue($validCookiePath)->beforeSave();
}
}
| {
"content_hash": "fc44d27dc2157bb25ce1036b5ef235f6",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 118,
"avg_line_length": 32.946236559139784,
"alnum_prop": 0.6380548302872062,
"repo_name": "j-froehlich/magento2_wk",
"id": "3fe1c4235dde0722bbfb3cff17c31fc955b2cf66",
"size": "3233",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "vendor/magento/module-cookie/Test/Unit/Model/Config/Backend/PathTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "13636"
},
{
"name": "CSS",
"bytes": "2076720"
},
{
"name": "HTML",
"bytes": "6151072"
},
{
"name": "JavaScript",
"bytes": "2488727"
},
{
"name": "PHP",
"bytes": "12466046"
},
{
"name": "Shell",
"bytes": "6088"
},
{
"name": "XSLT",
"bytes": "19979"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Spinner
android:id="@+id/month_spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/category_spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/expense_amount_textbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="@string/expense_amount_hint"
android:inputType="numberDecimal" >
<requestFocus />
</EditText>
<Spinner
android:id="@+id/spinner3"
android:entries="@array/currency_array"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<Button
android:id="@+id/add_expense_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add_expense_text" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/expensesToPostText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/expenses_to_post_text"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/expensesToPostValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/expenses_to_post_default"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="2">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/total_text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/monthTotalDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</LinearLayout>
| {
"content_hash": "859e8517e95c1db92ebb4adc860e2405",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 74,
"avg_line_length": 33.7816091954023,
"alnum_prop": 0.6165362368152433,
"repo_name": "nbeckman/nolacoaster",
"id": "88e53c5b8c1b70e85768cf2447a6aae63e4ea53d",
"size": "2939",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Megabudget/res/layout/main_budget.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "135"
},
{
"name": "Emacs Lisp",
"bytes": "6477"
},
{
"name": "HTML",
"bytes": "14577"
},
{
"name": "Java",
"bytes": "314235"
},
{
"name": "Python",
"bytes": "3817"
}
],
"symlink_target": ""
} |
namespace Google.Cloud.PubSub.V1.Snippets
{
// [START pubsub_v1_generated_SubscriberServiceApi_ModifyPushConfig_async_flattened_resourceNames]
using Google.Cloud.PubSub.V1;
using System.Threading.Tasks;
public sealed partial class GeneratedSubscriberServiceApiClientSnippets
{
/// <summary>Snippet for ModifyPushConfigAsync</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public async Task ModifyPushConfigResourceNamesAsync()
{
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
SubscriptionName subscription = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]");
PushConfig pushConfig = new PushConfig();
// Make the request
await subscriberServiceApiClient.ModifyPushConfigAsync(subscription, pushConfig);
}
}
// [END pubsub_v1_generated_SubscriberServiceApi_ModifyPushConfig_async_flattened_resourceNames]
}
| {
"content_hash": "b3aba67989afc66e146f4b69ce3c4bf3",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 116,
"avg_line_length": 48,
"alnum_prop": 0.7067307692307693,
"repo_name": "jskeet/gcloud-dotnet",
"id": "1529bf863e9c2e1801f56e31c083ef3d3e260cb8",
"size": "1870",
"binary": false,
"copies": "2",
"ref": "refs/heads/bq-migration",
"path": "apis/Google.Cloud.PubSub.V1/Google.Cloud.PubSub.V1.GeneratedSnippets/SubscriberServiceApiClient.ModifyPushConfigResourceNamesAsyncSnippet.g.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1725"
},
{
"name": "C#",
"bytes": "1829733"
}
],
"symlink_target": ""
} |
/** @fileoverview
* This tool executes an SQL select to PostgreSQL
* database and returns resulted field list in JSON. */
var fs = require('fs');
var pg = require('pg.js');
var Promise = require('es6-promise').Promise;
/** @constructor
* Deferred encapsulates a promise that gets fulfilled by outside code. */
var Deferred = function () {
var self = this;
this.promise = new Promise(function (resolve, reject) {
self.resolve = resolve;
self.reject = reject;
});
};
/** Return a new function that calls fn making it see the desired scope
* through its "this" variable.
* @param {Object} scope Variable fn should see as "this".
* @param {function()} fn Function to call. */
function bindToScope(scope, fn) {
return function () {
fn.apply(scope, arguments);
};
}
/** @constructor
* PostgreSQL database interface.
* Simple wrapper to use promises with pg.js. */
var PgDatabase = function () {
this.client = null;
};
/** @param {Object} client:
* host, port, database, user and password. */
PgDatabase.prototype.connect = function (client) {
var defer = new Deferred();
this.client = client;
defer.resolve();
return (defer.promise);
};
/** Execute query without reading any results. */
PgDatabase.prototype.exec = function () {
var query = this.client.query.apply(this.client, arguments);
var defer = new Deferred();
query.on('error', function (err) {
defer.reject(err);
});
query.on('end', function (state) {
defer.resolve(state);
});
return (defer.promise);
};
/** Send query to database and read a single result row. */
PgDatabase.prototype.queryResult = function () {
var query = this.client.query.apply(this.client, arguments);
var defer = new Deferred();
var result = [];
query.on('row', function (row) {
result.push(row);
});
query.on('error', function (err) {
defer.reject(err);
});
query.on('end', function (state) {
if (!result) return (defer.reject('Not found'));
defer.resolve(result);
});
return (defer.promise);
};
PgDatabase.prototype.begin = function () {
return (this.exec('BEGIN TRANSACTION'));
};
PgDatabase.prototype.commit = function () {
return (this.exec('COMMIT'));
};
PgDatabase.prototype.rollback = function () {
return (this.exec('ROLLBACK'));
};
/** @constructor
* FieldSelector executes slq select to
* an SQL database. */
var FieldSelector = function () {
this.db = null;
};
/** @param {string} client Name of JSON file with database address and credentials. */
FieldSelector.prototype.connect = function (client) {
var defer = new Deferred();
this.db = new PgDatabase();
return (this.db.connect(client));
};
/**
* Read parameter values from database
* @param id config id
* @returns {Promise}
*/
FieldSelector.prototype.readFields = function() {
var self = this,
sql = 'SELECT search_tag FROM sld_type ORDER BY id';
console.log("readFields SQL: ", sql);
return (self.db.queryResult(sql));
};
/** Roll back current transaction and close connection. */
FieldSelector.prototype.abort = function () {
return (this.db.rollback());
};
/** Commit current transaction and close connection. */
FieldSelector.prototype.finish = function () {
return (this.db.commit());
};
/** Top function, to execute sql statement
*/
exports.select_fields = function (client, cb) {
console.log("in select_fields");
var selector = new FieldSelector(),
callback = cb;
var connected = selector.connect(client);
// Read parameter values
var ready = connected.then(function () {
return (selector.readFields());
});
ready.catch(function (err) {
console.error(err);
});
ready.then(function(readyResult) {
var i;
var result = [];
// Convert result to JSON object
for (i=0; i<readyResult.length; i++) {
result.push(JSON.parse('{"path":['+readyResult[i].search_tag+']}'));
}
console.log('Select fields success!');
callback(false, result);
});
};
| {
"content_hash": "69c858d49e572da0dd17cd8e5957a31c",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 86,
"avg_line_length": 25.181818181818183,
"alnum_prop": 0.6315282791817087,
"repo_name": "elf-oskari/NOSE",
"id": "9c2ae9ef184ed51deee413256898162d57ab8679",
"size": "4155",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sources/select_fields.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "147"
},
{
"name": "CSS",
"bytes": "131009"
},
{
"name": "HTML",
"bytes": "59449"
},
{
"name": "JavaScript",
"bytes": "8259085"
},
{
"name": "Scheme",
"bytes": "116963"
}
],
"symlink_target": ""
} |
'use strict';
var isA = require("Espresso/oop").isA;
var oop = require("Espresso/oop").oop;
var init = require("Espresso/oop").init;
var trim = require("Espresso/trim").trim;
var isA = require("Espresso/oop").isA;
var oop = require("Espresso/oop").oop;
var EncoderFactoryInterface = function(){
oop(this,"Espresso/Security/Core/Encoder/EncoderFactoryInterface");
}
/**
* Returns the password encoder to use for the given account.
*
* @param UserInterface|string $user A UserInterface instance or a class name
*
* @return PasswordEncoderInterface
*
* @throws \RuntimeException when no password encoder could be found for the user
public function getEncoder($user);
*/
module.exports = EncoderFactoryInterface; | {
"content_hash": "9676ffb4299362a4bcbaffdf7c66cc2d",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 81,
"avg_line_length": 25,
"alnum_prop": 0.7393103448275862,
"repo_name": "quimsy/espresso",
"id": "7e7a0838ab2114f82d71af50ea0bdaa5ea7b5ff4",
"size": "725",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Security/Core/Encoder/EncoderFactoryInterface.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Groff",
"bytes": "16024"
},
{
"name": "JavaScript",
"bytes": "598071"
}
],
"symlink_target": ""
} |
<!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/html; charset=utf-8" />
<meta name="GENERATOR" content="VSdocman - documentation generator; https://www.helixoft.com" />
<link rel="icon" href="favicon.ico">
<title>InvoicePerson.Address Property</title>
<link rel="stylesheet" type="text/css" href="msdn2019/toc.css" />
<script src="msdn2019/toc.js"></script>
<link rel="stylesheet" type="text/css" href="msdn2019/msdn2019.css"></link>
<script src="msdn2019/msdn2019.js" type="text/javascript"></script>
<script src="SyntaxHighlighter/scripts/shCore_helixoft.js" type="text/javascript"></script>
<script src="SyntaxHighlighter/scripts/shBrushVb.js" type="text/javascript"></script>
<script src="SyntaxHighlighter/scripts/shBrushCSharp.js" type="text/javascript"></script>
<script src="SyntaxHighlighter/scripts/shBrushFSharp.js" type="text/javascript"></script>
<script src="SyntaxHighlighter/scripts/shBrushCpp.js" type="text/javascript"></script>
<script src="SyntaxHighlighter/scripts/shBrushJScript.js" type="text/javascript"></script>
<link href="SyntaxHighlighter/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="SyntaxHighlighter/styles/shThemeMsdnLW.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
SyntaxHighlighter.all();
</script>
<link rel="stylesheet" type="text/css" href="vsdocman_overrides.css"></link>
</head>
<body style="direction: ltr;">
<div id="topic">
<!--HEADER START-->
<div id="header">
<div id="header-top-container">
<div id="header-top-parent-container1">
<div id="header-top-container1">
<div id="runningHeaderText1"><a id="headerLogo" href="#" onclick="window.location.href = getCssCustomProperty('--headerLogoLink'); return false;">logo</a></div>
<div id="runningHeaderText1b"><script>
document.write(getCssCustomProperty('--headerTopCustomLineHtml'));
</script></div>
</div>
</div>
<div id="header-top-container2">
<div id="runningHeaderText">SOLUTION-WIDE PROPERTIES Reference</div>
<div id="search-bar-container">
<form id="search-bar" action="search--.html">
<input id="HeaderSearchInput" type="search" name="search" placeholder="Search" >
<button id="btn-search" class="c-glyph" title="Search">
<span>Search</span>
</button>
</form>
<button id="cancel-search" class="cancel-search" title="Cancel">
<span>Cancel</span>
</button>
</div>
</div>
</div>
<hr />
<div id="header-breadcrumbs"></div>
<div id="headerLinks">
</div>
<hr />
</div>
<!--HEADER END-->
<div id="mainSection">
<div id="toc-area">
<div id="toc-container" class="stickthis full-height">
<div id="-1"></div>
<div id="c-1">
<div id="ci-1" class="inner-for-height"></div>
</div>
</div>
</div>
<div id="mainBody">
<h1 class="title">InvoicePerson.Address Property</h1>
<div class="metadata">
Namespace:
<a href="topic_00000000000007B3.html">Tlece.Recruitment.Models</a>
<br />Assembly: Tlece.Recruitment (in Tlece.Recruitment.dll)
</div>
<div class="section_container">
<div id="syntaxSection" class="section">
<div id="syntaxCodeBlocks">
<div class="codeSnippetContainer">
<div class="codeSnippetTabs">
<div class="codeSnippetTabLeftCornerActive">
</div>
<div class="codeSnippetTab csFirstTab csActiveTab codeVB">
<a>VB</a>
</div>
<div class="codeSnippetTab csNaTab codeCsharp">
<a href="javascript: CodeSnippet_SetLanguage('Csharp');">C#</a>
</div>
<div class="codeSnippetTab csNaTab codeFsharp">
<a href="javascript: CodeSnippet_SetLanguage('Fsharp');">F#</a>
</div>
<div class="codeSnippetTab csNaTab codeCpp">
<a href="javascript: CodeSnippet_SetLanguage('Cpp');">C++</a>
</div>
<div class="codeSnippetTab csLastTab csNaTab codeJScript">
<a href="javascript: CodeSnippet_SetLanguage('JScript');">JScript</a>
</div>
<div class="codeSnippetTabRightCorner">
</div>
<div style="clear:both;">
</div>
</div>
<div class="codeSnippetCodeCollection">
<div class="codeSnippetToolbar">
<a title="Copy to clipboard." href="javascript:void(0)" onclick="CopyCode(this);">Copy</a>
</div>
<div class="codeSnippetCode codeVB">
<pre xml:space="preserve" class="brush: vb">Public Property Address() As <a target="_top" href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a></pre>
</div>
<div class="codeSnippetCode codeNA">
<pre xml:space="preserve">This language is not supported or no code example is available.</pre>
</div>
</div>
</div>
<div class="codeSnippetContainer">
<div class="codeSnippetTabs">
<div class="codeSnippetTabLeftCorner">
</div>
<div class="codeSnippetTab csFirstTab csNaTab codeVB">
<a>VB</a>
</div>
<div class="codeSnippetTab csActiveTab codeCsharp">
<a href="javascript: CodeSnippet_SetLanguage('Csharp');">C#</a>
</div>
<div class="codeSnippetTab csNaTab codeFsharp">
<a href="javascript: CodeSnippet_SetLanguage('Fsharp');">F#</a>
</div>
<div class="codeSnippetTab csNaTab codeCpp">
<a href="javascript: CodeSnippet_SetLanguage('Cpp');">C++</a>
</div>
<div class="codeSnippetTab csLastTab csNaTab codeJScript">
<a href="javascript: CodeSnippet_SetLanguage('JScript');">JScript</a>
</div>
<div class="codeSnippetTabRightCorner">
</div>
<div style="clear:both;">
</div>
</div>
<div class="codeSnippetCodeCollection">
<div class="codeSnippetToolbar">
<a title="Copy to clipboard." href="javascript:void(0)" onclick="CopyCode(this);">Copy</a>
</div>
<div class="codeSnippetCode codeCsharp">
<pre xml:space="preserve" class="brush: csharp">public <a target="_top" href="https://docs.microsoft.com/en-us/dotnet/api/system.string">string</a> Address {get; set;}</pre>
</div>
<div class="codeSnippetCode codeNA">
<pre xml:space="preserve">This language is not supported or no code example is available.</pre>
</div>
</div>
</div>
<div class="codeSnippetContainer">
<div class="codeSnippetTabs">
<div class="codeSnippetTabLeftCorner">
</div>
<div class="codeSnippetTab csFirstTab csNaTab codeVB">
<a>VB</a>
</div>
<div class="codeSnippetTab csNaTab codeCsharp">
<a href="javascript: CodeSnippet_SetLanguage('Csharp');">C#</a>
</div>
<div class="codeSnippetTab csNaTab codeFsharp">
<a href="javascript: CodeSnippet_SetLanguage('Fsharp');">F#</a>
</div>
<div class="codeSnippetTab csActiveTab codeCpp">
<a href="javascript: CodeSnippet_SetLanguage('Cpp');">C++</a>
</div>
<div class="codeSnippetTab csLastTab csNaTab codeJScript">
<a href="javascript: CodeSnippet_SetLanguage('JScript');">JScript</a>
</div>
<div class="codeSnippetTabRightCorner">
</div>
<div style="clear:both;">
</div>
</div>
<div class="codeSnippetCodeCollection">
<div class="codeSnippetToolbar">
<a title="Copy to clipboard." href="javascript:void(0)" onclick="CopyCode(this);">Copy</a>
</div>
<div class="codeSnippetCode codeCpp">
<pre xml:space="preserve" class="brush: cpp">public: <br />property <a target="_top" href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a>^ Address { <br /> <a target="_top" href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a>^ get( ); <br /> void set( <br /> <a target="_top" href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a>^ value <br /> ); <br />}</pre>
</div>
<div class="codeSnippetCode codeNA">
<pre xml:space="preserve">This language is not supported or no code example is available.</pre>
</div>
</div>
</div>
<div class="codeSnippetContainer">
<div class="codeSnippetTabs">
<div class="codeSnippetTabLeftCorner">
</div>
<div class="codeSnippetTab csFirstTab csNaTab codeVB">
<a>VB</a>
</div>
<div class="codeSnippetTab csNaTab codeCsharp">
<a href="javascript: CodeSnippet_SetLanguage('Csharp');">C#</a>
</div>
<div class="codeSnippetTab csNaTab codeFsharp">
<a href="javascript: CodeSnippet_SetLanguage('Fsharp');">F#</a>
</div>
<div class="codeSnippetTab csNaTab codeCpp">
<a href="javascript: CodeSnippet_SetLanguage('Cpp');">C++</a>
</div>
<div class="codeSnippetTab csActiveTab csLastTab codeJScript">
<a href="javascript: CodeSnippet_SetLanguage('JScript');">JScript</a>
</div>
<div class="codeSnippetTabRightCornerActive">
</div>
<div style="clear:both;">
</div>
</div>
<div class="codeSnippetCodeCollection">
<div class="codeSnippetToolbar">
<a title="Copy to clipboard." href="javascript:void(0)" onclick="CopyCode(this);">Copy</a>
</div>
<div class="codeSnippetCode codeJScript">
<pre xml:space="preserve" class="brush: js">public function get Address() : <a target="_top" href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a>; <br />public function set Address(value : <a target="_top" href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a>);</pre>
</div>
<div class="codeSnippetCode codeNA">
<pre xml:space="preserve">This language is not supported or no code example is available.</pre>
</div>
</div>
</div>
</div>
<h4 class="subHeading">
Property Value</h4>
<a target="_top" href="https://docs.microsoft.com/en-us/dotnet/api/system.string">string</a>
</div>
</div>
<div class="section_container">
<div class="section_heading">
<span><a href="javascript:void(0)" title="Collapse" onclick="toggleSection(this);">Applies to</a></span>
<div> </div>
</div>
<div id="frameworksSection" class="section">
<h4 class="subHeading">.NET Framework</h4>Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1<br />
</div>
</div>
<div class="section_container">
<div class="section_heading">
<span><a href="javascript:void(0)" title="Collapse" onclick="toggleSection(this);">See Also</a></span>
<div> </div>
</div>
<div id="seeAlsoSection" class="section">
<div>
<a href="topic_0000000000000A20.html">InvoicePerson Class</a><br />
<a href="topic_00000000000007B3.html">Tlece.Recruitment.Models Namespace</a><br />
</div>
</div>
</div>
</div>
<div id="internal-toc-area">
<div id="internal-toc-container" class="stickthis">
<h3 id="internal-toc-heading">In this article</h3>
<span id="internal-toc-definition-localized-text">Definition</span>
</div>
</div>
</div>
<div id="footer">
<div id="footer-container">
<p><span style="color: #FF0000;">Generated with unregistered version of <a target="_top" href="http://www.helixoft.com/vsdocman/overview.html">VSdocman</a></span> <br />Your own footer text will only be shown in registered version.</p>
</div>
</div>
</div>
</body>
</html>
| {
"content_hash": "29e6c9f81fbae8172db57278fdc542c0",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 469,
"avg_line_length": 30.081841432225065,
"alnum_prop": 0.632205407243666,
"repo_name": "asiboro/asiboro.github.io",
"id": "5d4c9e392a8d18224d89f8e84ba4285d396445f2",
"size": "11762",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vsdoc/topic_0000000000000A22.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "310000"
},
{
"name": "HTML",
"bytes": "135195"
},
{
"name": "JavaScript",
"bytes": "621923"
}
],
"symlink_target": ""
} |
'use strict';
describe('Controller: SettingsCtrl', function () {
// load the controller's module
beforeEach(module('sayonaraAdminApp'));
var SettingsCtrl,
scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
SettingsCtrl = $controller('SettingsCtrl', {
$scope: scope
// place here mocked dependencies
});
}));
it('should attach a list of awesomeThings to the scope', function () {
expect(SettingsCtrl.awesomeThings.length).toBe(3);
});
});
| {
"content_hash": "b06aa979e0e33c875cafec1a92d1433c",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 72,
"avg_line_length": 25,
"alnum_prop": 0.6678260869565218,
"repo_name": "SayonaraJS/SayonaraJS",
"id": "02d03974912a4565849033f1cd9c069b0136f76a",
"size": "575",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "SayonaraAdmin/test/spec/controllers/settings.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6167"
},
{
"name": "HTML",
"bytes": "49313"
},
{
"name": "JavaScript",
"bytes": "235295"
}
],
"symlink_target": ""
} |
package com.jimmt.HologramClock;
import java.util.Arrays;
import java.util.Calendar;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.utils.viewport.FillViewport;
public class BaseScreen implements Screen {
Stage stage;
Stage uiStage;
Skin skin;
BitmapFont fontBig, fontSmall;
SettingsDialog settingsDialog;
TimeDisplay[] displays = new TimeDisplay[4];
float[] rotations = { 0, 90, -90, 180 };
int hour, day, month, year, minute, second;
boolean militaryTime;
public BaseScreen(HologramClock main) {
militaryTime = Prefs.prefs.getBoolean("militaryTime");
stage = new Stage(new FillViewport(Constants.WIDTH, Constants.HEIGHT));
uiStage = new Stage(new FillViewport(Constants.WIDTH, Constants.HEIGHT));
skin = new Skin(Gdx.files.internal("skin/uiskin.json"));
// FreeTypeFontGenerator generator = new FreeTypeFontGenerator(
// Gdx.files.internal("GeosansLight.ttf"));
// FreeTypeFontParameter parameter = new FreeTypeFontParameter();
// parameter.size = 105;
// parameter.borderWidth = 3;
// geosanslight = generator.generateFont(parameter);
// parameter.borderWidth = 0;
// parameter.size = 40;
// fontSmall = generator.generateFont(parameter);
// generator.dispose();
fontBig = new BitmapFont(Gdx.files.internal("geosanslight_big.fnt"));
fontSmall = new BitmapFont(Gdx.files.internal("geosanslight_small.fnt"));
int initialSelection = Prefs.prefs.getInteger("displayIndex");
DisplayEffect effect = null;
effect = DisplayEffect.values()[initialSelection];
for (int i = 0; i < 4; i++) {
displays[i] = new TimeDisplay(fontBig, effect, rotations[i], i == 1 || i == 2);
displays[i].setPosition(Constants.WIDTH / 2, Constants.HEIGHT / 2);
stage.addActor(displays[i]);
}
updateTime();
Gdx.input.setInputProcessor(new InputMultiplexer(uiStage, stage));
addIcon();
settingsDialog = new SettingsDialog(skin, initialSelection, this);
// settingsDialog.setVisible(false);
// stage.addActor(settingsDialog);
}
public void addIcon() {
Image icon = new Image(new Texture(Gdx.files.internal("settingsicon.png")));
stage.addActor(icon);
icon.setSize(128, 128);
icon.setPosition(Constants.WIDTH / 2 - icon.getWidth() / 2,
Constants.HEIGHT / 2 - icon.getHeight() / 2);
icon.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
settingsDialog.show(uiStage);
}
});
}
public void switchEffect(DisplayEffect effect) {
for (int i = 0; i < 4; i++) {
stage.getActors().removeValue(displays[i], false);
displays[i] = new TimeDisplay(fontBig, effect, rotations[i], i == 1 || i == 2);
displays[i].setPosition(Constants.WIDTH / 2, Constants.HEIGHT / 2);
stage.addActor(displays[i]);
}
}
public void rotateEffect(ParticleEffect effect, float deg) {
effect.getEmitters().get(0).getAngle()
.setLow(effect.getEmitters().get(0).getAngle().getLowMin() - deg);
effect.getEmitters()
.get(0)
.getAngle()
.setHigh(effect.getEmitters().get(0).getAngle().getHighMin() - deg,
effect.getEmitters().get(0).getAngle().getHighMax() - deg);
}
public void updateTime() {
if (militaryTime) {
hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
} else {
hour = Calendar.getInstance().get(Calendar.HOUR);
if(hour == 0){
hour = 12;
}
}
day = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
month = Calendar.getInstance().get(Calendar.MONTH);
year = Calendar.getInstance().get(Calendar.YEAR);
minute = Calendar.getInstance().get(Calendar.MINUTE);
second = Calendar.getInstance().get(Calendar.SECOND);
// hour = 12;
// month = 0;
// minute = 0;
// second = 0;
}
public void updateDisplays() {
for (int i = 0; i < displays.length; i++) {
displays[i].label.setText(hour + ":" + String.format("%02d", minute) + ":"
+ String.format("%02d", second));
}
}
@Override
public void render(float delta) {
Gdx.gl.glClearColor(0, 0, 0, 1.0f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
stage.act(delta);
stage.draw();
uiStage.act(delta);
uiStage.draw();
updateTime();
updateDisplays();
// for (Container container : containers) {
// // if (container.getActions().size == 0) {
// // container.addAction(Actions.sequence(Actions.scaleBy(1, 1, 1),
// // Actions.scaleBy(-1, -1, 1)));
// // }
// container.setOrigin(10, 10);
//
// }
}
@Override
public void resize(int width, int height) {
stage.getViewport().update(width, height, true);
}
@Override
public void show() {
}
@Override
public void hide() {
}
@Override
public void pause() {
}
@Override
public void resume() {
}
@Override
public void dispose() {
}
}
| {
"content_hash": "3d567398c6d86a18e9536c90241e4d2f",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 82,
"avg_line_length": 27.78494623655914,
"alnum_prop": 0.6965944272445821,
"repo_name": "Jimmt/HologramClock",
"id": "6152c3bb02280f5f36ec246ee9f591743d79060c",
"size": "5168",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/com/jimmt/HologramClock/BaseScreen.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1069"
},
{
"name": "HTML",
"bytes": "1526"
},
{
"name": "Java",
"bytes": "21068"
},
{
"name": "JavaScript",
"bytes": "24"
},
{
"name": "OpenEdge ABL",
"bytes": "42771"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<title>the blog</title>
<meta charset="UTF-8">
<!--<link rel="stylesheet" type="text/css" href="../stylesheets/default.css">-->
<link rel="stylesheet" type="text/css" href="../stylesheets/blog-stylesheet.css">
</head>
<main>
<div id="body">
<h1><a href="blog-template.html">the blog</a></h1>
<h2>tales from DBC</h2>
<div id="previous">
<h3> previous entries</h3>
<ul>
<li><a href="t1-git-blog.html">first</a></li>
<li><a href="c1-chefs-kitchen.html">second</a></li>
<li><a href="t2-css-design.html">third</a></li>
<li><a href="t3-arrays-hashes.html">fourth</a></li>
<li><a href="c3_thinking-style.html">fifth</a></li>
<li><a href="t4-enumerable-methods.html">sixth</a></li>
<li><a href="c4-tech-issues.html">seventh</a></li>
<li><a href="t5-ruby-classes.html">eigth</a></li>
<li><a href="c5-feedback.html">ninth</a></li>
<li><a href="t6-oop-concepts.html">ten</a></li>
<li><a href="c6-stereotype-threat.html">eleven</a></li>
<li><a href="t7-JavaScript.html">twelve</a></li>
<li><a href="c7-values.html">thirteen</a></li>
<li><a href="t8-tech.html">fourteen</a></li>
<li><a href="c8-conflict.html">fifteen</a></li>
<li><a href="c9-questions.html">sixteen</a></li>
</ul>
<a href="../index.html">back home</a>
</div>
<section id="blog-entry">
<h3>May 9th - Ruby on Rails</h3>
<p>
What is Ruby on Rails? In short, it is a a framework for building websites. What that means is that it is a package of tools designed to make programming web apps easier by making assumptions about what every dev needs to get started (<a href="http://guides.rubyonrails.org/getting_started.html">Source</a>). It was created by David Heinemeier, who helped build the project management software called Bootcamp, as an extension of the Ruby programming language. Like any other type of extension to the Ruby language, Ruby on Rails is a Ruby Gem.
</p>
<p>
Ruby is known for having a community dedicated to open source development. As such, there is a vast pool of open source software RoR libraries that make is easier to build complex sites quickly, which makes Ruby on Rails appealing to startups. Moreoever, "Ruby is known among programmers for a terse, uncluttered syntax that doesn’t require a lot of extra punctuation. Compared to Java, Ruby is streamlined, with less code required to create basic structures such as data fields." (<a href="http://railsapps.github.io/what-is-ruby-rails.html">Source</a>)
</p>
<p>
Like .NET, Ruby on Rails follows the MVC (Model View Controller) framework. This configuration means that the model maps to a table in a database, the controller responds to external requests and decides which file to render to a user, and the view evalutes and converts to HTML at runtime, and is displayed to the user.
</p>
<p>
Over 600,000 websites use Ruby on Rails, including Basecamp, Twitter, Hulu, Groupon, GitHub, AirBnB, and Square. An impressive list.
</p>
</section>
</div>
</main>
</html>
| {
"content_hash": "57c7c2ccfefebd541b94dd73fb27e595",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 560,
"avg_line_length": 56.67272727272727,
"alnum_prop": 0.6746871992300288,
"repo_name": "boguth/boguth.github.io",
"id": "9277f0264b56f91a79a60865c71a049aa244af02",
"size": "3119",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "blog/t8-tech.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2015"
},
{
"name": "HTML",
"bytes": "72762"
}
],
"symlink_target": ""
} |
package net.sourceforge.plantuml.skin;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
public class Area {
private final Dimension2D dimensionToUse;
private double deltaX1;
@Override
public String toString() {
return dimensionToUse.toString() + " (" + deltaX1 + ")";
}
public Area(Dimension2D dimensionToUse) {
this.dimensionToUse = dimensionToUse;
}
public Area(double with, double height) {
this(new Dimension2DDouble(with, height));
}
public Dimension2D getDimensionToUse() {
return dimensionToUse;
}
public void setDeltaX1(double deltaX1) {
this.deltaX1 = deltaX1;
}
public final double getDeltaX1() {
return deltaX1;
}
}
| {
"content_hash": "ef78a06e94df2272628973bec033cf6b",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 58,
"avg_line_length": 18.473684210526315,
"alnum_prop": 0.7393162393162394,
"repo_name": "Banno/sbt-plantuml-plugin",
"id": "d1addfe710cbd15898c8cb05fa1875abf4246e20",
"size": "1621",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/net/sourceforge/plantuml/skin/Area.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "12451864"
},
{
"name": "Scala",
"bytes": "7987"
},
{
"name": "Shell",
"bytes": "1069"
}
],
"symlink_target": ""
} |
@charset "UTF-8";
/*******************************************
*** SO Framework: Sass ***
*******************************************/
/* [2] */
/* [8] */
/*===============================================
[SASS DIRECTORY ]
[1] Minxin Link
[2] Minxin Button
[3] Minxin Triangle
[4] Minxin LABEL PRODUCT
[5] Minxin Scrollbars
[6] Minxin Dev Custom
==============================================*/
.no-margin {
margin: 0 !important; }
/*Dev Custom */
.lib-list-item-product2 {
border: none; }
.lib-list-item-product2 .image-dev .list-button-dev {
position: absolute;
top: 50%;
left: 50%;
z-index: 10;
transform: translate3d(-50%, -50%, 0);
-moz-transform: translate3d(-50%, -50%, 0);
-webkit-transform: translate3d(-50%, -50%, 0);
-ms-transform: translate3d(-50%, -50%, 0); }
.lib-list-item-product2 .image-dev .list-button-dev li {
display: inline-block;
float: left;
height: 40px;
width: 40px;
background: #fff;
position: relative;
border-width: 0 1px 0 0;
border-style: solid;
border-color: #ddd;
opacity: 0;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out; }
.lib-list-item-product2 .image-dev .list-button-dev li:nth-child(1) {
transform: translateX(40px);
-moz-transform: translateX(40px);
-webkit-transform: translateX(40px);
-ms-transform: translateX(40px);
z-index: 1;
transition-delay: 0s; }
.lib-list-item-product2 .image-dev .list-button-dev li:nth-child(2) {
transition-delay: 0.2s;
z-index: 2; }
.lib-list-item-product2 .image-dev .list-button-dev li:nth-child(3) {
transition-delay: 0.2s;
z-index: 2; }
.lib-list-item-product2 .image-dev .list-button-dev li:nth-child(4) {
transform: translateX(-40px);
-moz-transform: translateX(-40px);
-webkit-transform: translateX(-40px);
-ms-transform: translateX(-40px);
z-index: 1;
transition-delay: 0s; }
.lib-list-item-product2 .image-dev .list-button-dev li:first-child {
border-left: 1px solid #ddd; }
.lib-list-item-product2 .image-dev .list-button-dev li a, .lib-list-item-product2 .image-dev .list-button-dev li button {
background: none;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
line-height: 40px;
text-align: center;
box-shadow: none;
border: none;
color: #555;
width: 40px;
padding: 0; }
.lib-list-item-product2 .image-dev .list-button-dev li:hover {
background: #ff5c00; }
.lib-list-item-product2 .image-dev .list-button-dev li:hover a, .lib-list-item-product2 .image-dev .list-button-dev li:hover button {
color: #fff; }
.lib-list-item-product2 .caption-dev {
text-align: center;
padding: 0 15px; }
.lib-list-item-product2 .caption-dev .rating-dev {
margin: 5px 0; }
.lib-list-item-product2 .caption-dev .rating-dev .fa-stack-2x {
font-size: 11px; }
.lib-list-item-product2 .caption-dev .title-dev {
color: #444;
font-size: 13px; }
.lib-list-item-product2 .caption-dev .price-dev .price.product-price {
font-size: 16px; }
.lib-list-item-product2 .caption-dev .price-dev .price-new {
font-size: 16px; }
.lib-list-item-product2 .caption-dev .price-dev .price-old {
font-size: 12px; }
.lib-list-item-product2 .caption-dev .add-cart-dev {
background: #fff;
border: 1px solid #ddd;
font-size: 12px;
text-transform: uppercase;
color: #999;
font-weight: bold;
box-shadow: none;
border-radius: 0;
padding: 6px 20px;
margin: 0 0 30px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out; }
.lib-list-item-product-over2 .image-dev .list-button-dev li {
opacity: 1;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out; }
.lib-list-item-product-over2 .image-dev .list-button-dev li:nth-child(1) {
transform: translateX(0);
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transition-delay: 0.2s; }
.lib-list-item-product-over2 .image-dev .list-button-dev li:nth-child(2) {
transition-delay: 0s; }
.lib-list-item-product-over2 .image-dev .list-button-dev li:nth-child(3) {
transition-delay: 0s; }
.lib-list-item-product-over2 .image-dev .list-button-dev li:nth-child(4) {
transform: translateX(0);
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transition-delay: 0.2s; }
/*EFECT PRODUCT NUMBER*/
.lib-two-img, .best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left .item-image .lt-image, .products-list .product-layout .product-item-container .left-block .product-image-container.second_img {
position: relative;
display: block; }
.lib-two-img .img-1, .best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left .item-image .lt-image .img-1, .products-list .product-layout .product-item-container .left-block .product-image-container.second_img .img-1 {
position: relative;
/*@include transform(rotateY(0deg));*/
transition: all 0.5s ease-in-out; }
.lib-two-img .img-2, .best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left .item-image .lt-image .img-2, .products-list .product-layout .product-item-container .left-block .product-image-container.second_img .img-2 {
position: absolute;
z-index: 0;
top: 0;
opacity: 0;
width: 100%;
display: block;
/*@include transform(rotateY(90deg));*/
transition: all 0.5s ease-in-out;
right: 0; }
.lib-two-img-over .img-1, .best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1:hover .media-left .item-image .lt-image .img-1, .products-list .product-layout .product-item-container:hover .left-block .product-image-container.second_img .img-1 {
opacity: 0;
/*transform-style: inherit;
@include transform(rotateY(90deg));*/
transition: all 0.5s ease-in-out; }
.lib-two-img-over .img-2, .best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1:hover .media-left .item-image .lt-image .img-2, .products-list .product-layout .product-item-container:hover .left-block .product-image-container.second_img .img-2 {
opacity: 1;
/*@include transform(rotateY(0deg));*/
transition: all 0.5s ease-in-out; }
/*EFFECT SLIDERHOME*/
@keyframes myeffect-slideshow {
0% {
opacity: 0;
transform: translateY(-300px);
-webkit-transform: translateY(-300px);
-moz-transform: translateY(-300px);
-ms-transform: translateY(-300px);
-o-transform: translateY(-300px); }
100% {
opacity: 1;
transform: translateY(0);
-moz-transform: translateY(0);
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0); } }
@-webkit-keyframes myeffect-slideshow {
0% {
opacity: 0;
transform: translateY(-300px);
-webkit-transform: translateY(-300px);
-moz-transform: translateY(-300px);
-ms-transform: translateY(-300px);
-o-transform: translateY(-300px); }
100% {
opacity: 1;
transform: translateY(0);
-moz-transform: translateY(0);
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0); } }
@-moz-keyframes myeffect-slideshow {
0% {
opacity: 0;
transform: translateY(-300px);
-webkit-transform: translateY(-300px);
-moz-transform: translateY(-300px);
-ms-transform: translateY(-300px);
-o-transform: translateY(-300px); }
100% {
opacity: 1;
transform: translateY(0);
-moz-transform: translateY(0);
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0); } }
/*===============================================
[SASS DIRECTORY ]
[1] BACK TO TOP
[2] SOCIAL ACCOUNTS
[3] TOP PANEL
[4] LARY LOADER
[5] NO RESPONSIVE BOOTSTRAP
[6] PRELOADING SCREEN
==============================================*/
/*============BACK TO TOP ==================*/
.back-to-top {
position: fixed;
bottom: 20px;
cursor: pointer;
background-color: #666;
border: 4px solid #ddd;
color: #ddd;
display: inline-block;
line-height: 44px;
text-align: center;
width: 48px;
height: 48px;
z-index: 30;
border-radius: 50%;
-webkit-border-radius: 50%;
opacity: 1;
left: 20px;
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1); }
.back-to-top.hidden-top {
bottom: -100px;
opacity: 0;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0); }
.back-to-top:hover {
background-color: #444; }
.back-to-top i {
font-size: 20px;
margin: 1px 0 0 0 !important;
color: #ddd;
display: inline-block; }
.back-to-top i:before {
content: '\f062'; }
/*============SOCIAL ACCOUNTS ==================*/
.social-widgets {
position: fixed;
z-index: 999;
top: 50%;
height: 0;
width: 0;
left: 0; }
.account-register .buttons input[type=checkbox] {
position: relative;
top: 3px; }
.social-widgets .item, .social-widgets .items {
margin: 0;
padding: 0;
list-style-type: none; }
.social-widgets .items {
top: -100px;
position: relative; }
.social-widgets .item {
position: absolute;
top: 0;
right: 120px; }
.social-widgets .active {
z-index: 100;
right: -310px; }
.social-widgets .item-01, .social-widgets .item-02, .social-widgets .item-03, .social-widgets .item-04, .social-widgets .item-05, .social-widgets .item-06, .social-widgets .item-07, .social-widgets .item-08, .social-widgets .item-09 {
right: 0; }
.social-widgets .item-01 {
top: 0;
z-index: 99; }
.social-widgets .item-02 {
top: 45px;
z-index: 98; }
.social-widgets .item-03 {
top: 90px;
z-index: 97; }
.social-widgets .item-04 {
top: 150px;
z-index: 96; }
.social-widgets .item-05 {
top: 200px;
z-index: 95; }
.social-widgets .tab-icon .fa {
font-size: 18px;
line-height: 45px; }
.social-widgets .tab-icon {
position: absolute;
top: 0;
right: -45px;
display: block;
width: 45px;
height: 45px;
background: #fff;
text-align: center;
font-size: 1.54em; }
.social-widgets .tab-icon:hover {
text-decoration: none; }
.social-widgets .active .tab-icon {
border-color: #e9e9e9;
background: #fff; }
.social-widgets .facebook .tab-icon {
background: #3b5998;
background-clip: content-box;
color: white; }
.social-widgets .twitter .tab-icon {
background: #07779a;
background-clip: content-box;
color: white; }
.social-widgets .youtube .tab-icon {
background: #da2723;
background-clip: content-box;
color: white; }
.social-widgets .tab-content {
background: #fff;
width: 310px;
padding: 10px; }
.social-widgets .active .tab-content {
box-shadow: 0 0 4px rgba(0, 0, 0, .15); }
.social-widgets .title {
margin: -10px -10px 10px;
padding: 0px 10px;
background-color: #ccc;
text-transform: uppercase;
line-height: 45px;
color: #000;
font-weight: bold; }
.social-widgets .title h5 {
line-height: 45px;
margin: 0; }
.social-widgets .facebook.active {
right: -260px; }
.social-widgets .facebook .tab-content {
width: 260px; }
.social-widgets .twitter.active {
right: -300px; }
.social-widgets .twitter .tab-content {
width: 300px; }
.social-widgets .twitter-widget {
padding-top: 10px; }
.social-widgets .youtube.active {
right: -450px; }
.social-widgets .youtube .tab-content {
width: 450px; }
.social-widgets .youtube .tab-content iframe {
width: 100%; }
.social-widgets .loading {
min-height: 200px;
position: relative;
z-index: 100; }
.social-widgets .loading img.ajaxloader {
position: absolute;
top: 45%;
right: 45%;
width: 32px;
height: 32px; }
/*============TOP PANEL ==================*/
.wrapper-boxed header.navbar-compact, .wrapper-iframed header.navbar-compact, .wrapper-rounded header.navbar-compact {
width: auto; }
header.navbar-compact .compact-hidden {
display: none; }
.navbar-compact .header-center {
padding: 20px 0; }
.navbar-compact .header-bottom {
margin: 0 0 10px; }
.navbar-switcher {
text-align: center;
float: left;
display: none;
width: 45px;
height: 45px;
margin-bottom: -47px;
background: #ff5c00 !important;
padding: 6px 7px;
border-radius: 0 0 3px 3px;
cursor: pointer;
color: #fff; }
.navbar-switcher.active {
background: #333 !important; }
.navbar-switcher .i-active, .navbar-switcher.active .i-inactive {
display: none; }
.navbar-switcher.active .i-active, .navbar-switcher .fa-caret-down {
display: inline;
font-size: 1.8em;
line-height: 1.5em; }
/*============LARY LOADER ==================*/
.lazy {
display: block;
overflow: hidden;
background: transparent url(../../images/lazy-loader.gif) no-repeat center center; }
@media (min-width: 1200px) {
.lazy.lazy-loaded {
background: none;
height: auto; }
.lazy img {
transition: 1s all ease;
opacity: 0;
-webkit-backface-visibility: hidden;
display: inline-block; }
.lazy.lazy-loaded img {
opacity: 1; } }
/*============NONE RESPONSIVE BOOTSTRAP ==================*/
@media (max-width: 1024px) {
.no-res {
width: 1190px; } }
.wrapper-boxed, .wrapper-iframed, .wrapper-rounded {
max-width: 1200px;
margin: 0 auto;
background: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, .2); }
.wrapper-iframed {
margin: 20px auto; }
.wrapper-rounded {
margin: 20px auto;
border-radius: 10px;
overflow: hidden; }
/*============Preloading Screen==================*/
/*============Preloading Screen==================*/
.loader-content {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000111;
background-color: #fff;
opacity: 1;
transition: all 500ms linear 0s; }
.loader-content.loader-off, body.loaded .loader-content {
opacity: 0;
visibility: hidden;
transition: all 500ms linear 0s; }
/* The loader container */
/*#loader {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
height: 200px;
margin-top: -100px;
margin-left: -100px;
perspective: 400px;
transform-type: preserve-3d;
}*/
/* The dot */
/* Preloader Css */
.loader-content {
background-color: #fff;
height: 100%;
width: 100%;
position: fixed;
z-index: 1;
margin-top: 0px;
top: 0px;
z-index: 99999999; }
#loader {
height: 100px;
left: 50%;
margin-left: -50px;
margin-top: -50px;
position: absolute;
text-align: center;
top: 50%;
width: 100px; }
.cssload-thecube {
width: 50px;
height: 50px;
margin: 0 auto;
margin-top: 49px;
position: relative;
transform: rotateZ(45deg);
-o-transform: rotateZ(45deg);
-ms-transform: rotateZ(45deg);
-webkit-transform: rotateZ(45deg);
-moz-transform: rotateZ(45deg); }
.cssload-thecube .cssload-cube {
position: relative;
transform: rotateZ(45deg);
-o-transform: rotateZ(45deg);
-ms-transform: rotateZ(45deg);
-webkit-transform: rotateZ(45deg);
-moz-transform: rotateZ(45deg); }
.cssload-thecube .cssload-cube {
float: left;
width: 50%;
height: 50%;
position: relative;
transform: scale(1.1);
-o-transform: scale(1.1);
-ms-transform: scale(1.1);
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1); }
.cssload-thecube .cssload-cube:before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #ff5c00;
animation: cssload-fold-thecube 2.76s infinite linear both;
-o-animation: cssload-fold-thecube 2.76s infinite linear both;
-ms-animation: cssload-fold-thecube 2.76s infinite linear both;
-webkit-animation: cssload-fold-thecube 2.76s infinite linear both;
-moz-animation: cssload-fold-thecube 2.76s infinite linear both;
transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%; }
.cssload-thecube .cssload-c2 {
transform: scale(1.1) rotateZ(90deg);
-o-transform: scale(1.1) rotateZ(90deg);
-ms-transform: scale(1.1) rotateZ(90deg);
-webkit-transform: scale(1.1) rotateZ(90deg);
-moz-transform: scale(1.1) rotateZ(90deg); }
.cssload-thecube .cssload-c3 {
transform: scale(1.1) rotateZ(180deg);
-o-transform: scale(1.1) rotateZ(180deg);
-ms-transform: scale(1.1) rotateZ(180deg);
-webkit-transform: scale(1.1) rotateZ(180deg);
-moz-transform: scale(1.1) rotateZ(180deg); }
.cssload-thecube .cssload-c4 {
transform: scale(1.1) rotateZ(270deg);
-o-transform: scale(1.1) rotateZ(270deg);
-ms-transform: scale(1.1) rotateZ(270deg);
-webkit-transform: scale(1.1) rotateZ(270deg);
-moz-transform: scale(1.1) rotateZ(270deg); }
.cssload-thecube .cssload-c2:before {
animation-delay: 0.35s;
-o-animation-delay: 0.35s;
-ms-animation-delay: 0.35s;
-webkit-animation-delay: 0.35s;
-moz-animation-delay: 0.35s; }
.cssload-thecube .cssload-c3:before {
animation-delay: 0.69s;
-o-animation-delay: 0.69s;
-ms-animation-delay: 0.69s;
-webkit-animation-delay: 0.69s;
-moz-animation-delay: 0.69s; }
.cssload-thecube .cssload-c4:before {
animation-delay: 1.04s;
-o-animation-delay: 1.04s;
-ms-animation-delay: 1.04s;
-webkit-animation-delay: 1.04s;
-moz-animation-delay: 1.04s; }
@keyframes cssload-fold-thecube {
0%, 10% {
transform: perspective(136px) rotateX(-180deg);
opacity: 0; }
25%, 75% {
transform: perspective(136px) rotateX(0deg);
opacity: 1; }
90%, 100% {
transform: perspective(136px) rotateY(180deg);
opacity: 0; } }
@-ms-keyframes cssload-fold-thecube {
0%, 10% {
-ms-transform: perspective(136px) rotateX(-180deg);
opacity: 0; }
25%, 75% {
-ms-transform: perspective(136px) rotateX(0deg);
opacity: 1; }
90%, 100% {
-ms-transform: perspective(136px) rotateY(180deg);
opacity: 0; } }
@-webkit-keyframes cssload-fold-thecube {
0%, 10% {
-webkit-transform: perspective(136px) rotateX(-180deg);
opacity: 0; }
25%, 75% {
-webkit-transform: perspective(136px) rotateX(0deg);
opacity: 1; }
90%, 100% {
-webkit-transform: perspective(136px) rotateY(180deg);
opacity: 0; } }
/*============@group Banners hover effect ==================*/
.banners-effect-1 .banners > div img {
-webkit-transition: all 0.2s ease-in;
-moz-transition: all 0.2s ease-in;
transition: all 0.2s ease-in; }
.banners-effect-1 .banners > div img:hover {
opacity: 0.8; }
.banners-effect-2 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-2 .banners > div a:hover:before, .banners-effect-2 .banners > div a:hover:after {
left: 0;
opacity: 1; }
.banners-effect-2 .banners > div a:before, .banners-effect-2 .banners > div a:after {
background-color: rgba(255, 255, 255, 0.4);
display: block;
width: 100%;
height: 100%;
left: -100%;
opacity: 0;
filter: alpha(opacity=0);
position: absolute;
top: 0;
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
content: "";
z-index: 1; }
.banners-effect-3 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-3 .banners > div a:hover:before, .banners-effect-3 .banners > div a:hover:after {
border: 0 solid rgba(0, 0, 0, 0.7);
opacity: 0;
filter: alpha(opacity=0); }
.banners-effect-3 .banners > div a:before, .banners-effect-3 .banners > div a:after {
border: 50px solid transparent;
border-top-right-radius: 50px;
border-top-left-radius: 50px;
border-bottom-right-radius: 50px;
border-bottom-left-radius: 50px;
box-sizing: border-box;
cursor: pointer;
display: inline-block;
left: 0;
right: 0;
bottom: 0;
margin: auto;
position: absolute;
top: 0;
content: "";
opacity: 1;
filter: alpha(opacity=100);
width: 100px;
height: 100px;
-webkit-transform: scale(7);
-moz-transform: scale(7);
-ms-transform: scale(7);
-o-transform: scale(7);
transform: scale(7);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
visibility: visible;
z-index: 1; }
.banners-effect-4 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-4 .banners > div a:hover:before, .banners-effect-4 .banners > div a:hover:after {
opacity: 1;
-webkit-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 4, 1);
-moz-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 4, 1);
-ms-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 4, 1);
-o-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 4, 1);
transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 4, 1); }
.banners-effect-4 .banners > div a:before, .banners-effect-4 .banners > div a:after {
border-bottom: 50px solid rgba(0, 0, 0, 0.2);
border-top: 50px solid rgba(0, 0, 0, 0.2);
content: "";
height: 100%;
left: 0;
opacity: 0;
filter: alpha(opacity=0);
position: absolute;
top: 0;
transform-origin: 50% 50% 0;
width: 100%;
-webkit-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 0, 1);
-moz-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 0, 1);
-ms-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 0, 1);
-o-transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 0, 1);
transform: rotate3d(0, 0, 1, 45deg) scale3d(1, 0, 1);
-webkit-transition: opacity 0.4s ease 0s, -webkit-transform 0.35s ease 0s;
-moz-transition: opacity 0.4s ease 0s, -moz-transform 0.35s ease 0s;
transition: opacity 0.4s ease 0s, transform 0.35s ease 0s;
visibility: visible;
z-index: 1; }
.banners-effect-5 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-5 .banners > div a:before {
content: "";
height: 100%;
width: 100%;
position: absolute;
border: 70px solid rgba(255, 255, 255, 0);
top: 0;
right: 0;
transition: all 0.5s ease-in-out; }
.banners-effect-5 .banners > div a:after {
content: "";
height: 100%;
width: 100%;
position: absolute;
opacity: 0.5;
border: 30px solid #fff;
top: 0;
right: 0;
transform: scale(0);
-moz-transform: scale(0);
-webkit-transform: scale(0);
-ms-transform: scale(0);
transition: all 0.5s ease-in-out; }
.banners-effect-5 .banners > div a:hover:before {
border: 0 solid rgba(255, 255, 255, 0.7); }
.banners-effect-5 .banners > div a:hover:after {
transform: scale(0.8);
-moz-transform: scale(0.8);
-webkit-transform: scale(0.8);
-ms-transform: scale(0.8);
opacity: 0;
transition-delay: 0.1s; }
.banners-effect-6 .banners > div a {
display: inline-block;
position: relative;
overflow: hidden;
background: #000;
vertical-align: top; }
.banners-effect-6 .banners > div a img {
backface-visibility: hidden;
opacity: 1;
filter: alpha(opacity=100);
-webkit-transition: opacity 1s ease 0s, transform 1s ease 0s;
-o-transition: opacity 1s ease 0s, transform 1s ease 0s;
transition: opacity 1s ease 0s, transform 1s ease 0s; }
.banners-effect-6 .banners > div a:hover img {
opacity: 0.8;
filter: alpha(opacity=80);
transform: scale3d(1.1, 1.1, 1); }
.banners-effect-7 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-7 .banners > div a:before {
position: absolute;
background: rgba(0, 0, 0, 0.3);
width: 0;
top: 0;
left: 50%;
content: "";
transition: all 0.3s ease-in-out 0s; }
.banners-effect-7 .banners > div a:hover:before {
width: 100%;
left: 0;
top: 0;
height: 100%; }
.banners-effect-8 .banners > div a {
display: inline-block;
position: relative;
overflow: hidden;
background: #000;
vertical-align: top; }
.banners-effect-8 .banners > div a:before, .banners-effect-8 .banners > div a:after {
bottom: 20px;
content: "";
left: 20px;
opacity: 0;
position: absolute;
right: 20px;
top: 20px;
-webkit-transition: opacity 0.35s ease 0s, transform 0.35s ease 0s;
-o-transition: opacity 0.35s ease 0s, transform 0.35s ease 0s;
transition: opacity 0.35s ease 0s, transform 0.35s ease 0s;
z-index: 1; }
.banners-effect-8 .banners > div a:before {
border-bottom: 1px solid #fff;
border-top: 1px solid #fff;
-webkit-transform: scale(0, 1);
-ms-transform: scale(0, 1);
-o-transform: scale(0, 1);
transform: scale(0, 1); }
.banners-effect-8 .banners > div a:after {
border-left: 1px solid #fff;
border-right: 1px solid #fff;
-webkit-transform: scale(1, 0);
-ms-transform: scale(1, 0);
-o-transform: scale(1, 0);
transform: scale(1, 0); }
.banners-effect-8 .banners > div img {
opacity: 1;
filter: alpha(opacity=100);
-webkit-transition: opacity 0.35s ease 0s;
-o-transition: opacity 0.35s ease 0s;
transition: opacity 0.35s ease 0s; }
.banners-effect-8 .banners > div a:hover:before, .banners-effect-8 .banners > div a:hover:after {
opacity: 1;
filter: alpha(opacity=100);
-webkit-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1); }
.banners-effect-8 .banners > div a:hover img {
opacity: 0.5;
filter: alpha(opacity=50); }
.banners-effect-9 .banners > div a {
display: block;
position: relative;
z-index: 10; }
.banners-effect-9 .banners > div a:before {
position: absolute;
top: 0;
left: 0;
z-index: 0;
width: 100%;
height: 100%;
background: #000;
content: '';
-webkit-transition: opacity 0.35s;
transition: opacity 0.35s;
box-shadow: 0 3px 30px rgba(0, 0, 0, 0.2);
opacity: 0; }
.banners-effect-9 .banners > div a:hover:before {
opacity: 1; }
.banners-effect-9 .banners > div a img {
opacity: 1;
-webkit-transition: -webkit-transform 0.35s;
transition: transform 0.35s;
-webkit-transform: perspective(1000px) translate3d(0, 0, 0);
transform: perspective(1000px) translate3d(0, 0, 0); }
.banners-effect-9 .banners > div a:hover img {
-webkit-transform: perspective(1000px) translate3d(0, 0, 21px);
transform: perspective(1000px) translate3d(0, 0, 21px); }
.banners-effect-10 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-10 .banners > div a:before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 75%);
background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 75%);
content: '';
opacity: 0;
-webkit-transform: translate3d(0, 50%, 0);
transform: translate3d(0, 50%, 0);
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s; }
.banners-effect-10 .banners > div a:hover:before {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
.banners-effect-11 .banners > div a {
display: block;
position: relative;
overflow: hidden; }
.banners-effect-11 .banners > div a:hover:before, .banners-effect-11 .banners > div a:hover:after {
width: 100%;
height: 100%; }
.banners-effect-11 .banners > div a:before, .banners-effect-11 .banners > div a:after {
background-color: rgba(0, 0, 0, 0.15);
content: "";
height: 0;
left: 0;
margin: auto;
position: absolute;
width: 0;
-webkit-transition: all 0.3s ease-out 0s;
-moz-transition: all 0.3s ease-out 0s;
transition: all 0.3s ease-out 0s; }
.banners-effect-11 .banners > div a:after {
left: auto;
right: 0;
bottom: 0; }
.banners-effect-12 .banners > div img {
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
transition: all 0.3s ease-in; }
.banners-effect-12 .banners > div img:hover {
-webkit-filter: grayscale(100%);
filter: grayscale(100%); }
/*===============================================
[SASS DIRECTORY ]
[1] Pre-Loader
==============================================*/
/*============START Pre-Loader CSS ==================*/
.so-pre-loader {
background: #ff5c00;
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 99999; }
.so-pre-loader .so-loader-background {
background: #777;
display: block;
height: 100%; }
.so-pre-loader .so-loader-center {
position: absolute;
left: 50%;
top: 50%;
margin: -25px 0 0 -25px; }
.so-pre-loader .spinner {
width: 50px;
height: 50px;
background-color: white;
-webkit-animation: sk-rotateplane 1.2s infinite ease-in-out;
animation: sk-rotateplane 1.2s infinite ease-in-out; }
.so-pre-loader .spinner-bounce {
width: 60px;
height: 60px;
position: relative; }
.so-pre-loader .double-bounce1, .so-pre-loader .double-bounce2 {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: white;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
-webkit-animation: sk-bounce 2s infinite ease-in-out;
animation: sk-bounce 2s infinite ease-in-out; }
.so-pre-loader .double-bounce2 {
-webkit-animation-delay: -1s;
animation-delay: -1s; }
.so-pre-loader .spinner-wave {
width: 50px;
height: 50px;
text-align: center;
font-size: 10px; }
.so-pre-loader .spinner-wave > div {
background-color: white;
height: 100%;
width: 6px;
margin: 0 2px;
display: inline-block;
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
animation: sk-stretchdelay 1.2s infinite ease-in-out; }
.so-pre-loader .spinner-wave .rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s; }
.so-pre-loader .spinner-wave .rect3 {
-webkit-animation-delay: -1s;
animation-delay: -1s; }
.so-pre-loader .spinner-wave .rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s; }
.so-pre-loader .spinner-wave .rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s; }
.so-pre-loader .spinner-cube {
width: 40px;
height: 40px;
position: relative; }
.so-pre-loader .cube1, .so-pre-loader .cube2 {
background-color: white;
width: 15px;
height: 15px;
position: absolute;
top: 0;
left: 0;
-webkit-animation: sk-cubemove 1.8s infinite ease-in-out;
animation: sk-cubemove 1.8s infinite ease-in-out; }
.so-pre-loader .cube2 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s; }
.so-pre-loader .spinner-bounce2 {
width: 80px;
text-align: center; }
.so-pre-loader .spinner-bounce2 > div {
width: 18px;
height: 18px;
background-color: white;
border-radius: 100%;
display: inline-block;
margin: 0 3px;
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
animation: sk-bouncedelay 1.4s infinite ease-in-out both; }
.so-pre-loader .spinner-bounce2 .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s; }
.so-pre-loader .spinner-bounce2 .bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s; }
.so-pre-loader .spinner-circle {
width: 60px;
height: 60px;
position: relative; }
.so-pre-loader .spinner-circle .sk-child {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0; }
.so-pre-loader .spinner-circle .sk-child:before {
content: '';
display: block;
margin: 0 auto;
width: 15%;
height: 15%;
background-color: white;
border-radius: 100%;
-webkit-animation: sk-circleBounceDelay 1.2s infinite ease-in-out both;
animation: sk-circleBounceDelay 1.2s infinite ease-in-out both; }
.so-pre-loader .spinner-circle .sk-circle2 {
-webkit-transform: rotate(30deg);
-ms-transform: rotate(30deg);
transform: rotate(30deg); }
.so-pre-loader .spinner-circle .sk-circle3 {
-webkit-transform: rotate(60deg);
-ms-transform: rotate(60deg);
transform: rotate(60deg); }
.so-pre-loader .spinner-circle .sk-circle4 {
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg); }
.so-pre-loader .spinner-circle .sk-circle5 {
-webkit-transform: rotate(120deg);
-ms-transform: rotate(120deg);
transform: rotate(120deg); }
.so-pre-loader .spinner-circle .sk-circle6 {
-webkit-transform: rotate(150deg);
-ms-transform: rotate(150deg);
transform: rotate(150deg); }
.so-pre-loader .spinner-circle .sk-circle7 {
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg); }
.so-pre-loader .spinner-circle .sk-circle8 {
-webkit-transform: rotate(210deg);
-ms-transform: rotate(210deg);
transform: rotate(210deg); }
.so-pre-loader .spinner-circle .sk-circle9 {
-webkit-transform: rotate(240deg);
-ms-transform: rotate(240deg);
transform: rotate(240deg); }
.so-pre-loader .spinner-circle .sk-circle10 {
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg); }
.so-pre-loader .spinner-circle .sk-circle11 {
-webkit-transform: rotate(300deg);
-ms-transform: rotate(300deg);
transform: rotate(300deg); }
.so-pre-loader .spinner-circle .sk-circle12 {
-webkit-transform: rotate(330deg);
-ms-transform: rotate(330deg);
transform: rotate(330deg); }
.so-pre-loader .spinner-circle .sk-circle2:before {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s; }
.so-pre-loader .spinner-circle .sk-circle3:before {
-webkit-animation-delay: -1s;
animation-delay: -1s; }
.so-pre-loader .spinner-circle .sk-circle4:before {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s; }
.so-pre-loader .spinner-circle .sk-circle5:before {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s; }
.so-pre-loader .spinner-circle .sk-circle6:before {
-webkit-animation-delay: -0.7s;
animation-delay: -0.7s; }
.so-pre-loader .spinner-circle .sk-circle7:before {
-webkit-animation-delay: -0.6s;
animation-delay: -0.6s; }
.so-pre-loader .spinner-circle .sk-circle8:before {
-webkit-animation-delay: -0.5s;
animation-delay: -0.5s; }
.so-pre-loader .spinner-circle .sk-circle9:before {
-webkit-animation-delay: -0.4s;
animation-delay: -0.4s; }
.so-pre-loader .spinner-circle .sk-circle10:before {
-webkit-animation-delay: -0.3s;
animation-delay: -0.3s; }
.so-pre-loader .spinner-circle .sk-circle11:before {
-webkit-animation-delay: -0.2s;
animation-delay: -0.2s; }
.so-pre-loader .spinner-circle .sk-circle12:before {
-webkit-animation-delay: -0.1s;
animation-delay: -0.1s; }
.so-pre-loader .spinner-cube-grid {
width: 60px;
height: 60px; }
.so-pre-loader .spinner-cube-grid .sk-cube {
width: 33%;
height: 33%;
background-color: white;
float: left;
-webkit-animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out;
animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out; }
.so-pre-loader .spinner-cube-grid .sk-cube1 {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s; }
.so-pre-loader .spinner-cube-grid .sk-cube2 {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s; }
.so-pre-loader .spinner-cube-grid .sk-cube3 {
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s; }
.so-pre-loader .spinner-cube-grid .sk-cube4 {
-webkit-animation-delay: 0.1s;
animation-delay: 0.1s; }
.so-pre-loader .spinner-cube-grid .sk-cube5 {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s; }
.so-pre-loader .spinner-cube-grid .sk-cube6 {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s; }
.so-pre-loader .spinner-cube-grid .sk-cube7 {
-webkit-animation-delay: 0s;
animation-delay: 0s; }
.so-pre-loader .spinner-cube-grid .sk-cube8 {
-webkit-animation-delay: 0.1s;
animation-delay: 0.1s; }
.so-pre-loader .spinner-cube-grid .sk-cube9 {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s; }
.so-pre-loader .spinner-folding-cube {
width: 50px;
height: 50px;
position: relative;
-webkit-transform: rotateZ(45deg);
transform: rotateZ(45deg); }
.so-pre-loader .spinner-folding-cube .sk-cube {
float: left;
width: 50%;
height: 50%;
position: relative;
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1); }
.so-pre-loader .spinner-folding-cube .sk-cube:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: white;
-webkit-animation: sk-foldCubeAngle 2.4s infinite linear both;
animation: sk-foldCubeAngle 2.4s infinite linear both;
-webkit-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
transform-origin: 100% 100%; }
.so-pre-loader .spinner-folding-cube .sk-cube2 {
-webkit-transform: scale(1.1) rotateZ(90deg);
transform: scale(1.1) rotateZ(90deg); }
.so-pre-loader .spinner-folding-cube .sk-cube3 {
-webkit-transform: scale(1.1) rotateZ(180deg);
transform: scale(1.1) rotateZ(180deg); }
.so-pre-loader .spinner-folding-cube .sk-cube4 {
-webkit-transform: scale(1.1) rotateZ(270deg);
transform: scale(1.1) rotateZ(270deg); }
.so-pre-loader .spinner-folding-cube .sk-cube2:before {
-webkit-animation-delay: 0.3s;
animation-delay: 0.3s; }
.so-pre-loader .spinner-folding-cube .sk-cube3:before {
-webkit-animation-delay: 0.6s;
animation-delay: 0.6s; }
.so-pre-loader .spinner-folding-cube .sk-cube4:before {
-webkit-animation-delay: 0.9s;
animation-delay: 0.9s; }
.so-pre-loader .so-loader-with-logo {
top: 0;
left: 0;
width: 100%;
height: 150px;
right: 0;
bottom: 0;
margin: auto;
text-align: center;
position: absolute; }
.so-pre-loader .so-loader-with-logo .logo {
display: block;
width: auto; }
.so-pre-loader .so-loader-with-logo .line {
background: #ccc;
bottom: 0;
height: 5px; }
.so-pre-loader .so-loader-with-logo .run-number {
color: #fff;
font-size: 50px;
font-weight: 600;
line-height: 80px; }
/* ************* END:: Pre-Loader CSS ************* */
/* **************************************************** */
/* ************ START Loader Animation ************ */
/* **************************************************** */
@-webkit-keyframes sk-rotateplane {
0% {
-webkit-transform: perspective(120px); }
50% {
-webkit-transform: perspective(120px) rotateY(180deg); }
100% {
-webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg); } }
@keyframes sk-rotateplane {
0% {
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg); }
50% {
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); }
100% {
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg); } }
@-webkit-keyframes sk-bounce {
0%, 100% {
-webkit-transform: scale(0); }
50% {
-webkit-transform: scale(1); } }
@keyframes sk-bounce {
0%, 100% {
transform: scale(0);
-webkit-transform: scale(0); }
50% {
transform: scale(1);
-webkit-transform: scale(1); } }
@-webkit-keyframes sk-stretchdelay {
0%, 40%, 100% {
-webkit-transform: scaleY(0.4); }
20% {
-webkit-transform: scaleY(1); } }
@keyframes sk-stretchdelay {
0%, 40%, 100% {
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4); }
20% {
transform: scaleY(1);
-webkit-transform: scaleY(1); } }
@-webkit-keyframes sk-cubemove {
25% {
-webkit-transform: translateX(42px) rotate(-90deg) scale(0.5); }
50% {
-webkit-transform: translateX(42px) translateY(42px) rotate(-180deg); }
75% {
-webkit-transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5); }
100% {
-webkit-transform: rotate(-360deg); } }
@keyframes sk-cubemove {
25% {
transform: translateX(42px) rotate(-90deg) scale(0.5);
-webkit-transform: translateX(42px) rotate(-90deg) scale(0.5); }
50% {
transform: translateX(42px) translateY(42px) rotate(-179deg);
-webkit-transform: translateX(42px) translateY(42px) rotate(-179deg); }
50.1% {
transform: translateX(42px) translateY(42px) rotate(-180deg);
-webkit-transform: translateX(42px) translateY(42px) rotate(-180deg); }
75% {
transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5);
-webkit-transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5); }
100% {
transform: rotate(-360deg);
-webkit-transform: rotate(-360deg); } }
@-webkit-keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0); }
40% {
-webkit-transform: scale(1); } }
@keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0);
transform: scale(0); }
40% {
-webkit-transform: scale(1);
transform: scale(1); } }
@-webkit-keyframes sk-circleBounceDelay {
0%, 80%, 100% {
-webkit-transform: scale(0);
transform: scale(0); }
40% {
-webkit-transform: scale(1);
transform: scale(1); } }
@keyframes sk-circleBounceDelay {
0%, 80%, 100% {
-webkit-transform: scale(0);
transform: scale(0); }
40% {
-webkit-transform: scale(1);
transform: scale(1); } }
@-webkit-keyframes sk-cubeGridScaleDelay {
0%, 70%, 100% {
-webkit-transform: scale3D(1, 1, 1);
transform: scale3D(1, 1, 1); }
35% {
-webkit-transform: scale3D(0, 0, 1);
transform: scale3D(0, 0, 1); } }
@keyframes sk-cubeGridScaleDelay {
0%, 70%, 100% {
-webkit-transform: scale3D(1, 1, 1);
transform: scale3D(1, 1, 1); }
35% {
-webkit-transform: scale3D(0, 0, 1);
transform: scale3D(0, 0, 1); } }
@-webkit-keyframes sk-foldCubeAngle {
0%, 10% {
-webkit-transform: perspective(140px) rotateX(-180deg);
transform: perspective(140px) rotateX(-180deg);
opacity: 0; }
25%, 75% {
-webkit-transform: perspective(140px) rotateX(0deg);
transform: perspective(140px) rotateX(0deg);
opacity: 1; }
90%, 100% {
-webkit-transform: perspective(140px) rotateY(180deg);
transform: perspective(140px) rotateY(180deg);
opacity: 0; } }
@keyframes sk-foldCubeAngle {
0%, 10% {
-webkit-transform: perspective(140px) rotateX(-180deg);
transform: perspective(140px) rotateX(-180deg);
opacity: 0; }
25%, 75% {
-webkit-transform: perspective(140px) rotateX(0deg);
transform: perspective(140px) rotateX(0deg);
opacity: 1; }
90%, 100% {
-webkit-transform: perspective(140px) rotateY(180deg);
transform: perspective(140px) rotateY(180deg);
opacity: 0; } }
/* *********** END:: Loader Animation ************* */
/* **************************************************** */
/*===============================================
[SASS DIRECTORY ]
[1] OVERLAY PATTER
==============================================*/
/*============OVERLAY PATTERN ==================*/
/* 1. Overlay pattern ---------------------*/
body.no-bgbody {
background-image: none; }
.pattern-1 {
background-image: url(../../images/patterns/1.png); }
.pattern-2 {
background-image: url(../../images/patterns/2.png); }
.pattern-3 {
background-image: url(../../images/patterns/3.png); }
.pattern-4 {
background-image: url(../../images/patterns/4.png); }
.pattern-5 {
background-image: url(../../images/patterns/5.png); }
.pattern-6 {
background-image: url(../../images/patterns/6.png); }
.pattern-7 {
background-image: url(../../images/patterns/7.png); }
.pattern-8 {
background-image: url(../../images/patterns/8.png); }
.pattern-9 {
background-image: url(../../images/patterns/9.png); }
.pattern-10 {
background-image: url(../../images/patterns/10.png); }
.pattern-11 {
background-image: url(../../images/patterns/11.png); }
.pattern-12 {
background-image: url(../../images/patterns/12.png); }
.pattern-13 {
background-image: url(../../images/patterns/13.png); }
.pattern-14 {
background-image: url(../../images/patterns/14.png); }
.pattern-15 {
background-image: url(../../images/patterns/15.png); }
.pattern-16 {
background-image: url(../../images/patterns/16.png); }
.pattern-17 {
background-image: url(../../images/patterns/17.png); }
.pattern-18 {
background-image: url(../../images/patterns/18.png); }
.pattern-19 {
background-image: url(../../images/patterns/19.png); }
.pattern-20 {
background-image: url(../../images/patterns/20.png); }
.pattern-21 {
background-image: url(../../images/patterns/21.png); }
.pattern-22 {
background-image: url(../../images/patterns/22.png); }
.pattern-23 {
background-image: url(../../images/patterns/23.png); }
.pattern-24 {
background-image: url(../../images/patterns/24.png); }
.pattern-25 {
background-image: url(../../images/patterns/25.png); }
.pattern-26 {
background-image: url(../../images/patterns/26.png); }
.pattern-27 {
background-image: url(../../images/patterns/27.png); }
.pattern-28 {
background-image: url(../../images/patterns/28.png); }
.pattern-29 {
background-image: url(../../images/patterns/29.png); }
.pattern-30 {
background-image: url(../../images/patterns/30.png); }
.pattern-31 {
background-image: url(../../images/patterns/31.png); }
.pattern-32 {
background-image: url(../../images/patterns/32.png); }
.pattern-33 {
background-image: url(../../images/patterns/33.png); }
.pattern-34 {
background-image: url(../../images/patterns/34.png); }
.pattern-35 {
background-image: url(../../images/patterns/35.png); }
.pattern-36 {
background-image: url(../../images/patterns/36.png); }
.pattern-37 {
background-image: url(../../images/patterns/37.png); }
.pattern-38 {
background-image: url(../../images/patterns/38.png); }
.pattern-39 {
background-image: url(../../images/patterns/39.png); }
.pattern-40 {
background-image: url(../../images/patterns/40.png); }
.pattern-41 {
background-image: url(../../images/patterns/41.png); }
.pattern-42 {
background-image: url(../../images/patterns/42.png); }
.pattern-43 {
background-image: url(../../images/patterns/43.png); }
.pattern-44 {
background-image: url(../../images/patterns/44.png); }
.pattern-45 {
background-image: url(../../images/patterns/45.png); }
.divider {
clear: both;
height: 40px; }
.alert {
border-radius: 0; }
.alert .fa {
font-size: 20px;
vertical-align: middle;
margin-right: 10px; }
.tab-content {
padding: 15px 15px 10px;
margin-bottom: 20px;
z-index: 2;
border: 1px solid #ddd;
border-top: 0px; }
.simple-ul {
margin: 0 0 15px 0;
padding: 0;
list-style: none; }
.simple-ul li {
position: relative;
padding-left: 15px;
margin-bottom: 5px; }
.simple-ul li:before {
position: absolute;
top: 0;
left: 0;
display: block;
content: "\f105";
font-family: 'FontAwesome';
font-size: 14px; }
.simple-ul li ul {
margin: 10px 0 10px 0;
padding: 0;
list-style: none; }
.simple-ul li ul li:before {
content: "\f111";
font-size: 7px;
top: 7px; }
.decimal-list {
margin: 0px 0 15px 20px;
padding: 0;
list-style: decimal outside; }
.decimal-list li {
padding-left: 0;
margin-bottom: 5px;
text-indent: 0; }
blockquote {
font-size: 12px; }
.well {
border-radius: 0; }
ul, ol {
list-style: none;
margin: 0;
padding: 0; }
.feature-box {
border-radius: 0;
margin-bottom: 20px; }
.feature-box .feature-icon {
color: #ff5c00;
display: inline-block;
font-size: 64px;
height: 65px;
text-align: center;
width: 65px;
float: right; }
.feature-box .feature-content {
padding-right: 80px; }
.featured-icon {
border-radius: 50%;
color: #fff;
background-color: #ff5c00;
display: inline-block;
font-size: 40px;
height: 110px;
line-height: 110px;
margin: 5px;
position: relative;
text-align: center;
width: 110px;
z-index: 1; }
.common-home .default-nav .owl2-nav div {
width: 28px;
height: 28px;
display: inline-block;
top: -34px;
cursor: pointer; }
.common-home .default-nav .owl2-nav div.owl2-prev {
background: url("../../images/icon/icon_general.png") no-repeat -20px -1111px; }
.common-home .default-nav .owl2-nav div.owl2-prev:hover {
background: url("../../images/icon/icon_general.png") no-repeat -20px -1063px transparent; }
.common-home .default-nav .owl2-nav div.owl2-next {
background: url("../../images/icon/icon_general.png") no-repeat -20px -1015px; }
.common-home .default-nav .owl2-nav div.owl2-next:hover {
background: url("../../images/icon/icon_general.png") -20px -967px transparent; }
.common-home .h3-nav .owl2-nav div {
width: 28px;
height: 28px;
display: inline-block;
top: -34px;
cursor: pointer; }
.common-home .h3-nav .owl2-nav div.owl2-prev {
background: url("../../images/icon/icon_general.png") no-repeat -20px -647px; }
.common-home .h3-nav .owl2-nav div.owl2-prev:hover {
background: url("../../images/icon/icon_general.png") no-repeat -20px -586px transparent; }
.common-home .h3-nav .owl2-nav div.owl2-next {
background: url("../../images/icon/icon_general.png") no-repeat -20px -403px; }
.common-home .h3-nav .owl2-nav div.owl2-next:hover {
background: url("../../images/icon/icon_general.png") -20px -342px transparent; }
.common-home .owl2-nav div {
width: 41px;
height: 41px;
display: inline-block;
top: 50%;
margin-top: -20px;
cursor: pointer;
transition: inherit; }
.common-home .owl2-nav div.owl2-prev {
background: url("../../images/icon/icon_general.png") no-repeat -20px -525px; }
.common-home .owl2-nav div.owl2-prev:hover {
background: url("../../images/icon/icon_general.png") no-repeat -20px -464px; }
.common-home .owl2-nav div.owl2-next {
background: url("../../images/icon/icon_general.png") no-repeat -20px -281px; }
.common-home .owl2-nav div.owl2-next:hover {
background: url("../../images/icon/icon_general.png") no-repeat -20px -220px; }
.common-home .owl2-nav div:before {
display: none; }
/*===============================================
[SASS DIRECTORY ]
[1] PAGE ACCOUNT
[2] PAGE INFORMATION
[3] PAGE CHECKOUT
[4] LANGUAGE CURENTY
[5] CSS FEAFURE MENU DEMO
==============================================*/
/*============PAGE ACCOUNT ==================*/
.account-login .well, .affiliate-login .well {
min-height: 395px;
background: #fff; }
.account-account #content > h2, .affiliate-account #content > h2 {
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 16px;
font-size: 1.6rem;
/* [8] */ }
.account-account #content .list-unstyled, .affiliate-account #content .list-unstyled {
margin-bottom: 30px; }
.account-address #content .table-responsive .table > tbody > tr > td {
line-height: 24px;
padding: 10px; }
.custom-border {
border: 1px solid #eee;
padding: 10px 20px; }
/* @group List Box */
.list-box {
list-style: none;
margin: 0px;
padding: 0px; }
.rtl .wrapper-full {
overflow-x: hidden; }
.btn-link:focus, .btn-link:hover {
text-decoration: none; }
.dropdown-menu > li > button {
padding: 5px 15px; }
.list-box li {
border-bottom: 1px solid #ececec; }
.list-box li:last-child {
border-bottom: 0; }
.list-box li a {
display: inline-block;
word-wrap: break-word;
padding: 8px 0;
margin-right: 5px;
color: #555; }
.list-box li a:hover {
color: #ff5c00; }
/* @end */
/*============PAGE INFORMATION ==================*/
.simple-list {
margin: 0;
padding: 0;
list-style-type: none; }
.bold-list > li > a {
font-weight: 700;
text-transform: uppercase;
color: #555; }
.bold-list > li > a:hover {
color: #ff5c00; }
.simple-list ul {
margin: 0;
padding: 0;
list-style-type: none;
position: relative;
bottom: -0.8em; }
.simple-list li {
margin: 0;
padding: 0 0 12px; }
.simple-list ul a {
color: #555; }
.simple-list ul a:hover {
color: #ff5c00; }
.simple-list .checkbox {
padding-left: 0; }
.simple-list .checkbox input[type=checkbox] {
margin-left: 10px; }
.simple-list .icon {
margin-right: 9px; }
.arrow-list li {
padding-right: 12px;
position: relative; }
.arrow-list li:before {
margin-left: 10px;
font-size: 14px;
font-family: 'FontAwesome';
display: inline-block;
content: '\f104'; }
/*============PAGE CHECKOUT ==================*/
.checkout-cart .panel-group .panel, .checkout-checkout .panel-group .panel {
border-radius: 0; }
.checkout-cart .content_404 .item-left {
visibility: hidden; }
.table-responsive .table thead > * {
background-color: rgba(51, 51, 51, 0.1);
font-weight: bold; }
.table-responsive .table tbody td.text-left a {
font-weight: bold;
color: #7d7d7d; }
.table-responsive .table tbody td.text-left:hover a {
color: #ff5c00; }
/*============LANGUAGE CURENTY ==================*/
.btn-group .btn-link {
text-align: right;
background: transparent;
text-decoration: none;
padding: 5px 10px;
color: #2d2d2d;
font-weight: normal;
position: relative;
z-index: 1; }
.btn-group .btn-link:hover {
color: #ff5c00; }
.dropdown-menu .btn-block {
border: none;
background: transparent;
text-align: right; }
/*============ CSS FEAFURE MENU DEMO ==================*/
.feature-layout .image-link {
color: #555; }
.feature-layout .image-link:hover {
color: #ff5c00; }
.feature-layout .image-link .thumbnail {
position: relative;
overflow: hidden;
border-radius: 0;
background: #333;
padding: 0; }
.feature-layout .image-link .btn {
position: absolute;
top: -100px;
left: calc(50% - 50px);
padding: 9px 20px;
background: #555;
color: #fff;
border-radius: 3px;
border: none;
background: #ff5c00;
border-color: #ff5c00;
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
border-radius: 2px; }
.feature-layout .image-link .btn:hover {
background: #ff5c00;
border-color: #ff5c00;
color: #fff; }
.feature-layout .image-link .btn:hover {
background: #555;
border-color: #555; }
.feature-layout .image-link:hover .thumbnail {
border: 1px solid #ccc; }
.feature-layout .image-link:hover .thumbnail img {
opacity: 0.7; }
.feature-layout .image-link:hover .btn {
top: calc(50% - 25px); }
.feature-layout .image-link .figcaption {
font-size: 13px;
text-align: center;
font-weight: 600;
text-transform: uppercase; }
.with-sub-menu .feafure-dr {
text-align: right; }
.with-sub-menu .feafure-dr h3.title-feature {
display: block;
font-weight: 700;
font-size: 14px;
line-height: 1em;
text-transform: uppercase;
color: #444;
margin-bottom: 15px; }
.with-sub-menu .feafure-dr ul.row-list {
list-style: none;
padding: 0; }
.with-sub-menu .feafure-dr li {
line-height: 30px; }
.with-sub-menu .feafure-dr li a {
font-size: 14px;
position: relative;
color: #7d7d7d; }
.with-sub-menu .feafure-dr li a:hover {
color: #ff5c00; }
.with-sub-menu .feafure-dr .layout-color li a {
text-transform: capitalize; }
.with-sub-menu .feafure-dr .layout-color li a:before {
content: "";
display: inline-block;
width: 20px;
height: 20px;
position: relative;
background-color: #e1e1e1;
margin-left: 10px;
vertical-align: middle;
left: 0; }
.with-sub-menu .feafure-dr .layout-color li.orange a:before {
background: #fe5621; }
.with-sub-menu .feafure-dr .layout-color li.blue a:before {
background: #02a8f3; }
.with-sub-menu .feafure-dr .layout-color li.brown a:before {
background: #beae59; }
.with-sub-menu .feafure-dr .layout-color li.green a:before {
background: #8ac249; }
.with-sub-menu .feafure-dr .layout-color li.red a:before {
background: #df1f26; }
.with-sub-menu .feafure-dr .layout-color li.pink a:before {
background: #e81d62; }
/*===============================================
[SASS DIRECTORY ]
[1] MODULE DEFAULT
[2] BLOCK SEARCH
[3] SOCIAL FOOTER
==============================================*/
/*============MODULE DEFAULT ==================*/
.module {
margin-bottom: 40px; }
.module:before, .module:after {
content: " ";
display: table; }
.module:after {
clear: both; }
.module.fa-hidden h3.modtitle:before {
display: none; }
.module h3.modtitle {
background: #f2f2f2;
line-height: 100%;
padding: 10px 15px 9px 0;
border-bottom: 1px solid #e8e8e8;
margin-bottom: 0; }
.module h3.modtitle .fa {
color: #ff5c00;
margin-left: 5px; }
.module h3.modtitle:before {
color: #ff5c00;
content: '\f219';
font-family: FontAwesome;
font-size: 18px;
display: inline-block;
margin-left: 7px; }
.module h3.modtitle span {
font-size: 16px;
text-transform: uppercase;
color: #222;
font-weight: 700;
display: inline-block; }
.top-brand.arrow-default .owl2-nav {
position: static; }
.yt-content-slider.arrow-default .owl2-nav {
position: static; }
.module.sohomepage-slider .so-homeslider img {
transform-style: initial; }
.title-margin h3.modtitle {
margin-bottom: 15px; }
.title-underline h3.modtitle {
font-size: 16px;
text-transform: uppercase;
font-weight: bold;
position: relative; }
.title-underline h3.modtitle:after {
content: " ";
width: 125px;
height: 1px;
background: #ff5c00;
display: block;
position: absolute;
bottom: 0;
margin-bottom: -1px; }
.title-cart-h6 {
display: none; }
.bordered_content {
border-radius: 3px;
border: 1px solid #eaeaea;
background: #fff; }
.yt-content-slider .owl2-controls {
margin: 0; }
body .block-popup-login .tt_popup_login strong {
background-color: #ff5c00; }
body .block-popup-login .block-content .btn-reg-popup {
background-color: #ff5c00; }
body .block-popup-login .block-content .btn-reg-popup:hover {
background: #cc4a00; }
body .block-popup-login .tt_popup_login strong:before {
border-bottom: 37px solid #ff5c00; }
body .block-popup-login .tt_popup_login {
border-color: #ff5c00; }
/************************************************************************************************
EXTRASLIDER BESTSELER
*************************************************************************************************/
.best-seller-custom.best-seller {
position: relative;
margin: 0;
border: 1px solid #e8e8e8; }
.best-seller-custom.best-seller .so-extraslider {
margin: 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner {
padding-bottom: 0;
border: none; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item-wrap-inner {
margin: 18px 0 8px; }
@media (min-width: 1200px) {
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item-wrap-inner {
padding-right: 10px; } }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 {
border-bottom: none;
margin-bottom: 2px; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1:last-child {
border-bottom: 0;
margin-bottom: 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left {
float: right;
width: 100px; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left .item-image {
border: 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-left .item-image:hover {
box-shadow: none;
opacity: 0.8; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info {
background: transparent;
position: static;
color: #222; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info a {
color: #222; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-title {
padding: 0 0 5px 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-title a {
text-transform: capitalize;
font-size: 14px;
font-weight: normal; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-title a:hover {
color: #ff5c00; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .rating {
display: none; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-content {
margin-left: 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-content .content_price span {
color: #ff5e00;
font-size: 16px;
font-weight: bold; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .item-content .content_price span.price-old {
font-size: 13px;
color: #999;
font-weight: 600; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1 .media-body .item-info .rating {
padding: 0; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item .item-wrap.style1:hover .item-title a {
color: #ff5c00; }
.best-seller-custom.best-seller .so-extraslider .extraslider-inner .item-wrap .item-info .item-content .content_price {
margin-bottom: 0; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls {
margin-bottom: 8px;
text-align: right;
position: absolute;
top: 4px;
vertical-align: middle;
left: 5px; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls .owl2-nav > div {
width: 17px;
height: 30px;
text-align: center;
display: inline-block;
line-height: 30px;
font-size: 0;
cursor: pointer;
color: #999;
background-color: transparent;
margin-top: 0;
position: static;
float: left; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls .owl2-nav > div.owl2-next {
right: 0; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls .owl2-nav > div.owl2-prev {
left: 0; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls .owl2-nav > div:hover {
color: #ff5c00; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls .owl2-prev:before {
content: "\f104";
font-family: FontAwesome;
font-size: 28px; }
.best-seller-custom.best-seller .so-extraslider .owl2-controls .owl2-next:before {
content: "\f105";
font-family: FontAwesome;
font-size: 28px; }
/*============MODULE NEWLETTER POPUP ==================*/
.main-newsleter-popup .so-custom-popup {
background-color: #fff; }
@media (min-width: 768px) and (max-width: 991px) {
.main-newsleter-popup .so-custom-popup {
width: 85% !important; }
.main-newsleter-popup .so-custom-popup:before {
content: "";
position: absolute;
z-index: 2;
background: rgba(255, 255, 255, 0.9);
width: 100%;
height: 100%;
top: 0;
right: 0; } }
@media (max-width: 767px) {
.main-newsleter-popup .so-custom-popup:before {
content: "";
position: absolute;
z-index: 2;
background: rgba(255, 255, 255, 0.9);
width: 100%;
height: 100%;
top: 0;
right: 0; } }
.main-newsleter-popup .modcontent {
position: relative;
z-index: 9; }
.main-newsleter-popup .modcontent:before {
position: absolute;
content: "";
bottom: 0;
left: 0;
background: #ff5c00;
width: 100%;
height: 110px;
opacity: 0.7; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content {
padding: 15px 10px 0;
text-align: right; }
@media (min-width: 1200px) {
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content {
padding: 65px 45px 0;
margin: 0 20px; } }
@media (min-width: 992px) and (max-width: 1199px) {
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content {
padding: 60px 30px 0;
margin: 0 20px; } }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .popup-title {
color: #222;
font-size: 30px;
text-transform: uppercase;
font-weight: 700;
letter-spacing: 3px;
line-height: 100%; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .newsletter_promo {
color: #555;
padding-top: 8px;
padding-bottom: 16px;
font-size: 16px; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .newsletter_promo span {
font-size: 30px;
color: #ff5c00; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .email {
margin: 0; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .input-control {
position: relative;
width: 400px;
display: inline-block;
margin-top: 20px; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .form-control {
background: white;
border: 1px solid #ebebeb;
display: inline-block;
width: 100%;
height: 44px; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .hidden-popup {
font-weight: normal; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .btn-default {
font-size: 20px;
height: 40px;
background: #fff;
color: #ff5c00;
border: none;
position: absolute;
padding: 0 10px;
top: 2px;
margin: 0;
left: 2px; }
.main-newsleter-popup .so-custom-popup .oca_popup .popup-content .newsletter_promo {
padding: 15px 0 10px; }
.main-newsleter-popup .socials-popup {
position: relative;
z-index: 1;
padding: 30px 0;
text-align: center; }
@media (min-width: 1200px) {
.main-newsleter-popup .socials-popup {
padding: 65px 0 30px; } }
.main-newsleter-popup .socials-popup p {
color: #fff;
text-transform: uppercase;
font-size: 16px;
font-weight: 700; }
.main-newsleter-popup .socials-popup li {
display: inline-block; }
.main-newsleter-popup .socials-popup li a {
display: inline-block;
line-height: 34px;
text-align: center;
width: 34px;
height: 34px;
color: #222;
border-radius: 100%;
font-size: 16px;
background-color: #fff;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
margin: 0 3px; }
.main-newsleter-popup .socials-popup li a:hover {
color: #ff5c00; }
.custom-pop .popup-close {
background: #000;
border-radius: 100%;
width: 30px;
height: 30px;
color: #fff;
text-align: center;
font-size: 18px;
line-height: 26px;
opacity: 1;
top: -15px;
border: 2px solid #fff;
left: -15px;
right: auto; }
/*============MODULE BREADCRUMB ==================*/
.breadcrumb {
margin: 0;
background-color: #fff;
padding: 36px 0 31px; }
.breadcrumb li a {
color: #7d7d7d;
text-transform: uppercase;
font-size: 13px;
font-weight: 600; }
.breadcrumb > li + li:before {
padding: 0 5px;
content: '\f104';
display: inline-block;
font-family: FontAwesome;
color: #666;
font-size: 14px; }
/*============ MODULE MEGAMENU HORIZOL ==================*/
.container-megamenu.horizontal .feafute h4.title-feature, .container-megamenu.horizontal .title-feature, .container-megamenu.horizontal ul.megamenu .title-submenu, .container-megamenu.horizontal ul.megamenu li .sub-menu .content .static-menu a.main-menu, .container-megamenu.horizontal ul.megamenu .subcategory a.title-submenu {
font-size: 16px;
color: #222;
text-transform: uppercase;
padding: 15px 0;
border-bottom: 1px solid #eaeaea;
margin-bottom: 5px;
font-weight: bold; }
.container-megamenu.horizontal .best-sellers-menu {
margin-top: 20px; }
.container-megamenu.horizontal .best-sellers-menu h4 a {
color: #222;
display: inline-block;
clear: both;
margin-top: 20px;
margin-bottom: 0px; }
.container-megamenu.horizontal .best-sellers-menu h4 a:hover {
color: #ff5c00; }
.container-megamenu.horizontal .content-feature li a {
padding: 5px 0;
display: inline-block;
text-transform: capitalize;
font-size: 13px;
color: #7d7d7d; }
.container-megamenu.horizontal .content-feature li a:hover {
color: #ff5c00; }
.container-megamenu.horizontal ul.megamenu li .sub-menu .content .html a.subcategory_item {
display: inline-block;
padding: 3px 0;
text-transform: capitalize;
font-size: 13px;
color: #7d7d7d; }
.container-megamenu.horizontal ul.megamenu li .sub-menu .content .html a.subcategory_item:hover {
color: #ff5c00; }
.container-megamenu.horizontal ul.megamenu li .sub-menu .content .static-menu .menu ul ul li a, .container-megamenu.horizontal ul.megamenu .sub-menu .content .hover-menu .menu ul a.main-menu {
padding: 9px 0;
text-transform: capitalize;
font-size: 13px;
color: #7d7d7d; }
.container-megamenu.horizontal ul.megamenu li .sub-menu .content .static-menu .menu ul ul li a:hover, .container-megamenu.horizontal ul.megamenu .sub-menu .content .hover-menu .menu ul a.main-menu:hover {
color: #ff5c00; }
.container-megamenu.horizontal ul.megamenu > li > a strong img {
position: absolute;
top: -15px;
left: 30px; }
/*============ MODULE MEGAMENU VERTICAL ==================*/
.container-megamenu.vertical a {
color: #555;
font-size: 13px;
display: block; }
.container-megamenu.vertical a:hover {
color: #ff5c00; }
.container-megamenu.vertical #menuHeading {
margin-top: 0;
height: 58px;
cursor: pointer; }
.container-megamenu.vertical #menuHeading .megamenuToogle-wrapper {
background-color: #ff5c00;
height: 58px;
cursor: pointer;
-webkit-transition: 0.3s all ease 0s;
-moz-transition: 0.3s all ease 0s;
transition: 0.3s all ease 0s;
border-radius: 0; }
.container-megamenu.vertical #menuHeading .megamenuToogle-wrapper .container {
font-size: 13px;
text-transform: uppercase;
font-weight: bold;
padding: 0 15px 0 0 !important;
line-height: 58px;
background: #2d2d2d; }
.container-megamenu.vertical #menuHeading .megamenuToogle-wrapper .container:before {
width: 19px;
height: 14px;
display: inline-block;
background: url("../../images/icon/icon_general.png") no-repeat -20px -1379px;
margin-left: 10px; }
.container-megamenu.vertical #menuHeading .megamenuToogle-wrapper .container > div {
margin: 3px 0 0 9px;
float: right !important;
display: none; }
.container-megamenu.vertical:after {
content: "\f0d7";
font-family: fontawesome;
font-size: 12px;
position: absolute;
top: 22px;
z-index: 10;
color: #fff;
line-height: 13px;
text-align: center;
width: 15px;
border-radius: 100%;
border: 1px solid #fff;
left: 13px; }
.container-megamenu.vertical .vertical-wrapper {
width: 100%;
background: white;
position: relative;
border-top: 0; }
.container-megamenu.vertical .vertical-wrapper ul li {
border-top: 0;
min-height: 37px; }
.container-megamenu.vertical .vertical-wrapper ul li > a {
color: #444;
padding: 0 18px;
line-height: 48px;
border-bottom: 0; }
.container-megamenu.vertical .vertical-wrapper ul li > a:hover {
color: #ff5c00; }
.container-megamenu.vertical .vertical-wrapper ul li > a strong {
font-weight: 600;
padding-right: 30px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu {
border: 1px solid #efefef;
border-top: none;
background: #fff; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .sub-menu .content .img-banner img {
width: 100%; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .sub-menu .content .img-banner {
padding-left: 15px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li .sub-menu .content .banner {
margin-top: -21px;
margin-bottom: -22px;
margin-right: -21px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li > a img {
height: auto;
margin: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 2px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li {
padding: 0 15px;
background: none;
border: 0;
position: relative;
z-index: 1;
cursor: pointer; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li b.fa {
float: left;
line-height: 50px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li b.fa:before {
content: "\f104"; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li > a {
padding: 0;
font-size: 14px;
color: #222;
border-bottom: 1px solid #e1e1e1; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li > a strong i {
font-size: 9px;
padding-left: 5px;
color: #222; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li.active > a, .container-megamenu.vertical .vertical-wrapper ul.megamenu > li:hover > a {
background: transparent !important;
color: #ff5c00; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu > li.active > a i, .container-megamenu.vertical .vertical-wrapper ul.megamenu > li:hover > a i {
color: #ff5c00; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .title-submenu {
color: #444; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .fa-caret-right {
float: left;
margin-top: 5px;
color: #999;
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style1 .content {
padding: 20px 20px 0 0;
overflow: hidden; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style1 .content .col-sm-4 {
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style1 .content .col-sm-4 img {
margin-top: 45px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style1 .content > .border {
border: none;
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style1 .content .row:nth-child(3) {
padding: 12px 0px;
background: #eee;
margin: 0 -20px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content {
padding-left: 0;
padding-bottom: 0;
padding-top: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu ul li {
padding: 0;
line-height: 26px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu ul li a.main-menu {
margin: 0 0 10px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu > ul {
margin-top: 20px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu > ul ul li {
padding: 1px 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu > ul > li {
margin: 0 0 20px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style2 .content .static-menu .menu > ul > li:last-child {
margin: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style3 .content > .border {
border: none;
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.vertical-style3 .content .image-position {
position: absolute;
bottom: 30%;
left: -20px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content {
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul {
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li {
padding: 0 15px;
position: relative;
border-bottom: 1px solid #ddd;
line-height: 26px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li:last-child {
border: none; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li > a {
line-height: 37px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li b {
line-height: 37px;
font-size: 16px;
margin: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li:hover > a {
color: #ff5c00; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul {
padding: 0;
top: -4px;
margin: 0;
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
border: 1px solid #e6e6e6;
right: 100%; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul:before, .container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul:after {
display: none; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul li {
line-height: 22px;
padding: 0 15px;
border-bottom: 1px solid #ddd; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul li:last-child {
border: none; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .item-vertical.css-menu .content .menu > ul > li ul li > a {
font-weight: normal;
line-height: 37px;
font-size: 13px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu {
left: auto;
right: 100% !important; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content {
border: 1px solid #e6e6e6;
padding: 20px 30px;
box-shadow: 1px 3px 4px 0 rgba(0, 0, 0, 0.1); }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .hover-menu a:before {
display: none; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .hover-menu a:hover:before {
color: #ff5c00; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul li a.main-menu {
margin: 0 0 10px;
border-bottom: 1px solid #eaeaea;
padding: 0 0 10px;
font-size: 16px;
color: #222;
text-transform: uppercase; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul ul {
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul ul li {
padding: 0; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul ul li a {
padding: 0;
line-height: 38px;
display: block;
font-size: 13px;
color: #7d7d7d; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul ul li:before {
display: none; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu li .sub-menu .content .static-menu .menu ul ul li:hover a {
color: #ff5c00; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .loadmore {
text-align: right;
background-position: top right;
padding: 12px 20px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .loadmore i.fa {
padding: 0;
font-size: 10px;
border: 1px solid #999;
width: 15px;
color: #999;
height: 15px;
line-height: 13px;
text-align: center;
border-radius: 100%;
position: relative;
top: -1px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .loadmore span.more-view {
font-weight: 600;
color: #222;
padding-right: 12px;
padding-right: 12px; }
.container-megamenu.vertical .vertical-wrapper ul.megamenu .loadmore span.more-view:hover {
color: #ff5c00; }
/*============CATEGORY SIMPLE BLOG==================*/
.blog-category {
border-radius: 0;
border: 0;
box-shadow: none;
margin: 0; }
.blog-category .blog-cate {
border: 1px solid #e8e8e8; }
.blog-category .box-content {
margin-bottom: 30px; }
.blog-category .box-content ul {
margin-bottom: 0; }
.blog-category #blog-search input {
border-radius: 0; }
.blog-category ul.list-group {
padding: 0;
margin: 0; }
.blog-category ul li.list-group-item {
border-radius: 0;
border: 0;
border-bottom: 1px solid #e8e8e8;
margin: 0;
padding: 10px 0; }
.blog-category ul li.list-group-item a {
color: #7d7d7d;
padding: 0 20px; }
.blog-category ul li.list-group-item a:hover, .blog-category ul li.list-group-item a.active, .blog-category ul li.list-group-item a.active:hover {
color: #ff5c00; }
.blog-category ul li.list-group-item:last-child {
border: none; }
ul.megamenu .best-sellers-menu {
padding: 0; }
ul.megamenu .best-sellers-menu .image {
overflow: hidden; }
ul.megamenu .best-sellers-menu .caption {
overflow: hidden; }
ul.megamenu .best-sellers-menu .caption h4 a {
font-size: 14px;
font-weight: normal; }
ul.megamenu .best-sellers-menu .caption p {
display: none; }
ul.megamenu .best-sellers-menu .caption .price {
display: inline-block; }
ul.megamenu .best-sellers-menu .caption .price .price-old, ul.megamenu .best-sellers-menu .caption .price .price-tax {
display: none; }
ul.megamenu li.buy_color a strong {
color: #ff5c00; }
ul.megamenu .layout-color .content-feature li a {
position: relative; }
ul.megamenu .layout-color .content-feature li a:before {
content: "";
display: inline-block;
width: 20px;
height: 20px;
position: relative;
background-color: #e1e1e1;
vertical-align: middle;
right: 0;
margin-left: 10px; }
ul.megamenu .layout-color .content-feature li.red a:before {
background: #ea3a3c; }
ul.megamenu .layout-color .content-feature li.orange a:before {
background: #f4a137; }
ul.megamenu .layout-color .content-feature li.green a:before {
background: #20bc5a; }
ul.megamenu .layout-color .content-feature li.cyan a:before {
background: #009688; }
ul.megamenu .layout-color .content-feature li.blue a:before {
background: #5f87d1; }
/*============MODULE FILTER ==================*/
.module.so_filter_wrap {
border: 1px solid #e8e8e8; }
.module.so_filter_wrap .modcontent {
border: none;
background: #fff;
border-radius: 0; }
.module.so_filter_wrap .modcontent .so-filter-heading {
padding: 0 20px; }
.module.so_filter_wrap .modcontent .so-filter-heading i {
padding: 18px 0 0; }
.module.so_filter_wrap .modcontent .so-filter-heading .so-filter-heading-text {
float: right;
padding: 15px 0 0px;
color: #444;
font-weight: 700;
text-transform: uppercase; }
.module.so_filter_wrap .modcontent .so-filter-content-opts {
padding: 0 20px; }
.module.so_filter_wrap .modcontent #text_search {
height: 30px; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container {
padding-top: 5px;
padding-left: 0px;
padding-right: 0px;
padding-bottom: 15px; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option label {
font-size: 12px; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .opt-select {
border: none; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .noUi-horizontal .noUi-handle {
border-radius: 100%;
/* &.noUi-handle-lower{left: 0;}
&.noUi-handle-upper{right: 15px; left: initial;}*/ }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .noUi-horizontal .noUi-handle:before, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .noUi-horizontal .noUi-handle:after {
display: none; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .put-min_max {
display: inline-block;
background: #fff;
border: 1px solid #ddd;
width: 49%;
padding: 0 5px;
float: right; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .put-min_max.put-min {
margin-left: 2%; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .put-min_max input {
background: transparent; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .option-input img {
display: none; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .option-input .fa-check-square-o, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .option-input .fa-square-o {
display: none; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .option-count.opt_close {
background: #ff5c00; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .input-group {
border: 1px solid #ddd; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .input-group .form-control {
background: transparent; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .input-group .btn.btn-default {
padding: 7px;
color: #555;
background: transparent;
border-radius: 0; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .input-group .btn.btn-default:hover {
background: #ff5c00;
color: #fff; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option:hover .option-input:before {
background-color: transparent;
border: 2px solid #999; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option .option-input:before {
margin-top: -7px !important; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option.opt_active .option-input:before {
background-color: transparent;
border: 2px solid #999; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option .option-input, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option-sub {
position: relative;
padding-right: 14px; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option .option-input:before, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option-sub:before {
display: inline-block;
content: "";
width: 12px;
height: 12px;
position: absolute;
top: 50%;
margin-top: -10px;
right: 0;
background-color: #999;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option .option-input:hover:before, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option-sub:hover:before {
background-color: transparent;
border: 2px solid #999; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option .option-input .fa-circle, .module.so_filter_wrap .modcontent .so-filter-content-opts-container .so-filter-option-sub .fa-circle {
display: none; }
.module.so_filter_wrap .modcontent .noUi-horizontal .noUi-handle {
top: -5px; }
.module.so_filter_wrap .modcontent li.so-filter-options {
border-bottom: 1px solid #e8e8e8;
margin-bottom: 7px; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price {
text-align: right;
padding: 0; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_scroll {
margin: 30px 15px 20px; }
.module.so_filter_wrap .modcontent .so-filter-content-opts-container ul li {
float: right; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max {
display: block; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .txt-price-shopby {
min-width: 60px;
width: 49%;
padding: 0 5px;
display: inline-block;
float: right;
border: 1px solid #ddd;
display: inline-block; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .txt-price-shopby.txt-price-shopby-fisrt {
margin-left: 2%; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .txt-price-shopby span {
display: table-cell;
vertical-align: middle; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .txt-price-shopby span.text-current {
position: relative;
top: 1px; }
.module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .input_max, .module.so_filter_wrap .modcontent .so-filter-option.so-filter-price .content_min_max .input_min {
border: none;
box-shadow: none;
padding: 0;
margin: 0; }
.module.so_filter_wrap .modcontent .noUi-handle {
background-color: #fff;
border: 1px solid #e9e9e9;
width: 15px;
height: 15px; }
.module.so_filter_wrap .modcontent .noUi-connect {
box-shadow: none;
background-color: #555;
height: 8px;
border-radius: 5px; }
.module.so_filter_wrap .modcontent .noUi-background {
background: #ff5c00;
box-shadow: none;
height: 8px; }
.module.so_filter_wrap .modcontent .noUi-horizontal .noUi-handle-upper {
right: 15px; }
.module.so_filter_wrap .modcontent .noUi-target {
border: none; }
.module.so_filter_wrap .modcontent .noUi-background {
background: #ddd; }
.module.so_filter_wrap .modcontent #btn_resetAll {
padding: 8px 15px;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
color: #fff; }
.module.so_filter_wrap .modcontent #btn_resetAll .fa.fa-times {
color: #ff5c00; }
.so-filter-content-opts-container .option-count {
background: #999;
min-width: 24px;
text-align: center; }
.so-filter-content-opts-container .option-count:not(.opt_close):after {
border-right-color: #999; }
.so_filter_wrap .modcontent .so-filter-heading .so-filter-heading-text {
float: right;
font-size: 12px;
color: #222; }
.so_filter_wrap .modcontent .so-filter-heading i {
float: left; }
.so_filter_wrap .modcontent .so-filter-content-opts-container label {
font-weight: normal; }
.so_filter_wrap .modcontent .so-filter-content-opts-container .option-count {
float: left; }
.so_filter_wrap .modcontent .so-filter-content-opts-container .option-count:not(.opt_close):after {
left: 100%;
right: auto;
border-right-color: transparent;
border-left-color: #999; }
#content .filter-horizontal .so-filter-heading {
padding: 0 15px; }
#content .filter-horizontal .so-filter-content-opts-container {
padding: 15px; }
#content .filter-horizontal ul {
display: -webkit-box;
display: -moz-box;
display: box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: flex; }
#content .filter-horizontal li.so-filter-options {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
-webkit-flex: 1;
-moz-flex: 1;
-ms-flex: 1;
flex: 1;
border: none;
border-left: 1px solid #eaeaea;
margin: 0; }
#content .filter-horizontal li.so-filter-options:last-child {
border-right: none; }
#content .filter-horizontal .clear_filter {
border-top: 1px solid #eaeaea; }
/*============MODULE CATEGORY ==================*/
.category-style {
border: 1px solid #e8e8e8; }
.box-category ul {
list-style: none;
padding: 0px;
margin: 0px; }
.box-category > ul > li {
padding: 0px;
position: relative;
margin: 0;
box-shadow: none;
background: transparent;
border-bottom: 1px solid #e8e8e8; }
.box-category > ul > li:last-child {
border: none; }
.box-category ul li a {
padding: 10px 20px;
display: block;
color: #7d7d7d;
font-weight: 600;
font-family: Raleway; }
.box-category ul li a.active {
color: #ff5c00; }
.box-category ul li .head a:before {
content: "\f107";
display: inline-block;
font: normal normal normal 14px/1 'FontAwesome'; }
.box-category ul li .head .collapsed:before {
content: "\f105"; }
.box-category ul li .head .collapsed:before {
content: "\f104"; }
.box-category ul li .head {
display: block;
position: absolute;
top: 5px;
line-height: 20px;
left: 10px;
text-align: center; }
.box-category ul li .head a {
padding: 9px 20px;
background: #555;
color: #fff;
border-radius: 3px;
border: none;
background: #999;
width: 20px;
height: 20px;
padding: 0;
border-radius: 3px;
margin-top: 8px; }
.box-category ul li .head a:hover {
background: #ff5c00;
border-color: #ff5c00;
color: #fff; }
.box-category ul li .head a:hover {
background: #ff5c00; }
.box-category ul li ul li {
padding: 0px 15px 0px 0px; }
.box-category ul ul {
margin-bottom: 20px; }
.box-category ul ul li a {
padding: 3px 0; }
.box-category ul li ul li a:before {
font-family: 'FontAwesome';
transition: all 0.3s ease;
content: "\f104";
margin: 0 0 0 5px;
float: right; }
.box-category ul li ul li a:hover:before {
margin-right: 10px; }
.basic-product-list .item-element {
margin-bottom: 20px; }
.basic-product-list .item-element:hover .image {
border-color: #ff5c00; }
.basic-product-list .image {
float: right;
border: 1px solid #ddd;
padding: 0;
margin-left: 20px; }
.basic-product-list .caption {
overflow: hidden; }
.basic-product-list h4 {
font-size: 15px;
margin: 0 0 5px; }
.basic-product-list h4 a {
color: #555; }
.basic-product-list h4 a:hover {
color: #ff5c00; }
.tag-button a {
padding: 9px 20px;
background: #eee;
color: #333;
border-radius: 3px;
border: none;
padding: 6px 10px;
display: inline-block;
margin: 0 4px 4px 0; }
.tag-button a:hover {
background: #ff5c00;
border-color: #ff5c00;
color: #fff; }
div.so-extraslider.grid {
border-right: 1px solid #ddd; }
div.so-extraslider.grid .extraslider-inner {
border: none;
padding: 0; }
div.so-extraslider.grid .owl2-dots .owl2-dot.active {
background: #ff5c00; }
div.so-extraslider.grid div.owl2-controls {
left: 10px; }
div.so-extraslider.grid div.owl2-controls .owl2-nav .owl2-next, div.so-extraslider.grid div.owl2-controls .owl2-nav .owl2-prev {
background: #fff;
border: 1px solid #a0a0a0;
opacity: 1; }
div.style-dev-so-listing-tabs {
position: relative;
z-index: 2; }
div.style-dev-so-listing-tabs h3.modtitle {
margin: 0; }
div.style-dev-so-listing-tabs .so-listing-tabs {
margin: 0; }
div.style-dev-so-listing-tabs .so-listing-tabs .ltabs-tabs-container {
margin: 0; }
div.style-dev-so-listing-tabs .so-listing-tabs .wap-listing-tabs {
border: none; }
div.style-dev-so-listing-tabs .so-listing-tabs .product-layout .product-item-container {
border: 1px solid #ddd;
margin-left: -1px; }
div.style-dev-so-listing-tabs .so-listing-tabs .product-layout .product-item-container .button-group {
margin-bottom: 12px; }
div.style-dev-so-listing-tabs .owl2-controls {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 45; }
div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-prev {
content: "\f104";
top: 7px;
right: auto;
left: 7px; }
div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-next {
content: "\f105";
top: 7px;
right: auto;
left: 37px; }
div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-prev, div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-next {
height: 25px;
width: 25px;
font-family: 'FontAwesome';
border-radius: 25px;
background: #fff;
opacity: 1;
border: 1px solid #a0a0a0;
color: #a0a0a0;
font-size: 0;
margin: 0;
padding: 0;
text-align: center; }
div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-prev:before, div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-next:before {
font-size: 17px;
line-height: 22px;
text-align: center; }
div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-prev:hover, div.style-dev-so-listing-tabs .owl2-controls .owl2-nav div.owl2-next:hover {
border-color: #ff5c00;
color: #ff5c00; }
div.style-dev-so-listing-tabs .list-sub-cat {
border-width: 0 0 1px 1px;
border-style: solid;
border-color: #ddd;
margin: 0 0 30px; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate {
width: 10%;
float: right;
border-width: 0 1px 0 0;
border-color: #ddd;
border-style: solid;
text-align: center;
padding: 10px 0;
margin: 0; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate .ltabs-tab-img {
margin: 0;
float: none;
height: auto; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate .ltabs-tab-img img {
margin: 10px auto;
background: none !important; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate .title-sub-cate {
font-size: 13px;
font-weight: bold;
text-transform: capitalize;
color: #555; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate.tab-sel, div.style-dev-so-listing-tabs .list-sub-cat li.item-cate:hover {
background: #eee; }
div.style-dev-so-listing-tabs .list-sub-cat li.item-cate.tab-sel .title-sub-cate, div.style-dev-so-listing-tabs .list-sub-cat li.item-cate:hover .title-sub-cate {
color: #ff5c00; }
.rtl .block-popup-login .fa-times-circle:before {
display: none; }
.shopping_cart .dropdown-menu .content-item {
max-height: 320px;
overflow: auto; }
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
.so-search#sosearchpro .select_category select {
padding-right: 0 !important; }
.so-search#sosearchpro .select_category::after {
display: none; } }
/*===============================================
[SASS DIRECTORY ]
[1] SO LATSET BLOG
[2] SIMPLE BLOG
[3] ARTICLE INFO
==============================================*/
/*============SO LATSET BLOG ==================*/
/*============SIMPLE BLOG ==================*/
.blog-header {
margin-bottom: 35px; }
.blog-header h3 {
color: #222;
font-weight: bold;
text-transform: uppercase;
margin: 0;
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 18px;
font-size: 1.8rem;
/* [8] */ }
.blog-listitem.grid .itemBlogImg.left-block {
display: block;
position: relative; }
.so-latest-blog .media-content .media-author {
padding: 0 0 0 10px; }
.so-latest-blog .content-detail {
text-align: right; }
.so-latest-blog .media-content .readmore {
padding-left: 15px;
padding-right: 0; }
.blog-listitem.list .blog-item .itemBlogImg .article-image {
margin: 0; }
.blog-listitem {
margin: 0 -15px;
display: inline-block; }
.blog-listitem .blog-item {
padding: 0;
margin-bottom: 30px; }
.blog-listitem .blog-item .itemBlogImg .article-image {
position: relative; }
.blog-listitem .blog-item .itemBlogImg .article-image:before {
content: '';
width: 0;
height: 0;
border-bottom: 85px solid transparent;
top: 0;
position: absolute;
z-index: 2;
border-right: 80px solid #fff;
right: 0; }
.blog-listitem .blog-item .itemBlogImg .article-image .article-date {
position: absolute;
z-index: 2;
top: 0;
right: 0; }
.blog-listitem .blog-item .itemBlogImg .article-image .article-date .date {
font-size: 14px;
color: #909090;
display: block; }
.blog-listitem .blog-item .itemBlogImg .article-image .article-date .date b {
font-size: 24px;
color: #909090;
font-family: 'Raleway';
display: block; }
.blog-listitem .blog-item .readmore a {
display: block;
width: 100%;
padding: 15px 0 0;
font-size: 13px;
font-weight: 600;
color: #ff5c00;
text-align: right; }
.blog-listitem .blog-item .readmore a i {
padding-left: 5px; }
.blog-listitem .blog-item .article-image {
margin-bottom: 15px; }
.blog-listitem .blog-item .itemBlogContent .article-title h4 {
margin-bottom: 5px;
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 16px;
font-size: 1.6rem;
/* [8] */ }
.blog-listitem .blog-item .itemBlogContent .article-title h4 a {
color: #222;
font-size: 16px;
font-weight: bold; }
.blog-listitem .blog-item .itemBlogContent .article-title h4 a:hover {
color: #ff5c00; }
.blog-listitem .blog-item .itemBlogContent .blog-meta {
display: inline-block;
padding: 15px 0 20px;
border-bottom: 1px solid #ebebeb;
vertical-align: top;
width: 100%; }
.blog-listitem .blog-item .itemBlogContent .blog-meta i {
padding-left: 5px; }
.blog-listitem .blog-item .itemBlogContent .blog-meta > span {
line-height: 15px;
font-weight: normal;
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 13px;
font-size: 1.3rem;
/* [8] */
color: #909090;
float: right;
padding-left: 20px; }
.blog-listitem .blog-item .itemBlogContent .blog-meta > span.comment_count {
padding-right: 0;
color: #909090; }
.blog-listitem .blog-item .itemBlogContent .blog-meta > span.comment_count a {
color: #999;
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 13px;
font-size: 1.3rem;
/* [8] */ }
.blog-listitem .blog-item .itemBlogContent .blog-meta > span.comment_count a:hover {
color: #ff5c00; }
.blog-listitem.list .article-description {
border-bottom: 1px solid #ebebeb;
padding-bottom: 20px;
margin-bottom: 0; }
.blog-listitem.list .blog-item {
margin-bottom: 40px; }
.blog-listitem.list .blog-item .itemBlogContent .blog-meta {
padding: 15px 0 20px;
border: none; }
.product-filter-bottom.filters-blog {
display: inline-block;
float: none;
width: 100%;
padding: 15px;
margin: 10px 0 0 !important;
text-align: center;
background-color: #f2f2f2;
border: 1px solid #ebebeb; }
.product-filter-bottom.filters-blog .view-mode {
text-align: right; }
.product-filter-bottom.filters-blog .pagination {
margin-top: 5px; }
.product-filter-bottom.filters-blog .pagination > li span, .product-filter-bottom.filters-blog .pagination > li a {
width: 32px;
height: 32px;
padding: 0;
line-height: 30px;
border-radius: 100%; }
.simple-blog-product h4 {
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 14px;
font-size: 1.4rem;
/* [8] */ }
/*============ARTICLE INFO==================*/
div.article-info .article-title h3 {
font-size: 20px;
text-transform: uppercase;
color: #1e1e1e;
font-weight: bold;
margin: 0 0 15px; }
div.article-info .article-sub-title {
display: inline-block;
width: 100%; }
div.article-info .article-sub-title span {
display: block;
float: right;
color: #999;
padding: 0 10px;
font-size: 13px; }
div.article-info .article-sub-title span.article-author {
padding-right: 0; }
div.article-info .article-sub-title span.article-author a {
color: #999;
font-size: 13px; }
div.article-info .article-sub-title span.article-author a:hover {
color: #ff5c00; }
div.article-info .article-sub-title span.article-comment {
border-left: 0; }
div.article-info .article-sub-title .article-share {
display: none; }
div.article-info .article-image {
margin-bottom: 30px; }
div.article-info .related-comment {
border-radius: 0;
border: 0;
border-top: 1px solid #e6e6e6;
padding-top: 40px;
box-shadow: none;
margin-top: 40px; }
div.article-info .related-comment .article-reply {
border: none;
background: #f9f9f9; }
div.article-info .related-comment .article-reply .author {
font-weight: bold;
font-size: 16px; }
div.article-info .related-comment .article-reply .article-reply {
background: #f4f3f3; }
div.article-info .related-comment .panel-body {
padding: 0;
border: 0; }
div.article-info .related-comment .panel-body .form-group #comments {
padding: 0;
border: 0;
overflow: hidden; }
div.article-info .related-comment .panel-body .form-group #comments h2#review-title {
margin: 0 0 30px;
padding: 0;
font-weight: bold;
text-transform: uppercase;
font-size: 18px;
color: #121212; }
div.article-info .related-comment #button-comment {
background: #ff5c00;
border-color: #ff5c00;
text-transform: uppercase; }
@media (min-width: 992px) {
div.article-info .related-comment #button-comment {
padding: 10px 52px; } }
div.article-info .related-comment #button-comment:hover {
background: #444;
border-color: #444; }
div.article-info .itemFullText {
text-align: justify; }
/*============ARTICLE COMMENTS==================*/
.comments {
margin-bottom: 30px; }
.comments.comments-level-1 {
margin-right: 136px; }
.comments .pull-left {
width: 100px;
height: 100px;
display: block;
background-color: #f5f5f5;
margin-left: 30px;
position: relative;
padding: 0; }
.comments .pull-left .fa {
font-size: 46px;
display: block;
text-align: center;
margin: 25px 0; }
.comments .pull-left img {
width: 100%;
height: auto;
position: relative;
z-index: 2; }
.comments .pull-left span {
position: absolute;
display: inline-block;
top: 15%; }
.comments .media-body .media-title {
color: #1fc0a0;
padding-bottom: 14px; }
.comments .media-body .media-title .username {
font-size: 18px;
font-style: italic;
font-family: Georgia, sans-serif;
display: inline-block;
margin-left: 14px; }
.comments .media-body .media-title .time {
font-size: 16px; }
.comments .media-body .media-title .time .fa {
font-size: 20px;
margin-left: 13px;
position: relative;
top: 3px; }
.comments .media-body .media-title .link:hover {
text-decoration: none; }
@media (max-width: 745px) {
.comments {
margin-bottom: 28px; }
.comments.comments-level-1 {
margin-right: 70px; }
.comments .pull-left {
width: 70px;
height: 70px;
margin-left: 20px; }
.comments .pull-left:before {
font-size: 46px;
line-height: 1em;
top: 10px; }
.comments .media-body .media-title time {
display: block; }
.comments .media-body .media-title time .icon {
font-size: 20px;
margin: 0 6px 0 0;
position: relative;
top: 3px; } }
/*===============================================
[SASS DIRECTORY ]
[1] HEADING
[2] LINK & COLUMN
[3] BLOCK FORM
[4] BLOCK TABLE
==============================================*/
/*================ HEADING ===================*/
html {
width: 100%;
outline: 0 !important;
direction: rtl; }
body {
color: #7d7d7d;
font-size: 13px;
line-height: 25px; }
.owl2-carousel .owl2-item img {
transform-style: inherit; }
h1 {
font-size: 33px; }
h2 {
font-size: 27px; }
h3 {
font-size: 23px; }
h4 {
font-size: 17px; }
h5 {
font-size: 13px; }
h6 {
font-size: 12px; }
.h1, .h2, .h3, h1, h2, h3, .h4, .h5, .h6, h4, h5, h6 {
margin: 0 0 15px 0; }
::-webkit-scrollbar {
width: 0.5em;
height: 0.5em; }
::-webkit-scrollbar-thumb {
background: #777; }
::-webkit-scrollbar-track {
background: #d6d6d6; }
body {
scrollbar-face-color: #777;
scrollbar-track-color: #d6d6d6; }
@media only screen and (max-width: 992px) {
::-webkit-scrollbar {
width: 0.3em;
height: 0.3em; }
::-webkit-scrollbar-thumb {
background: #777; }
::-webkit-scrollbar-track {
background: #d6d6d6; }
body {
scrollbar-face-color: #777;
scrollbar-track-color: #d6d6d6; } }
/*================ LINK & COLUMN ===================*/
.textColor {
color: #ff5c00; }
ul.menu, ol.menu, ul.blank {
list-style: none;
margin: 0;
padding: 0; }
option {
padding: 2px 5px;
border-width: 1px; }
.alert ol li {
list-style-type: decimal;
margin: 0 0 5px 15px; }
img {
max-width: 100%; }
.over {
overflow: visible; }
.align-center {
display: table;
margin: 0 auto; }
.text-danger {
color: #fff;
display: inline-block;
background-color: #a94442;
padding: 0 5px;
margin: 5px 0;
border-radius: 3px;
font-size: 11px; }
a {
color: #666; }
a:hover {
color: #b34000;
text-decoration: none; }
a, a:visited, a:active, a:link, a:focus {
cursor: pointer;
text-decoration: none;
outline: none; }
ol {
counter-reset: item;
padding: 0 0 0 15px; }
sup {
color: #f00;
font-size: 100%;
top: -4px; }
.list-inline {
display: inline-block;
margin: 0; }
.container-megamenu .list-inline a {
display: inline-block; }
.clearfix {
clear: both; }
.img-thumbnail.pull-left {
margin-right: 30px; }
.img-thumbnail.pull-right {
margin-left: 30px; }
.margin-zero {
margin: 0; }
.col-xs-15, .col-sm-15, .col-md-15, .col-lg-15 {
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px; }
.col-xs-15 {
width: 20%;
float: right; }
@media (min-width: 768px) {
.col-sm-15 {
width: 20%;
float: right; } }
@media (min-width: 992px) {
.col-md-15 {
width: 20%;
float: right; } }
@media (min-width: 1200px) {
.col-lg-15 {
width: 20%;
float: right; } }
/*================ FORM ===================*/
legend {
font-size: 18px;
padding: 7px 0px; }
/* @group 2. Inputs
-------------------*/
textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input, .form-control, select {
border-radius: 3px;
border: none;
color: #3d3d3d;
padding: 9px;
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 12px;
font-size: 1.2rem;
/* [8] */
box-shadow: none !important;
transition: all 0.3s ease; }
input#input-captcha {
margin-bottom: 15px; }
textarea:focus, textarea:hover, input[type="text"]:focus, input[type="text"]:hover, input[type="password"]:focus, input[type="password"]:hover, input[type="datetime"]:focus, input[type="datetime"]:hover, input[type="datetime-local"]:focus, input[type="datetime-local"]:hover, input[type="date"]:focus, input[type="date"]:hover, input[type="month"]:focus, input[type="month"]:hover, input[type="time"]:focus, input[type="time"]:hover, input[type="week"]:focus, input[type="week"]:hover, input[type="number"]:focus, input[type="number"]:hover, input[type="email"]:focus, input[type="email"]:hover, input[type="url"]:focus, input[type="url"]:hover, input[type="search"]:focus, input[type="search"]:hover, input[type="tel"]:focus, input[type="tel"]:hover, input[type="color"]:focus, input[type="color"]:hover, .uneditable-input:focus, .uneditable-input:hover {
outline: 0;
outline: thin dotted \9;
background-color: #e9e9e9;
/* IE6-9 */ }
textarea {
max-width: 100%; }
.form-control {
height: 38px; }
/* @end */
/* @group 3. Dropdown
-------------------*/
.header-top-right .top-link > li {
position: relative; }
header .dropdown-menu {
display: block;
opacity: 0;
filter: alpha(opacity=0);
visibility: hidden;
transition: all 0.2s ease-out;
margin-top: 20px;
min-width: 120px;
padding: 0;
border: 1px solid rgba(0, 0, 0, .15);
left: 0;
right: auto;
-webkit-background-clip: padding-box;
background-clip: padding-box; }
header .open > .dropdown-menu {
margin-top: 0;
opacity: 1;
filter: alpha(opacity=100);
visibility: visible; }
.size-img-cart {
width: 80px; }
.dropdown-menu {
background: #fff;
padding: 5px 0;
margin-top: 0;
border-radius: 0px;
border: none;
box-shadow: 0px 0px 25px rgba(0, 0, 0, 0.15);
font-size: 12px; }
#sosearchpro .dropdown-menu {
top: 100%;
display: none; }
@media (min-width: 1200px) {
#sosearchpro .dropdown-menu {
min-width: 300px; } }
#sosearchpro .dropdown-menu .media-left {
float: right; }
#sosearchpro .dropdown-menu .media-body a {
color: #555;
float: none; }
#sosearchpro .dropdown-menu .media-body a:hover {
color: #ff5c00; }
#sosearchpro .dropdown-menu:after {
display: none; }
.dropdown-menu > li > a {
padding: 5px 15px;
color: #555; }
.dropdown-menu > li > a:hover {
color: #ff5c00; }
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
background: #f7f7f7; }
.nav-header {
color: #667280; }
/* @end */
/* @group 4. Buttons
------------------*/
.input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child) {
border-bottom-right-radius: 0;
border-top-right-radius: 0; }
.button, .btn {
padding: 9px 20px;
background: #555;
color: #fff;
border-radius: 3px;
border: none;
background: #ff5c00;
border-color: #ff5c00; }
.button:hover, .btn:hover {
background: #ff5c00;
border-color: #ff5c00;
color: #fff; }
.button:hover, .btn:hover {
background: #555;
border-color: #555; }
.btn-warning {
background: #f0ad4e; }
.btn-success {
background: #5cb85c; }
.btn-info {
background: #999;
border-radius: 0;
text-transform: uppercase; }
.btn-primary {
background: #999;
border-radius: 0;
text-transform: uppercase; }
.btn-danger {
background: #d9534f;
border-radius: 0; }
.btn-revo {
background: #ff5c00;
height: 40px;
line-height: 40px;
color: #fff;
font-size: 14px;
border-radius: 20px;
padding: 0 35px;
display: inline-block;
vertical-align: top;
font-weight: bold;
text-transform: uppercase;
margin: 0 0px 0 20px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
.btn-revo:hover {
background: #999; }
.button .fa, .btn .fa {
margin: 0 5px; }
.button.inverse, .btn.inverse {
background-color: #555; }
.button.inverse:hover, .btn.inverse:hover {
background-color: #ff5c00; }
.button-continue-shopping {
display: block;
float: left; }
.button-checkout {
display: block;
float: right; }
.btn-lg, .btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33333; }
.btn-sm, .btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5; }
.btn-xs, .btn-group-xs > .btn {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5; }
/* @end */
.btn-inline {
display: inline-block; }
/*================ TABLE ===================*/
.table thead > tr > th {
background: #eee; }
table.std th, table.std td {
vertical-align: middle;
border: #ddd;
padding: 10px;
text-align: center; }
table.std th {
white-space: nowrap;
background: #f5f5f5; }
table.std tfoot td {
color: #333;
text-align: left;
white-space: nowrap; }
table.std {
background: #fdfdfd;
border-spacing: 0;
vertical-align: middle;
border: #ddd;
width: 100%; }
table th {
border: #ddd;
color: #7a7a7a;
font-size: 13px;
font-weight: bold;
padding: 10px;
text-align: center;
vertical-align: middle;
text-transform: uppercase; }
.delivery_option table td {
text-align: center; }
table tfoot td {
text-align: left; }
table.table-bordered thead > * {
background-color: rgba(51, 51, 51, 0.1);
font-weight: bold; }
/*================ PAGINATION ===================*/
.pagination > li {
display: inline-block;
margin: 0 2px;
vertical-align: top; }
.pagination > li span, .pagination > li a {
padding: 3px 8px; }
.pagination > li a:hover, .pagination > li span:hover {
color: #fff;
background: #ff5c00;
border-color: #ff5c00; }
.pagination > li.active, .pagination > li:hover {
background: transparent;
border-color: #ff5c00; }
.pagination > li.active span, .pagination > li:hover span {
color: #ff5c00;
background: transparent;
border-color: #ff5c00; }
.pagination > li.active span:hover, .pagination > li:hover span:hover {
background: #ff5c00;
border-color: #ff5c00; }
.pagination > li:last-child {
margin-left: 0; }
.pagination > li:first-child > a, .pagination > li:first-child > span {
border-radius: 0; }
.pagination > li > a, .pagination > li > span {
color: #666; }
.pagination > li:last-child > a, .pagination > li:last-child > span {
border-radius: 0; }
.checkout-cart .btn-block input {
min-width: 40px;
text-align: center; }
.checkout-cart .table-responsive {
direction: ltr; }
/*===============================================
[SASS DIRECTORY ]
[1] CONTACT PAGE
[2] PAEG ABOUT US
[3] PAGE BLOG
[4] PAGE 404
==============================================*/
/*============ CONTACT PAGE ==============*/
#map-canvas {
height: 550px;
width: 100%;
margin: 0px 0 10px; }
.info-contact {
padding-top: 30px; }
.info-contact .name-store h3 {
font-size: 16px;
color: #222;
text-transform: uppercase; }
.info-contact .text {
padding-right: 30px; }
.info-contact .comment {
padding-bottom: 15px;
border-bottom: 1px solid #e9e9e9;
margin-bottom: 25px; }
.module.page_contact_custom {
margin-bottom: 0; }
.module.page_contact_custom .block-contact .item .item-wrap {
background-color: #f2f2f2;
font-size: 14px;
color: #222;
overflow: hidden;
text-align: right;
padding: 17px 20px; }
.module.page_contact_custom .image-about-us img {
cursor: pointer;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
.module.page_contact_custom .image-about-us img:hover {
opacity: 0.7; }
.module.page_contact_custom .block-contact .item .item-wrap .icon {
display: inline-block;
height: 66px;
width: 66px;
border-radius: 50%;
border: 1px solid #b7b7b7;
float: right;
margin-left: 10px; }
.module.page_contact_custom .block-contact .item .item-wrap .info {
padding: 20px 0;
line-height: 20px;
white-space: nowrap; }
.module.page_contact_custom .block-contact .item.address .item-wrap .info {
padding: 13px 0; }
.module.page_contact_custom .block-contact .item.phone .item-wrap .icon {
background: url("../../images/icon/icon_general.png") no-repeat -9px -1761px #f2f2f2; }
.module.page_contact_custom .block-contact .item.address .item-wrap .icon {
background: url("../../images/icon/icon_general.png") no-repeat -9px -1818px #f2f2f2; }
.module.page_contact_custom .block-contact .item.support .item-wrap .icon {
background: url("../../images/icon/icon_general.png") no-repeat -9px -1706px #f2f2f2; }
.contact-form legend {
border: none;
padding: 0;
text-transform: uppercase;
font-weight: 600;
text-align: center; }
.contact-form legend h2 {
font-size: 18px;
color: #222;
text-transform: uppercase;
margin-bottom: 20px;
text-align: center;
font-weight: bold; }
.contact-form p {
text-align: center; }
/*============ PAEG ABOUT US ==============*/
.about_us {
text-align: center; }
.about_us .title-page {
font-size: 18px;
color: #222;
text-transform: uppercase;
margin-bottom: 20px;
font-weight: bold; }
.about_us .content-page {
text-align: center; }
/*============ PAGE 404 ==============*/
.button-404 > a {
margin: 0 10px; }
.content_404 {
margin: 40px 0 30px;
overflow: hidden; }
.content_404 .block-top h2 {
color: #222;
font-size: 24px;
font-weight: bold;
text-transform: uppercase;
margin-bottom: 25px; }
.content_404 .block-top .warning-code {
font-size: 14px;
color: #7d7d7d;
margin-bottom: 40px; }
/*============ PAGE COMMING SOON ==============*/
.page-comingsoon {
background: url("../../images//bg-comingsoon.jpg") no-repeat center center;
text-align: center;
min-height: 600px; }
/*INFOMATION*/
.module-content {
background: #fff;
border: 1px solid #ddd;
padding: 0 20px; }
.module-content .list-box li {
position: relative;
padding-right: 15px; }
.module-content .list-box li:before {
position: absolute;
display: block;
top: 16px;
background: #999;
content: "";
width: 6px;
height: 6px;
border-radius: 100%;
right: 0; }
.panel-default > .panel-heading {
background: #fff; }
.title-under {
position: relative;
margin-bottom: 50px; }
.title-under:after {
content: "";
position: absolute;
display: block;
height: 4px;
width: 68px;
background: #ff5c00;
bottom: -10px; }
.owl2-carousel .owl2-item img {
transform-style: initial !important; }
.title-under.text-center:after {
left: 50%;
margin-left: -34px; }
.media-box-link--arrow .fa-arrow-right {
transform: rotate(180deg); }
.media-box-link--arrow .icon {
font-size: 30px; }
.media-box-link--figure .icon {
font-size: 70px; }
.media-box-link {
display: table-row;
width: 100%;
height: 100%;
background-color: #ff5c00;
cursor: pointer;
color: #fff;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; }
.btn-default {
background: #ff5c00;
border-radius: 0; }
.btn-default:hover {
background: #ff5c00; }
.media-box-link h4 {
color: #fff;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; }
.media-box-link .icon {
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; }
.media-box-link--figure, .media-box-link--content, .media-box-link--arrow {
display: table-cell;
padding: 6% 0;
vertical-align: middle; }
.media-box-link--figure {
width: 23%; }
.media-box-link--content {
padding-right: 5%;
width: 67%; }
.media-box-link--arrow {
width: 10%;
vertical-align: middle; }
.media-box-link:hover {
background-color: #f5f5f5;
color: #777; }
.media-box-link:hover h4 {
color: #333; }
.media-box-link:hover .icon {
color: #ff5c00; }
.page_warranity {
color: #777; }
.page_warranity .title-under {
color: #333; }
.page_warranity .icon.icon-error {
font-size: 30px;
vertical-align: middle; }
.page_warranity .media-icon--content .color-dark.font18 {
color: #333;
font-size: 500; }
.color {
color: #ff5c00; }
.title-decimal {
font-size: 20px;
position: relative;
padding: 4px 69px 9px 0; }
@media (min-width: 1200px) {
.title-decimal {
font-size: 30px; } }
.title-decimal:before {
content: attr(data-content);
display: table-cell;
vertical-align: middle;
position: absolute;
top: 0px;
line-height: 40px;
background: #ff5c00;
width: 44px;
height: 44px;
color: #fff;
text-align: center;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
right: 0; }
.decimal-list {
padding: 0;
margin: 10px 0 0 0;
list-style-type: none;
counter-reset: myCounter; }
.decimal-list li {
font-size: 14px;
font-weight: bold;
color: #333;
padding: 0 18px 0 0;
margin-bottom: 7px;
text-indent: 0;
position: relative; }
.decimal-list li:before {
content: counter(myCounter);
counter-increment: myCounter;
position: absolute;
top: 0;
z-index: 1;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
color: #ff5c00;
font-weight: 500;
right: 0; }
/*===============================================
[SASS DIRECTORY ]
[1] BOX SALE,NEW
[2] RATE
[3] TODAY'S DEALS
[4] PRODUCT CATEGORY
[5] TOOLBAR
[6] PRODUCT LIST SIMPLE
[7] QUICKVIEW
==============================================*/
/*============ BOX SALE,NEW ==============*/
.label-product {
font-size: 12px;
font-weight: bold;
color: #fff;
text-align: center;
display: inline-block;
width: 38px;
height: 38px;
z-index: 7;
border-radius: 50%;
line-height: 38px;
position: absolute; }
.label-product.label-sale {
background: #ff5c00;
top: 10px;
left: 15px; }
.label-product.label-new {
background: #00abf0;
top: 10px;
right: 15px; }
.label-percent {
padding: 2px 5px;
background: #ff5c00;
font-size: 13px;
font-weight: normal; }
.product-options label {
padding: 0;
color: #666; }
.product-options .label {
font-weight: normal;
font-size: 11px; }
.product-options .radio {
position: relative;
z-index: 2;
text-transform: capitalize;
cursor: pointer; }
.product-options .radio .fa {
display: none; }
.product-options .active .fa {
display: block; }
.product-options .fa {
position: absolute;
top: 0;
z-index: 2;
width: 22px;
height: 22px;
color: white;
line-height: 22px;
text-align: center;
right: 0; }
/*============ BOX RATE ==============*/
.rating, .ratings {
font-size: 13px;
margin-bottom: 5px; }
.rating span.fa-stack .fa-star-o:before, .ratings span.fa-stack .fa-star-o:before {
content: "\f006";
color: #ff5c00; }
.rating span.fa-stack .fa-star.fa-stack-1x, .ratings span.fa-stack .fa-star.fa-stack-1x {
z-index: 1; }
.rating span.fa-stack .fa-star.fa-stack-1x:before, .ratings span.fa-stack .fa-star.fa-stack-1x:before {
content: "\f005";
color: #ebdb2c; }
span.fa-stack {
width: 14px;
height: 14px;
line-height: 14px; }
span.fa-stack .fa-star-o:before {
content: "\f006";
color: #ff5c00; }
span.fa-stack .fa-stack-2x {
font-size: 1em; }
span.fa-stack .fa-star.fa-stack-2x {
position: relative;
z-index: 1; }
span.fa-stack .fa-star.fa-stack-2x:before {
content: "\f005";
color: #ebdb2c; }
.price {
margin: 0 0 10px 0;
line-height: normal;
color: #ff5c00;
font-size: 16px;
font-weight: 700; }
.price .price-old {
line-height: normal;
padding: 0 5px;
display: inline-block;
text-decoration: line-through;
color: #999;
font-size: 13px;
font-weight: normal; }
.price .price-new, .price span.price {
color: #ff5c00;
font-size: 16px;
font-weight: 700; }
/*====================TODAY'S DEALS ====================*/
.countdown_box {
position: absolute;
top: 50%;
margin-top: -28px;
left: 50%;
width: 170px;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
-webkit-transform: scale(1) translateX(-50%);
-moz-transform: scale(1) translateX(-50%);
-ms-transform: scale(1) translateX(-50%);
-o-transform: scale(1) translateX(-50%);
transform: scale(1) translateX(-50%); }
.countdown_box .countdown_inner {
display: table;
background: #555;
width: 100%;
text-align: center; }
.countdown_box .title {
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
color: #fff;
padding: 8px;
display: none; }
.countdown_box .time-item {
display: inline-block;
color: #fff;
font-size: 12px;
border-left: 1px solid rgba(255, 255, 255, 0.2);
width: 25%; }
.countdown_box .time-item .num-time {
font-size: 14px;
font-weight: 700;
background: rgba(255, 255, 255, 0.06); }
.countdown_box .time-item .num-time, .countdown_box .time-item .name-time {
padding: 0 10px; }
.countdown_box .time-item:last-child {
border: none; }
.today_deals .title-category {
padding: 0;
padding-bottom: 20px; }
.today_deals .product-item-container .left-block {
text-align: center; }
.today_deals .product-item-container .left-block .product-image-container {
display: inline-block; }
.deals_module_wrapper .product-item-container {
border: 1px solid #e6e6e6;
padding: 20px;
overflow: hidden; }
.deals_module_wrapper .product-item-container .left-block {
position: relative;
z-index: 2; }
.deals_module_wrapper .product-item-container .box-label .label-product {
margin-right: 15px; }
.deals_module_wrapper button.btn-default {
border: 1px solid #ff5c00;
height: 32px;
line-height: 30px;
color: #ff5c00;
background: #fff;
border-radius: 0;
min-width: 32px;
padding: 0;
border-radius: 50%; }
.deals_module_wrapper button.btn-default:hover {
background: #ff5c00;
color: #fff; }
.deals_module_wrapper button.btn-default.addToCart {
padding: 0 10px;
background: #ff5c00;
color: #fff;
border-radius: 18px; }
.deals_module_wrapper .price .price-new {
font-size: 18px; }
.deals_module_wrapper .product-box-desc {
margin-top: 5px; }
.deals_module_wrapper .product-box-desc span {
min-width: 100px;
display: inline-block; }
.deals_module_wrapper .product-box-desc .status-stock {
color: #5dbe45; }
.deals_module_wrapper .title-product {
font-size: 18px;
margin-bottom: 10px; }
.deals_module_wrapper .title-product a {
color: #555; }
.deals_module_wrapper .title-product a:hover {
color: #ff5c00; }
.deals_module_wrapper .short_description {
margin: 10px 0; }
.deals_module_wrapper .countdown_box {
position: static;
-webkit-transform: scale(1) translateX(0);
-moz-transform: scale(1) translateX(0);
-ms-transform: scale(1) translateX(0);
-o-transform: scale(1) translateX(0);
transform: scale(1) translateX(0);
margin: -50px auto 0;
width: 210px; }
.deals_module_wrapper .owl2-controls {
position: absolute;
z-index: 1;
left: 0;
top: -35px; }
.deals_module_wrapper .owl2-controls .owl2-prev, .deals_module_wrapper .owl2-controls .owl2-next {
vertical-align: top;
margin: 0 3px;
padding: 9px 20px;
background: #555;
color: #fff;
border-radius: 3px;
border: none;
background: #999;
float: left;
border-radius: 0;
padding: 3px 10px;
line-height: 20px;
font-size: 18px; }
.deals_module_wrapper .owl2-controls .owl2-prev:hover, .deals_module_wrapper .owl2-controls .owl2-next:hover {
background: #ff5c00;
border-color: #ff5c00;
color: #fff; }
.deals_module_wrapper .owl2-controls .owl2-prev:hover, .deals_module_wrapper .owl2-controls .owl2-next:hover {
background: #ff5c00; }
/*====================PRODUCT CATEGORY ====================*/
.title-category {
color: #222;
text-transform: uppercase;
font-size: 18px;
margin: 0;
font-weight: bold;
padding-bottom: 22px; }
.products-category .form-group.clearfix {
margin: 0; }
.products-category .filter_group {
width: 25%;
display: inline-block;
vertical-align: top; }
.products-category .category-info img {
margin-bottom: 10px; }
.refine-search .thumbnail {
margin-bottom: 10px; }
.refine-search a {
color: #555;
display: block; }
.refine-search a:hover {
color: #ff5c00; }
/*SIDEBAR LISTING - RESPONSIVE*/
.open-sidebar {
line-height: 25px;
display: inline-block;
border: 2px solid #999;
margin-bottom: 20px;
padding: 0px 15px;
letter-spacing: 1px;
font-size: 10px;
text-transform: uppercase; }
#close-sidebar {
display: none; }
@media only screen and (max-width: 992px) {
body.open-sboff {
height: 100%;
overflow: hidden; }
.open-sidebar i.fa {
margin-right: 5px; }
.product-detail .sidebar-overlay, .page-category .sidebar-overlay {
background: rgba(0, 0, 0, 0.5);
display: none;
height: 100%;
opacity: 1;
position: fixed;
top: 0;
left: 0px;
right: 0px;
width: 100%;
z-index: 9998; }
.product-detail .sidebar-offcanvas, .page-category .sidebar-offcanvas {
background: #fff;
width: 300px;
position: fixed;
top: 0px;
bottom: 0px;
z-index: 9999;
height: 100%;
overflow-x: scroll;
box-shadow: 0 0 5px 0 rgba(50, 50, 50, 0.75);
transition: all 300ms ease-in-out;
padding-top: 30px;
margin: 0px;
right: -100%;
padding-right: 15px !important;
padding-left: 10px !important; }
.product-detail .sidebar-offcanvas.active, .page-category .sidebar-offcanvas.active {
right: 0; }
.product-detail .sidebar-offcanvas #close-sidebar, .page-category .sidebar-offcanvas #close-sidebar {
position: absolute;
top: 10px;
left: 20px;
font-size: 16px;
display: block; }
.product-detail .sidebar-offcanvas #close-sidebar:hover, .page-category .sidebar-offcanvas #close-sidebar:hover {
cursor: pointer;
color: #f00; } }
/*TOOLBAR LISTING TOP*/
#content.col-sm-6 .product-compare {
display: none; }
.filters-panel {
margin-bottom: 25px; }
.filters-panel:before, .filters-panel:after {
content: " ";
display: table; }
.filters-panel:after {
clear: both; }
.filters-panel.product-filter-bottom {
margin: 25px 0 0; }
.filters-panel.product-filter-bottom .short-by-show {
line-height: 40px; }
.filters-panel .pagination {
margin: 0; }
.filters-panel .list-view button.btn {
border-radius: 0;
padding: 9px;
color: #fff;
border: none;
background: #252525;
width: 40px;
height: 40px;
font-size: 14px; }
.filters-panel .list-view button.btn.grid {
margin-right: -3px; }
.filters-panel .list-view button.btn.active {
background: #ff5c00;
color: #fff;
box-shadow: none; }
.filters-panel .list-view button.btn.active:hover {
background: #ff5c00;
color: #fff; }
.filters-panel .list-view button.btn:hover {
color: #fff;
background: #ff5c00; }
.filters-panel .list-view button.btn:focus {
border-radius: 0;
border-color: #ff5c00;
outline: none; }
.filters-panel .list-view .fa {
margin: 0; }
.filters-panel label {
font-weight: normal;
line-height: 40px; }
.filters-panel .btn-default {
padding: 9px 20px;
background: #eee;
color: #333;
border-radius: 3px;
border: none;
font-size: 13px; }
.filters-panel .btn-default:hover {
background: #ff5c00;
border-color: #ff5c00;
color: #fff; }
.filters-panel .form-control, .filters-panel .btn {
color: #6b6b6b;
height: 38px;
padding: 9px 15px;
border: 1px solid #e8e8e8;
background: transparent;
border-radius: 0; }
@media (min-width: 1200px) {
.filters-panel .form-inline .form-group {
margin-right: 20px; } }
.box-pagination .pagination > li span, .box-pagination .pagination > li a {
padding: 0;
width: 27px;
height: 28px;
line-height: 28px;
text-align: center; }
.box-pagination .pagination {
display: block; }
/*================ PRODUCT LIST ===================*/
.product-layout .second_img .img_0 {
right: 50%;
top: 0;
transform: translate(50%, 0); }
.products-list {
/*------------------PRODUCT GRID ====================*/
/*----------------PRODUCT LIST ------------------*/ }
.products-list .product-layout {
overflow: hidden; }
.products-list .product-layout .product-item-container .left-block .countdown_box .countdown_inner {
background: transparent;
box-shadow: none; }
.products-list .product-layout .product-item-container .left-block .countdown_box .countdown_inner .time-item {
padding: 1px 0;
background: #444;
border: none;
margin-right: 2px;
width: 23.5%; }
.products-list .product-layout .product-item-container .left-block .countdown_box .countdown_inner .time-item .num-time {
font-size: 14px;
color: #fff;
margin: 0;
border: none;
height: 18px;
line-height: 20px;
font-weight: bold; }
.products-list .product-layout .product-item-container .left-block .countdown_box .countdown_inner .time-item .name-time {
font-size: 10px;
color: #fff;
margin: 0;
height: 20px;
line-height: 20px;
text-transform: uppercase; }
.products-list .product-layout .product-item-container .left-block .quickview {
height: 32px;
width: 32px;
text-align: center;
line-height: 32px;
background: #ff5c00;
color: #fff;
cursor: pointer;
z-index: 99; }
.products-list .product-layout .product-item-container .left-block .quickview:hover {
background-color: #cc4a00;
color: #fff; }
.products-list .product-layout .product-item-container .button-group button.addToCart, .products-list .product-layout .product-item-container .button-group button.wishlist, .products-list .product-layout .product-item-container .button-group button.compare {
background-color: #fff;
border: 1px solid #ff5c00; }
.products-list .product-layout .product-item-container .button-group button:hover {
background: #ff5c00;
color: #ff5c00;
border-color: #ff5c00; }
.products-list .product-layout .product-item-container .button-group .quickview {
width: 30px;
height: 30px;
text-indent: -99999px;
background: #999 url("../../images/icon/icon_quickview.png") no-repeat center center; }
.products-list .product-layout .product-item-container:hover .countdown_box {
-webkit-transform: scale(0);
-moz-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0); }
.products-list.list-masonry .product-layout .product-item-container, .products-list.grid .product-layout .product-item-container {
padding: 15px 0;
margin: 15px 0;
position: relative;
border: 1px solid #e8e8e8;
overflow: hidden; }
.products-list.list-masonry .product-layout .product-item-container iframe, .products-list.grid .product-layout .product-item-container iframe {
width: 100%; }
.products-list.list-masonry .product-layout .product-item-container .quickview, .products-list.grid .product-layout .product-item-container .quickview {
opacity: 1;
position: absolute;
top: 30%;
margin: 0;
background-color: #ff5c00;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
opacity: 0;
border-radius: 50%;
right: 50%;
margin-right: -16px; }
.products-list.list-masonry .product-layout .product-item-container .left-block, .products-list.grid .product-layout .product-item-container .left-block {
position: relative;
width: 100%;
float: right; }
.products-list.list-masonry .product-layout .product-item-container .left-block .countdown_box .countdown_inner .time-item, .products-list.grid .product-layout .product-item-container .left-block .countdown_box .countdown_inner .time-item {
background: rgba(0, 0, 0, 0.7); }
.products-list.list-masonry .product-layout .product-item-container .right-block, .products-list.grid .product-layout .product-item-container .right-block {
margin-top: 20px;
width: 100%;
text-align: center;
clear: both; }
.products-list.list-masonry .product-layout .product-item-container .right-block .caption, .products-list.grid .product-layout .product-item-container .right-block .caption {
padding: 0;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; }
.products-list.list-masonry .product-layout .product-item-container .right-block .caption h4, .products-list.grid .product-layout .product-item-container .right-block .caption h4 {
margin-bottom: 10px; }
.products-list.list-masonry .product-layout .product-item-container .right-block .caption h4 a, .products-list.grid .product-layout .product-item-container .right-block .caption h4 a {
font-size: 15px;
color: #222;
font-weight: 600;
text-transform: capitalize; }
.products-list.list-masonry .product-layout .product-item-container .right-block .caption h4 a:hover, .products-list.grid .product-layout .product-item-container .right-block .caption h4 a:hover {
color: #ff5c00; }
.products-list.list-masonry .product-layout .product-item-container .right-block .caption .ratings, .products-list.grid .product-layout .product-item-container .right-block .caption .ratings {
display: none; }
.products-list.list-masonry .product-layout .product-item-container .button-group, .products-list.grid .product-layout .product-item-container .button-group {
position: absolute;
font-size: 15px;
bottom: 15px;
right: 0;
left: 0;
z-index: 2;
opacity: 0;
visibility: hidden; }
.products-list.list-masonry .product-layout .product-item-container .button-group button, .products-list.grid .product-layout .product-item-container .button-group button {
bottom: -70px;
position: relative;
border: none;
height: 32px;
line-height: 30px;
border-radius: 100%;
color: #ff5c00;
border: 1px solid #ff5c00;
min-width: 32px;
text-align: center; }
.products-list.list-masonry .product-layout .product-item-container .button-group button:hover, .products-list.grid .product-layout .product-item-container .button-group button:hover {
border-color: #ff5c00;
color: #fff !important; }
.products-list.list-masonry .product-layout .product-item-container .button-group button.addToCart, .products-list.grid .product-layout .product-item-container .button-group button.addToCart {
padding: 0 10px;
color: #fff;
border-radius: 16px;
background: #ff5c00;
-webkit-transition: bottom 0.2s ease-in-out;
-moz-transition: bottom 0.2s ease-in-out;
transition: bottom 0.2s ease-in-out; }
.products-list.list-masonry .product-layout .product-item-container .button-group button.wishlist, .products-list.grid .product-layout .product-item-container .button-group button.wishlist {
padding: 0;
width: 32px;
-webkit-transition: bottom 0.4s ease-in-out;
-moz-transition: bottom 0.4s ease-in-out;
transition: bottom 0.4s ease-in-out;
color: #ff5c00; }
.products-list.list-masonry .product-layout .product-item-container .button-group button.compare, .products-list.grid .product-layout .product-item-container .button-group button.compare {
padding: 0;
width: 32px;
-webkit-transition: bottom 0.6s ease-in-out;
-moz-transition: bottom 0.6s ease-in-out;
transition: bottom 0.6s ease-in-out;
color: #ff5c00; }
.products-list.list-masonry .product-layout .product-item-container:hover .button-group, .products-list.grid .product-layout .product-item-container:hover .button-group {
opacity: 1;
visibility: visible; }
.products-list.list-masonry .product-layout .product-item-container:hover .button-group button, .products-list.grid .product-layout .product-item-container:hover .button-group button {
bottom: 0;
margin: 0 1px; }
.products-list.list-masonry .product-layout .product-item-container:hover .caption, .products-list.grid .product-layout .product-item-container:hover .caption {
opacity: 0;
visibility: hidden; }
.products-list.list-masonry .product-layout .product-item-container:hover .quickview, .products-list.grid .product-layout .product-item-container:hover .quickview {
opacity: 1;
top: 40%; }
.products-list.list-masonry .product-layout .product-item-container:hover .quickview:hover, .products-list.grid .product-layout .product-item-container:hover .quickview:hover {
background-color: #ff5c00; }
.products-list.list .product-layout .product-item-container {
float: left;
width: 100%;
margin: 15px 0;
overflow: hidden; }
.products-list.list .product-layout .product-item-container .left-block {
padding: 0;
overflow: hidden;
text-align: center; }
.products-list.list .product-layout .product-item-container .left-block .quickview {
border-radius: 100%;
top: 0;
opacity: 0;
top: 30%;
opacity: 0;
position: absolute;
right: 50%;
margin-right: -16px; }
.products-list.list .product-layout .product-item-container .left-block .product-image-container {
border: 1px solid #e8e8e8; }
.products-list.list .product-layout .product-item-container .left-block .countdown_box {
padding: 10px; }
.products-list.list .product-layout .product-item-container .countdown_box {
width: 100%; }
.products-list.list .product-layout .product-item-container .label-new {
top: 8px;
right: 8px;
left: auto; }
.products-list.list .product-layout .product-item-container .label-sale {
top: 8px;
left: 8px;
right: auto; }
.products-list.list .product-layout .product-item-container .right-block .caption {
padding: 0 10px; }
.products-list.list .product-layout .product-item-container .right-block .caption h4 {
margin-top: 0; }
.products-list.list .product-layout .product-item-container .right-block .caption h4 a {
color: #222;
font-size: 18px; }
.products-list.list .product-layout .product-item-container .right-block .description {
padding: 0; }
.products-list.list .product-layout .product-item-container .right-block .button-group {
margin: 20px 0 0 0;
padding: 0 10px; }
.products-list.list .product-layout .product-item-container .button-group button {
background-color: #ff5c00;
color: #fff;
font-size: 13px;
transition: all 0.3s;
height: 32px;
line-height: 30px;
border: 1px solid #ff5c00;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
border-radius: 50%;
min-width: 32px; }
.products-list.list .product-layout .product-item-container .button-group button:hover {
border-color: #ff5c00;
color: #fff !important;
background: #ff5c00 !important; }
.products-list.list .product-layout .product-item-container .button-group button.addToCart {
padding: 0 10px;
color: #fff;
border-radius: 16px;
background: #ff5c00; }
.products-list.list .product-layout .product-item-container .button-group button.wishlist {
color: #ff5c00;
background: transparent;
margin-right: 2px; }
.products-list.list .product-layout .product-item-container .button-group button.compare {
color: #ff5c00;
background: transparent;
margin-right: 2px; }
.products-list.list .product-layout .product-item-container:hover .left-block .quickview {
top: 46%;
opacity: 1;
z-index: 1;
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
background-color: #ff5c00;
color: #fff;
border-color: #ff5c00; }
.products-list.list .product-layout .product-item-container:hover .left-block .quickview:hover {
background-color: #444;
border-color: #444; }
.products-list.list .product-layout .product-item-container:hover .left-block .countdown_box {
transform: scale(0); }
.products-list.list .product-layout .product-item-container:hover .left-block .product-image-container.second_img .img_0 {
top: 0;
opacity: 1;
z-index: 0; }
.products-list.list .product-layout .product-item-container:hover .right-block .caption h4 a {
color: #ff5c00; }
/*============ QUICKVIEW ==============*/
#product-quick .title-product {
width: 50%; }
#product-quick .title-product h1 {
font-size: 16px; }
#product-quick .product-view .content-product-right .product-box-desc {
padding: 15px;
border: 1px dotted #eee;
margin: -25px 0 0px;
font-style: italic;
color: #999; }
#product-quick .product-view .content-product-right .product-box-desc span {
font-weight: normal; }
/*===============================================
[SASS DIRECTORY ]
[1] CONTENT PRODUCT OTHER
[2] PRODUCT INFO
[3] PRODUCT TABS
[3] RELATED PRODUCT
==============================================*/
/*============CONTENT PRODUCT OTHER ==================*/
/*.zoomContainer{z-index: 450;}*/
.lightSlider {
padding: 0; }
left-content-product.product-view .flexslider-thumb.not_full_slider {
padding: 0;
margin-bottom: 30px; }
.product_page_price {
margin-bottom: 10px;
margin-top: 5px; }
.product_page_price .price-new {
font-size: 22px; }
.product_page_price .price-old {
vertical-align: top; }
.product_page_price .price-tax {
margin-bottom: 10px;
color: #555;
font-size: 12px;
font-weight: normal; }
.product-search input[type=checkbox], .product-search input[type=radio] {
margin: 7px -20px 0 0;
margin-top: 1px \9;
line-height: normal; }
.product-detail .producttab .tab-content ul, .product-detail .producttab .tab-content ol {
display: block;
list-style-type: disc;
-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;
-webkit-padding-start: 40px; }
.product-detail .best-seller {
margin-bottom: 30px; }
#tab-review input[type=radio] {
position: relative;
top: 2px; }
#tab-review .contacts-form span span.text-danger {
margin-left: 15px;
margin-top: 0; }
#tab-review .form-group textarea {
height: 150px; }
/*============PRODUCT INFO ==================*/
.product-view {
margin-bottom: 30px; }
.product-view .content-product-left .large-image {
cursor: pointer;
display: block;
padding: 1px;
overflow: hidden;
position: relative;
border: 1px solid #eee; }
.product-view .content-product-left .thumb-video {
bottom: 10px;
position: absolute;
z-index: 950;
font-size: 32px;
left: 20px; }
.product-view .content-product-left .full_slider, .product-view .content-product-left .not_full_slider {
margin-top: 10px; }
.product-view .content-product-left .full_slider .thumbnail, .product-view .content-product-left .not_full_slider .thumbnail {
border-radius: 0;
margin-bottom: 0; }
.product-view .content-product-left .full_slider .thumbnail:hover, .product-view .content-product-left .not_full_slider .thumbnail:hover {
border-color: #ff5c00; }
.product-view .content-product-left .full_slider .thumbnail.active, .product-view .content-product-left .not_full_slider .thumbnail.active {
border-color: #ff5c00; }
.product-view .content-product-left .full_slider:hover .owl2-nav div, .product-view .content-product-left .not_full_slider:hover .owl2-nav div {
opacity: 1; }
.product-view .content-product-left .full_slider:hover .owl2-nav div.owl2-prev, .product-view .content-product-left .not_full_slider:hover .owl2-nav div.owl2-prev {
left: -14px; }
.product-view .content-product-left .full_slider:hover .owl2-nav div.owl2-next, .product-view .content-product-left .not_full_slider:hover .owl2-nav div.owl2-next {
right: -14px; }
.product-view .content-product-left .full_slider .owl2-nav div, .product-view .content-product-left .not_full_slider .owl2-nav div {
display: block;
width: 28px;
text-align: center;
background: #fff;
color: #e8e8e8;
z-index: 9;
line-height: 24px;
border-radius: 50%;
border: 2px solid #e8e8e8;
cursor: pointer;
transition: 0.2s;
position: absolute;
height: 28px;
top: 50%;
margin-top: -14px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
opacity: 0; }
.product-view .content-product-left .full_slider .owl2-nav div .fa, .product-view .content-product-left .not_full_slider .owl2-nav div .fa {
font-size: 14px;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
position: relative;
top: 50%;
display: block; }
.product-view .content-product-left .full_slider .owl2-nav div:hover, .product-view .content-product-left .not_full_slider .owl2-nav div:hover {
border-color: #ff5c00;
color: #ff5c00; }
.product-view .content-product-left .full_slider .owl2-nav div.owl2-prev, .product-view .content-product-left .not_full_slider .owl2-nav div.owl2-prev {
left: -30px; }
.product-view .content-product-left .full_slider .owl2-nav div.owl2-next, .product-view .content-product-left .not_full_slider .owl2-nav div.owl2-next {
right: -30px; }
.product-view .content-product-right {
overflow: hidden; }
.product-view .content-product-right .title-product h1 {
font-size: 18px;
color: #222;
font-weight: bold;
text-transform: capitalize;
margin-bottom: 7px; }
.product-view .content-product-right .box-review .ratings {
display: inline-block;
margin: 0 0 0 20px;
z-index: 0;
position: relative; }
.product-view .content-product-right .box-review a {
color: #7d7d7d;
display: inline-block; }
.product-view .content-product-right .box-review a:hover {
color: #ff5c00; }
.product-view .content-product-right .product-box-desc {
float: right;
width: 100%;
padding: 10px 20px;
position: relative;
font-weight: bold;
display: inline-block;
min-width: 120px;
text-transform: uppercase;
font-size: 12px;
font-weight: normal;
color: #525252; }
.product-view .content-product-right .product-box-desc span {
padding-left: 5px; }
.product-view .content-product-right .product-box-desc .inner-box-desc {
width: 100%;
position: relative; }
.product-view .content-product-right .product-box-desc .inner-box-desc:before {
content: "";
width: 4px;
background: #ff5c00;
height: 100%;
position: absolute;
right: -20px;
top: 0; }
.product-view .content-product-right .product-box-desc .brand a {
color: #525252; }
.product-view .content-product-right .product-box-desc .brand a:hover {
color: #ff5c00; }
.product-view .content-product-right .product-label {
line-height: 24px;
margin-top: 12px;
float: right;
width: 100%; }
.product-view .content-product-right .product-label .price {
float: right;
margin-top: 0; }
.product-view .content-product-right .product-label .price .list-unstyled {
font-size: 12px;
font-weight: bold;
color: #444; }
.product-view .content-product-right .short_description {
display: block;
padding-top: 20px;
clear: both; }
.product-view .content-product-right .short_description h3 {
margin-bottom: 5px; }
.product-view .content-product-right .countdown_box {
position: static;
margin: 0;
-webkit-transform: scale(1) translateX(0);
-moz-transform: scale(1) translateX(0);
-ms-transform: scale(1) translateX(0);
-o-transform: scale(1) translateX(0);
transform: scale(1) translateX(0);
width: 100%;
margin-bottom: 20px; }
@media (min-width: 1200px) {
.product-view .content-product-right .countdown_box {
width: 420px; } }
.product-view .content-product-right .countdown_box .countdown_inner .title {
padding: 10px;
display: table-cell;
vertical-align: top;
border-left: 1px solid rgba(255, 255, 255, 0.2); }
.product-view .content-product-right h3 {
text-transform: uppercase;
font-size: 14px;
color: #222;
font-weight: 700; }
.product-view .content-product-right .box-info-product {
float: right;
width: 100%;
margin: 0 -10px 20px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control {
float: right;
margin: 0;
padding: 0 10px 0;
position: relative; }
.product-view .content-product-right .box-info-product .quantity .quantity-control label {
font-weight: bold;
margin-bottom: 5px;
font-size: 11px;
text-transform: uppercase;
color: #545454;
font-family: Raleway;
float: right;
display: none;
margin: 0;
line-height: 30px;
padding-left: 8px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control input.form-control {
background: #fff;
float: right;
height: 32px;
line-height: 30px;
margin: 0;
padding: 0 10px;
width: 38px;
border: 1px solid #ddd;
border-radius: 0;
z-index: 0;
box-shadow: none;
text-align: center;
margin-left: 17px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control span {
border: 0 none;
color: white;
float: right;
font-size: 10px;
font-weight: normal;
border-radius: 0;
cursor: pointer;
line-height: 16px;
margin-right: 5px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control span.product_quantity_up {
font-size: 14px;
background: none repeat scroll 0 0 #999;
padding: 0 4px;
position: absolute;
top: 0;
height: 16px;
width: 15px;
left: 13px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control span.product_quantity_down {
font-size: 14px;
background: none repeat scroll 0 0 #999;
font-size: 13px;
padding: 0 4px;
position: absolute;
top: 15px;
width: 15px;
height: 17px;
line-height: 15px;
left: 13px; }
.product-view .content-product-right .box-info-product .quantity .quantity-control span:hover {
background: #ff5c00 !important; }
.product-view .content-product-right .box-info-product .cart {
float: right;
overflow: hidden;
margin-left: 5px; }
@media (min-width: 1200px) {
.product-view .content-product-right .box-info-product .cart {
padding-right: 10px; } }
.product-view .content-product-right .box-info-product .cart a {
font-size: 12px;
font-weight: bold;
text-transform: uppercase; }
.product-view .content-product-right .box-info-product .cart a i {
margin-left: 5px; }
.product-view .content-product-right .box-info-product .cart input {
height: 33px;
line-height: 33px;
padding: 0 10px;
font-weight: normal;
font-size: 13px;
text-transform: capitalize;
border-radius: 18px; }
.product-view .content-product-right .box-info-product .cart input:hover {
background-color: #ff5c00; }
.product-view .content-product-right .box-info-product .add-to-links li {
display: inline-block; }
.product-view .content-product-right .box-info-product .add-to-links li.wishlist a {
margin-left: 2px; }
.product-view .content-product-right .box-info-product .add-to-links ul li a {
height: 32px;
width: 32px;
line-height: 30px;
text-align: center;
padding: 0;
border-radius: 50%;
border: 1px solid #ff5c00;
display: inline-block;
background-color: #fff;
color: #ff5c00; }
.product-view .content-product-right .box-info-product .add-to-links ul li a.text {
display: none; }
.product-view .content-product-right .box-info-product .add-to-links ul li a:hover {
border-color: #ff5c00;
background: #ff5c00;
color: #fff; }
.product-view .content-product-right .box-info-product .add-to-links .fa-chevron-right:before {
content: "\f053"; }
.product-view .content-product-right .share {
margin-top: 10px; }
.social-share .title-share {
text-transform: uppercase;
float: right;
font-size: 14px;
color: #222;
line-height: 35px;
font-family: 'Raleway';
font-weight: bold;
padding-left: 25px; }
.social-share a {
display: inline-block;
vertical-align: top;
margin: 0 5px;
width: 35px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
height: 35px;
text-align: center;
border-radius: 50%;
color: #fff;
font-size: 16px;
background-color: #ff5c00; }
.social-share a i {
line-height: 35px; }
.social-share a:hover {
background: #cc4a00; }
.product-attribute .table-responsive {
border: 1px solid #e1e1e1; }
.product-attribute .table-responsive .title-attribute {
font-size: 14px;
text-transform: uppercase;
color: #222;
font-family: Raleway;
padding: 13px 17px; }
.product-attribute .table-responsive .table {
margin-bottom: 0; }
.product-attribute .table-responsive .name-attribute {
text-transform: uppercase;
color: #222;
font-family: Raleway;
border-right: 1px solid #e1e1e1;
padding: 8px 15px;
font-weight: bold; }
.product-attribute .table-responsive .text-attribute {
padding: 8px 15px; }
#product {
margin-top: 15px; }
#product .image_option_type .product-options {
display: inline-block; }
#product .control-label {
font-weight: bold;
margin-bottom: 5px;
font-size: 11px;
text-transform: uppercase;
color: #545454;
font-family: Raleway;
min-width: 65px;
float: right;
padding-left: 5px; }
#product .product-options .img-thumbnail {
width: 22px;
height: 22px;
border-radius: 0;
padding: 1px; }
#product .radio-type-button {
display: inline-block;
vertical-align: top;
width: auto;
margin: 0 7px 5px 0px;
padding: 0px; }
#product .radio-type-button label {
padding: 0;
font-size: 14px; }
#product .radio-type-button input {
visibility: hidden; }
#product .radio-type-button .option-content-box {
background: #999;
border: 1px solid #999;
display: block;
text-align: center;
border-radius: 0;
padding: 0;
color: #fff;
font-weight: bold;
min-width: 28px;
min-height: 28px; }
#product .radio-type-button .option-content-box.active, #product .radio-type-button .option-content-box.active:hover {
background: #666;
color: white; }
#product .radio-type-button .option-content-box:hover {
background: #ff5c00;
border-color: #ff5c00;
color: white; }
#product .radio-type-button .option-name {
padding: 0 5px; }
#product .radio-type-button.option_image .option-content-box {
display: block;
text-align: center;
border-radius: 0;
padding: 0;
border: none; }
#product .radio-type-button.option_image .option-content-box img {
padding: 2px;
border: 1px solid #ddd;
width: 30px;
border-radius: 0; }
#product .radio-type-button.option_image .option-content-box img:hover {
border-color: #ff5c00; }
#product .radio-type-button.option_image .option-content-box.active, #product .radio-type-button.option_image .option-content-box.active:hover {
background: transparent;
color: white; }
#product .radio-type-button.option_image .option-content-box:hover {
background: transparent; }
#product .radio-type-button.option_image .option-name {
display: none; }
#product .option_image label {
padding: 0; }
#product .option_image input {
visibility: hidden; }
#product .option_image .option-name {
padding: 0 5px; }
#product .option_image .option-content-box {
padding: 1px; }
#product .box-date {
padding-right: 0; }
#product .box-date label {
margin-left: 10px;
width: 80px; }
#product .box-date input {
width: 200px; }
#product .box-date input, #product .box-date button {
border-radius: 0;
position: relative;
z-index: 0;
margin-right: 0; }
#product .box-date .input-group-btn {
float: right; }
#product .box-date button:hover {
background: #ff5c00;
color: #fff; }
#product .icheckbox.checked:before, #product .iradio.checked:before {
background-color: #ff5c00;
border-color: #ff5c00; }
.thumb-vertical-outer {
width: 94px;
position: relative;
padding: 20px 0;
float: right;
margin-left: 15px; }
.thumb-vertical-outer .lSAction {
display: none !important; }
.thumb-vertical-outer .thumbnail {
border-color: #ddd; }
.thumb-vertical-outer .btn-more {
display: block;
height: 20px;
width: 20px;
line-height: 20px;
color: #999;
background: transparent;
text-align: center;
position: absolute;
font-size: 18px;
cursor: pointer;
margin-right: -10px;
right: 50%;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; }
.thumb-vertical-outer .btn-more:hover {
color: #ff5c00; }
.thumb-vertical-outer .btn-more.prev-thumb {
top: -5px; }
.thumb-vertical-outer .btn-more.next-thumb {
bottom: -5px; }
.thumb-vertical-outer .prev {
margin-bottom: 5px; }
.thumb-vertical-outer .prev, .thumb-vertical-outer .next {
cursor: pointer; }
.thumb-vertical-outer .prev.disabled, .thumb-vertical-outer .next.disabled {
visibility: hidden; }
.thumb-vertical-outer .prev .fa, .thumb-vertical-outer .next .fa {
font-size: 16px;
display: block;
text-align: center; }
.thumb-vertical-outer ul li {
cursor: pointer;
margin-bottom: 10px; }
.thumb-vertical-outer ul li a {
-webkit-transform: scale(1) translate3d(0px, 0px, 0px);
-moz-transform: scale(1) translate3d(0px, 0px, 0px);
-ms-transform: scale(1) translate3d(0px, 0px, 0px);
-o-transform: scale(1) translate3d(0px, 0px, 0px);
transform: scale(1) translate3d(0px, 0px, 0px); }
.thumb-vertical-outer ul li .thumbnail {
border-radius: 0;
padding: 0;
margin: 0; }
.thumb-vertical-outer ul li .thumbnail img {
padding: 0px;
-webkit-transition: all 0.3s ease;
transition: all 0.3s ease;
position: relative;
padding: 4px; }
.thumb-vertical-outer ul li .thumbnail:hover {
border-color: #ff5c00; }
.thumb-vertical-outer ul li .thumbnail.active {
border-color: #ff5c00; }
/*============PRODUCT TABS==================*/
.producttab .tabsslider {
margin-bottom: 30px;
padding: 0; }
.producttab .tabsslider .nav-tabs {
border: 1px solid #e1e1e1;
background: #f2f2f2; }
.producttab .tabsslider .nav-tabs li {
margin: -1px -1px 0 0;
list-style: none;
cursor: pointer;
float: right;
font-size: 16px;
text-transform: uppercase;
border-left: 1px solid #e1e1e1; }
.producttab .tabsslider .nav-tabs li a {
font-weight: bold;
border: none;
padding: 0;
color: #222;
padding: 11px 30px;
margin: 0;
border-radius: 0;
font-family: Raleway;
font-size: 14px; }
.producttab .tabsslider .nav-tabs li.active, .producttab .tabsslider .nav-tabs li:hover {
border-color: #ff5c00; }
.producttab .tabsslider .nav-tabs li.active a, .producttab .tabsslider .nav-tabs li:hover a {
color: #fff;
background: #ff5c00; }
.producttab .tabsslider .tab-content {
padding: 30px;
display: block;
margin: 0;
border-style: solid;
margin-top: -1px;
border-width: 1px;
border-color: #e6e6e6;
line-height: 22px; }
.producttab .tabsslider.vertical-tabs {
border: 1px solid #e6e6e6;
padding: 0;
border-bottom: 1px solid #ddd; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs {
border: medium none;
margin: 0;
padding: 0; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li {
border: none;
border-bottom: 1px solid #ddd;
clear: both;
position: relative;
width: 100%;
padding: 5px 0;
border-left: none; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li a {
padding: 5px 30px; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:hover {
border-color: #ddd; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:hover a {
background: transparent; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:last-child {
border: none; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:before {
content: "";
width: 5px;
height: 100%;
right: -1px;
position: absolute;
top: 0;
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
z-index: 99; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:hover {
border-right-color: #ff5c00; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:hover a {
color: #ff5c00; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li:hover:before {
background-color: #ff5c00; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li.active {
border-left-color: #ff5c00; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li.active:before {
background-color: #ff5c00; }
.producttab .tabsslider.vertical-tabs ul.nav-tabs li.active a {
background: transparent;
color: #ff5c00; }
.producttab .tabsslider.vertical-tabs .tab-content {
border: 0;
border-right: 1px solid #e6e6e6;
min-height: 200px; }
#product-accordion {
border: 1px solid #ddd;
border-top: 4px solid #ff5c00; }
#product-accordion .panel {
padding: 0 20px 0 20px;
border-bottom: 0;
box-shadow: none;
margin: 0; }
#product-accordion .panel .panel-heading {
border-bottom: 1px solid #eee;
padding: 0 0 10px 0; }
#product-accordion .panel .panel-heading a {
text-transform: uppercase;
font-weight: bold;
margin: 0;
color: #7d7d7d;
width: 100%;
display: inline-block;
position: relative; }
#product-accordion .panel .panel-heading a.title-head.collapsed {
color: #7d7d7d; }
#product-accordion .panel .panel-heading a.title-head.collapsed span.arrow-up:before {
content: "\f077"; }
#product-accordion .panel .panel-heading a.title-head {
color: #ff5c00; }
#product-accordion .panel .panel-heading a.title-head span.arrow-up:before {
content: "\f078"; }
#product-accordion .panel .panel-heading a span.arrow-up {
display: block;
position: absolute;
left: 0;
top: -2px;
cursor: pointer;
z-index: 10;
font-size: 0;
text-align: center; }
#product-accordion .panel .panel-heading a span.arrow-up:before {
content: "\f078";
font-family: 'FontAwesome';
display: block;
vertical-align: middle;
width: 30px;
height: 30px;
line-height: 30px;
font-size: 14px; }
#product-accordion .panel .panel-heading:hover a {
color: #ff5c00; }
#product-accordion .panel:first-child .panel-heading {
padding-top: 10px; }
#product-accordion .panel:last-child .panel-heading {
border-bottom: 0; }
#product-accordion .panel-heading + .panel-collapse > .list-group, #product-accordion .panel-heading + .panel-collapse > .panel-body {
border: none;
padding: 15px 0; }
/*============RELATED PRODUCT==================*/
.releate-products .owl2-controls .owl2-nav .owl2-next, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-next, .releate-products .owl2-controls .owl2-nav .owl2-prev, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-prev {
height: 36px;
width: 36px;
line-height: 34px;
text-align: center;
font-size: 28px;
display: inline-block;
background: #fff;
position: absolute;
top: 50%;
margin-top: -18px;
border: 1px solid #ddd; }
.releate-products .owl2-controls .owl2-nav .owl2-next:hover, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-next:hover, .releate-products .owl2-controls .owl2-nav .owl2-prev:hover, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-prev:hover {
background: #ff5c00;
color: #fff;
border-color: #ff5c00; }
.releate-products .owl2-controls .owl2-nav .owl2-next, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-next {
right: -18px; }
.releate-products .owl2-controls .owl2-nav .owl2-prev, div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-prev {
left: -18px; }
.releate-products .modtitle, div.so-extraslider.grid .modtitle {
margin-bottom: 20px; }
.releate-products .item-element, div.so-extraslider.grid .item-element {
border: 1px solid #ddd;
border-bottom: none;
padding: 15px 15px 0;
margin: 0; }
.releate-products .item-element:last-child, div.so-extraslider.grid .item-element:last-child {
border: 1px solid #ddd; }
.releate-products .image, div.so-extraslider.grid .image {
width: 90px;
border: none;
margin-left: 15px; }
.releate-products .releate-products-slider, div.so-extraslider.grid .releate-products-slider {
position: relative;
z-index: 2; }
.module.banner-left {
margin-top: 30px; }
.releate-horizontal {
border: 1px solid #e8e8e8; }
.releate-horizontal .releate-products .item-element, .releate-horizontal div.so-extraslider.grid .item-element {
border-width: 1px 0 0 0; }
.releate-horizontal .releate-products .item-element:first-child, .releate-horizontal div.so-extraslider.grid .item-element:first-child {
border: none; }
.releate-horizontal.module h3.modtitle span {
font-size: 14px; }
.releate-horizontal:hover .releate-products .owl2-controls .owl2-nav .owl2-prev, .releate-horizontal:hover div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-prev {
opacity: 1;
left: -18px; }
.releate-horizontal:hover .releate-products .owl2-controls .owl2-nav .owl2-next, .releate-horizontal:hover div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-next {
opacity: 1;
right: -18px; }
.releate-horizontal .releate-products .owl2-controls .owl2-nav .owl2-prev, .releate-horizontal div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-prev {
opacity: 0;
left: -30px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
.releate-horizontal .releate-products .owl2-controls .owl2-nav .owl2-next, .releate-horizontal div.so-extraslider.grid .owl2-controls .owl2-nav .owl2-next {
opacity: 0;
right: -30px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
.releate-horizontal .image {
width: 80px;
float: right; }
.releate-horizontal .ratings {
display: none; }
.releate-horizontal .caption h4 a {
font-size: 14px;
font-weight: 600;
color: #222; }
.releate-horizontal .caption h4 a:hover {
color: #ff5c00; }
/*Related Hozilzol*/
#product-related .owl2-controls {
display: none; }
/*Upsell*/
.ex_upsell.custom-extra {
position: relative; }
.ex_upsell.custom-extra .so-extraslider {
margin: 0; }
.ex_upsell.custom-extra .so-extraslider .extraslider-inner {
border: none;
padding: 0; }
.ex_upsell.custom-extra .so-extraslider .owl2-controls {
float: none; }
.ex_upsell.custom-extra .owl2-nav div {
display: inline-block;
width: 36px;
height: 36px;
background-repeat: no-repeat;
background-position: center center;
overflow: hidden;
font-family: FontAwesome;
font-size: 0;
color: #c0c0c0;
opacity: 1;
position: absolute;
top: 73%;
margin-top: -85px;
z-index: 501;
-webkit-transition: 0.2s;
-moz-transition: 0.2s;
transition: 0.2s;
cursor: pointer;
background: #fff !important;
border: 1px solid #ddd;
transition: all 0.3s ease 0s;
transform: scale(0);
text-align: center; }
.ex_upsell.custom-extra .owl2-nav div.owl2-prev {
left: 0px; }
.ex_upsell.custom-extra .owl2-nav div.owl2-prev:before {
content: "\f104";
line-height: 35px;
padding: 10px;
font-size: 28px; }
.ex_upsell.custom-extra .owl2-nav div.owl2-next {
right: 0; }
.ex_upsell.custom-extra .owl2-nav div.owl2-next:before {
content: "\f105";
line-height: 35px;
padding: 10px;
font-size: 28px; }
.ex_upsell.custom-extra .owl2-nav div:hover {
background-color: #ff5c00;
border-color: #ff5c00;
color: #fff; }
.ex_upsell.custom-extra:hover .owl2-nav div {
transform: scale(1); }
.bottom-product {
padding: 0 15px; }
.bottom-product .nav-tabs {
display: block;
vertical-align: top;
margin: 0 0 10px;
border-bottom: 1px solid #e8e8e8;
background-color: transparent; }
.bottom-product .nav-tabs li {
background-color: transparent;
border: 0; }
.bottom-product .nav-tabs li:first-child a {
padding-right: 0; }
.bottom-product .nav-tabs li:first-child a:before {
content: '';
width: 1px;
height: 16px;
background-color: #ebebeb;
position: absolute;
top: 16px;
left: 0; }
.bottom-product .nav-tabs li:last-child:before {
display: none; }
.bottom-product .nav-tabs li a {
margin: 0;
border: 0;
display: inline-block;
padding: 12px 20px;
background-color: transparent;
font-size: 18px;
color: #222;
font-weight: bold;
font-family: 'Raleway';
text-transform: uppercase;
position: relative; }
.bottom-product .nav-tabs li a:after {
content: '';
position: absolute;
bottom: 0px;
width: 0;
height: 2px;
-webkit-transition: all 0.2s ease 0s;
-moz-transition: all 0.2s ease 0s;
transition: all 0.2s ease 0s;
background-color: #ff5c00;
right: 0; }
.bottom-product .nav-tabs > li > a:hover, .bottom-product .nav-tabs > li.active > a, .bottom-product .nav-tabs > li.active > a:focus, .bottom-product .nav-tabs > li.active > a:hover {
border: none;
color: #ff5c00;
background: transparent; }
.bottom-product .nav-tabs > li > a:hover:after, .bottom-product .nav-tabs > li.active > a:after, .bottom-product .nav-tabs > li.active > a:focus:after, .bottom-product .nav-tabs > li.active > a:hover:after {
width: 100px; }
.bottom-product .tab-content {
border: none;
padding: 0;
margin: 0; }
.bottom-product .active.tab-pane {
height: auto !important; }
.bottom-product .tab-pane {
height: 0;
display: block;
overflow: hidden; }
/*============ HEADER ==================*/
.horizontal ul.megamenu > li > .sub-menu {
border-top: 2px solid #ff5c00; }
.horizontal ul.megamenu > li > a {
padding: 10px 15px;
text-transform: uppercase; }
.horizontal ul.megamenu > li > a .fa {
padding-left: 10px; }
.horizontal ul.megamenu > li {
margin-left: 1px;
float: right; }
.horizontal ul.megamenu li .sub-menu .content .fa {
margin: 0 10px; }
.horizontal ul.megamenu li .sub-menu .content .fa.fa-angle-right:before {
content: "\f104"; }
.horizontal ul.megamenu > li.active > a, .horizontal ul.megamenu > li.home > a, .horizontal ul.megamenu > li:hover > a {
background: transparent;
color: #ff5c00; }
.horizontal .subcategory li a {
color: #555; }
.horizontal .subcategory li a:hover {
color: #ff5c00; }
.header-top .header-top-left .welcome-msg .owl2-carousel .owl2-stage-outer {
direction: ltr; }
.mega-horizontal .navbar-default {
border: none;
background: transparent; }
@media (max-width: 991px) {
.responsive ul.megamenu > li.click:before, .responsive ul.megamenu > li.hover:before {
left: 0;
right: auto; }
.responsive ul.megamenu > li.active .close-menu {
left: 0;
right: auto; } }
.header-bottom .content_menu .container {
overflow: visible; }
@media (min-width: 1200px) {
.btn-shopping-cart:before {
content: "";
width: 38px;
height: 25px;
position: absolute;
bottom: -9px;
background: transparent;
left: 0;
z-index: 99; } }
.btn-shopping-cart .dropdown-menu {
min-width: 350px;
border: none; }
.btn-shopping-cart .dropdown-menu:before {
content: "";
background: #cc4a00;
height: 3px;
width: 100%;
left: 0;
right: 0;
top: 0;
position: absolute; }
.btn-shopping-cart .dropdown-menu:after {
border-color: transparent transparent #ff5c00 transparent;
border-width: 10px;
top: -21px; }
.btn-shopping-cart .dropdown-menu .cart_product_name {
color: #555; }
.btn-shopping-cart .dropdown-menu .cart_product_name:hover {
color: #ff5c00; }
.btn-shopping-cart .dropdown-menu .empty {
padding: 15px; }
.btn-shopping-cart .table > tbody > tr > td {
border: none;
border-bottom: 1px solid #eee;
vertical-align: middle; }
.btn-shopping-cart .checkout {
padding: 0 20px 10px; }
.btn-shopping-cart .added_items {
padding: 10px; }
.typeheader-5 #sosearchpro.so-search .autosearch-input {
border-color: #0f8db3 !important; }
.megamenu-style-dev {
position: relative; }
.megamenu-style-dev .vertical ul.megamenu {
position: absolute;
width: 100%;
background: #222;
z-index: 999; }
.megamenu-style-dev .vertical ul.megamenu > li > a {
font-size: 11px; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li {
margin: 0;
border-right: 0;
background: #222; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li strong i {
display: none; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li > a {
padding-left: 15px;
padding-right: 12px;
color: #fff; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li > a:hover {
color: #fff; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .sub-menu .content {
padding: 0; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul {
padding: 0;
margin: 0; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li {
border-bottom: 1px solid #eee; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li:hover {
background: #eee; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li:hover > a {
color: #ff5c00; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li a {
line-height: 37px; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li a b {
line-height: 37px;
font-size: 16px;
margin: 0 20px; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul li:last-child {
border: none; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul ul {
padding: 0;
left: 100%;
margin: 0;
box-shadow: none;
border: 1px solid #eee;
min-width: 200px; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul ul:before, .megamenu-style-dev .vertical .vertical ul.megamenu > li.css-menu .hover-menu .menu > ul ul:after {
display: none; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.item-style3 .sub-menu .content {
padding-right: 0; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.with-sub-menu > a:after {
content: "\f105";
color: #fff;
font-family: Fontawesome;
font-size: 13px;
float: right;
margin: 0; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.with-sub-menu:hover > a:after {
position: static;
border-color: transparent; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li:hover {
background-color: #444; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li:hover > a {
color: #fff; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li.active > a {
background: transparent !important; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li .sub-menu .content {
border-top: 1px solid #ddd; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li .sub-menu .content .banner {
margin-top: -21px;
margin-bottom: -22px;
margin-right: -1px; }
.megamenu-style-dev .vertical .vertical ul.megamenu > li .sub-menu .content .static-menu .menu ul a.main-menu {
padding: 0; }
.megamenu-style-dev .vertical ul.megamenu .sub-menu .content .static-menu .menu ul {
padding-bottom: 0; }
.megamenu-style-dev .vertical ul.megamenu .sub-menu .content .static-menu .menu ul li > a {
line-height: inherit;
padding-bottom: 0;
border-bottom: none;
min-height: auto; }
.megamenu-style-dev .vertical ul.megamenu .sub-menu .content .static-menu .menu ul li > a:hover {
color: #ff5c00; }
.megamenu-style-dev .vertical ul.megamenu .sub-menu .content .static-menu .menu ul ul a {
padding: 0; }
.megamenu-style-dev .vertical ul.megamenu .sub-menu .content .static-menu .menu ul ul a:hover {
color: #ff5c00; }
header.typeheader-1 .header-bottom {
background: #ff5c00; }
.typeheader-2 .shopping_cart {
background: #ff5c00; }
.typeheader-2 .shopping_cart:after {
border-left: 15px solid #ff5c00; }
.typeheader-2 .shopping_cart .total-shopping-cart {
background-color: #cc4a00; }
.typeheader-1 .header-top .header-top-left .link-lg, .typeheader-1 .header-top .header-top-right ul.top-link > li:hover > a, .typeheader-1 .megamenu-style-dev .horizontal ul.megamenu > li:hover > a {
color: #ff5c00 !important; }
.typeheader-1 #sosearchpro.so-search .autosearch-input {
border-color: #ff5c00; }
.typeheader-2 .header-top-right ul.top-link > li:hover > a {
color: #ff5c00; }
.typeheader-2 #sosearchpro.so-search .button-search i {
color: #ff5c00; }
.typeheader-2 #sosearchpro.so-search .button-search:hover i {
color: #cc4a00; }
.typeheader-2 .header-top .header-top-right ul.top-link > li:hover > a, .typeheader-2 .header-top .header-top-left .link-lg {
color: #ff5c00 !important; }
.typeheader-2 .shopping_cart, .typeheader-2 .header-bottom .header_custom_link li a, .typeheader-2 #sosearchpro.so-search .autosearch-input, .typeheader-2 #sosearchpro.so-search .select_category {
border-color: #ff5c00 !important; }
.typeheader-2 .header-center .phone-header a:hover, .typeheader-2 .header-center .phone-header .phone, .typeheader-2 .megamenu-style-dev .horizontal ul.megamenu > li.active > a, .typeheader-2 .megamenu-style-dev .horizontal ul.megamenu > li:hover > a {
color: #ff5c00 !important; }
.typeheader-2 #sosearchpro.so-search .button-search:hover {
background: #ff5c00 !important; }
.typeheader-2 #sosearchpro.so-search .button-search:hover i {
color: #fff !important; }
.typeheader-2 .shopping_cart .btn-shopping-cart .total-shopping-cart, .typeheader-2 .container-megamenu.vertical #menuHeading .megamenuToogle-wrapper {
background: #ff5c00 !important; }
.typeheader-3 .shopping_cart {
background: #ff5c00; }
.typeheader-3 .shopping_cart:after {
border-left: 15px solid #ff5c00; }
.typeheader-3 .shopping_cart .total-shopping-cart {
background-color: #cc4a00; }
.typeheader-3 .header-top-right ul.top-link > li:hover > a {
color: #ff5c00; }
.typeheader-3 #sosearchpro.so-search .button-search i {
color: #ff5c00; }
.typeheader-3 #sosearchpro.so-search .button-search:hover i {
color: #cc4a00; }
.typeheader-4 .shopping_cart {
background: #ff5c00; }
.typeheader-4 .shopping_cart:after {
border-left: 15px solid #ff5c00; }
.typeheader-4 .shopping_cart .total-shopping-cart {
background-color: #cc4a00; }
.typeheader-4 .header-top-right ul.top-link > li:hover > a {
color: #ff5c00; }
.typeheader-4 #sosearchpro.so-search .button-search i {
color: #ff5c00; }
.typeheader-4 #sosearchpro.so-search .button-search:hover i {
color: #cc4a00; }
.typeheader-5 .header-top-right ul.top-link > li:hover > a {
color: #ff5c00; }
.typeheader-5 #sosearchpro.so-search .button-search i {
color: #ff5c00; }
.typeheader-5 #sosearchpro.so-search .button-search:hover i {
color: #cc4a00; }
.typeheader-5 .header-top {
background: #ff5c00;
border-color: #ff5c00 !important; }
.typeheader-5 .header-top .header-top-left .welcome-msg .label-msg {
background: #ff7d33; }
header.typeheader-6 .header-center .block_link a {
background: #ff5c00 !important; }
header.typeheader-6 .header-bottom {
background-color: #ff5c00 !important; }
header.typeheader-6 .header-top .header-top-right ul.top-link > li .btn-group .btn-link:hover {
color: #ff5c00 !important; }
header.typeheader-6 .header-top .header-top-right ul.top-link > li:hover > a {
color: #ff5c00 !important; }
header.typeheader-6 #sosearchpro.so-search .select_category, header.typeheader-6 #sosearchpro.so-search .autosearch-input {
border: 1px solid #ff5c00 !important; }
header.typeheader-6 #sosearchpro.so-search .button-search {
background: #ff5c00 !important; }
header.typeheader-6 #sosearchpro.so-search .button-search:hover {
background: #cc4a00 !important; }
.typeheader-7 .header-top .header-top-right ul.top-link > li:hover > a {
color: #ff5c00 !important; }
.typeheader-7 .header-top .header-top-right ul.top-link > li .btn-group .btn-link:hover {
color: #ff5c00 !important; }
.typeheader-7 .megamenu-style-dev .horizontal ul.megamenu > li.active > a, .typeheader-7 .megamenu-style-dev .horizontal ul.megamenu > li:hover > a {
color: #ff5c00 !important; }
.typeheader-7 .shopping_cart .total-shopping-cart {
background: #ff5c00 !important; }
.typeheader-7 #sosearchpro.so-search .button-search {
background: #ff5c00 !important; }
.typeheader-7 #sosearchpro.so-search .button-search:hover {
background: #cc4a00 !important; }
/************************************************************************************************
FOOTER DEFFAULT
*************************************************************************************************/
footer {
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 13px;
font-size: 1.3rem;
/* [8] */
color: #7d7d7d;
background: #f0f0f0;
/*FOOTER BOTTOM*/
/*HTML SOCIAL*/
/*NEWLETTER*/ }
footer a {
color: #7d7d7d; }
footer .module {
margin: 0; }
footer .module h3.footertitle {
/* [4] */
/* [6] */
/* [6] */
/* [7] */
font-size: 16px;
font-size: 1.6rem;
/* [8] */
font-weight: bold;
border: none;
color: #222;
letter-spacing: 1.2px;
text-transform: uppercase;
margin: 0 0 12px 0;
line-height: inherit;
height: auto; }
footer .footer-top {
background-color: #ff5c00;
padding: 18px 0 19px; }
footer .footer-top .block-infos .info {
width: 20%;
float: right; }
footer .footer-top .block-infos .info .inner {
float: right;
width: 100%;
border-right: 1px solid rgba(255, 255, 255, 0.3);
padding-right: 35px; }
footer .footer-top .block-infos .info .inner i {
float: right;
font-size: 36px;
padding-top: 1px;
color: #fff; }
footer .footer-top .block-infos .info .inner .info-cont {
padding-right: 50px; }
footer .footer-top .block-infos .info .inner .info-cont span {
font-size: 13px;
color: #fff;
text-transform: uppercase;
margin-bottom: 2px;
font-weight: 600; }
footer .footer-top .block-infos .info .inner .info-cont p {
text-transform: capitalize;
color: #fff;
padding-top: 0;
margin-bottom: 0px;
line-height: normal; }
footer .footer-top .block-infos .info.info1 .inner {
border-right: 0;
padding-right: 0px; }
footer .footer-center {
padding-top: 25px; }
@media (min-width: 1200px) {
footer .footer-center {
padding-top: 44px; }
footer .footer-center .footer-extra {
padding: 0 40px 0 0; }
footer .footer-center .footer-contact {
padding-right: 50px; }
footer .footer-center .footer-newsletter {
width: 70%; }
footer .footer-center .footer-socials {
width: 30%; } }
footer .footer-center .module ul.menu li a {
position: relative;
color: #7d7d7d;
text-transform: capitalize;
font-size: 13px;
position: relative;
padding: 4px 0px 5px 0px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
display: inline-block;
vertical-align: top; }
footer .footer-center .module ul.menu li a:before {
display: none; }
footer .footer-center .module ul.menu li a:after {
content: "\f104" !important;
font-family: FontAwesome;
margin-left: 8px;
font-size: 14px;
float: right; }
footer .footer-center .module ul.menu li a:before {
content: '\f105';
font-family: FontAwesome;
font-size: 14px;
margin-left: 8px; }
footer .footer-center .module ul.menu li a:hover {
color: #ff5c00;
padding-right: 10px; }
footer .footer-center .footer-contact ul > li {
list-style: none;
overflow: hidden;
line-height: 24px;
margin-top: 23px; }
footer .footer-center .footer-contact ul > li .fa {
width: 31px;
height: 31px;
background-color: #9d9d9d;
color: #fff;
line-height: 31px;
font-size: 16px;
text-align: center;
float: right;
border-radius: 2px;
margin-left: 10px; }
footer .footer-center .footer-contact ul > li span {
display: block;
overflow: hidden;
line-height: 15px;
color: #7d7d7d;
font-size: 13px; }
footer .footer-center .footer-contact ul > li.email {
margin-bottom: 22px;
line-height: 32px;
font-size: 13px; }
footer .footer-center .custom_categories {
border-top: 1px solid #e0e0e0;
text-align: center;
clear: both;
padding: 28px 0 30px 0;
margin-top: 36px; }
footer .footer-center .custom_categories nav a {
color: #222;
font-weight: 700;
text-transform: uppercase;
padding: 0 15px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
footer .footer-center .custom_categories nav a:hover {
color: #ff5c00; }
footer .footer-center .custom_categories p {
padding: 0 25%;
line-height: 28px;
margin: 10px 13px 0; }
footer .footer-center .footer-center-2 {
border-top: 1px solid #e0e0e0;
padding: 30px 0; }
footer .footer-bottom {
background-color: #3b3b3b;
text-align: center;
padding: 22px 0; }
footer .footer-bottom .copyright {
margin-bottom: 7px; }
footer .footer-bottom .copyright a {
color: #ff5c00; }
footer .socials-wrap {
display: inline-block;
float: left; }
footer .socials-wrap .title-follow {
white-space: nowrap;
display: table-cell;
vertical-align: top;
padding-top: 8px; }
footer .socials-wrap ul {
display: table-cell;
padding-top: 5px;
padding-right: 5px; }
footer .socials-wrap ul li {
float: right;
margin-right: 9px; }
footer .socials-wrap ul li a {
font-size: 18px;
display: block;
width: 34px;
height: 34px;
text-align: center;
line-height: 34px;
background-color: #fff;
color: #222;
border-radius: 50%;
-webkit-border-radius: 50%;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s; }
footer .socials-wrap ul li a:hover {
color: #ff5c00; }
footer .socials-wrap ul li a i {
font-size: 16px; }
footer .socials-wrap ul li a .name-social {
display: none; }
footer .news-letter {
overflow: hidden;
float: right;
color: #222;
padding-left: 0; }
footer .news-letter .title-block {
display: table-cell;
line-height: 100%;
padding: 15px 0;
white-space: nowrap; }
footer .news-letter .page-heading {
font-size: 16px;
text-transform: uppercase;
font-weight: bold;
color: #222; }
footer .news-letter .pre-text {
margin: 0;
line-height: 12px;
font-size: 12px;
display: none; }
footer .news-letter .block_content {
padding: 0 27px 0 30px;
display: table-cell;
margin-top: 0;
vertical-align: top; }
footer .news-letter .block_content form {
margin: 0px; }
footer .news-letter .block_content form .form-group {
margin: 0px;
overflow: hidden; }
footer .news-letter .block_content .input-box {
float: right; }
footer .news-letter .block_content .input-box input {
border-radius: 20px 0 0 20px;
height: 42px;
padding: 5px 15px;
background: #fff;
color: #999;
font-size: 12px;
float: right;
width: 515px;
transition: 0.3s all ease 0s;
border: solid 1px #fff;
border-left: none;
margin-left: 20px;
border-radius: 20px 0 0 20px; }
footer .news-letter .block_content .subcribe {
left: 0;
position: absolute; }
footer .news-letter .block_content .subcribe button {
border-radius: 0 20px 20px 0;
height: 42px;
text-transform: uppercase;
font-size: 14px;
transition: 0.3s all ease 0s;
font-weight: bold;
background-color: #ff5c00;
border-color: #ff5c00;
color: #fff;
border-radius: 20px 0 0 20px; }
@media (min-width: 1200px) {
footer .news-letter .block_content .subcribe button {
padding: 0 25px; } }
footer .news-letter .block_content .subcribe button:hover {
background-color: #cc4a00;
border-color: #cc4a00; }
footer.typefooter-6 div.footer-top {
background-color: #ff5c00; }
footer.typefooter-6 div.footer-top .bf-right a:hover {
color: #ff5c00; }
footer.typefooter-6 .footer-center .footer-newletter .subcribe .btn:hover {
background: #cc4a00; }
footer.typefooter-6 div.footer-center .module ul.menu li a:hover {
color: #ff5c00; }
footer.typefooter-7 .footer-center ul li a:hover {
color: #ff5c00; }
/*===============================================
[SASS DIRECTORY ]
[1] MODULE DEFAULT
[2] BLOCK SEARCH
[3] SOCIAL FOOTER
==============================================*/
#content {
margin-bottom: 40px; }
.sohomepage-slider .so-homeslider {
border: none; }
.container-megamenu.vertical .vertical-wrapper {
display: none; }
.container-megamenu.vertical:hover .vertical-wrapper {
position: absolute;
width: 100%;
display: block;
z-index: 9; }
body {
background: #fff; }
@media (min-width: 1200px) {
.common-home .block-slide {
padding-right: 0; }
.common-home .block-slide .block-left {
padding: 0;
width: 71%; }
.common-home .block-slide .block-right {
padding-right: 0;
width: 29%; }
.common-home .block-slide .block-right .module {
margin: 0; }
.common-home .module h3.modtitle span {
font-size: 18px; } }
.common-home .block.block_1 {
margin-top: 0; }
.common-home .block.block_2 {
margin-top: 22px; }
.common-home .block.block_3 {
margin-top: 40px; }
.common-home .block.block_4 {
margin-top: 40px; }
.common-home .block.block_5 {
margin-top: 0; }
.common-home .block.block_6 {
margin-top: 0; }
.common-home .block.block_7 {
margin-top: 40px; }
.common-home .block.block_8 {
margin-top: 40px; }
.common-home .block.block_9 {
margin-top: 32px; }
.common-home .block.block_10 {
margin-top: 21px; }
/************************************************************************************************
MODULE HOME SLIDER
*************************************************************************************************/
.module.sohomepage-slider {
margin: 0; }
.module.sohomepage-slider .owl2-controls .owl2-nav div {
position: absolute;
margin: 0;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
outline: 0;
width: 36px;
height: 36px;
font-size: 0;
z-index: 9;
transition: all 0.3s ease; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-prev {
left: 0px;
background: #444 url("../../images/icon/arrow-slider-left.png") no-repeat center;
border: none; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-prev:hover {
background-color: #ff5c00; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-prev:before, .module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-prev:after {
display: none; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-next {
right: 0px;
background: #444 url("../../images/icon/arrow-slider-right.png") no-repeat center;
border: none; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-next:hover {
background-color: #ff5c00; }
.module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-next:before, .module.sohomepage-slider .owl2-controls .owl2-nav div.owl2-next:after {
display: none; }
.module.sohomepage-slider .owl2-dots {
position: absolute;
bottom: 30px;
width: 100%;
line-height: 100%;
right: 20%;
left: auto; }
.module.sohomepage-slider .owl2-dots .owl2-dot {
display: inline-block;
float: none; }
.module.sohomepage-slider .owl2-dots .owl2-dot span {
width: 8px;
height: 8px;
background-color: #7d7d7d;
border: none;
margin: 0 2px;
opacity: 1;
display: block;
border-radius: 50%;
-webkit-border-radius: 50%;
-webkit-transition: all 0.2s ease 0s;
-moz-transition: all 0.2s ease 0s;
transition: all 0.2s ease 0s; }
.module.sohomepage-slider .owl2-dots .owl2-dot.active span {
background-color: #ff5c00;
width: 25px;
border-radius: 4px; }
.module.sohomepage-slider .owl2-dots .owl2-dot:hover span {
background-color: #ff5c00; }
.module.sohomepage-slider .owl2-item.active .sohomeslider-description .title-slider {
opacity: 1;
animation: myeffect-slideshow 2s ease-in-out;
-webkit-animation: myeffect-slideshow 2s ease-in-out;
/* Chrome, Safari, Opera */
-moz-animation: myeffect-slideshow 2s ease-in-out;
-o-animation: myeffect-slideshow 2s ease-in-out;
-ms-animation: myeffect-slideshow 2s ease-in-out; }
.module.sohomepage-slider .owl2-item.active .sohomeslider-description h3.tilte {
opacity: 1;
animation: myeffect-slideshow 1.5s ease-in-out;
-webkit-animation: myeffect-slideshow 1.5s ease-in-out;
/* Chrome, Safari, Opera */
-moz-animation: myeffect-slideshow 1.5s ease-in-out;
-o-animation: myeffect-slideshow 1.5s ease-in-out;
-ms-animation: myeffect-slideshow 1.5s ease-in-out; }
.module.sohomepage-slider .owl2-item.active .sohomeslider-description h4 {
opacity: 1;
animation: myeffect-slideshow 1s ease-in-out;
-webkit-animation: myeffect-slideshow 1s ease-in-out;
/* Chrome, Safari, Opera */
-moz-animation: myeffect-slideshow 1s ease-in-out;
-o-animation: myeffect-slideshow 1s ease-in-out; }
.module.sohomepage-slider .owl2-item.active .sohomeslider-description .des {
opacity: 1;
animation: myeffect-slideshow 0.8s ease-in-out;
-webkit-animation: myeffect-slideshow 0.8s ease-in-out;
/* Chrome, Safari, Opera */
-moz-animation: myeffect-slideshow 0.8s ease-in-out;
-o-animation: myeffect-slideshow 0.8s ease-in-out; }
.module.sohomepage-slider .sohomeslider-description {
position: static;
padding: 0; }
.module.sohomepage-slider .sohomeslider-description p {
width: 100%;
color: #fff;
font-size: 14px;
padding: 0;
padding: 0;
margin: 0; }
.module.sohomepage-slider .sohomeslider-description .title-slider {
position: absolute;
width: auto;
opacity: 0;
top: 31%;
font-size: 20px;
color: #3b3b3b;
text-transform: uppercase; }
.module.sohomepage-slider .sohomeslider-description .title-slider.pos-right {
right: 30px; }
.module.sohomepage-slider .sohomeslider-description .title-slider.pos-left {
left: 30px; }
.module.sohomepage-slider .sohomeslider-description .title-slider.image-sl12 {
left: 35px; }
.module.sohomepage-slider .sohomeslider-description .text {
position: absolute;
top: 49%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%); }
.module.sohomepage-slider .sohomeslider-description .text h3.tilte, .module.sohomepage-slider .sohomeslider-description .text h4, .module.sohomepage-slider .sohomeslider-description .text .des {
opacity: 0; }
.module.sohomepage-slider .sohomeslider-description .text.pos-right {
right: 70px; }
.module.sohomepage-slider .sohomeslider-description .text.pos-left {
left: 30px; }
.module.sohomepage-slider .sohomeslider-description .text .modtitle-sl11 {
font-size: 34px;
font-weight: bold;
text-transform: uppercase;
color: #fff;
letter-spacing: 2px; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl11 {
left: 30px; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12 h3.tilte {
font-size: 30px;
color: #444;
font-weight: 700;
margin: 0; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12.pos-left {
left: 150px;
top: 65%; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12.pos-left i {
margin-right: 5px; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12.pos-left:hover {
color: #222; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12.pos-left a {
font-weight: 600;
color: #ff5c00;
font-size: 14px; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12 h4 {
font-size: 84px;
color: #ff5c00;
font-weight: 700;
margin: 0; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl12 .des {
font-size: 27px;
color: #444; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl13 h3.tilte {
font-size: 26px;
font-weight: 700;
color: #fff; }
.module.sohomepage-slider .sohomeslider-description .text.text-sl13 h4 {
font-size: 80px;
font-weight: 700;
color: #ff5c00; }
.module.sohomepage-slider .sohomeslider-description .des.des-sl11 {
margin-top: 15px;
color: #fff;
font-size: 14px; }
.module.sohomepage-slider .sohomeslider-description .des.des-sl11 i {
margin-right: 5px; }
.module.sohomepage-slider .sohomeslider-description .des.des-sl11:hover {
color: #222; }
/************************************************************************************************
MODULE Categories Slider
*************************************************************************************************/
.block-cate {
overflow: visible; }
.module.custom_cate_slider {
border: none;
overflow: visible;
margin: 0; }
.module.custom_cate_slider.custom_cate_slider_v2 .head-top {
border-top: 2px solid #f36; }
.module.custom_cate_slider.custom_cate_slider_v2 h2.modtitle {
background: #f36; }
.module.custom_cate_slider.custom_cate_slider_v2 h2.modtitle:before {
border-right: 8px solid #b91a66; }
.module.custom_cate_slider .head-top {
border-top: 2px solid #6170bc;
float: right;
box-shadow: 0 2px 4px 0 rgba(208, 208, 208, 0.6);
width: 100%;
border-left: 1px solid #ebebeb; }
.module.custom_cate_slider h2.modtitle {
line-height: 46px;
background-color: #6170bc;
font-size: 18px;
padding: 0 14px;
color: #fff;
margin: 0;
display: inline-block;
border-radius: 0;
position: relative;
text-transform: uppercase;
margin-top: -2px;
margin-left: -8px;
min-width: 199px; }
.module.custom_cate_slider h2.modtitle:before {
content: '';
width: 0;
height: 0;
border-bottom: 8px solid transparent;
border-right: 8px solid #1b57bc;
left: 0;
bottom: -8px;
position: absolute; }
.module.custom_cate_slider .box-title {
position: relative;
float: right;
min-width: 193px;
color: #fff;
text-transform: uppercase; }
.module.custom_cate_slider .box-cate .item-sub-cat {
float: none; }
.module.custom_cate_slider .box-cate .item-sub-cat ul {
margin: 0;
line-height: 100%; }
.module.custom_cate_slider .box-cate .item-sub-cat ul li {
margin: 0;
float: right; }
.module.custom_cate_slider .box-cate .item-sub-cat ul li a {
padding: 15px 13px;
text-transform: capitalize;
color: #222; }
.module.custom_cate_slider .box-cate .item-sub-cat ul li a:before {
display: none; }
.module.custom_cate_slider .box-cate .item-sub-cat ul li a:hover {
color: #ff5c00;
font-weight: normal; }
.module.custom_cate_slider .box-cate .item-sub-cat ul li .views {
color: #ff5c00; }
.module.custom_cate_slider .form-group {
margin: 0; }
.module.custom_cate_slider .page-top {
display: none; }
.module.custom_cate_slider .show .item-deals {
width: 47%;
float: right;
border-left: 1px solid #ebebeb;
padding-left: 1px; }
.module.custom_cate_slider .show .item-deals .item-time {
margin: 5px 20px 0; }
.module.custom_cate_slider .show .item-deals .num-time {
border-radius: 3px;
font-weight: 600;
font-size: 18px; }
.module.custom_cate_slider .show .item-deals .item-timer {
position: absolute;
left: 20px;
right: 20px;
z-index: 1;
top: 18px; }
.module.custom_cate_slider .show .item-deals .product-layout .product-item-container {
margin: 0;
border: none;
padding-top: 7px;
padding-bottom: 21px; }
.module.custom_cate_slider .show .item-deals .product-layout .product-item-container:hover .caption {
opacity: 1;
visibility: visible; }
.module.custom_cate_slider .show .item-simple {
width: 53%;
border: none; }
.module.custom_cate_slider .show .item-simple .product-layout {
padding: 0;
margin: 0; }
.module.custom_cate_slider .show .item-simple .product-layout .product-item-container {
margin: 0;
padding: 9px 20px 20px 3px;
border: none; }
.module.custom_cate_slider .show .item-simple .product-layout .product-item-container .right-block {
clear: inherit;
text-align: right; }
.module.custom_cate_slider .show .item-simple .product-layout .product-item-container .left-block {
width: 100px;
float: right;
padding-left: 10px; }
.module.custom_cate_slider .show .item-simple .product-layout .product-item-container:hover .caption {
opacity: 1;
visibility: visible; }
.module.custom_cate_slider .so-category-slider {
border: none; }
.module.custom_cate_slider .owl2-controls .owl2-nav > div {
border: none;
width: 28px;
height: 28px;
background-color: transparent; }
.module.custom_cate_slider .owl2-controls .owl2-nav > div.owl2-prev {
right: 32px;
left: auto; }
.module.custom_cate_slider .owl2-controls .owl2-nav > div:hover {
border: none; }
.module.custom_cate_slider .owl2-dots {
position: relative;
bottom: 13px;
width: 100%;
line-height: 100%;
right: 36%; }
.module.custom_cate_slider .owl2-dots .owl2-dot {
display: inline-block;
background: transparent;
width: auto; }
.module.custom_cate_slider .owl2-dots .owl2-dot:hover, .module.custom_cate_slider .owl2-dots .owl2-dot.active {
background: transparent; }
.module.custom_cate_slider .owl2-dots .owl2-dot span {
width: 8px;
height: 8px;
background-color: #7d7d7d;
border: none;
margin: 0;
opacity: 1;
display: block;
border-radius: 50%;
-webkit-border-radius: 50%;
-webkit-transition: all 0.2s ease 0s;
-moz-transition: all 0.2s ease 0s;
transition: all 0.2s ease 0s; }
.module.custom_cate_slider .owl2-dots .owl2-dot.active span {
background-color: #ff5c00;
width: 25px;
border-radius: 4px; }
.module.custom_cate_slider .owl2-dots .owl2-dot:hover span {
background-color: #ff5c00; }
/************************************************************************************************
Mod Supper Categories
*************************************************************************************************/
.module.custom_supper {
margin: 0; }
.module.custom_supper.custom_supper_v2 {
margin: 0; }
.module.custom_supper.custom_supper_v2 .so-sp-cat .spcat-wrap .category-wrap .sp-cat-title-parent {
background: #2bafa4; }
.module.custom_supper.custom_supper_v2 .so-sp-cat .spcat-wrap .spc-wrap {
border-color: #2bafa4; }
.module.custom_supper.custom_supper_v2 .so-sp-cat .spcat-wrap .category-wrap .sp-cat-title-parent:before {
border-top: 8px solid #0096a4; }
.module.custom_supper.custom_supper_v3 {
margin: 0; }
.module.custom_supper.custom_supper_v3 .so-sp-cat .spcat-wrap .category-wrap .sp-cat-title-parent {
background: #f24f5a; }
.module.custom_supper.custom_supper_v3 .so-sp-cat .spcat-wrap .spc-wrap {
border-color: #f24f5a; }
.module.custom_supper.custom_supper_v3 .so-sp-cat .spcat-wrap .category-wrap .sp-cat-title-parent:before {
border-top: 8px solid #ac365a; }
.module.custom_supper .products-list.grid .product-layout .product-item-container {
padding: 0 0 19px;
margin: 0;
border-color: #e8e8e8;
border-width: 0 0 1px 1px; }
.module.custom_supper .products-list.grid .product-layout .product-item-container:hover {
-moz-box-shadow: 0 2px 7px 0 rgba(56, 56, 56, 0.2);
-webkit-box-shadow: 0 2px 7px 0 rgba(56, 56, 56, 0.2);
box-shadow: 0 2px 7px 0 rgba(56, 56, 56, 0.2);
z-index: 9; }
.module.custom_supper .products-list .product-layout, .module.custom_supper .spcat-wrap, .module.custom_supper .so-sp-cat {
overflow: visible; }
.module.custom_supper .spcat-tabs-container {
display: none; }
.module.custom_supper .so-sp-cat .spcat-wrap {
padding: 0; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap {
padding: 0; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .category-wrap-cat {
padding: 0; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .sp-cat-title-parent {
background: #ff5c00;
font-size: 18px;
font-weight: 700;
color: #fff;
text-transform: uppercase;
width: 203px;
height: 48px;
line-height: 48px;
position: relative;
top: 0;
margin-right: -8px;
padding-right: 20px; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .sp-cat-title-parent a {
color: #fff; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .sp-cat-title-parent:before {
border-top: 8px solid #ad3f01;
bottom: -8px;
content: "";
height: 0;
position: absolute;
width: 0;
right: 0;
border-right: 8px solid transparent; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider {
margin: 0;
border: none;
bottom: 0; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider .cat_slider_inner {
display: block;
border: 1px solid #e8e8e8;
padding: 20px 15px; }
@media (min-width: 1200px) {
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider .cat_slider_inner {
min-height: 496px; } }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider .cat_slider_inner .item {
margin: 0;
float: none;
text-align: right; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider .cat_slider_inner .item .cat_slider_image {
display: none; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider .cat_slider_inner .item .cat_slider_title {
margin-bottom: 9px; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider .cat_slider_inner .item a {
color: #222;
font-weight: 600; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider .cat_slider_inner .item a:hover {
color: #ff5c00; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider .cat_slider_inner .view-all a {
font-weight: 600;
color: #ff5c00; }
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider .cat_slider_inner .view-all a .fa {
padding-left: 5px; }
.module.custom_supper .so-sp-cat .spcat-wrap .spc-wrap {
border-top: 2px solid #ff5c00;
padding: 0; }
.module.custom_supper .so-sp-cat .spcat-wrap .spc-wrap .spcat-items-container {
margin: 0; }
/************************************************************************************************
SHORT CODE CONTENT SLIDER BRAND
*************************************************************************************************/
.block-infos {
padding: 30px 0;
float: right;
width: 100%;
border: 1px solid #ebebeb;
border-radius: 5px; }
.block-infos .info {
width: 20%;
float: right; }
.block-infos .info .inner {
width: 100%;
float: right;
border-right: 1px solid #ebebeb;
padding-right: 30px; }
.block-infos .info .inner i {
float: right;
font-size: 36px;
padding-top: 2px;
color: #ff5c00; }
.block-infos .info .inner .info-cont {
padding-right: 50px; }
.block-infos .info .inner span {
text-transform: uppercase;
line-height: 100%;
color: #222;
font-weight: 600; }
.block-infos .info .inner p {
text-transform: capitalize;
line-height: 100%;
padding-top: 2px;
margin-bottom: 3px; }
.block-infos .info.info1 .inner {
border-right: none; }
/************************************************************************************************
SHORT CODE CONTENT SLIDER BRAND
*************************************************************************************************/
.top-brand.arrow-default {
padding: 15px;
direction: ltr;
padding: 14px 20px;
border: 1px solid #ebebeb;
border-radius: 8px; }
@media (min-width: 1200px) {
.top-brand.arrow-default {
padding: 14px 80px; } }
.top-brand.arrow-default .owl2-nav div {
width: 41px;
height: 41px;
transition: inherit; }
.top-brand.arrow-default .owl2-nav div.owl2-prev {
left: 16px;
opacity: 1; }
.top-brand.arrow-default .owl2-nav div.owl2-next {
right: 16px;
opacity: 1; }
/************************************************************************************************
BLOCK FEATURED CATE
*************************************************************************************************/
.module.block-categories {
margin-bottom: 46px; }
.module.block-categories h3.modtitle {
position: relative;
background: transparent;
padding-right: 0; }
.module.block-categories h3.modtitle span {
font-size: 18px;
letter-spacing: 0.7px; }
.module.block-categories h3.modtitle:before {
display: none; }
.module.block-categories h3.modtitle:after {
content: '';
height: 2px;
width: 100px;
background-color: #ff5c00;
position: absolute;
bottom: -1px;
right: 0; }
.module.block-categories .cate-content {
margin: 30px -15px 0; }
.module.block-categories .cate-content .cate {
float: right;
width: 20%;
padding: 0 15px; }
.module.block-categories .cate-content .cate .inner {
-moz-box-shadow: 0px 2px 3px 0px rgba(100, 100, 100, 0.3);
-webkit-box-shadow: 0px 2px 3px 0px rgba(100, 100, 100, 0.3);
box-shadow: 0px 2px 3px 0px rgba(100, 100, 100, 0.3);
text-align: center; }
.module.block-categories .cate-content .cate a {
color: #222;
font-weight: 700;
font-size: 16px;
text-transform: uppercase;
line-height: 52px;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
display: block; }
.module.block-categories .cate-content .cate a:hover {
background: #222;
color: #fff; }
/************************************************************************************************
MODULE DEALS
*************************************************************************************************/
.custom_deals_featured.so-deals {
clear: both;
position: relative;
margin: 0;
border: 1px solid #e1e1e1; }
.custom_deals_featured.so-deals h2.modtitle {
position: absolute;
z-index: 9;
top: -2px;
right: 13px; }
.custom_deals_featured.so-deals h2.modtitle span {
background: #ff5c00;
color: #fff;
font-size: 18px;
text-transform: uppercase;
padding: 11px;
font-weight: bold;
border-radius: 0 8px 8px 0; }
.custom_deals_featured.so-deals h2.modtitle span:before {
content: "";
border-left: 5px solid transparent;
border-right: 0px solid transparent;
border-bottom: 5px solid #cc4a00;
position: absolute;
left: -5px;
top: -4px; }
.custom_deals_featured.so-deals h2.modtitle span:after {
content: "";
border-left: 0px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #cc4a00;
position: absolute;
right: -5px;
top: -4px; }
.custom_deals_featured.so-deals .so-deal .product-feature {
border: none; }
.custom_deals_featured.so-deals .so-deal .product-feature .product-thumb .caption {
width: 50%; }
.custom_deals_featured.so-deals .so-deal .product-feature .product-thumb .image {
float: right;
width: 50%; }
.custom_deals_featured.so-deals .so-deal .product-feature .caption h4 {
margin-bottom: 8px; }
.custom_deals_featured.so-deals .so-deal .product-feature .caption h4 a {
color: #222;
font-size: 18px;
text-transform: capitalize; }
.custom_deals_featured.so-deals .so-deal .product-feature .box-label {
display: none; }
.custom_deals_featured.so-deals .so-deal .product-feature .des_deal {
border-top: 1px solid #e1e1e1;
margin-top: 11px;
padding-top: 18px;
margin-bottom: 11px;
line-height: 23px;
font-weight: normal; }
.custom_deals_featured.so-deals .so-deal .product-feature .price {
margin-bottom: 20px; }
.custom_deals_featured.so-deals .so-deal .product-feature .price .price-new {
font-size: 22px; }
.custom_deals_featured.so-deals .so-deal .product-feature .price .price-old {
font-size: 16px; }
.custom_deals_featured.so-deals .so-deal .product-feature .item-timer .time-item {
position: relative;
display: inline-block;
width: auto;
line-height: normal;
border: none;
background: transparent;
margin-left: 24px; }
.custom_deals_featured.so-deals .so-deal .product-feature .item-timer .time-item .num-time {
display: block;
width: 70px;
height: 42px;
background-color: #ebebeb;
line-height: 42px;
text-align: center;
font-size: 30px;
color: #222;
margin-bottom: 10px;
border-radius: 3px; }
.custom_deals_featured.so-deals .so-deal .product-feature .item-timer .time-item .name-time {
text-align: center;
font-size: 12px;
display: block;
color: #7d7d7d;
text-transform: uppercase; }
.custom_deals_featured.so-deals .owl2-controls.featureslider .owl2-nav div {
position: absolute;
top: 18%;
height: 41px;
z-index: 9; }
.custom_deals_featured.so-deals .owl2-controls.featureslider .owl2-nav div.owl2-prev {
left: 15px; }
.custom_deals_featured.so-deals .owl2-controls.featureslider .owl2-nav div.owl2-next {
right: 15px; }
.custom_deals_featured.so-deals .product-feature {
padding: 20px;
overflow: visible; }
@media (min-width: 1200px) {
.custom_deals_featured.so-deals .product-feature {
padding: 20px 95px 0px 20px; }
.custom_deals_featured.so-deals .product-feature .product-thumb .image img {
padding-right: 40px; } }
.custom_deals_featured.so-deals .product-feature .product-thumb, .custom_deals_featured.so-deals .so-deal {
margin: 0; }
.custom_deals_featured.so-deals .box-label.label {
display: block;
color: #fff;
font-size: 12px;
text-transform: uppercase;
width: 40px;
height: 40px;
background: #ff5c00;
text-align: center;
line-height: 40px;
border-radius: 100%;
padding: 0; }
.custom_deals_featured.so-deals .extraslider-inner {
border-top: 1px solid #e1e1e1;
border-bottom: none;
padding: 23px 10px 6px; }
.custom_deals_featured.so-deals .extraslider-inner .caption {
text-align: center; }
.custom_deals_featured.so-deals .extraslider-inner .caption p, .custom_deals_featured.so-deals .extraslider-inner .caption .rating, .custom_deals_featured.so-deals .extraslider-inner .caption .item-time {
display: none; }
.custom_deals_featured.so-deals .extraslider-inner .caption h4 {
font-size: 13px;
color: #7d7d7d;
text-transform: capitalize;
margin-bottom: 4px; }
.custom_deals_featured.so-deals .extraslider-inner .product-thumb {
margin: 0;
padding: 0 10px; }
.custom_deals_featured.so-deals .extraslider-inner .product-thumb .image {
width: 122px;
position: relative;
border: 1px solid #e1e1e1;
border-radius: 5px;
padding: 5px;
margin-bottom: 10px;
-webkit-transition: all 0.2s ease 0s;
-moz-transition: all 0.2s ease 0s;
transition: all 0.2s ease 0s; }
.custom_deals_featured.so-deals .extraslider-inner .product-thumb .image:hover {
border-color: #ff5c00; }
.custom_deals_featured.so-deals .extraslider-inner .product-thumb .image .bt-sale {
position: absolute;
z-index: 3;
top: 10px;
right: 15px;
font-size: 12px;
font-weight: bold;
color: #fff;
text-align: center;
display: inline-block;
width: 38px;
height: 38px;
border-radius: 50%;
line-height: 38px;
background-color: #ff5c00; }
.custom_deals_featured.so-deals .extraslider-inner .owl2-controls .owl2-nav > div {
border: none;
width: 28px;
height: 28px;
line-height: 28px;
background-color: transparent;
opacity: 1;
visibility: visible;
position: absolute;
top: 50%;
margin-top: -14px; }
.custom_deals_featured.so-deals .extraslider-inner .owl2-controls .owl2-nav > div.owl2-prev {
left: 0; }
.custom_deals_featured.so-deals .extraslider-inner .owl2-controls .owl2-nav > div.owl2-next {
right: 0; }
.custom_deals_featured.so-deals .extraslider-inner .owl2-controls .owl2-nav > div:hover {
border: none; }
/************************************************************************************************
MODULE LASTET BLOG
*************************************************************************************************/
.module.custom-ourblog {
margin-bottom: 6px;
position: relative; }
.module.custom-ourblog h3.modtitle {
position: relative;
background: transparent;
padding-right: 0; }
.module.custom-ourblog h3.modtitle:before {
display: none; }
.module.custom-ourblog h3.modtitle:after {
content: '';
height: 2px;
width: 100px;
background-color: #ff5c00;
position: absolute;
bottom: -1px;
right: 0; }
.module.custom-ourblog .so-blog-external.button-type2 .owl2-nav {
position: absolute;
top: 10px;
left: 0; }
.module.custom-ourblog .owl2-carousel .owl2-stage-outer {
direction: ltr; }
.module.custom-ourblog .so-blog-external .blog-external .media .so-block {
float: none; }
.module.custom-ourblog .blog-external {
border: none;
margin-top: 15px; }
.module.custom-ourblog .blog-external .content-img {
position: relative; }
.module.custom-ourblog .blog-external .content-img:before {
content: '';
width: 0;
height: 0;
border-bottom: 85px solid transparent;
top: 0;
position: absolute;
z-index: 2;
border-right: 80px solid #fff;
right: 0; }
.module.custom-ourblog .blog-external .content-img .entry-date {
position: absolute;
top: 0;
z-index: 2;
right: 0; }
.module.custom-ourblog .blog-external .content-img .entry-date .day-time {
font-size: 24px;
color: #909090;
font-weight: bold; }
.module.custom-ourblog .blog-external .content-img .entry-date .month-time {
font-size: 14px;
color: #909090; }
.module.custom-ourblog .blog-external .content-detail h4 a {
color: #222;
font-size: 14px;
text-transform: capitalize;
display: block;
padding: 0; }
.module.custom-ourblog .blog-external .content-detail h4 a:hover {
color: #ff5c00; }
.module.custom-ourblog .blog-external .content-detail .media-heading {
margin: 15px 0 10px; }
.module.custom-ourblog .blog-external .content-detail .media-subcontent .media-author {
border: none;
color: #909090; }
.module.custom-ourblog .blog-external .content-detail .media-subcontent i {
font-size: 14px;
margin-left: 5px; }
.module.custom-ourblog .blog-external .content-detail .readmore {
border-top: 1px solid #ddd;
padding-top: 14px;
margin-top: 14px;
width: 100%;
display: block; }
.module.custom-ourblog .blog-external .content-detail .readmore a {
color: #ff5c00;
font-weight: 600; }
.module.custom-ourblog .blog-external .content-detail .readmore i {
margin-left: 5px; }
/************************************************************************************************
DEFFAULT BESTSELLER HOME
*************************************************************************************************/
.bestseller {
clear: inherit; }
.bestseller h3 {
font-size: 18px;
font-weight: bold;
margin-bottom: 20px;
margin-top: 12px;
color: #222;
text-transform: uppercase; }
.bestseller .description, .bestseller .button-group {
display: none; }
.bestseller .product-layout {
margin-bottom: 15px;
display: inline-block;
width: 100%; }
.bestseller .product-layout .image {
float: right;
border: 1px solid #eee;
width: 70px;
padding: 10px;
margin-left: 20px; }
.bestseller .product-layout .image:hover {
border-color: #ff5c00; }
.bestseller .product-layout .caption {
float: right;
display: block;
margin-top: -5px; }
.bestseller .product-layout .caption h4 {
margin: 0 0 2px; }
.bestseller .product-layout .caption h4 a {
font-size: 14px;
font-weight: bold;
color: #222; }
.bestseller .product-layout .caption h4 a:hover {
color: #ff5c00; }
.bestseller .product-layout .caption .ratings {
margin-top: -5px;
margin-bottom: 6px; }
.bestseller .product-layout .caption .price {
margin-bottom: 0; }
.bestseller .product-layout .price .price-new, .bestseller .product-layout .price span.price {
font-size: 16px; }
/************************************************************************************************
DEFFAULT LISTING TAB
*************************************************************************************************/
.module.custom-listingtab {
margin: 0 0 0 0;
position: relative; }
.module.custom-listingtab .box-title {
position: absolute;
top: -8px;
min-width: 204px;
right: -8px; }
.module.custom-listingtab .box-title h2 {
line-height: 48px;
background-color: #ff5c00;
font-size: 18px;
padding: 0 16px;
color: #fff;
margin: 0;
font-weight: bold;
border-radius: 0 0 0 7px;
position: relative;
text-transform: uppercase;
box-shadow: 0 2px 4px 0px rgba(0, 0, 0, 0.1); }
.module.custom-listingtab .box-title h2:before {
content: '';
width: 0;
height: 0;
border-bottom: 8px solid transparent;
bottom: -8px;
position: absolute;
border-left: 8px solid #b94300;
right: 0; }
.module.custom-listingtab .module, .module.custom-listingtab .so-listing-tabs .ltabs-wrap .ltabs-tabs-container, .module.custom-listingtab .so-listing-tabs {
margin: 0; }
.module.custom-listingtab .list-sub-cat {
border: 0;
background-color: #f2f2f2;
margin: 0 196px 0 0;
border: 0;
font-size: 12px;
color: #333;
text-transform: uppercase;
padding: 0 15px;
line-height: 40px;
border-radius: 0; }
.module.custom-listingtab .list-sub-cat:hover {
color: #ff5c00; }
.module.custom-listingtab .list-sub-cat.ltabs-tabs li.tab-sel.ltabs-tab > span {
color: #ff5c00; }
.module.custom-listingtab .list-sub-cat.ltabs-tabs li {
border: 0;
padding: 0;
margin: 0;
font-size: 13px; }
.module.custom-listingtab .list-sub-cat.ltabs-tabs li span {
font-size: 12px;
color: #333;
text-transform: uppercase;
padding: 0 15px;
border-radius: 0; }
.module.custom-listingtab .list-sub-cat.ltabs-tabs li span:hover {
color: #ff5c00; }
.module.custom-listingtab .list-sub-cat.ltabs-tabs li.tab-sel {
background: transparent; }
.module.custom-listingtab .ltabs-wrap .wap-listing-tabs .item-cat-image {
float: right; }
.module.custom-listingtab .ltabs-wrap .wap-listing-tabs .item-cat-image img:hover:before {
visibility: visible;
opacity: 1; }
.module.custom-listingtab .ltabs-wrap .wap-listing-tabs .item-cat-image img:before {
background-color: rgba(0, 0, 0, 0.3);
content: "";
height: 100%;
width: 100%;
position: absolute;
top: 0;
-webkit-transition: all 0.2s ease 0s;
-moz-transition: all 0.2s ease 0s;
transition: all 0.2s ease 0s;
visibility: hidden;
opacity: 0;
right: 0; }
.module.custom-listingtab .products-list.grid .product-layout .product-item-container {
margin: 0;
border-width: 0 0 1px 1px;
padding-bottom: 17px; }
.module.custom-listingtab .owl2-controls {
position: absolute;
top: 21px;
left: 15px; }
.module.custom-listingtab .owl2-controls .owl2-nav > div {
border: none;
width: 28px;
height: 28px;
background-color: transparent; }
.module.custom-listingtab .owl2-controls .owl2-nav > div.owl2-prev {
right: 32px;
left: auto; }
.module.custom-listingtab .owl2-controls .owl2-nav > div:hover {
border: none; }
.module.custom-listingtab.img-float .box-title {
left: -7px;
right: auto; }
.module.custom-listingtab.img-float .box-title h2 {
border-radius: 7px 0 0 0; }
.module.custom-listingtab.img-float .box-title h2:before {
content: '';
width: 0;
height: 0;
border-bottom: 8px solid transparent;
bottom: -8px;
position: absolute;
border-right: 8px solid #b94300;
border-left: none;
left: 0;
right: auto; }
.module.custom-listingtab.img-float .so-listing-tabs .ltabs-tabs-container .ltabs-tabs li {
float: left; }
.module.custom-listingtab.img-float .list-sub-cat {
border: 0;
background-color: #f2f2f2;
margin: 0 0 0 196px; }
.module.custom-listingtab.img-float .ltabs-wrap .wap-listing-tabs .item-cat-image {
float: left; }
.module.custom-listingtab.img-float .products-list.grid .product-layout .product-item-container {
border-width: 0 1px 1px 0; }
.module.custom-listingtab.img-float .owl2-controls {
right: 70px;
left: auto; }
.module.custom_bestseler {
border: 1px solid #e1e1e1;
position: relative;
margin: 0; }
.module.custom_bestseler.h3.modtitle {
border: none; }
.module.custom_bestseler .image-slide {
float: right;
width: 50%;
position: relative;
z-index: 3; }
.module.custom_bestseler .image-slide .form-group {
margin: 0; }
.module.custom_bestseler .so-extraslider {
margin: 0; }
.module.custom_bestseler .extraslider-inner {
clear: inherit;
float: left;
width: 50%;
padding: 25px 0 0;
border: none; }
.module.custom_bestseler .extraslider-inner .right-block {
float: right;
padding-top: 15px; }
.module.custom_bestseler .extraslider-inner .left-block {
width: 90px;
float: right;
margin-left: 20px; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image {
border: none; }
.module.custom_bestseler .extraslider-inner .item-wrap.style1 .item-info {
background: transparent;
position: relative; }
.module.custom_bestseler .extraslider-inner .item-wrap.style1 .item-info .item-title, .module.custom_bestseler .extraslider-inner .item-wrap.style2 .item-info .item-title {
padding: 0;
font-weight: normal; }
.module.custom_bestseler .extraslider-inner .item-wrap.style1 .item-info .item-title a, .module.custom_bestseler .extraslider-inner .item-wrap.style2 .item-info .item-title a {
font-size: 14px;
color: #222;
text-transform: capitalize; }
.module.custom_bestseler .extraslider-inner .item-wrap.style1 .item-info .item-title a:hover, .module.custom_bestseler .extraslider-inner .item-wrap.style2 .item-info .item-title a:hover {
color: #ff5c00; }
.module.custom_bestseler .extraslider-inner .item-wrap-inner {
margin: 0;
padding: 0; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-info .item-content {
margin: 0; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-info .item-content .content_price span {
font-size: 16px;
color: #ff5c00;
font-weight: 700; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image img {
box-shadow: none; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image .img-2 {
position: absolute;
top: 0;
-webkit-transition: all 0.2s ease 0s;
-moz-transition: all 0.2s ease 0s;
transition: all 0.2s ease 0s;
opacity: 0;
visibility: hidden; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image:hover {
box-shadow: none; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image:hover img {
box-shadow: none;
opacity: 0.7; }
.module.custom_bestseler .extraslider-inner .item-wrap .item-image:hover .img-2 {
opacity: 1;
visibility: visible; }
.module.custom_bestseler .extraslider-inner .item-wrap {
margin-bottom: 25px; }
.module.custom_bestseler .owl2-controls {
position: absolute;
top: 21px;
left: 15px; }
.module.custom_bestseler .owl2-controls .owl2-nav > div {
border: none;
width: 28px;
height: 28px;
background-color: transparent;
opacity: 1;
visibility: visible;
position: relative;
top: 0; }
.module.custom_bestseler .owl2-controls .owl2-nav > div.owl2-prev {
right: 5px;
left: auto; }
.module.custom_bestseler .owl2-controls .owl2-nav > div:hover {
border: none; }
@media screen and (-moz-images-in-menus: 0) {
.module.custom_supper .so-sp-cat .spcat-wrap .category-wrap .slider .cat_slider_inner {
min-height: 499px; } }
| {
"content_hash": "bb865694afbf6b162b2ce2c26980a79e",
"timestamp": "",
"source": "github",
"line_count": 7442,
"max_line_length": 856,
"avg_line_length": 32.175893576995435,
"alnum_prop": 0.6397957010352763,
"repo_name": "yannicksade/SAV8817",
"id": "7c7449467fc8da06907560b3214106bcdcb2e734",
"size": "239453",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/Shop/catalog/view/theme/so-revo/css/layout2/orange-rtl.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "755"
},
{
"name": "CSS",
"bytes": "23866548"
},
{
"name": "CoffeeScript",
"bytes": "83288"
},
{
"name": "Gherkin",
"bytes": "14162"
},
{
"name": "HTML",
"bytes": "2744626"
},
{
"name": "JavaScript",
"bytes": "29185812"
},
{
"name": "PHP",
"bytes": "5341907"
},
{
"name": "Shell",
"bytes": "19458"
},
{
"name": "Smarty",
"bytes": "1774849"
}
],
"symlink_target": ""
} |
using namespace std;
class State{
private:
struct Transition{
unsigned int probability;
unsigned long posterior_state, cost;
};
struct Action{
vector<Transition> trans;
};
vector<Action> m_actions;
unsigned long m_value;
int m_action_index;
const static unsigned long m_value_max = 70368744177664;//2^46
public:
State();
~State();
bool setStateTrans(int a,unsigned long s_to,unsigned int p,unsigned long c,int action_num);
unsigned long valueIteration(vector<State> &other_state);
unsigned long valueIterationAction(int a, vector<State> &other_state);
//unsigned long valueIterationAction(Action *a, vector<State> &other_state);
void setValue(unsigned long v);
unsigned long getValue(void){return m_value;}
int getActionIndex(void);
};
#endif
| {
"content_hash": "672d1b4d2dff92e1ae420cd62b01e1bf",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 92,
"avg_line_length": 26.517241379310345,
"alnum_prop": 0.7503250975292588,
"repo_name": "ryuichiueda/DP_TOOL2",
"id": "a92be9728447b89a526e556695e62062c68cdadb",
"size": "880",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "bin/State.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "10258"
},
{
"name": "Shell",
"bytes": "1211"
}
],
"symlink_target": ""
} |
<?php
/**
* ALIPAY API: alipay.pass.tpl.content.update request
*
* @author auto create
* @since 1.0, 2015-01-30 16:22:25
*/
class AlipayPassTplContentUpdateRequest
{
/**
* 代理商代替商户发放卡券后,再代替商户更新卡券时,此值为商户的pid/appid
**/
private $channelId;
/**
* 支付宝pass唯一标识
**/
private $serialNumber;
/**
* 券状态,支持更新为USED,CLOSED两种状态
**/
private $status;
/**
* 模版动态参数信息【支付宝pass模版参数键值对JSON字符串】
**/
private $tplParams;
/**
* 核销码串值【当状态变更为USED时,建议传入】
**/
private $verifyCode;
/**
* 核销方式,目前支持:wave(声波方式)、qrcode(二维码方式)、barcode(条码方式)、input(文本方式,即手工输入方式)。pass和verify_type不能同时为空
**/
private $verifyType;
private $apiParas = array();
private $terminalType;
private $terminalInfo;
private $prodCode;
private $apiVersion="1.0";
private $notifyUrl;
public function setChannelId($channelId)
{
$this->channelId = $channelId;
$this->apiParas["channel_id"] = $channelId;
}
public function getChannelId()
{
return $this->channelId;
}
public function setSerialNumber($serialNumber)
{
$this->serialNumber = $serialNumber;
$this->apiParas["serial_number"] = $serialNumber;
}
public function getSerialNumber()
{
return $this->serialNumber;
}
public function setStatus($status)
{
$this->status = $status;
$this->apiParas["status"] = $status;
}
public function getStatus()
{
return $this->status;
}
public function setTplParams($tplParams)
{
$this->tplParams = $tplParams;
$this->apiParas["tpl_params"] = $tplParams;
}
public function getTplParams()
{
return $this->tplParams;
}
public function setVerifyCode($verifyCode)
{
$this->verifyCode = $verifyCode;
$this->apiParas["verify_code"] = $verifyCode;
}
public function getVerifyCode()
{
return $this->verifyCode;
}
public function setVerifyType($verifyType)
{
$this->verifyType = $verifyType;
$this->apiParas["verify_type"] = $verifyType;
}
public function getVerifyType()
{
return $this->verifyType;
}
public function getApiMethodName()
{
return "alipay.pass.tpl.content.update";
}
public function setNotifyUrl($notifyUrl)
{
$this->notifyUrl=$notifyUrl;
}
public function getNotifyUrl()
{
return $this->notifyUrl;
}
public function getApiParas()
{
return $this->apiParas;
}
public function getTerminalType()
{
return $this->terminalType;
}
public function setTerminalType($terminalType)
{
$this->terminalType = $terminalType;
}
public function getTerminalInfo()
{
return $this->terminalInfo;
}
public function setTerminalInfo($terminalInfo)
{
$this->terminalInfo = $terminalInfo;
}
public function getProdCode()
{
return $this->prodCode;
}
public function setProdCode($prodCode)
{
$this->prodCode = $prodCode;
}
public function setApiVersion($apiVersion)
{
$this->apiVersion=$apiVersion;
}
public function getApiVersion()
{
return $this->apiVersion;
}
}
| {
"content_hash": "81739f9f9e317ef5aa63275fbb071e15",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 95,
"avg_line_length": 16.57471264367816,
"alnum_prop": 0.6858529819694869,
"repo_name": "PhotoArtLife/Personal-Blog",
"id": "6c0464b4b6c2dc9f546927b764d446e4d5124322",
"size": "3174",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "project/demo/mall/includes/lib/alipaySDK/aop/request/AlipayPassTplContentUpdateRequest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "386801"
},
{
"name": "HTML",
"bytes": "301842"
},
{
"name": "JavaScript",
"bytes": "40259"
},
{
"name": "PHP",
"bytes": "201992"
}
],
"symlink_target": ""
} |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<div class="container">
<div class="panel panel-default panel-control">
<?php
$received=date("d-m-Y H:i:s", strtotime($record[0]["received"]));
$processed=date("d-m-Y H:i:s", strtotime($record[0]["processed"]));
$resolved="hidden";
?>
<div class="panel-heading header-abm">
<div class="navbar navbar-default">
<div class="navbar-collapse collapse navbar-inverse-collapse">
<span class="navbar-text"><h4 style='color:black;'><?php echo lang('p_task_detail');?></h4></span>
<ul class="nav navbar-nav navbar-right">
<li><a class='btn btn-bar btn-raised btn-task-resolver btn-success' data-id-contact-channel='<?php echo $record[0]["id_contact_channel"];?>' data-id='<?php echo $id;?>'>Resolver cliente <span class='glyphicon glyphicon-search' aria-hidden='true'></span></a></li>
<li><span style="padding:10px;"></span></li>
<li><a class='btn btn-bar btn-raised btn-task-close btn-primary' data-id='<?php echo $id;?>'>Cerrar la tarea <span class='glyphicon glyphicon-ok' aria-hidden='true'></span></a></li>
<li><span style="padding:3px;"></span></li>
</ul>
</div>
</div>
<input class="dbase hidden" type="text" id="id" name="id" value="<?php echo $id;?>"/>
<input value="<?php echo $record[0]["id_client_credipaz"];?>" class="dbase" type="hidden" name="id_client_credipaz" id="id_client_credipaz"/>
</div>
<div class="panel-body" style="overflow-y:auto;">
<div class='container-fluid closer'></div>
<div class='container-fluid resolver'>
<div class='alert alert-success' style="color:black;">
<?php if ($credipazClients["idCliente"]!="") {
$resolved="";?>
<h4><span class='glyphicon glyphicon-link' aria-hidden='true' style='color:darkgreen;'></span> Cliente en Credipaz</h4>
<table class='table'>
<tr>
<td><?php echo $credipazClients["id"];?></td>
<td><?php echo $credipazClients["Nombre"];?></td>
<td><?php echo $credipazClients["Sexo"];?></td>
<td><?php echo $credipazClients["DocTipo"]." ".$credipazClients["DocNro"];?></td>
<td class="linked-phone"><?php echo "Fijo: ".$credipazClients["TelefonoFijo"];?></td>
<td class="linked-phone"><?php echo "Celular: ".$credipazClients["TelefonoCelular"];?></td>
<td class="linked-email"><?php echo $credipazClients["eMail"];?></td>
</tr>
</table>
<?php };?>
</div>
</div>
<div class='alert alert-info' style="color:black;">
<div data-role="fieldcontain" class="row">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"><b><?php echo lang('p_created');?></b></div>
<div class="col-xs-6 col-sm-8 col-md-3 col-lg-4"><?php echo $received;?></div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"><b><?php echo lang('p_assigned');?></b></div>
<div class="col-xs-6 col-sm-8 col-md-3 col-lg-4"><?php echo $processed;?></div>
</div>
<div data-role="fieldcontain" class="row">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"><b><?php echo lang('p_username');?></b></div>
<div class="col-xs-6 col-sm-8 col-md-9 col-lg-10"><?php echo $record[0]["username"];?></div>
</div>
<div data-role="fieldcontain" class="row" style="padding-bottom:15px;">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"><b><?php echo lang('p_subject');?></b></div>
<div class="col-xs-6 col-sm-8 col-md-9 col-lg-10"><i><?php echo explode("<br/>",$record[0]["subject"])[0];?></i></div>
</div>
<div data-role="fieldcontain" class="row">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"><b><?php echo lang('p_body');?></b></div>
<div class="col-xs-6 col-sm-8 col-md-9 col-lg-10"><?php echo $record[0]["body"];?></div>
</div>
</div>
<div class="container-fluid all-tasks <?php echo $resolved;?>">
<ul class="nav nav-pills">
<li class="li-task" data-function="getByTask" data-id="<?php echo $id;?>" data-target=".detalle-task1"><a data-toggle="tab" href="#tabTask1"><?php echo lang('p_tab_task1');?></a></li>
<li class="li-task" data-function="availableBalance" data-id="<?php echo $id;?>" data-target=".detalle-task2">
<a data-toggle="tab" href="#tabTask2">
<?php echo lang('p_tab_task2');?>
</a>
</li>
<li class="li-task hidden" data-function="" data-id="<?php echo $id;?>" data-target=".detalle-task3">
<a data-toggle="tab" href="#tabTask3">
<?php echo lang('p_tab_task3');?>
</a>
</li>
<li class="li-task hidden" data-function="" data-id="<?php echo $id;?>" data-target=".detalle-task4">
<a data-toggle="tab" href="#tabTask4">
<?php echo lang('p_tab_task4');?>
</a>
</li>
</ul>
<hr />
<div class="tab-content">
<div id="tabTask1" class="tab-pane fade in active">
<div class="container-fluid detalle-task1">
</div>
</div>
<div id="tabTask2" class="tab-pane fade in">
<div class="container-fluid detalle-task2">
</div>
</div>
<div id="tabTask3" class="tab-pane fade in">
<div class="container-fluid detalle-task3">
</div>
</div>
<div id="tabTask4" class="tab-pane fade in">
<div class="container-fluid detalle-task4">
</div>
</div>
</div>
</div>
</div>
<?php
$data["id"]=$id;
echo $this->load->view("controls/footer-abm-notransac",$data,true);?>
</div>
</div>
| {
"content_hash": "ce20a378d82cf0a23afa07fc5a8c0a06",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 278,
"avg_line_length": 56.64957264957265,
"alnum_prop": 0.48823174411587206,
"repo_name": "DanielNeodata/Credipaz.XEndpoints",
"id": "d1569d70b7ac102999607004379a70d83ced82be",
"size": "6628",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/views/mod_channels/abm/operators_tasks/edit.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "21841"
},
{
"name": "HTML",
"bytes": "5376343"
},
{
"name": "JavaScript",
"bytes": "681584"
},
{
"name": "PHP",
"bytes": "3018783"
},
{
"name": "PowerShell",
"bytes": "2678"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<title>Table as a flex item in row-oriented flex container</title>
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#resolve-flexible-lengths">
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#computing-the-table-width">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1692116">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<meta name="assert" content="Inflexible table flex item's flex base size is its final main size.">
<p>Test passes if there is a filled green square.</p>
<div style="display: flex; flex-direction: row;">
<div style="display: table; border: 10px solid green; height: 80px; background: green; flex: 0 0 80px;"></div>
</div>
| {
"content_hash": "1ae9d354bb5d943b2d30380a11c0b079",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 112,
"avg_line_length": 63,
"alnum_prop": 0.7233560090702947,
"repo_name": "ric2b/Vivaldi-browser",
"id": "073e7f7274ab7b3b52252d1d1b7301816c7dbf5e",
"size": "882",
"binary": false,
"copies": "22",
"ref": "refs/heads/master",
"path": "chromium/third_party/blink/web_tests/external/wpt/css/css-flexbox/table-as-item-inflexible-in-row-1.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "822c45a9d3326963aac1e826b2995d62",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "ac95ff625318b49e01f2039bee1e0e9fb9f5e131",
"size": "174",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Crataegus/Crataegus multifida/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package com.lightcrafts.image.types;
import java.io.IOException;
import java.awt.image.RenderedImage;
import java.awt.image.renderable.ParameterBlock;
import javax.media.jai.JAI;
import javax.media.jai.operator.TransposeType;
import com.lightcrafts.image.BadImageFileException;
import com.lightcrafts.image.ImageInfo;
import com.lightcrafts.image.UnknownImageTypeException;
import com.lightcrafts.image.metadata.*;
/**
* A <code>DCRImageType</code> is-a {@link RawImageType} for DCR (Kodak raw)
* images.
*
* @author Fabio Riccardi [fabio@lightcrafts.com]
*/
public final class DCRImageType extends RawImageType {
////////// public /////////////////////////////////////////////////////////
/** The singleton instance of <code>DCRImageType</code>. */
public static final DCRImageType INSTANCE = new DCRImageType();
/**
* {@inheritDoc}
*/
public String[] getExtensions() {
return EXTENSIONS;
}
/**
* {@inheritDoc}
*/
public String getName() {
return "DCR";
}
/**
* {@inheritDoc}
*/
public RenderedImage getThumbnailImage( ImageInfo imageInfo )
throws BadImageFileException, IOException, UnknownImageTypeException
{
final RenderedImage thumb = super.getThumbnailImage( imageInfo );
final ImageMetadata metaData = imageInfo.getMetadata();
final ImageOrientation orientation = metaData.getOrientation();
final TransposeType transpose = orientation.getCorrection();
if ( transpose == null )
return thumb;
final ParameterBlock pb = new ParameterBlock();
pb.addSource( thumb );
pb.add( transpose );
return JAI.create( "Transpose", pb, null );
}
/**
* {@inheritDoc}
*/
public void readMetadata( ImageInfo imageInfo )
throws BadImageFileException, IOException
{
final ImageMetadataReader reader = new TIFFMetadataReader( imageInfo );
MetadataUtil.removePreviewMetadataFrom( reader.readMetadata() );
}
////////// private ////////////////////////////////////////////////////////
/**
* Construct a <code>DCRImageType</code>.
* The constructor is <code>private</code> so only the singleton instance
* can be constructed.
*/
private DCRImageType() {
// do nothing
}
/**
* All the possible filename extensions for DCR files. All must be lower
* case and the preferred one must be first.
*/
private static final String[] EXTENSIONS = {
"dcr"
};
}
/* vim:set et sw=4 ts=4: */
| {
"content_hash": "f0c1b49b548e7784c3ad2de3590e1e91",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 79,
"avg_line_length": 28.593406593406595,
"alnum_prop": 0.6241352805534205,
"repo_name": "ktgw0316/LightZone",
"id": "b45460d322cf5b7a1aa2e0d0ed6d2ad59a0d0063",
"size": "2646",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lightcrafts/src/com/lightcrafts/image/types/DCRImageType.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "4332975"
},
{
"name": "C++",
"bytes": "1197703"
},
{
"name": "CSS",
"bytes": "10092"
},
{
"name": "HTML",
"bytes": "2646074"
},
{
"name": "Haskell",
"bytes": "11797"
},
{
"name": "Java",
"bytes": "5832938"
},
{
"name": "JavaScript",
"bytes": "1713"
},
{
"name": "Makefile",
"bytes": "57064"
},
{
"name": "Objective-C",
"bytes": "5028"
},
{
"name": "Objective-C++",
"bytes": "25200"
},
{
"name": "Perl",
"bytes": "6906"
},
{
"name": "Shell",
"bytes": "23570"
}
],
"symlink_target": ""
} |
{% extends "marco.html" %}
{% block content %}
{% load crispy_forms_tags %}
{% crispy form %}
{% endblock content %}
| {
"content_hash": "0b4d3d3c3bac3628be1456cbf0758c7b",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 28,
"avg_line_length": 23.8,
"alnum_prop": 0.6050420168067226,
"repo_name": "nqnmovil/nqnm_e16",
"id": "97811adfd4c6d31383b40d3c0e6250caca1e4aba",
"size": "119",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "templates/appencuesta/campania_form.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "67442"
},
{
"name": "HTML",
"bytes": "11399"
},
{
"name": "JavaScript",
"bytes": "149731"
},
{
"name": "Python",
"bytes": "51458"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "f8165c7d5b6d4efb983471d3ec549e8b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "420b66a74e7deffc681efe1295957fa9ea0029d1",
"size": "194",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Chlorophyta/Chlorophyceae/Chlorococcales/Chlorococcaceae/Coccomyxa/Coccomyxa peltigerae/Coccomyxa peltigerae variolosae/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import uuid
import os
class TempImage:
def __init__(self, basePath="./", ext=".jpg"):
# construct the file path
self.path = "{base_path}/{rand}{ext}".format(base_path=basePath,
rand=str(uuid.uuid4()), ext=ext)
def cleanup(self):
# remove the file
os.remove(self.path)
| {
"content_hash": "9d59def74f8f237e140e9f564671a643",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 66,
"avg_line_length": 23.75,
"alnum_prop": 0.656140350877193,
"repo_name": "hncshtq/CSC450-Software-Engineering-Project-",
"id": "ea35b5851b213fd5056bee8b5f909b91e2a5ff02",
"size": "318",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tempimage.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "9164"
}
],
"symlink_target": ""
} |
set -ev
cd keyvi
scons -j 4 mode=$CONF
$CONF/dictionaryfsa_unittests/dictionaryfsa_unittests
cd ../pykeyvi
python setup.py build --mode $CONF
python setup.py install --user
py.test tests
cd ..
| {
"content_hash": "2841adaf3ee8abda94ded7ba94bef6c5",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 53,
"avg_line_length": 19.4,
"alnum_prop": 0.7577319587628866,
"repo_name": "hendrikmuhs/keyvi",
"id": "12f30909514b464bb8c42926856641f55e0c490c",
"size": "214",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "travis/build_linux.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "4301"
},
{
"name": "C++",
"bytes": "586003"
},
{
"name": "CMake",
"bytes": "1822"
},
{
"name": "Python",
"bytes": "135041"
},
{
"name": "Shell",
"bytes": "9150"
}
],
"symlink_target": ""
} |
package io.futurestud.tutorials.customfont;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| {
"content_hash": "0f22016ffeb9d752ccd9322f0c5370d6",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 56,
"avg_line_length": 23.266666666666666,
"alnum_prop": 0.7593123209169055,
"repo_name": "fs-opensource/android-tutorials-customfont",
"id": "738ef14adad98b125b23e3f51ce4c80ac82b1306",
"size": "349",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FutureStudioTutorialsCustomFont/app/src/main/java/io/futurestud/tutorials/customfont/MainActivity.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "6052"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StreamWriterMagnets
{
using System.IO;
class Flobbo
{
private string zap;
public Flobbo(string zap)
{
this.zap = zap;
}
public StreamWriter Snobbo()
{
return new
StreamWriter("macaw.txt");
}
public bool Blobbo(StreamWriter sw)
{
sw.WriteLine(zap);
zap = "green purple";
return false;
}
public bool Blobbo
(bool Already, StreamWriter sw)
{
if (Already)
{
sw.WriteLine(zap);
sw.Close();
return false;
}
else
{
sw.WriteLine(zap);
zap = "red orange";
return true;
}
}
}
}
| {
"content_hash": "206bd53ba1437ebc2cc741ee771d8cf4",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 43,
"avg_line_length": 16.34375,
"alnum_prop": 0.4187380497131931,
"repo_name": "head-first-csharp/third-edition",
"id": "b629949f6b98720e51230dcd62970c9eb1762ca4",
"size": "1048",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "VS2012/Chapter_9/StreamWriterMagnets/Flobbo.cs",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "3954986"
}
],
"symlink_target": ""
} |
package com.elven.danmaku.sample.stage01;
import org.lwjgl.input.Keyboard;
import com.elven.danmaku.core.configuration.DefaultGameEngineConfiguration;
import com.elven.danmaku.core.configuration.GameConfiguration;
import com.elven.danmaku.core.configuration.GameSetup;
import com.elven.danmaku.core.gameinfo.GameInfo;
import com.elven.danmaku.core.input.InputReceiver;
import com.elven.danmaku.core.listeners.GameInfoChangeListener;
import com.elven.danmaku.sample.player.SamplePlayerFactory;
public class Stage01 {
public static void main(String[] args) {
final GameInfo gameInfo = new GameInfo();
final GameSetup setup = new GameSetup(new DefaultGameEngineConfiguration());
setup.setCollisionListenerFactory(new DefaultCollisionListenerFactory(setup.gameContext().textureLoader()));
SamplePlayerFactory playerFactory = new SamplePlayerFactory(setup.gameContext().textureLoader());
final GameConfiguration gameConfiguration = new GameConfiguration(playerFactory.createPlayer(gameInfo), gameInfo);
setup.setGameConfiguration(gameConfiguration);
showMenu(setup);
gameConfiguration.getPlayer().getPosition().set(175.0, 420.0);
gameInfo.getLifeModel().addChangeListener(new GameInfoChangeListener() {
@Override
public void valueChanged(Object newValue) {
if (newValue.equals(-1)) {
gameInfo.getLifeModel().setValue(3);
gameInfo.getBombModel().setValue(2);
gameInfo.getGrazeModel().setValue(0);
gameInfo.getScoreModel().setValue(0L);
showMenu(setup);
gameConfiguration.getPlayer().getController().getInvincibilityController().reset();
gameConfiguration.getPlayer().getController().getInputDisabledController().reset();
gameConfiguration.getPlayer().getController().getInputManager().reset();
gameConfiguration.getPlayer().getPosition().set(175.0, 420.0);
}
}
});
setup.start();
}
private static void showMenu(final GameSetup setup) {
Stage01Menu menu = new Stage01Menu(setup.gameContext().textureLoader());
setup.gameContext().changeView(menu);
setup.gameContext().setCurrentInputReceiver(new InputReceiver() {
@Override
public void pressed(int keyCode) {
if(keyCode == Keyboard.KEY_Z) {
loadStage01(setup);
}
}
@Override
public void released(int keyCode) {
}
@Override
public void clear() {
}
});
}
private static void loadStage01(GameSetup setup) {
setup.loadStage(new Stage01Configuration(), new Stage01Script());
}
}
| {
"content_hash": "cf22c2c619fd3aaa8df8f524aeb06fd8",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 116,
"avg_line_length": 34.32,
"alnum_prop": 0.728049728049728,
"repo_name": "AlanSchaeffer/Danmaku",
"id": "c5308963b36e866aa4ab7e03c174d48e3e5d02dd",
"size": "2574",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Danmaku/src/com/elven/danmaku/sample/stage01/Stage01.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "256985"
},
{
"name": "Shell",
"bytes": "118"
}
],
"symlink_target": ""
} |
<?php
namespace Oro\Bundle\EntityConfigBundle\Form\Handler;
use Oro\Bundle\EntityConfigBundle\Config\ConfigHelper;
use Oro\Bundle\EntityConfigBundle\Entity\ConfigModel;
use Oro\Bundle\EntityConfigBundle\Entity\FieldConfigModel;
use Oro\Bundle\EntityConfigBundle\Form\Type\ConfigType;
use Oro\Bundle\EntityExtendBundle\Form\Type\FieldType;
use Oro\Bundle\UIBundle\Route\Router;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Encapsulate a logic for config form handlers
*/
class ConfigHelperHandler
{
/** @var FormFactoryInterface */
private $formFactory;
/** @var Session */
private $session;
/** @var Router */
private $router;
/** @var ConfigHelper */
private $configHelper;
/** @var TranslatorInterface */
private $translator;
/** @var UrlGeneratorInterface */
protected $urlGenerator;
/**
* @param FormFactoryInterface $formFactory
* @param Session $session
* @param Router $router
* @param ConfigHelper $configHelper
*/
public function __construct(
FormFactoryInterface $formFactory,
Session $session,
Router $router,
ConfigHelper $configHelper,
TranslatorInterface $translator,
UrlGeneratorInterface $urlGenerator
) {
$this->formFactory = $formFactory;
$this->session = $session;
$this->router = $router;
$this->configHelper = $configHelper;
$this->translator = $translator;
$this->urlGenerator = $urlGenerator;
}
/**
* @param Request $request
* @param FormInterface $form
* @return bool
*/
public function isFormValidAfterSubmit(Request $request, FormInterface $form)
{
if ($request->isMethod('POST')) {
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
return true;
}
}
return false;
}
/**
* @param FieldConfigModel $fieldConfigModel
* @return FormInterface
*/
public function createFirstStepFieldForm(FieldConfigModel $fieldConfigModel)
{
$entityConfigModel = $fieldConfigModel->getEntity();
return $this->formFactory->create(
FieldType::class,
$fieldConfigModel,
['class_name' => $entityConfigModel->getClassName()]
);
}
/**
* @param FieldConfigModel $fieldConfigModel
* @return FormInterface
*/
public function createSecondStepFieldForm(FieldConfigModel $fieldConfigModel)
{
return $this->formFactory->create(
ConfigType::class,
null,
['config_model' => $fieldConfigModel]
);
}
/**
* @param FieldConfigModel $fieldConfigModel
* @param string $successMessage
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
public function showSuccessMessageAndRedirect(FieldConfigModel $fieldConfigModel, $successMessage)
{
$this->session->getFlashBag()->add('success', $successMessage);
return $this->redirect($fieldConfigModel);
}
/**
* @return $this
*/
public function showClearCacheMessage()
{
$message = $this->translator->trans(
'oro.translation.translation.rebuild_cache_required',
[
'%path%' => $this->generateUrl('oro_translation_translation_index')
]
);
$this->session->getFlashBag()->add('warning', $message);
return $this;
}
/**
* @param ConfigModel|string $entityOrUrl
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
public function redirect($entityOrUrl)
{
return $this->router->redirect($entityOrUrl);
}
/**
* @param FieldConfigModel $fieldConfigModel
* @param FormInterface $form
* @param string $formAction
* @return array
*/
public function constructConfigResponse(FieldConfigModel $fieldConfigModel, FormInterface $form, $formAction)
{
return [
'entity_config' => $this->configHelper->getEntityConfigByField($fieldConfigModel, 'entity'),
'non_extended_entities_classes' => $this->configHelper->getNonExtendedEntitiesClasses(),
'field_config' => $this->configHelper->getFieldConfig($fieldConfigModel, 'entity'),
'field' => $fieldConfigModel,
'form' => $form->createView(),
'formAction' => $formAction,
'jsmodules' => $this->configHelper->getExtendJsModules()
];
}
/**
* Generates a URL from the given parameters.
*
* @param string $route The name of the route
* @param mixed $parameters An array of parameters
* @param int $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
*
* @return string The generated URL
*
* @see UrlGeneratorInterface
*/
private function generateUrl($route, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
{
return $this->urlGenerator->generate($route, $parameters, $referenceType);
}
}
| {
"content_hash": "ec30b98bf1560057c8c792f5827d4572",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 118,
"avg_line_length": 30.238888888888887,
"alnum_prop": 0.6395370200257211,
"repo_name": "orocrm/platform",
"id": "7807939ac7c0a819478bfc0236d06b3972c42def",
"size": "5443",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Oro/Bundle/EntityConfigBundle/Form/Handler/ConfigHelperHandler.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "618485"
},
{
"name": "Gherkin",
"bytes": "158217"
},
{
"name": "HTML",
"bytes": "1648915"
},
{
"name": "JavaScript",
"bytes": "3326127"
},
{
"name": "PHP",
"bytes": "37828618"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>V8 API Reference Guide for node.js v7.7.4: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v7.7.4
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li class="current"><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_func.html"><span>Functions</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
<li><a href="functions_type.html"><span>Typedefs</span></a></li>
<li><a href="functions_enum.html"><span>Enumerations</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="functions.html#index_a"><span>a</span></a></li>
<li><a href="functions_b.html#index_b"><span>b</span></a></li>
<li><a href="functions_c.html#index_c"><span>c</span></a></li>
<li><a href="functions_d.html#index_d"><span>d</span></a></li>
<li><a href="functions_e.html#index_e"><span>e</span></a></li>
<li><a href="functions_f.html#index_f"><span>f</span></a></li>
<li><a href="functions_g.html#index_g"><span>g</span></a></li>
<li><a href="functions_h.html#index_h"><span>h</span></a></li>
<li><a href="functions_i.html#index_i"><span>i</span></a></li>
<li><a href="functions_j.html#index_j"><span>j</span></a></li>
<li><a href="functions_k.html#index_k"><span>k</span></a></li>
<li><a href="functions_l.html#index_l"><span>l</span></a></li>
<li><a href="functions_m.html#index_m"><span>m</span></a></li>
<li><a href="functions_n.html#index_n"><span>n</span></a></li>
<li><a href="functions_o.html#index_o"><span>o</span></a></li>
<li><a href="functions_p.html#index_p"><span>p</span></a></li>
<li class="current"><a href="functions_r.html#index_r"><span>r</span></a></li>
<li><a href="functions_s.html#index_s"><span>s</span></a></li>
<li><a href="functions_t.html#index_t"><span>t</span></a></li>
<li><a href="functions_u.html#index_u"><span>u</span></a></li>
<li><a href="functions_v.html#index_v"><span>v</span></a></li>
<li><a href="functions_w.html#index_w"><span>w</span></a></li>
<li><a href="functions_0x7e.html#index_0x7e"><span>~</span></a></li>
</ul>
</div>
</div><!-- top -->
<!-- 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 class="contents">
<div class="textblock">Here is a list of all documented class members with links to the class documentation for each member:</div>
<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
<li>ReadOnlyPrototype()
: <a class="el" href="classv8_1_1FunctionTemplate.html#a91d2e0643e8c5a53ab1d75f7766c2422">v8::FunctionTemplate</a>
</li>
<li>RegisterExternallyReferencedObject()
: <a class="el" href="classv8_1_1PersistentValueMapBase.html#a7d1cd63172b997dfaac9d0f009edd709">v8::PersistentValueMapBase< K, V, Traits ></a>
</li>
<li>RegisterExternalReference()
: <a class="el" href="classv8_1_1PersistentBase.html#a7c03be90a4ec2e19719b2425cdd700fc">v8::PersistentBase< T ></a>
</li>
<li>RegisterV8References()
: <a class="el" href="classv8_1_1EmbedderHeapTracer.html#afa88b641b32638f798017b29755a88b3">v8::EmbedderHeapTracer</a>
</li>
<li>Release()
: <a class="el" href="classv8_1_1PersistentValueMapBase.html#a9ffa7a4e0c59121c0471d71c04112966">v8::PersistentValueMapBase< K, V, Traits ></a>
</li>
<li>Remove()
: <a class="el" href="classv8_1_1PersistentValueMapBase.html#abd75a4c050416712167ba0bb9eace097">v8::PersistentValueMapBase< K, V, Traits ></a>
</li>
<li>RemoveBeforeCallEnteredCallback()
: <a class="el" href="classv8_1_1Isolate.html#a92be6cf5ce1e7360843794cc1528369f">v8::Isolate</a>
</li>
<li>RemoveCallCompletedCallback()
: <a class="el" href="classv8_1_1Isolate.html#a46f0a5d35f8b29030922bdb433c0dc4f">v8::Isolate</a>
</li>
<li>RemoveGCEpilogueCallback()
: <a class="el" href="classv8_1_1Isolate.html#a059d51bc45cdd5f4821233170863a9ff">v8::Isolate</a>
</li>
<li>RemoveGCPrologueCallback()
: <a class="el" href="classv8_1_1Isolate.html#a7c424950b2bc9589fc676a9b38b27d63">v8::Isolate</a>
</li>
<li>RemoveMessageListeners()
: <a class="el" href="classv8_1_1Isolate.html#a0319e55b26ba3ac51d867b37b917a21f">v8::Isolate</a>
</li>
<li>RemoveMicrotasksCompletedCallback()
: <a class="el" href="classv8_1_1Isolate.html#a0fdc58db0d44c5a8f427d809e1c0b604">v8::Isolate</a>
</li>
<li>RemovePrototype()
: <a class="el" href="classv8_1_1FunctionTemplate.html#a4a184aca244174c7fe52d58871d3129e">v8::FunctionTemplate</a>
</li>
<li>RemoveTraceStateObserver()
: <a class="el" href="classv8_1_1Platform.html#af25d10c9fbe0f080e164a0c1eca365a0">v8::Platform</a>
</li>
<li>ReportProgressValue()
: <a class="el" href="classv8_1_1ActivityControl.html#a1300f10611306a3e8f79239e057eb0bf">v8::ActivityControl</a>
</li>
<li>RequestGarbageCollectionForTesting()
: <a class="el" href="classv8_1_1Isolate.html#a59fe893ed7e9df52cef2d59b2d98ab23">v8::Isolate</a>
</li>
<li>RequestInterrupt()
: <a class="el" href="classv8_1_1Isolate.html#a971b6094ecc6c7f55eb6f58a71a8afd3">v8::Isolate</a>
</li>
<li>ReserveCapacity()
: <a class="el" href="classv8_1_1PersistentValueVector.html#ad4cccfee3a275986578276efe0c78510">v8::PersistentValueVector< V, Traits ></a>
</li>
<li>Reset()
: <a class="el" href="classv8_1_1PersistentBase.html#a174bb1e45b18fd4eeaee033622825bb8">v8::PersistentBase< T ></a>
, <a class="el" href="classv8_1_1TryCatch.html#a3aae8acab4c99b374b7d782763d4c8e1">v8::TryCatch</a>
</li>
<li>ResetToBookmark()
: <a class="el" href="classv8_1_1ScriptCompiler_1_1ExternalSourceStream.html#a425cf1ba265eeca194b805fe5c52bc19">v8::ScriptCompiler::ExternalSourceStream</a>
</li>
<li>ReThrow()
: <a class="el" href="classv8_1_1TryCatch.html#ab8c3a1dbb38e6fd00e37436034daf707">v8::TryCatch</a>
</li>
<li>RunMicrotasks()
: <a class="el" href="classv8_1_1Isolate.html#ac3cbe2a1632eb863912640dcfc98b6c8">v8::Isolate</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
| {
"content_hash": "1937e05c8c849660d2cadb06fe0162e6",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 156,
"avg_line_length": 47.25247524752475,
"alnum_prop": 0.6724986904138293,
"repo_name": "v8-dox/v8-dox.github.io",
"id": "cd4c4c6cca7f07724592a6d74f548865b7b86b3b",
"size": "9545",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ca31986/html/functions_r.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
// ExecApp.cpp Version 1.0 - see article at CodeProject.com
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// Description:
// ExecApp implements functions to execute an application, look up the
// application registered for a file extension, and execute a registered
// application.
//
// History
// Version 1.0 - 2008 June 8
// - Initial public release
//
// Public APIs:
// NAME DESCRIPTION
// --------------------- -------------------------------------------------
// ExecApp() Run an application; replacement for WinExec()
// ExecRegisteredApp() Look up application registered for extension and
// run it
// LookupRegisteredApp() Look up application registered for extension
//
// License:
// This software is released under the Code Project Open License (CPOL),
// which may be found here: http://www.codeproject.com/info/eula.aspx
// You are free to use this software in any way you like, except that you
// may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
//=============================================================================
// Do NOT include stdafx.h.
// Set this file to "not using precompiled headers".
//=============================================================================
#include <windows.h>
#include <tchar.h>
#include "ExecApp.h"
#pragma warning(disable : 4996) // disable bogus deprecation warning
//=============================================================================
// If you have the latest Platform SDK you can use this include instead of
// the definitions following
//#include <shlwapi.h>
#ifdef _INC_SHLWAPI
#pragma message("ExecApp.cpp: shlwapi.h has been included")
#else
#pragma message("ExecApp.cpp: defining shlwapi objects")
#define ASSOCF_NOTRUNCATE 0x020
#define ASSOCF_IGNOREUNKNOWN 0x400
typedef DWORD ASSOCF;
typedef enum
{
ASSOCSTR_COMMAND = 1, // shell\verb\command string
ASSOCSTR_EXECUTABLE, // the executable part of command string
// ...
} ASSOCSTR;
#define LWSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
LWSTDAPI AssocQueryStringW(ASSOCF flags, ASSOCSTR str, LPCWSTR pszAssoc,
LPCWSTR pszExtra, LPWSTR pszOut, DWORD *pcchOut);
#endif // _INC_SHLWAPI
//=============================================================================
//=============================================================================
// The following links to shlwapi.dll
#pragma message("ExecApp.cpp: automatic link to shlwapi.lib")
#pragma comment(lib, "shlwapi.lib")
//=============================================================================
#ifndef __noop
#if _MSC_VER < 1300
#define __noop ((void)0)
#endif
#endif
#undef TRACE
#define TRACE __noop
//=============================================================================
// if you want to see the TRACE output, uncomment this line:
//#include "XTrace.h"
//=============================================================================
///////////////////////////////////////////////////////////////////////////////
//
// ExecApp()
//
// Purpose: Runs the specified application (replacement for WinExec)
//
// Parameters: lpszCommandLine - [in] command line (including exe filepath)
// that is passed to CreateProcess()
// wShowCmd - [in] Specifies how app window is to be shown.
// See ShowWindow() in MSDN for possible values.
//
// Returns: BOOL - TRUE = CreateProcess() succeeded
//
BOOL ExecApp(LPCTSTR lpszCommandLine, WORD wShowCmd /*= SW_SHOWNORMAL*/)
{
BOOL rc = FALSE;
if (lpszCommandLine && (lpszCommandLine[0] != _T('\0')))
{
STARTUPINFO si = { 0 };
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = wShowCmd;
PROCESS_INFORMATION pi = { 0 };
rc = ::CreateProcess(NULL, (LPTSTR)lpszCommandLine, NULL, NULL, FALSE,
NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);
TRACE(_T("CreateProcess returned %d for <%s>\n"), rc, lpszCommandLine);
// close process and thread handles now (app will continue to run)
if (pi.hProcess)
::CloseHandle(pi.hProcess);
if (pi.hThread)
::CloseHandle(pi.hThread);
}
return rc;
}
///////////////////////////////////////////////////////////////////////////////
//
// _AssocQueryString() - private function
//
// Purpose: Calls AssocQueryStringW() to get associated application.
//
// Parameters: See AssocQueryString() in MSDN.
//
// Returns: HRESULT - S_OK = AssocQueryStringW() succeeded
//
// Notes: This code is necessary because AssocQueryStringA() doesn't
// work (confirmed by MS Tech Support), so for ANSI version
// we convert parameters to Unicode and call wide version.
//
static HRESULT _AssocQueryString(ASSOCF flags,
ASSOCSTR str,
LPCTSTR pszAssoc,
LPCTSTR pszExtra, // may be NULL
LPTSTR pszOut,
DWORD *pcchOut) // size of pszOut in TCHARs
{
HRESULT hr = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND);
if (!pszOut || !pcchOut || (*pcchOut == 0) ||
!pszAssoc || (pszAssoc[0] == _T('\0')))
{
TRACE(_T("ERROR: _AssocQueryString: bad parameters\n"));
return hr;
}
*pszOut = 0;
#ifdef _UNICODE
hr = AssocQueryStringW(flags, str, pszAssoc, pszExtra, pszOut, pcchOut);
#else
// get size of buffer for pszAssoc
int wlen = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pszAssoc, -1, NULL, 0);
TRACE(_T("wlen=%d\n"), wlen);
WCHAR *pszAssocW = new WCHAR [wlen+16];
pszAssocW[0] = 0;
// convert pszAssoc to unicode
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pszAssoc, -1, pszAssocW, wlen+2);
// get size of buffer for pszExtra
WCHAR *pszExtraW = NULL;
if (pszExtra && (pszExtra[0] != _T('\0')))
{
wlen = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pszExtra, -1, NULL, 0);
TRACE(_T("wlen=%d\n"), wlen);
pszExtraW = new WCHAR [wlen+16];
pszExtraW[0] = 0;
// convert pszExtra to unicode
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pszExtra, -1, pszExtraW, wlen+2);
}
// create buffer for wide-character output
WCHAR *pszOutW = new WCHAR [MAX_PATH*3];
pszOutW[0] = 0;
DWORD dwOut = MAX_PATH*3 - 4;
// get exe filepath
hr = AssocQueryStringW(flags, str, pszAssocW, pszExtraW, pszOutW, &dwOut);
// convert exe filepath to ansi
WideCharToMultiByte(CP_ACP, 0, pszOutW, -1, pszOut, *pcchOut, NULL, NULL);
*pcchOut = _tcslen(pszOut);
delete [] pszAssocW;
delete [] pszExtraW;
delete [] pszOutW;
#endif
return hr;
}
///////////////////////////////////////////////////////////////////////////////
//
// LookupRegisteredApp()
//
// Purpose: Retrieves the application registered for the specified file
// extension
//
// Parameters: lpszExt - [in] file extension (e.g., ".txt") used to
// look up application file path. Preceding '.'
// is necessary.
// lpszApplication - [out] application path buffer
// nSize - [in/out] size of path buffer in TCHARs
//
// Returns: BOOL - TRUE = found registered app
//
// Notes: AssocQueryString() is broken in Vista. If no application is
// associated with the file extension, in Vista the function returns
// the "Unknown" application, rather than an error code (as in XP).
// Adding ASSOCF_IGNOREUNKNOWN to the flags parameter will make the
// function behave as in XP. ASSOCF_IGNOREUNKNOWN is defined in the
// latest Platform SDK.
//
BOOL LookupRegisteredApp(LPCTSTR lpszExt,
LPTSTR lpszApplication,
DWORD *nSize)
{
TRACE(_T("in LookupRegisteredApp: lpszExt=<%s>\n"), lpszExt);
BOOL rc = FALSE;
// get app associated with file extension
HRESULT hr = _AssocQueryString(ASSOCF_IGNOREUNKNOWN|ASSOCF_NOTRUNCATE,
ASSOCSTR_EXECUTABLE,
lpszExt,
NULL,
lpszApplication,
nSize);
TRACE(_T("hr=0x%X\n"), hr);
if (SUCCEEDED(hr) && (lpszApplication[0] != _T('\0')))
rc = TRUE;
return rc;
}
///////////////////////////////////////////////////////////////////////////////
//
// ExecRegisteredApp()
//
// Purpose: Runs the application registered for the specified file extension
//
// Parameters: lpszArgs - [in] command line arguments that are passed to app
// via CreateProcess(); if not already in quotes ("),
// they will be enclosed in quotes before CreateProcess()
// is called. May be NULL.
// lpszExt - [in] file extension (e.g., ".txt") used to look up
// application file path. Preceding '.' is necessary.
// wShowCmd - [in] Specifies how the app window is to be shown.
// See ShowWindow() in MSDN for possible values.
//
// Returns: BOOL - TRUE = found registered app; CreateProcess() succeeded
//
BOOL ExecRegisteredApp(LPCTSTR lpszArgs, // may be NULL
LPCTSTR lpszExt,
WORD wShowCmd /*= SW_SHOWNORMAL*/)
{
TRACE(_T("in ExecRegisteredApp: lpszArgs=<%s> lpszExt=<%s>\n"), lpszArgs, lpszExt);
BOOL rc = FALSE;
TCHAR szExe[MAX_PATH*3];
szExe[0] = _T('\0');
DWORD dwOut = sizeof(szExe)/sizeof(TCHAR)-4;
rc = LookupRegisteredApp(lpszExt, szExe, &dwOut);
if (rc)
{
size_t nBufSize = _tcslen(szExe);
if (lpszArgs)
nBufSize += _tcslen(lpszArgs);
nBufSize += 100;
TCHAR *buf = new TCHAR [nBufSize];
// enclose exe filepath in quotes
_tcscpy(buf, _T("\""));
_tcscat(buf, szExe);
_tcscat(buf, _T("\""));
if (lpszArgs && (lpszArgs[0] != _T('\0')))
{
if (lpszArgs[0] != _T('"'))
{
// add args in quotes
_tcscat(buf, _T(" \""));
_tcscat(buf, lpszArgs);
_tcscat(buf, _T("\""));
}
else
{
// add args (already in quotes)
_tcscat(buf, _T(" "));
_tcscat(buf, lpszArgs);
}
}
rc = ExecApp(buf, wShowCmd);
delete [] buf;
}
return rc;
}
| {
"content_hash": "1822cf480281bf60f0df94c1a7d8dbc0",
"timestamp": "",
"source": "github",
"line_count": 327,
"max_line_length": 86,
"avg_line_length": 31.6697247706422,
"alnum_prop": 0.5599652375434531,
"repo_name": "ximenpo/simple-cpp-win32",
"id": "cd2c57f9385c1bbe97f8b269f5d705b2b1cc4aef",
"size": "10356",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "inc/simple-win32/_third/ExecApp/ExecApp.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1825"
},
{
"name": "C",
"bytes": "28202"
},
{
"name": "C++",
"bytes": "567017"
},
{
"name": "HTML",
"bytes": "5706"
},
{
"name": "Objective-C",
"bytes": "54491"
}
],
"symlink_target": ""
} |
from __future__ import print_function
from twython import Twython, TwythonError
from twython import TwythonStreamer
import os
import re
CONSUMER_KEY = os.environ['CONSUMER_KEY']
CONSUMER_SECRET = os.environ['CONSUMER_SECRET']
ACCESS_TOKEN = os.environ['ACCESS_TOKEN']
ACCESS_TOKEN_SECRET = os.environ['ACCESS_TOKEN_SECRET']
twitter = Twython(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
twitter.verify_credentials()
class meStreamer(TwythonStreamer):
def on_success(self, data):
if 'text' in data:
acct = "@n_remixed"
username = str(data['user']['screen_name'])
body = str(data['text'])
print(username,body)
## only respond if you are directly tweeted at
if body.startswith(acct):
bodyStrip = re.sub(r'[^\w\s]','',body.lower())
print("@%s: %s" % (username, bodyStrip))
## grab the last tweet you tweeted, and turn it backwards, then re-tweet it back.
bodySend = bodyStrip.replace("n_remixed","")
toTweet = "@{0} {1}".format(username,bodySend[::-1])
try:
twitter.update_status(status=toTweet)
print("!sent: ",toTweet)
except TwythonError as e:
print(e)
meStream = meStreamer(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_TOKEN,ACCESS_TOKEN_SECRET)
meStream.statuses.filter(track="@n_remixed") #only works if you are public | {
"content_hash": "cf05e2fda4933c2ae6eb7cb6ea562e5c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 86,
"avg_line_length": 32.975,
"alnum_prop": 0.6967399545109931,
"repo_name": "sharkwheels/n_remixed",
"id": "b5d28fb30f930cdfcb8f2b4b7a494e620f917616",
"size": "1451",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "streamer.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6704"
},
{
"name": "HTML",
"bytes": "2340"
},
{
"name": "Python",
"bytes": "107549"
}
],
"symlink_target": ""
} |
require 'amqp'
AMQP.start(host: 'clusters.imm.uran.ru') do |connection|
channel = AMQP::Channel.new(connection)
exchange = channel.fanout('infiniband')
queue = channel.queue('', exclusive: true)
queue.bind(exchange)
Signal.trap('INT') do
connection.close do
EM.stop { exit }
end
end
queue.subscribe do |body|
puts body
end
end
| {
"content_hash": "e837de3274ea7e43572e247dfbcc1a56",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 56,
"avg_line_length": 19.42105263157895,
"alnum_prop": 0.6612466124661247,
"repo_name": "dustalov/uranwatch",
"id": "ea2a3ea6e7d4f2e25f099404f067b1deb72578b0",
"size": "408",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "scripts/recvib.rb",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "126276"
},
{
"name": "JavaScript",
"bytes": "161948"
},
{
"name": "Python",
"bytes": "25654"
},
{
"name": "Ruby",
"bytes": "12202"
},
{
"name": "Shell",
"bytes": "1447"
}
],
"symlink_target": ""
} |
import { inject as service } from '@ember/service';
import { oneWay } from '@ember/object/computed';
import Component from '@ember/component';
import { isEmpty } from '@ember/utils';
import {
setProperties,
set,
get,
computed
} from '@ember/object';
import layout from '../templates/components/verification-modal';
import LocaleMixin from '../mixins/locale-headers';
import {
buildValidations
} from 'ember-cp-validations';
import {
default as ImpactValidation,
getRequiredValidations,
getWebsiteValidations
} from '../mixins/impact-validation';
import { task } from 'ember-concurrency';
const Validations = buildValidations({
file: getRequiredValidations(),
url: getWebsiteValidations(),
verificationDescription: getRequiredValidations(),
pages: getRequiredValidations()
});
export default Component.extend(Validations, ImpactValidation, LocaleMixin, {
i18n: service(),
store: service(),
layout,
tagName: 'verification-modal',
type: 'file',
question: null,
verification: null,
isUploading: false,
accept: null,
// model
file: null,
url: oneWay('verification.displayName'),
verificationDescription: oneWay('verification.description'),
pages: oneWay('verification.pageNumbers'),
// card title
title: computed('type', function() {
const type = get(this, 'type');
const key = `components.question-card.verification.modal.${type}.title`;
return get(this, 'i18n').t(key);
}),
// description placeholder - based on type
description: computed('type', function() {
const type = get(this, 'type');
const key = `components.question-card.verification.modal.${type}.description`;
return get(this, 'i18n').t(key);
}),
// is file type
isFile: computed('type', function() {
return get(this, 'type') === 'file';
}),
// is url type
isUrl: computed('type', function() {
return get(this, 'type') === 'url';
}),
// friendly name to display to user for file upload
fileName: computed('file', 'verification', function() {
// file provided through picker - use file object
const file = get(this, 'file');
if (!isEmpty(file)) {
return file.name;
}
// edit a verification - use the display name
const verification = get(this, 'verification');
if (!isEmpty(verification)) {
return get(verification, 'displayName');
}
// placeholder text
return get(this, 'i18n')
.t('components.question-card.verification.modal.file.uploadPlaceholder');
}),
actions: {
// get file from input
fileChanged(files) {
const file = files.item(0);
set(this, 'file', file);
this.element.querySelector('[name=file-upload]').blur();
this.updateValidationState();
},
// close the modal
cancel() {
this.closeModal();
},
// save the verification
save() {
const onSave = get(this, 'performSave');
onSave.perform();
},
formChanged() {
this.updateValidationState();
}
},
// cleanup validation
cleanupValidationState() {
setProperties(this, {
file: null,
url: null,
reply: null,
verificationDescription: null,
pages: null,
validationEnabled: false
});
this.element.querySelector('input').classList.remove('invalid');
this.element.querySelector('textarea').classList.remove('invalid');
const error = this.element.querySelector('#file-upload-error');
if (!isEmpty(error)) {
error.style.visibility = 'hidden';
}
},
// close the modal
closeModal() {
// clear validation
this.cleanupValidationState();
// callback
const close = get(this, 'close');
if (!isEmpty(close)) {
close();
}
},
// get a verification model for insert or update
createUpdateVerification() {
const store = get(this, 'store');
let verification = get(this, 'verification');
if (isEmpty(verification)) {
// create a new model
verification = store.createRecord('verification', {
resourceId: null,
resourceType: get(this, 'type'),
status: 'Active',
question: get(this, 'question')
});
} else {
// use the parameter
setProperties(verification, {
resourceId: get(verification, 'resourceId'),
resourceType: get(verification, 'resourceType'),
status: get(verification, 'status')
});
}
setProperties(verification, {
responseId: get(this, 'question.responseId'),
description: get(this, 'verificationDescription'),
pageNumbers: get(this, 'pages'),
displayName: get(this, 'isFile') ? get(this, 'fileName') : get(this, 'url')
});
set(this, 'verification', verification);
return verification;
},
// perform save
performSave: task(function* () {
const isFile = get(this, 'isFile');
const fields = isFile ? [
'file',
'verificationDescription',
'pages'
] : [
'url',
'verificationDescription'
];
// if there's an existing verification but no file,
// the user is just updating the verification record. do not validate
// the file
const verification = get(this, 'verification');
if (!isEmpty(verification) && isFile && isEmpty(get(this, 'file'))) {
fields.removeAt(0);
}
this.enableValidations();
const { validations } = yield this.validate({ on: fields });
const isValid = get(validations, 'isValid');
if (isValid) {
const upload = get(this, 'onSave');
if (!isEmpty(upload)) {
const verification = this.createUpdateVerification();
const resource = get(this, 'isFile') ? get(this, 'file') : get(this, 'url');
yield upload(verification, resource);
}
} else {
this.updateValidationState();
this.notify.error('app.errors.formErrors');
}
}),
close() { },
updateValidationState() {
const verification = get(this, 'verification');
this.drawInputValidation('#page-numbers', 'pages');
this.drawInputValidation('#url-upload', 'url');
this.drawTextAreaValidation('#description', 'verificationDescription');
// file validation
if (get(this, 'validationEnabled')) {
const error = this.element.querySelector('#file-upload-error');
const file = get(this, 'file');
if (isEmpty(file) && isEmpty(verification) && !isEmpty(error)) {
error.style.visibility = 'visible';
} else if (!isEmpty(error)) {
error.style.visibility = 'hidden';
}
}
}
});
| {
"content_hash": "5a43ad36bcaddacd8660ea30279335b0",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 84,
"avg_line_length": 27.7531914893617,
"alnum_prop": 0.6338546458141674,
"repo_name": "b-lab-org/ember-cli-impact-core",
"id": "8854d525f8327768a8868aee3caec7b94fca19c4",
"size": "6522",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "addon/components/verification-modal.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "63890"
},
{
"name": "HTML",
"bytes": "135536"
},
{
"name": "JavaScript",
"bytes": "584340"
},
{
"name": "Shell",
"bytes": "3307"
}
],
"symlink_target": ""
} |
export class AttributeMetadataMock implements Xrm.Metadata.AttributeMetadata {
public DefaultFormValue: number;
public LogicalName: string;
public DisplayName: string;
public AttributeType: XrmEnum.AttributeTypeCode;
public EntityLogicalName: string;
public OptionSet: Xrm.Metadata.OptionMetadata[];
constructor(components: IAttributeMetadataComponents) {
this.DefaultFormValue = components.DefaultFormValue;
this.LogicalName = components.LogicalName;
this.DisplayName = components.DisplayName;
this.AttributeType = components.AttributeType;
this.EntityLogicalName = components.EntityLogicalName;
this.OptionSet = components.OptionSet;
}
}
export interface IAttributeMetadataComponents {
DefaultFormValue?: number;
LogicalName?: string;
DisplayName?: string;
AttributeType?: XrmEnum.AttributeTypeCode;
EntityLogicalName?: string;
OptionSet?: Xrm.Metadata.OptionMetadata[];
}
| {
"content_hash": "1dfa1048ca701ecd9325b3a9b70679ee",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 35.73076923076923,
"alnum_prop": 0.7922497308934338,
"repo_name": "camelCaseDave/xrm-mock",
"id": "a39e704d5f66367463ee11b4d16b31c37792ae8d",
"size": "929",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/xrm-mock/metadata/attributemetadata/attributemetadata.mock.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "355"
},
{
"name": "TypeScript",
"bytes": "282433"
}
],
"symlink_target": ""
} |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.cs475x</groupId>
<artifactId>AnyBar4j</artifactId>
<version>1.0.0</version>
<name>AnyBar4j</name>
<description>Java controller and API for AnyBar</description>
<issueManagement>
<url>https://github.com/cs475x/AnyBar4j/issues</url>
<system>GitHub Issues</system>
</issueManagement>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<project.jdk>1.7</project.jdk>
</properties>
<dependencies>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<version>4.8</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>clean install</defaultGoal>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${project.jdk}</source>
<target>${project.jdk}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<mainClass>com.gmail.cs475x.anybar4j.AnyBar4j</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactSet>
<includes>
<include>net.sf.jopt-simple:jopt-simple</include>
</includes>
</artifactSet>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "fddf1b2a0e7af895b74e5f43d4bef659",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 204,
"avg_line_length": 28.428571428571427,
"alnum_prop": 0.6733668341708543,
"repo_name": "cs475x/AnyBar4j",
"id": "dc79dcc390c297717fcd03c626b6830b8161f1a5",
"size": "2587",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pom.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "5370"
}
],
"symlink_target": ""
} |
package com.jaivox.ui.gengram;
import java.util.Set;
import java.util.TreeMap;
public class generate {
static parse P;
static wnlink W;
static String tests [];
public generate (String filename) {
P = new parse (filename);
if (P.Valid) P.createsentences ();
W = new wnlink ();
W.createsyns ();
W.addtablecolumn ("road.data", ",\r\n", 3, 0);
// W.test ("house");
TreeMap <String, sentence> sentences = P.sentences;
Set <String> keys = sentences.keySet ();
int n = keys.size ();
tests = keys.toArray (new String [n]);
for (int i=0; i<n; i++) {
String key = tests [i];
sentence s = sentences.get (key);
// s.show (""+i+" ");
// s.findmultiwords (W);
s.multiwordsubs (P, W);
}
// generate using okays instead of subs
for (int i=0; i<n; i++) {
String key = tests [i];
sentence s = sentences.get (key);
Debug ("Sentence "+i+" Generating okays for: "+key);
s.generateokays ();
}
}
static void Debug (String s) {
System.out.println ("[generate]" + s);
}
public static void main (String args []) {
//new generate (args [0]);
new generate ("road.tree");
}
}
| {
"content_hash": "16da5e388154c8c6930642206d3314ac",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 55,
"avg_line_length": 22.64,
"alnum_prop": 0.6068904593639576,
"repo_name": "jaivox/tools",
"id": "d8472208a55e5aff4f1c9374eaa64e0a6f723e9a",
"size": "1132",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "v2/com/jaivox/ui/gengram/generate.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "59247"
},
{
"name": "Java",
"bytes": "260979"
},
{
"name": "Objective-J",
"bytes": "2997"
}
],
"symlink_target": ""
} |
<html ng-app="app">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Markov Poet</title>
<!-- cdn css -->
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<link rel="stylesheet" href="./css/style.css">
<link rel="icon" type="image/png" href="favicon.png">
<!-- google web fonts -->
<link href='http://fonts.googleapis.com/css?family=Lakki+Reddy' rel='stylesheet' type='text/css'>
<!-- cdn ie compat -->
<!-- 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]-->
<!-- jquery js -->
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<!-- bootstrap -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<!-- angularjs -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.8/angular.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.0/ui-bootstrap.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.min.js"></script>
<!-- text animation: textilate.js -->
<script src="./js/vendor/textilate.js"></script>
<!-- app -->
<script src="./js/countsyllables.js"></script>
<script src="./js/nickmarkov.js"></script> <!-- markov chain generator -->
<script src="./js/data.js"></script> <!-- app plumbing -->
<script src="./js/process.js"></script> <!-- output processor -->
<script src="./js/app.js"></script> <!-- app plumbing -->
</head>
<body ng-controller="MainController" ng-init=init()>
<!-- Header / Nav -->
<nav class="navbar navbar-inverse navbar-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">{{appconfig.title}}</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="#" ng-click="init()"><span class="glyphicon glyphicon-remove"></span> Reset</a></li>
<li><a href="#" ng-click="toggleconfig()"><span class="glyphicon glyphicon-wrench"></span> Config</a></li>
<!--<li><a class="btn btn-primary" href="#" ng-click="run()"><span class="glyphicon glyphicon-star"></span> Generate</a></li>-->
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<!-- Main -->
<div class="container">
<div style="width:100%; margin-bottom:20px;">
<center><button class="btn btn-primary btn-lg" href="#" ng-click="run()"><span class="glyphicon glyphicon-star"></span> Generate Haiku</button></center>
</div>
<!-- jumbotron for output -->
<div class="jumbotron" ng-show="state.jumbo">
<div id="output"></div>
</div>
<!-- markov chain sources -->
<div id="sources">
<h3>Source Texts</h3>
<form name="sourcesForm">
<div class="form-group" data-ng-repeat="source in sources">
<strong>{{source.title}}</strong>
<textarea ng-model="source.text" class="source-textfield form-control" style="width: 700px; height: 150px;"></textarea>
<br/>
<button type="button" class="btn btn-danger btn-sm" ng-click="removeSource($index)"><span class="glyphicon glyphicon-remove"></span> Remove this</button>
<button type="button" class="btn btn-primary" ng-show="$last" ng-click="addNewSource()"><span class="glyphicon glyphicon-plus"></span> Add another source</button>
</div>
</form>
</div>
<!-- configuration -->
<div id="configpanel">
<div class="container">
<form name="configForm">
<h4>Source PreProcessing</h4>
<div class="form-group">
<label class="checkbox-inline" for="toLower">
<input ng-model="runconfig.lowercase" type="checkbox" id="toLower"> Zap to Lowercase</label>
</div>
<div class="form-group">
<label class="checkbox-inline" for="filterChars">
<input ng-model="runconfig.filterchars" type="checkbox" id="filterChars"> Filter Characters</label>
</div>
<h4>Markov Chain Generation</h4>
<div class="form-group">
<label class="control-label" for="maxChains"> Number of rows to output</label>
<input ng-model="runconfig.maxchains" type="text" class="form-control" id="maxChains" style="width:50px">
</div>
<h4>Markov Chain PostProcessing</h4>
<div class="form-group">
<label class="checkbox-inline" for="haiku353">
<input ng-model="runconfig.syllables" type="text" id="syllables" style="width:50px"> Filter by syllable pattern</label>
</div>
<h4>Display</h4>
<div class="form-group">
<label class="checkbox-inline" for="animateOutput">
<input ng-model="runconfig.animate" type="checkbox" id="animateOutput"> Animate Output</label>
</div>
<div class="form-group">
<label class="checkbox-inline" for="speechSynth">
<input ng-model="runconfig.speech" type="checkbox" id="speechSynth"> Speech Synthesis</label>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
| {
"content_hash": "3782e82736deda0117e9d75e11aa3f50",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 188,
"avg_line_length": 54.36619718309859,
"alnum_prop": 0.5060880829015544,
"repo_name": "mrlecko/markovpoet",
"id": "746ccf0c3ab7d7de8e68adf05f85527f18fa31d4",
"size": "7720",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "486"
},
{
"name": "JavaScript",
"bytes": "13380"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!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/html; charset=UTF-8" />
<title>operator=</title>
<link rel="stylesheet" href="apiReference.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
<link rel="start" href="index.html" title="Berkeley DB C++ Standard Template Library API Reference" />
<link rel="up" href="db_base_iterator.html" title="Chapter 10. Db_base_iterator" />
<link rel="prev" href="stldb_base_iteratordb_base_iterator.html" title="db_base_iterator" />
<link rel="next" href="stldb_base_iteratordstr_db_base_iterator.html" title="~db_base_iterator" />
</head>
<body>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">operator=</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="stldb_base_iteratordb_base_iterator.html">Prev</a> </td>
<th width="60%" align="center">Chapter 10.
Db_base_iterator </th>
<td width="20%" align="right"> <a accesskey="n" href="stldb_base_iteratordstr_db_base_iterator.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="sect1" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="stldb_base_iteratoroperator_assign"></a>operator=</h2>
</div>
</div>
</div>
<div class="sect2" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="stldb_base_iteratoroperator_assign_details"></a>Function Details</h3>
</div>
</div>
</div>
<pre class="programlisting">
const self& operator=(const self &bi)
</pre>
<p>Iterator assignment operator. </p>
<p>Iterator assignment will cause the underlying cursor of the right iterator to be duplicated to the left iterator after its previous cursor is closed, to make sure each iterator owns one unique cursor. The key/data cached in the right iterator is copied to the left iterator. Consequently, the left iterator points to the same key/data pair in the database as the the right value after the assignment, and have identical cached key/data pair. </p>
<div class="sect3" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a id="id3397650"></a>Parameters</h4>
</div>
</div>
</div>
<div class="sect4" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h5 class="title"><a id="id3397762"></a>bi</h5>
</div>
</div>
</div>
<p>The other iterator to assign with. </p>
</div>
</div>
<div class="sect3" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a id="id3397704"></a>Return Value</h4>
</div>
</div>
</div>
<p>The iterator bi's reference. </p>
</div>
</div>
<div class="sect2" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="id3397710"></a>Class</h3>
</div>
</div>
</div>
<p>
<a class="link" href="db_base_iterator.html" title="Chapter 10. Db_base_iterator">db_base_iterator</a>
</p>
</div>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="stldb_base_iteratordb_base_iterator.html">Prev</a> </td>
<td width="20%" align="center">
<a accesskey="u" href="db_base_iterator.html">Up</a>
</td>
<td width="40%" align="right"> <a accesskey="n" href="stldb_base_iteratordstr_db_base_iterator.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">
db_base_iterator
</td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> ~db_base_iterator</td>
</tr>
</table>
</div>
</body>
</html>
| {
"content_hash": "e0e278b4d67d1f8a4e1fab86ff97ceb8",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 457,
"avg_line_length": 41.08695652173913,
"alnum_prop": 0.5453968253968254,
"repo_name": "jtimberman/omnibus",
"id": "df70fffd687a90ced07196c5abb4b70072fbc2a6",
"size": "4737",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "source/db-5.0.26.NC/docs/api_reference/STL/stldb_base_iteratoroperator_assign.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
namespace VideoGamesRecords\CoreBundle\Event;
use Symfony\Contracts\EventDispatcher\Event;
use VideoGamesRecords\CoreBundle\Entity\Platform;
class PlatformEvent extends Event
{
protected Platform $platform;
public function __construct(Platform $platform)
{
$this->platform = $platform;
}
public function getPlatform(): Platform
{
return $this->platform;
}
} | {
"content_hash": "894f4bd8067c03fec5b06e29e8e1a8c2",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 51,
"avg_line_length": 19.61904761904762,
"alnum_prop": 0.7087378640776699,
"repo_name": "video-games-records/CoreBundle",
"id": "a67e19b1b5fbd896f2c7962f8f09b1940e72b9a2",
"size": "412",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/Event/PlatformEvent.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "685021"
},
{
"name": "PLpgSQL",
"bytes": "2300"
},
{
"name": "Twig",
"bytes": "27487"
}
],
"symlink_target": ""
} |
package uz.greenwhite.slidingmenu.support.v10;
import android.app.Application;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import uz.greenwhite.slidingmenu.support.v10.util.RequestUtil;
public abstract class SupportApplication extends Application {
private static Context context;
public static Boolean DEBUG;
public static String VERSION;
public static final String TAG = "Support";
public static RequestUtil requestUtil;
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
DEBUG = (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
VERSION = getVersion();
requestUtil = new RequestUtil(context);
}
public static Context getContext() {
return context;
}
private String getVersion() {
try {
return context.getPackageManager()
.getPackageInfo(context.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return "";
}
}
| {
"content_hash": "fdfbe71382f6d6bc66c545117f321853",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 84,
"avg_line_length": 28.78048780487805,
"alnum_prop": 0.6788135593220339,
"repo_name": "axmadjon/AndroidSlidingMenu",
"id": "4cac6b68b360ffc463138f6c6d251e2d70e7b9f0",
"size": "1180",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/uz/greenwhite/slidingmenu/support/v10/SupportApplication.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1012898"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_22) on Fri Jun 29 20:39:36 GMT+01:00 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class org.apache.http.entity.mime.content.AbstractContentBody (HttpComponents Client 4.2.1 API)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Uses of Class org.apache.http.entity.mime.content.AbstractContentBody (HttpComponents Client 4.2.1 API)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/http/entity/mime/content/AbstractContentBody.html" title="class in org.apache.http.entity.mime.content"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/apache/http/entity/mime/content/class-use/AbstractContentBody.html" target="_top"><B>FRAMES</B></A>
<A HREF="AbstractContentBody.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.http.entity.mime.content.AbstractContentBody</B></H2>
</CENTER>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Packages that use <A HREF="../../../../../../../org/apache/http/entity/mime/content/AbstractContentBody.html" title="class in org.apache.http.entity.mime.content">AbstractContentBody</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.apache.http.entity.mime.content"><B>org.apache.http.entity.mime.content</B></A></TD>
<TD>MIME Multipart content body parts. </TD>
</TR>
</TABLE>
<P>
<A NAME="org.apache.http.entity.mime.content"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../../../org/apache/http/entity/mime/content/AbstractContentBody.html" title="class in org.apache.http.entity.mime.content">AbstractContentBody</A> in <A HREF="../../../../../../../org/apache/http/entity/mime/content/package-summary.html">org.apache.http.entity.mime.content</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../../../../org/apache/http/entity/mime/content/AbstractContentBody.html" title="class in org.apache.http.entity.mime.content">AbstractContentBody</A> in <A HREF="../../../../../../../org/apache/http/entity/mime/content/package-summary.html">org.apache.http.entity.mime.content</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/http/entity/mime/content/ByteArrayBody.html" title="class in org.apache.http.entity.mime.content">ByteArrayBody</A></B></CODE>
<BR>
Body part that is built using a byte array containing a file.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/http/entity/mime/content/FileBody.html" title="class in org.apache.http.entity.mime.content">FileBody</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/http/entity/mime/content/InputStreamBody.html" title="class in org.apache.http.entity.mime.content">InputStreamBody</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../org/apache/http/entity/mime/content/StringBody.html" title="class in org.apache.http.entity.mime.content">StringBody</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/http/entity/mime/content/AbstractContentBody.html" title="class in org.apache.http.entity.mime.content"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/apache/http/entity/mime/content/class-use/AbstractContentBody.html" target="_top"><B>FRAMES</B></A>
<A HREF="AbstractContentBody.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 1999-2012 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
| {
"content_hash": "e100bd920efb765ad356bfdf1053cdda",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 354,
"avg_line_length": 47.70646766169154,
"alnum_prop": 0.6321827093544686,
"repo_name": "Access4Learning/JavaLibsA4L",
"id": "8aade79d5fee7fef01fb5ac6f44b9e5e7daf90ea",
"size": "9589",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "SIFCommonsDemo/lib/httpcomponents-client-4.2.1/javadoc/org/apache/http/entity/mime/content/class-use/AbstractContentBody.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "54358"
},
{
"name": "CSS",
"bytes": "10546"
},
{
"name": "HTML",
"bytes": "432774"
},
{
"name": "Java",
"bytes": "659421"
},
{
"name": "JavaScript",
"bytes": "9294"
},
{
"name": "Ruby",
"bytes": "22051"
},
{
"name": "XQuery",
"bytes": "563"
}
],
"symlink_target": ""
} |
var requireDir = require('require-dir'),
gulp = require('gulp');
requireDir('./gulp/tasks', { recurse: true });
gulp.task('default', [ 'dist' ], function () {
});
process.on('uncaughtException', function (err) {
console.log('A global exception occured:', err);
console.log('Restart recommended');
}) | {
"content_hash": "74e52cd3c23fc64f022900c5ffdec493",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 52,
"avg_line_length": 26.166666666666668,
"alnum_prop": 0.6464968152866242,
"repo_name": "deniskaber/propertycross-angular-lazyload",
"id": "c005c5c4d7804599851eeccfc4c72d0160e00379",
"size": "314",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "gulpfile.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9668"
},
{
"name": "HTML",
"bytes": "7715"
},
{
"name": "JavaScript",
"bytes": "45277"
}
],
"symlink_target": ""
} |
using namespace cocos2d;
using namespace cocostudio;
EnemyController::EnemyController(void)
{
_name = "EnemyController";
}
EnemyController::~EnemyController(void)
{
}
bool EnemyController::init()
{
return true;
}
void EnemyController::onEnter()
{
ComController::onEnter();
// Determine where to spawn the target along the Y axis
Size winSize = Director::getInstance()->getVisibleSize();
float minY = getOwner()->getContentSize().height/2;
float maxY = winSize.height - getOwner()->getContentSize().height/2;
int rangeY = (int)(maxY - minY);
// srand( TimGetTicks() );
int actualY = ( rand() % rangeY ) + (int)minY;
// Create the target slightly off-screen along the right edge,
// and along a random position along the Y axis as calculated
_owner->setPosition(
Vec2(winSize.width + (getOwner()->getContentSize().width/2),
Director::getInstance()->getVisibleOrigin().y + actualY) );
// Determine speed of the target
int minDuration = 2;
int maxDuration = 4;
int rangeDuration = maxDuration - minDuration;
// srand( TimGetTicks() );
int actualDuration = ( rand() % rangeDuration ) + minDuration;
// Create the actions
FiniteTimeAction* actionMove = MoveTo::create( actualDuration,
Vec2(0 - getOwner()->getContentSize().width/2, actualY) );
FiniteTimeAction* actionMoveDone = CallFuncN::create(
CC_CALLBACK_1(SceneController::spriteMoveFinished, static_cast<SceneController*>( getOwner()->getParent()->getComponent("SceneController") )));
_owner->runAction( Sequence::create(actionMove, actionMoveDone, nullptr) );
}
void EnemyController::onExit()
{
}
void EnemyController::update(float delta)
{
}
EnemyController* EnemyController::create(void)
{
EnemyController * pRet = new (std::nothrow) EnemyController();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
void EnemyController::die()
{
auto com = _owner->getParent()->getComponent("SceneController");
auto& targets = static_cast<SceneController*>(com)->getTargets();
targets.eraseObject(_owner);
_owner->removeFromParentAndCleanup(true);
static_cast<SceneController*>(com)->increaseKillCount();
}
| {
"content_hash": "799b073800183c8cc0810bda07da33a0",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 184,
"avg_line_length": 27.843373493975903,
"alnum_prop": 0.6737343141497187,
"repo_name": "hylthink/Sample_Lua",
"id": "f109da7e5ec42b609c960781b4f5bd10b26ae6cd",
"size": "2370",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "frameworks/cocos2d-x/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2434"
},
{
"name": "C",
"bytes": "2298609"
},
{
"name": "C#",
"bytes": "66998"
},
{
"name": "C++",
"bytes": "18024271"
},
{
"name": "CMake",
"bytes": "188078"
},
{
"name": "GLSL",
"bytes": "53294"
},
{
"name": "HTML",
"bytes": "86"
},
{
"name": "Java",
"bytes": "275335"
},
{
"name": "Lua",
"bytes": "2945485"
},
{
"name": "Makefile",
"bytes": "46792"
},
{
"name": "Objective-C",
"bytes": "420555"
},
{
"name": "Objective-C++",
"bytes": "357759"
},
{
"name": "PowerShell",
"bytes": "18747"
},
{
"name": "Python",
"bytes": "394368"
},
{
"name": "Shell",
"bytes": "20976"
}
],
"symlink_target": ""
} |
<?php
/**
* Unit test class for the SwitchDeclaration sniff.
*
* A sniff unit test checks a .inc file for expected violations of a single
* coding standard. Expected errors and warnings are stored in this class.
*
* @category PHP
* @package PHP_CodeSniffer
* @author Greg Sherwood <gsherwood@squiz.net>
* @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
* @version Release: @package_version@
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
class PSR2_Tests_ControlStructures_SwitchDeclarationUnitTest extends AbstractSniffUnitTest
{
/**
* Returns the lines where errors should occur.
*
* The key of the array should represent the line number and the value
* should represent the number of errors that should occur on that line.
*
* @return array(int => int)
*/
public function getErrorList()
{
return array(
20 => 1,
23 => 2,
26 => 1,
29 => 1,
31 => 1,
33 => 1,
37 => 1,
);
}//end getErrorList()
/**
* Returns the lines where warnings should occur.
*
* The key of the array should represent the line number and the value
* should represent the number of warnings that should occur on that line.
*
* @return array(int => int)
*/
public function getWarningList()
{
return array();
}//end getWarningList()
}//end class
?>
| {
"content_hash": "9de25365af66b9311706f3d750409cc1",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 94,
"avg_line_length": 25.951612903225808,
"alnum_prop": 0.6016159105034182,
"repo_name": "dryabkov/PHP_CodeSniffer",
"id": "5b792713879c1794090f1672293193a2b0afd180",
"size": "2001",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CodeSniffer/Standards/PSR2/Tests/ControlStructures/SwitchDeclarationUnitTest.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "33736"
},
{
"name": "PHP",
"bytes": "2060161"
},
{
"name": "Shell",
"bytes": "699"
}
],
"symlink_target": ""
} |
<?php
class Buscador_Bootstrap extends Zend_Application_Module_Bootstrap
{
}
| {
"content_hash": "e3ae14caf56229dfea8954184602c62c",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 66,
"avg_line_length": 15.6,
"alnum_prop": 0.7948717948717948,
"repo_name": "tomasVega/trobador",
"id": "46d17aae6bc43d3b41946371d6aeee8aff72e26d",
"size": "78",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web-service/application/modules/buscador/Bootstrap.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "24494"
},
{
"name": "PHP",
"bytes": "15416490"
},
{
"name": "Python",
"bytes": "10367"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>unimath-ktheory: 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 / extra-dev</a></li>
<li class="active"><a href="">dev / unimath-ktheory - 0.1.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
unimath-ktheory
<small>
0.1.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-03-10 22:06:32 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-10 22:06:32 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 4 Virtual package relying on a GMP lib system installation
coq dev Formal proof management system
dune 3.0.3 Fast, portable, and opinionated build system
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
ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler
ocamlfind 1.9.1 A library manager for OCaml
ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "opam@clarus.me"
homepage: "https://github.com/UniMath/UniMath"
dev-repo: "git+https://github.com/UniMath/UniMath.git"
bug-reports: "https://github.com/UniMath/UniMath/issues"
license: "Kind of MIT"
authors: ["The UniMath Development Team"]
build: [
["coq_makefile" "-f" "Make" "-o" "Makefile"]
[make "-j%{jobs}%"]
]
install: [
[make "install"]
]
depends: [
"ocaml"
"coq" {>= "8.5.0" & < "8.6"}
"coq-unimath-category-theory"
"coq-unimath-foundations"
]
synopsis: "Aims to formalize a substantial body of mathematics using the univalent point of view"
extra-files: ["Make" "md5=ba645952ced22f5cf37e29da5175d432"]
url {
src: "https://github.com/UniMath/UniMath/archive/v0.1.tar.gz"
checksum: "md5=1ed57c1028e227a309f428a6dc5f0866"
}
</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-unimath-ktheory.0.1.0 coq.dev</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is dev).
The following dependencies couldn't be met:
- coq-unimath-ktheory -> coq-unimath-foundations -> coq < 8.6 -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
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-unimath-ktheory.0.1.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>
| {
"content_hash": "7d73a2b1d7b652fd34eae730807202ab",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 159,
"avg_line_length": 41.92941176470588,
"alnum_prop": 0.5416666666666666,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "33920a27a5671c92ba13187891cbd12d63ac1a86",
"size": "7153",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.06.1-2.0.5/extra-dev/dev/unimath-ktheory/0.1.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
Ensembl.extend({
initialize: function () {
this.base.apply(this, arguments);
this.setUserFlag();
},
setUserFlag: function () {
if (!this.hasOwnProperty('isLoggedInUser')) {
this.isLoggedInUser = $('div._account_holder').hasClass('_logged_in');
}
}
});
| {
"content_hash": "9e73085fec067d08dd158b769d5aa9ab",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 76,
"avg_line_length": 19.066666666666666,
"alnum_prop": 0.6118881118881119,
"repo_name": "Ensembl/public-plugins",
"id": "198e8026e57d8522774eb04f2f154d146ff78c1d",
"size": "1022",
"binary": false,
"copies": "1",
"ref": "refs/heads/release/108",
"path": "users/htdocs/components/01_Ensembl_Users.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "135249"
},
{
"name": "CoffeeScript",
"bytes": "269058"
},
{
"name": "HTML",
"bytes": "2485745"
},
{
"name": "JavaScript",
"bytes": "2429063"
},
{
"name": "Perl",
"bytes": "1620180"
}
],
"symlink_target": ""
} |
package ch.spacebase.openclassic.api.block;
import ch.spacebase.openclassic.api.block.model.CubeModel;
import ch.spacebase.openclassic.api.block.model.CuboidModel;
import ch.spacebase.openclassic.api.block.model.EmptyModel;
import ch.spacebase.openclassic.api.block.model.Model;
import ch.spacebase.openclassic.api.block.model.PlantModel;
import ch.spacebase.openclassic.api.block.model.LiquidModel;
import ch.spacebase.openclassic.api.block.physics.BlockPhysics;
/**
* Represents a vanilla block type.
*/
public enum VanillaBlock implements BlockType {
AIR((byte) 0, StepSound.NONE, new EmptyModel(), false),
STONE((byte) 1, StepSound.STONE, 1),
GRASS((byte) 2, StepSound.GRASS, new CubeModel(TERRAIN, new int[] { 2, 0, 3, 3, 3, 3 })),
DIRT((byte) 3, StepSound.GRAVEL, 2),
COBBLESTONE((byte) 4, StepSound.STONE, 16),
WOOD((byte) 5, StepSound.WOOD, 4),
SAPLING((byte) 6, StepSound.GRASS, new PlantModel(TERRAIN, 15), false),
BEDROCK((byte) 7, StepSound.STONE, 17),
WATER((byte) 8, StepSound.NONE, new LiquidModel(TERRAIN, 14), 5, true, true),
STATIONARY_WATER((byte) 9, StepSound.NONE, new LiquidModel(TERRAIN, 14), true, true),
LAVA((byte) 10, StepSound.NONE, new LiquidModel(TERRAIN, 30), 20, true, true),
STATIONARY_LAVA((byte) 11, StepSound.NONE, new LiquidModel(TERRAIN, 30), true, true),
SAND((byte) 12, StepSound.SAND, 18),
GRAVEL((byte) 13, StepSound.GRAVEL, 19),
GOLD_ORE((byte) 14, StepSound.STONE, 32),
IRON_ORE((byte) 15, StepSound.STONE, 33),
COAL_ORE((byte) 16, StepSound.STONE, 34),
LOG((byte) 17, StepSound.WOOD, new CubeModel(TERRAIN, new int[] { 21, 21, 20, 20, 20, 20 })),
LEAVES((byte) 18, StepSound.GRASS, 22, false),
SPONGE((byte) 19, StepSound.GRASS, 48),
GLASS((byte) 20, StepSound.METAL, 49, false),
RED_CLOTH((byte) 21, StepSound.CLOTH, 64),
ORANGE_CLOTH((byte) 22, StepSound.CLOTH, 65),
YELLOW_CLOTH((byte) 23, StepSound.CLOTH, 66),
LIME_CLOTH((byte) 24, StepSound.CLOTH, 67),
GREEN_CLOTH((byte) 25, StepSound.CLOTH, 68),
AQUA_GREEN_CLOTH((byte) 26, StepSound.CLOTH, 69),
CYAN_CLOTH((byte) 27, StepSound.CLOTH, 70),
BLUE_CLOTH((byte) 28, StepSound.CLOTH, 71),
PURPLE_CLOTH((byte) 29, StepSound.CLOTH, 72),
INDIGO_CLOTH((byte) 30, StepSound.CLOTH, 73),
VIOLET_CLOTH((byte) 31, StepSound.CLOTH, 74),
MAGENTA_CLOTH((byte) 32, StepSound.CLOTH, 75),
PINK_CLOTH((byte) 33, StepSound.CLOTH, 76),
BLACK_CLOTH((byte) 34, StepSound.CLOTH, 77),
GRAY_CLOTH((byte) 35, StepSound.CLOTH, 78),
WHITE_CLOTH((byte) 36, StepSound.CLOTH, 79),
DANDELION((byte) 37, StepSound.GRASS, false, new PlantModel(TERRAIN, 13)),
ROSE((byte) 38, StepSound.GRASS, false, new PlantModel(TERRAIN, 12)),
BROWN_MUSHROOM((byte) 39, StepSound.GRASS, false, new PlantModel(TERRAIN, 29)),
RED_MUSHROOM((byte) 40, StepSound.GRASS, false, new PlantModel(TERRAIN, 28)),
GOLD_BLOCK((byte) 41, StepSound.METAL, new CubeModel(TERRAIN, new int[] { 56, 24, 40, 40, 40, 40 })),
IRON_BLOCK((byte) 42, StepSound.METAL, new CubeModel(TERRAIN, new int[] { 55, 23, 39, 39, 39, 39 })),
DOUBLE_SLAB((byte) 43, StepSound.STONE, new CubeModel(TERRAIN, new int[] { 6, 6, 5, 5, 5, 5 })),
SLAB((byte) 44, StepSound.STONE, new CuboidModel(TERRAIN, new int[] { 6, 6, 5, 5, 5, 5 }, 0, 0, 0, 1, 0.5F, 1)),
BRICK_BLOCK((byte) 45, StepSound.STONE, 7),
TNT((byte) 46, StepSound.GRASS, new CubeModel(TERRAIN, new int[] { 10, 9, 8, 8, 8, 8 })),
BOOKSHELF((byte) 47, StepSound.WOOD, new CubeModel(TERRAIN, new int[] { 4, 4, 35, 35, 35, 35 })),
MOSSY_COBBLESTONE((byte) 48, StepSound.STONE, 36),
OBSIDIAN((byte) 49, StepSound.STONE, 37);
private byte id;
private BlockPhysics phys;
private boolean liquid;
private int tickDelay;
private boolean opaque;
private StepSound sound;
private Model model;
private VanillaBlock(byte id, StepSound sound, int texture) {
this(id, sound, texture, 0, true, false);
}
private VanillaBlock(byte id, StepSound sound, Model model) {
this(id, sound, model, 0, true, false);
}
private VanillaBlock(byte id, StepSound sound, int texture, boolean opaque) {
this(id, sound, texture, 0, opaque, false);
}
private VanillaBlock(byte id, StepSound sound, Model model, boolean opaque) {
this(id, sound, model, 0, opaque, false);
}
private VanillaBlock(byte id, StepSound sound, boolean opaque, Model model) {
this(id, sound, model, 0, opaque, false);
}
private VanillaBlock(byte id, StepSound sound, Model model, boolean opaque, boolean liquid) {
this(id, sound, model, 0, opaque, liquid);
}
private VanillaBlock(byte id, StepSound sound, int texture, int tickDelay, boolean opaque, boolean liquid) {
this(id, sound, new CubeModel(TERRAIN, texture), tickDelay, opaque, liquid);
}
private VanillaBlock(byte id, StepSound sound, Model model, int tickDelay, boolean opaque, boolean liquid) {
this.id = id;
this.sound = sound;
this.model = model;
this.tickDelay = tickDelay;
this.liquid = liquid;
this.opaque = opaque;
if(this.liquid || id == 0) {
this.model.setCollisionBox(null);
}
Blocks.register(this);
}
public byte getId() {
return this.id;
}
public BlockPhysics getPhysics() {
return this.phys;
}
public void setPhysics(BlockPhysics phys) {
this.phys = phys;
}
public boolean isOpaque() {
return this.opaque;
}
public boolean isSelectable() {
return !this.liquid && this != GRASS && this != AIR && this != BEDROCK && this != DOUBLE_SLAB;
}
public StepSound getStepSound() {
return this.sound;
}
public boolean isLiquid() {
return this.liquid;
}
public int getTickDelay() {
return this.tickDelay;
}
public void setTickDelay(int tickDelay) {
this.tickDelay = tickDelay;
}
public Model getModel() {
return this.model;
}
public boolean isSolid() {
return this != AIR && this != SAPLING && this != WATER && this != STATIONARY_WATER && this != LAVA && this != STATIONARY_LAVA && this != LEAVES && this != GLASS && this != DANDELION && this != ROSE && this != BROWN_MUSHROOM && this != RED_MUSHROOM && this != SLAB;
}
}
| {
"content_hash": "bb1f6a0a7340faf37b852ba81aa1e40c",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 266,
"avg_line_length": 37.01234567901235,
"alnum_prop": 0.6932955303535691,
"repo_name": "good2000mo/OpenClassicAPI",
"id": "30769236e8dd3ed19b64db66a9893c587f3721bd",
"size": "5996",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/ch/spacebase/openclassic/api/block/VanillaBlock.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "359800"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/PORTFOLIO.iml" filepath="$PROJECT_DIR$/.idea/PORTFOLIO.iml" />
</modules>
</component>
</project> | {
"content_hash": "10183f403cf6b935303fb9b3537483e0",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 112,
"avg_line_length": 33.75,
"alnum_prop": 0.662962962962963,
"repo_name": "klebek/Portfolio",
"id": "a6ccaecac5ceef2dcb0450e19ef3c4125b6e0ef5",
"size": "270",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/modules.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3345"
},
{
"name": "HTML",
"bytes": "5079"
},
{
"name": "JavaScript",
"bytes": "12004"
}
],
"symlink_target": ""
} |
"use strict";
const Generator = require("yeoman-generator");
const chalk = require("chalk");
const yosay = require("yosay");
const path = require("path");
const ROOT_DIRECTORY = "project-root";
const APP_NAME = "appname";
const USER = "user";
const EMAIL = "email";
const PORT = "port";
class NExTGenerator extends Generator {
constructor(args, opts) {
super(args, opts);
this.argument("appname", {type: String, required: true});
}
initializing() {
this.log(yosay(
"Welcome to the " + chalk.red("NExT") + " generator!"
));
this.destinationRoot(this.options.appname);
this.log("All files will be generated in the folder: \"" + this.destinationRoot() + "\"");
}
prompting() {
let prompts = [
{
type: "input",
name: USER,
message: "Enter your name",
default: this.user.git.name()
}, {
type: "input",
name: EMAIL,
message: "Enter your E-Mail",
default: this.user.git.email()
}, {
type: "input",
name: PORT,
message: "Enter the port on which the server should run.",
default: 1337
}];
return this.prompt(prompts)
.then(function(responses) {
this.responses = responses;
}.bind(this));
}
configuring() {
this.log("Configuring ...");
this.config.set(this.responses);
this.config.set(APP_NAME, this.options.appname);
}
writing() {
this.log("Writing files ...");
this.fs.copyTpl(
this.templatePath("package.json"),
this.destinationPath("package.json"),
{
name: this.config.get(APP_NAME),
username: this.config.get(USER),
email: this.config.get(EMAIL)
}
);
this.fs.copyTpl(
this.templatePath("gitignore"),
this.destinationPath(".gitignore")
);
this.fs.copyTpl(
this.templatePath("gulpfile.js"),
this.destinationPath("gulpfile.js")
);
this.fs.copyTpl(
this.templatePath("README.md"),
this.destinationPath("README.md"),
{
name: this.config.get(APP_NAME)
}
);
this.fs.copyTpl(
this.templatePath("tsconfig.json"),
this.destinationPath("tsconfig.json")
);
this.fs.copyTpl(
this.templatePath("tslint.json"),
this.destinationPath("tslint.json")
);
this.fs.copyTpl(
this.templatePath("src/server.ts"),
this.destinationPath("src/server.ts"),
{
port: this.config.get(PORT)
}
);
this.fs.copyTpl(
this.templatePath("src/test.ts"),
this.destinationPath("src/test.ts")
);
this.fs.copyTpl(
this.templatePath("test/index.ts"),
this.destinationPath("test/index.ts")
);
}
install() {
this.log("Installing dependencies, this could take a while ...");
this.npmInstall();
}
end() {
this.log("NExT scaffolding was generated");
this.log("Below you'll find some things that are up to you:");
this.log(" - Insert detailed information in package.json, e.g. description of project.");
this.log(" - Replace the demo test functions with actual ones.");
this.log("\nThanks for using the NExt Generator!");
this.log("Feel free to star, fork and create issues on GitHub https://github.com/ommsolutions/generator-next ...");
}
}
module.exports = NExTGenerator;
| {
"content_hash": "712b11730d2e006cfda6e7ea53ed5c56",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 123,
"avg_line_length": 28.992481203007518,
"alnum_prop": 0.5217842323651453,
"repo_name": "ommsolutions/generator-next",
"id": "cd26a46b3cbbd5f570ebecd27541fb5624622dcc",
"size": "3856",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "generators/app/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "13956"
},
{
"name": "TypeScript",
"bytes": "2026"
}
],
"symlink_target": ""
} |
%This script closes the device and clears all Init_ variables
stop(Init_NI);
delete(Init_NI);
daqreset;
clear Init_NI;
clear Init_sampleRate;
clear Init_NID;
clear Init_initialized; | {
"content_hash": "c46c1bfafedc5818d1c2dd92ece6dbc2",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 61,
"avg_line_length": 23.5,
"alnum_prop": 0.7553191489361702,
"repo_name": "jceipek/Mind-Rush",
"id": "eac4f401c93df664d27137fc9271e4f2bf777ff1",
"size": "188",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "old/daq/Cleanup.m",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "15951"
},
{
"name": "Matlab",
"bytes": "266"
},
{
"name": "Objective-C",
"bytes": "2766"
},
{
"name": "Python",
"bytes": "86763"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie ie9" lang="en" class="no-js"> <![endif]-->
<!--[if !(IE)]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
<title>Calendar | KingAdmin - Admin Dashboard</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="KingAdmin - Bootstrap Admin Dashboard Theme">
<meta name="author" content="The Develovers">
<!-- CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="assets/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="assets/css/main.css" rel="stylesheet" type="text/css">
<link href="assets/css/my-custom-styles.css" rel="stylesheet" type="text/css">
<!--[if lte IE 9]>
<link href="assets/css/main-ie.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/main-ie-part2.css" rel="stylesheet" type="text/css"/>
<![endif]-->
<!-- CSS for demo style switcher. you can remove this -->
<link href="demo-style-switcher/assets/css/style-switcher.css" rel="stylesheet" type="text/css">
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/kingadmin-favicon144x144.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/kingadmin-favicon114x114.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/kingadmin-favicon72x72.png">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="assets/ico/kingadmin-favicon57x57.png">
<link rel="shortcut icon" href="assets/ico/favicon.png">
</head>
<body class="fullcalendar">
<!-- WRAPPER -->
<div class="wrapper">
<!-- TOP BAR -->
<div class="top-bar">
<div class="container">
<div class="row">
<!-- logo -->
<div class="col-md-2 logo">
<a href="index.html"><img src="assets/img/kingadmin-logo-white.png" alt="KingAdmin - Admin Dashboard" /></a>
<h1 class="sr-only">KingAdmin Admin Dashboard</h1>
</div>
<!-- end logo -->
<div class="col-md-10">
<div class="row">
<div class="col-md-3">
<!-- search box -->
<div id="tour-searchbox" class="input-group searchbox">
<input type="search" class="form-control" placeholder="enter keyword here...">
<span class="input-group-btn">
<button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
</span>
</div>
<!-- end search box -->
</div>
<div class="col-md-9">
<div class="top-bar-right">
<!-- responsive menu bar icon -->
<a href="#" class="hidden-md hidden-lg main-nav-toggle"><i class="fa fa-bars"></i></a>
<!-- end responsive menu bar icon -->
<button type="button" id="start-tour" class="btn btn-link"><i class="fa fa-refresh"></i> Start Tour</button>
<button type="button" id="global-volume" class="btn btn-link btn-global-volume"><i class="fa"></i></button>
<div class="notifications">
<ul>
<!-- notification: inbox -->
<li class="notification-item inbox">
<div class="btn-group">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-envelope"></i><span class="count">2</span>
<span class="circle"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li class="notification-header">
<em>You have 2 unread messages</em>
</li>
<li class="inbox-item clearfix">
<a href="#">
<div class="media">
<div class="media-left">
<img class="media-object" src="assets/img/user1.png" alt="Antonio">
</div>
<div class="media-body">
<h5 class="media-heading name">Antonius</h5>
<p class="text">The problem just happened this morning. I can't see ...</p>
<span class="timestamp">4 minutes ago</span>
</div>
</div>
</a>
</li>
<li class="inbox-item unread clearfix">
<a href="#">
<div class="media">
<div class="media-left">
<img class="media-object" src="assets/img/user2.png" alt="Antonio">
</div>
<div class="media-body">
<h5 class="media-heading name">Michael</h5>
<p class="text">Hey dude, cool theme!</p>
<span class="timestamp">2 hours ago</span>
</div>
</div>
</a>
</li>
<li class="inbox-item unread clearfix">
<a href="#">
<div class="media">
<div class="media-left">
<img class="media-object" src="assets/img/user3.png" alt="Antonio">
</div>
<div class="media-body">
<h5 class="media-heading name">Stella</h5>
<p class="text">Ok now I can see the status for each item. Thanks! :D</p>
<span class="timestamp">Oct 6</span>
</div>
</div>
</a>
</li>
<li class="inbox-item clearfix">
<a href="#">
<div class="media">
<div class="media-left">
<img class="media-object" src="assets/img/user4.png" alt="Antonio">
</div>
<div class="media-body">
<h5 class="media-heading name">Jane Doe</h5>
<p class="text"><i class="fa fa-reply"></i> Please check the status of your ...</p>
<span class="timestamp">Oct 2</span>
</div>
</div>
</a>
</li>
<li class="inbox-item clearfix">
<a href="#">
<div class="media">
<div class="media-left">
<img class="media-object" src="assets/img/user5.png" alt="Antonio">
</div>
<div class="media-body">
<h5 class="media-heading name">John Simmons</h5>
<p class="text"><i class="fa fa-reply"></i> I've fixed the problem :)</p>
<span class="timestamp">Sep 12</span>
</div>
</div>
</a>
</li>
<li class="notification-footer">
<a href="#">View All Messages</a>
</li>
</ul>
</div>
</li>
<!-- end notification: inbox -->
<!-- notification: general -->
<li class="notification-item general">
<div class="btn-group">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-bell"></i><span class="count">8</span>
<span class="circle"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li class="notification-header">
<em>You have 8 notifications</em>
</li>
<li>
<a href="#">
<i class="fa fa-comment green-font"></i>
<span class="text">New comment on the blog post</span>
<span class="timestamp">1 minute ago</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-user green-font"></i>
<span class="text">New registered user</span>
<span class="timestamp">12 minutes ago</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-comment green-font"></i>
<span class="text">New comment on the blog post</span>
<span class="timestamp">18 minutes ago</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-shopping-cart red-font"></i>
<span class="text">4 new sales order</span>
<span class="timestamp">4 hours ago</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-edit yellow-font"></i>
<span class="text">3 product reviews awaiting moderation</span>
<span class="timestamp">1 day ago</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-comment green-font"></i>
<span class="text">New comment on the blog post</span>
<span class="timestamp">3 days ago</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-comment green-font"></i>
<span class="text">New comment on the blog post</span>
<span class="timestamp">Oct 15</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-warning red-font"></i>
<span class="text red-font">Low disk space!</span>
<span class="timestamp">Oct 11</span>
</a>
</li>
<li class="notification-footer">
<a href="#">View All Notifications</a>
</li>
</ul>
</div>
</li>
<!-- end notification: general -->
</ul>
</div>
<!-- logged user and the menu -->
<div class="logged-user">
<div class="btn-group">
<a href="#" class="btn btn-link dropdown-toggle" data-toggle="dropdown">
<img src="assets/img/user-avatar.png" alt="User Avatar" />
<span class="name">Stacy Rose</span> <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#">
<i class="fa fa-user"></i>
<span class="text">Profile</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-cog"></i>
<span class="text">Settings</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-power-off"></i>
<span class="text">Logout</span>
</a>
</li>
</ul>
</div>
</div>
<!-- end logged user and the menu -->
</div>
<!-- /top-bar-right -->
</div>
</div>
<!-- /row -->
</div>
</div>
<!-- /row -->
</div>
<!-- /container -->
</div>
<!-- /top -->
<!-- BOTTOM: LEFT NAV AND RIGHT MAIN CONTENT -->
<div class="bottom">
<div class="container">
<div class="row">
<!-- left sidebar -->
<div class="col-md-2 left-sidebar">
<!-- main-nav -->
<nav class="main-nav">
<ul class="main-menu">
<li>
<a href="#" class="js-sub-menu-toggle">
<i class="fa fa-dashboard fa-fw"></i><span class="text">Dashboard</span>
<i class="toggle-icon fa fa-angle-left"></i>
</a>
<ul class="sub-menu ">
<li><a href="index.html"><span class="text">Dashboard v1</span></a></li>
<li><a href="index-dashboard-v2.html"><span class="text">Dashboard v2 <span class="badge element-bg-color-blue">New</span></span></a></li>
</ul>
</li>
<li>
<a href="#" class="js-sub-menu-toggle">
<i class="fa fa-clipboard fa-fw"></i><span class="text">Pages</span>
<i class="toggle-icon fa fa-angle-left"></i>
</a>
<ul class="sub-menu ">
<li><a href="page-profile.html"><span class="text">Profile</span></a></li>
<li><a href="page-invoice.html"><span class="text">Invoice</span></a></li>
<li><a href="page-knowledgebase.html"><span class="text">Knowledge Base</span></a></li>
<li><a href="page-inbox.html"><span class="text">Inbox</span></a></li>
<li><a href="page-new-message.html"><span class="text">New Message</span></a></li>
<li><a href="page-view-message.html"><span class="text">View Message</span></a></li>
<li><a href="page-search-result.html"><span class="text">Search Result</span></a></li>
<li><a href="page-submit-ticket.html"><span class="text">Submit Ticket</span></a></li>
<li><a href="page-file-manager.html"><span class="text">File Manager <span class="badge element-bg-color-blue">New</span></span></a></li>
<li><a href="page-projects.html"><span class="text">Projects <span class="badge element-bg-color-blue">New</span></span></a></li>
<li><a href="page-project-detail.html"><span class="text">Project Detail <span class="badge element-bg-color-blue">New</span></span></a></li>
<li><a href="page-faq.html"><span class="text">FAQ <span class="badge element-bg-color-blue">New</span></span></a></li>
<li><a href="page-register.html"><span class="text">Register</span></a></li>
<li><a href="page-login.html"><span class="text">Login</span></a></li>
<li><a href="page-404.html"><span class="text">404</span></a></li>
<li><a href="page-blank.html"><span class="text">Blank Page</span></a></li>
</ul>
</li>
<li>
<a href="#" class="js-sub-menu-toggle">
<i class="fa fa-bar-chart-o fw"></i><span class="text">Charts & Statistics</span>
<i class="toggle-icon fa fa-angle-left"></i>
</a>
<ul class="sub-menu ">
<li><a href="charts-statistics.html"><span class="text">Charts</span></a></li>
<li><a href="charts-statistics-interactive.html"><span class="text">Interactive Charts</span></a></li>
<li><a href="charts-statistics-real-time.html"><span class="text">Realtime Charts</span></a></li>
<li><a href="charts-d3charts.html"><span class="text">D3 Charts</span></a></li>
</ul>
</li>
<li>
<a href="#" class="js-sub-menu-toggle">
<i class="fa fa-edit fw"></i><span class="text">Forms</span>
<i class="toggle-icon fa fa-angle-left"></i>
</a>
<ul class="sub-menu ">
<li><a href="form-inplace-editing.html"><span class="text">In-place Editing</span></a></li>
<li><a href="form-elements.html"><span class="text">Form Elements</span></a></li>
<li><a href="form-layouts.html"><span class="text">Form Layouts</span></a></li>
<li><a href="form-bootstrap-elements.html"><span class="text">Bootstrap Elements</span></a></li>
<li><a href="form-validations.html"><span class="text">Validation</span></a></li>
<li><a href="form-file-upload.html"><span class="text">File Upload</span></a></li>
<li><a href="form-text-editor.html"><span class="text">Text Editor</span></a></li>
</ul>
</li>
<li>
<a href="#" class="js-sub-menu-toggle">
<i class="fa fa-list-alt fw"></i><span class="text">UI Elements</span>
<i class="toggle-icon fa fa-angle-left"></i>
</a>
<ul class="sub-menu ">
<li><a href="ui-elements-general.html"><span class="text">General Elements</span></a></li>
<li><a href="ui-elements-tabs.html"><span class="text">Tabs</span></a></li>
<li><a href="ui-elements-buttons.html"><span class="text">Buttons</span></a></li>
<li><a href="ui-elements-icons.html"><span class="text">Icons <span class="badge element-bg-color-blue">Updated</span></span></a></li>
<li><a href="ui-elements-flash-message.html"><span class="text">Flash Message</span></a></li>
</ul>
</li>
<li>
<a href="widgets.html"><i class="fa fa-puzzle-piece fa-fw"></i><span class="text">Widgets <span class="badge element-bg-color-blue">Updated</span></span></a>
</li>
<li class="active">
<a href="#" class="js-sub-menu-toggle">
<i class="fa fa-gears fw"></i><span class="text">Components</span>
<i class="toggle-icon fa fa-angle-down"></i>
</a>
<ul class="sub-menu open">
<li><a href="components-wizard.html"><span class="text">Wizard (with validation)</span></a></li>
<li class="active"><a href="components-calendar.html"><span class="text">Calendar</span></a></li>
<li><a href="components-maps.html"><span class="text">Maps</span></a></li>
<li><a href="components-gallery.html"><span class="text">Gallery</span></a></li>
<li><a href="components-tree-view.html"><span class="text">Tree View <span class="badge element-bg-color-blue">New</span></span></a></li>
</ul>
</li>
<li>
<a href="#" class="js-sub-menu-toggle">
<i class="fa fa-table fw"></i><span class="text">Tables</span>
<i class="toggle-icon fa fa-angle-left"></i>
</a>
<ul class="sub-menu ">
<li><a href="tables-static-table.html"><span class="text">Static Table</span></a></li>
<li><a href="tables-dynamic-table.html"><span class="text">Dynamic Table</span></a></li>
</ul>
</li>
<li><a href="typography.html"><i class="fa fa-font fa-fw"></i><span class="text">Typography</span></a></li>
<li>
<a href="#" class="js-sub-menu-toggle"><i class="fa fa-bars"></i>
<span class="text">Menu Lvl 1 <span class="badge element-bg-color-blue">New</span></span>
<i class="toggle-icon fa fa-angle-left"></i>
</a>
<ul class="sub-menu">
<li class="">
<a href="#" class="js-sub-menu-toggle">
<span class="text">Menu Lvl 2</span>
<i class="toggle-icon fa fa-angle-left"></i>
</a>
<ul class="sub-menu">
<li><a href="#">Menu Lvl 3</a></li>
<li><a href="#">Menu Lvl 3</a></li>
<li><a href="#">Menu Lvl 3</a></li>
</ul>
</li>
<li>
<a href="#">
<span class="text">Menu Lvl 2</span>
</a>
</li>
</ul>
</li>
</ul>
</nav>
<!-- /main-nav -->
<div class="sidebar-minified js-toggle-minified">
<i class="fa fa-angle-left"></i>
</div>
<!-- sidebar content -->
<div class="sidebar-content">
<div class="panel panel-default">
<div class="panel-heading">
<h5><i class="fa fa-lightbulb-o"></i> Tips</h5>
</div>
<div class="panel-body">
<p>You can do live search to the widget at search box located at top bar. It's very useful if your dashboard is full of widget.</p>
</div>
</div>
<h5 class="label label-default"><i class="fa fa-info-circle"></i> Server Info</h5>
<ul class="list-unstyled list-info-sidebar bottom-30px">
<li class="data-row">
<div class="data-name">Disk Space Usage</div>
<div class="data-value">
274.43 / 2 GB
<div class="progress progress-xs">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" style="width: 10%">
<span class="sr-only">10%</span>
</div>
</div>
</div>
</li>
<li class="data-row">
<div class="data-name">Monthly Bandwidth Transfer</div>
<div class="data-value">
230 / 500 GB
<div class="progress progress-xs">
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="46" aria-valuemin="0" aria-valuemax="100" style="width: 46%">
<span class="sr-only">46%</span>
</div>
</div>
</div>
</li>
<li class="data-row">
<span class="data-name">Database Disk Space</span>
<span class="data-value">219.45 MB</span>
</li>
<li class="data-row">
<span class="data-name">Operating System</span>
<span class="data-value">Linux</span>
</li>
<li class="data-row">
<span class="data-name">Apache Version</span>
<span class="data-value">2.4.6</span>
</li>
<li class="data-row">
<span class="data-name">PHP Version</span>
<span class="data-value">5.3.27</span>
</li>
<li class="data-row">
<span class="data-name">MySQL Version</span>
<span class="data-value">5.5.34-cll</span>
</li>
<li class="data-row">
<span class="data-name">Architecture</span>
<span class="data-value">x86_64</span>
</li>
</ul>
</div>
<!-- end sidebar content -->
</div>
<!-- end left sidebar -->
<!-- top general alert -->
<div class="alert alert-danger top-general-alert">
<span>If you <strong>can't see the logo</strong> on the top left, please reset the style on right style switcher (for upgraded theme only).</span>
<button type="button" class="close">×</button>
</div>
<!-- end top general alert -->
<!-- content-wrapper -->
<div class="col-md-10 content-wrapper">
<div class="row">
<div class="col-lg-4 ">
<ul class="breadcrumb">
<li><i class="fa fa-home"></i><a href="#">Home</a></li>
<li><a href="#">Components</a></li>
<li class="active">Calendar</li>
</ul>
</div>
<div class="col-lg-8 ">
<div class="top-content">
<ul class="list-inline quick-access">
<li>
<a href="charts-statistics-interactive.html">
<div class="quick-access-item bg-color-green">
<i class="fa fa-bar-chart-o"></i>
<h5>CHARTS</h5><em>basic, interactive, real-time</em>
</div>
</a>
</li>
<li>
<a href="page-inbox.html">
<div class="quick-access-item bg-color-blue">
<i class="fa fa-envelope"></i>
<h5>INBOX</h5><em>inbox with gmail style</em>
</div>
</a>
</li>
<li>
<a href="tables-dynamic-table.html">
<div class="quick-access-item bg-color-orange">
<i class="fa fa-table"></i>
<h5>DYNAMIC TABLE</h5><em>tons of features and interactivity</em>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
<!-- main -->
<div class="content">
<div class="main-header">
<h2>Calendar</h2>
<em>event calendar with drag & drop feature</em>
</div>
<div class="main-content">
<!-- WIDGET CALENDAR -->
<div class="widget">
<div class="widget-header">
<h3><i class="fa fa-calendar"></i> Calendar</h3>
</div>
<div class="widget-content">
<!-- external events -->
<div id="external-events">
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Create Quick Event</h3>
</div>
<div class="panel-body">
<input type="text" class="form-control" id="quick-event-name" placeholder="new event title">
<select name="colorpicker-picker-longlist">
<option value="#ac725e">#ac725e</option>
<option value="#d06b64">#d06b64</option>
<option value="#f83a22">#f83a22</option>
<option value="#fa573c">#fa573c</option>
<option value="#ff7537">#ff7537</option>
<option value="#ffad46" selected="selected">#ffad46</option>
<option value="#42d692">#42d692</option>
<option value="#16a765">#16a765</option>
<option value="#7bd148">#7bd148</option>
<option value="#b3dc6c">#b3dc6c</option>
<option value="#fbe983">#fbe983</option>
<option value="#fad165">#fad165</option>
<option value="#92e1c0">#92e1c0</option>
</select>
<button type="button" id="btn-quick-event" class="btn btn-custom-primary btn-block"><i class="fa fa-plus-square"></i> Create</button>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Draggable Events</h3>
</div>
<div class="panel-body">
<div id="event1" class="external-event">Seminar</div>
<div id="event2" class="external-event">Jane's Birthday</div>
<div id="event3" class="external-event">Coffee Break</div>
<div id="event4" class="external-event">Fitness</div>
<div id="event5" class="external-event">Buy Some Foods</div>
<div id="event6" class="external-event">Weekly Meeting</div>
<div id="event7" class="external-event">Monthly Meeting</div>
<br />
<label class="control-inline fancy-checkbox">
<input type="checkbox" id="drop-remove">
<span>Remove event after drop</span>
</label>
</div>
</div>
</div>
</div>
</div>
<!-- end external events -->
<div class="calendar"></div>
</div>
</div>
<!-- END WIDGET CALENDAR -->
</div>
<!-- /main-content -->
</div>
<!-- /main -->
</div>
<!-- /content-wrapper -->
</div>
<!-- /row -->
</div>
<!-- /container -->
</div>
<!-- END BOTTOM: LEFT NAV AND RIGHT MAIN CONTENT -->
</div>
<!-- /wrapper -->
<!-- FOOTER -->
<footer class="footer">
© 2014-2015 The Develovers
</footer>
<!-- END FOOTER -->
<!-- STYLE SWITCHER -->
<div class="del-style-switcher">
<div class="del-switcher-toggle toggle-hide"></div>
<form>
<section class="del-section del-section-skin">
<h5 class="del-switcher-header">Choose Skins:</h5>
<ul>
<li><a href="#" title="Slate Gray" class="switch-skin slategray" data-skin="assets/css/skins/slategray.css">Slate Gray</a></li>
<li><a href="#" title="Dark Blue" class="switch-skin darkblue" data-skin="assets/css/skins/darkblue.css">Dark Blue</a></li>
<li><a href="#" title="Dark Brown" class="switch-skin darkbrown" data-skin="assets/css/skins/darkbrown.css">Dark Brown</a></li>
<li><a href="#" title="Light Green" class="switch-skin lightgreen" data-skin="assets/css/skins/lightgreen.css">Light Green</a></li>
<li><a href="#" title="Orange" class="switch-skin orange" data-skin="assets/css/skins/orange.css">Orange</a></li>
<li><a href="#" title="Red" class="switch-skin red" data-skin="assets/css/skins/red.css">Red</a></li>
<li><a href="#" title="Teal" class="switch-skin teal" data-skin="assets/css/skins/teal.css">Teal</a></li>
<li><a href="#" title="Yellow" class="switch-skin yellow" data-skin="assets/css/skins/yellow.css">Yellow</a></li>
</ul>
<button type="button" class="switch-skin-full fulldark" data-skin="assets/css/skins/fulldark.css">Full Dark</button>
<button type="button" class="switch-skin-full fullbright" data-skin="assets/css/skins/fullbright.css">Full Bright</button>
</section>
<label class="fancy-checkbox"><input type="checkbox" id="fixed-top-nav"><span>Fixed Top Navigation</span></label>
<p><a href="#" title="Reset Style" class="del-reset-style">Reset Style</a></p>
</form>
</div>
<!-- END STYLE SWITCHER -->
<!-- Javascript -->
<script src="assets/js/jquery/jquery-2.1.0.min.js"></script>
<script src="assets/js/bootstrap/bootstrap.min.js"></script>
<script src="assets/js/plugins/modernizr/modernizr.js"></script>
<script src="assets/js/plugins/bootstrap-tour/bootstrap-tour.custom.js"></script>
<script src="assets/js/king-common.js"></script>
<script src="demo-style-switcher/assets/js/deliswitch.js"></script>
<script src="assets/js/jquery-ui/jquery-ui-1.10.4.custom.min.js"></script>
<script src="assets/js/plugins/fullcalendar/fullcalendar.min.js"></script>
<script src="assets/js/plugins/jquery-simplecolorpicker/jquery.simplecolorpicker.js"></script>
<script src="assets/js/king-components.js"></script>
</body>
</html>
| {
"content_hash": "bbcbe29ec961100404b93a68d2571d1e",
"timestamp": "",
"source": "github",
"line_count": 677,
"max_line_length": 166,
"avg_line_length": 42.74889217134417,
"alnum_prop": 0.5164299782315745,
"repo_name": "project-store/theme",
"id": "e1bf13fc1d809a545f8657b1c1ec8c36ace41899",
"size": "28941",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/kingadmin/components-calendar.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "27940912"
},
{
"name": "CoffeeScript",
"bytes": "16726"
},
{
"name": "HTML",
"bytes": "231766282"
},
{
"name": "JavaScript",
"bytes": "81504306"
},
{
"name": "PHP",
"bytes": "417111"
},
{
"name": "Ruby",
"bytes": "902"
},
{
"name": "Shell",
"bytes": "616"
}
],
"symlink_target": ""
} |
from datetime import datetime
import pprint
# copied from process.py
import os, sys, subprocess
# os.environ['DJANGO_SETTINGS_MODULE'] = 'dj.settings'
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj.settings")
sys.path.insert(0, '..' )
from django.conf import settings
import django
django.setup()
import socket
from main.models import Show # , Episode
fnames=[]
test_filename = 'tests.txt'
if os.path.exists(test_filename):
call_list = open(test_filename).read().split('\n')
else:
call_list = []
def callme_maybe(f):
# if the function name is on the list, call it.
# good way to disable it in the file is to # it, then "foo" not in ["# foo"]
name = f.__name__
# for when there is no list, create it.
if name not in fnames: fnames.append(name)
# if the name is on the list, call it.
if name in call_list:
print "running %s..." % name
return f
else:
def skip(*args,**kwargs):
# print "skipping %s" % name
return "skipped"
return skip
class Run_Tests(object):
def run_cmd(self, cmd, get_out=False):
log_text = ' '.join(cmd)
# print log_text
open(self.sh_pathname,'a').write(log_text+'\n')
if get_out:
p = subprocess.Popen(cmd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,stderr=subprocess.PIPE)
sout, serr = p.communicate()
ret = dict( sout=sout, serr=serr, returncode=p.returncode)
else:
p = subprocess.Popen(cmd)
p.wait()
ret = dict( returncode=p.returncode)
if ret['returncode']:
ret['command'] = cmd
print "command returned", ret
print "cmd:", cmd
return ret
@callme_maybe
def make_test_user(self):
from django.contrib.auth.models import User
users=User.objects.all()
if not users:
user = User.objects.create_user( 'test', 'a@b.com', 'abc' )
user.is_superuser=True
user.is_staff=True
user.save()
print user
return
# @callme_maybe
# always do this, cuz of self.episode=
def setup_test_data(self):
# make sample data: location, client, show, episode
from main.views import make_test_data, del_test_data
del_test_data()
t=datetime(2010,5,21,0,0,4)
self.episode=make_test_data(self.title, start_time = t)
return
# @callme_maybe
def make_dirs(self):
# create dirs for video files
import mkdirs
p=mkdirs.mkdirs()
p.main()
# hack to save some of these values for other tests
self.show_dir = p.show_dir
self.show=Show.objects.get(slug=p.options.show)
self.options = p.options
self.sh_pathname = os.path.join(
self.show_dir, 'tmp', "%s.sh" % (self.slug) )
return
@callme_maybe
def make_source_dvs(self):
"""
` Make a set of .dv files.
Similar to what dvswitch creates (dir/filename date/time.dv)
This takes the place of using dvswitch to record an event.
be sure the 2010-05-21 date
matches start_date in make_sample_data above.
"""
# get melt version to stick into video
melt_outs = self.run_cmd(['melt', '--version'], True )
melt_ver = melt_outs['serr'].split('\n')[0]
print melt_ver
dv_dir = self.show_dir + '/dv/test_loc/2010-05-21'
if not os.path.exists(dv_dir): os.makedirs(dv_dir)
# MELT_PARMS="-attach lines width=80 num=1 -attach lines width=2 num=10"
text_file="source.txt"
for i in range(5):
# each file is 3 seconds long
# encode the text file into .dv
out_file="00_00_%02i.dv" % (i*3)
frames = 90
parms={'input_file':text_file,
'output_file':os.path.join(dv_dir,out_file),
# 'format':self.options.dv_format,
'format':"dv_ntsc_wide",
'video_frames':frames,
'audio_frames':frames}
if i%2:
parms['audio-track'] = "-producer noise"
parms['bgcolour'] = "red"
else:
parms['audio-track'] = "static/goforward.wav"
parms['bgcolour'] = "blue"
print parms
# make a text file to use as encoder input
text = ["test %s - %s" % ( i, self.options.dv_format),
out_file,
melt_ver, datetime.now().ctime(),
'',
socket.gethostname()
]
print text
tf = open(text_file,'w')
tf.write('\n'.join(text))
tf.close()
cmd = "melt \
-profile %(format)s \
-audio-track %(audio-track)s out=%(audio_frames)s \
-video-track %(input_file)s bgcolour=%(bgcolour)s out=%(video_frames)s \
meta.attr.titles=1 \
meta.attr.titles.markup=#timecode# \
-attach data_show dynamic=1 \
-consumer avformat:%(output_file)s \
pix_fmt=yuv411p" % parms
self.run_cmd(cmd.split())
return
@callme_maybe
def make_source_footer(self):
"""
` make a footer.png
via a convoluted process, which has a side effect of more testing
the process:
create 1 line source.txt: ABCDEFG
convert to 1 frame dv
convert that frame to footer.png
"""
# dv_dir = os.path.join(self.show_dir,'dv', 'test_loc','2010-05-21')
tmp_dir = os.path.join(self.show_dir, 'tmp')
bling_dir = os.path.join(self.show_dir, 'bling')
text_file = os.path.join(tmp_dir, "source.txt")
dv_file = os.path.join(tmp_dir,"footer.dv")
parms={'input_file':text_file,
'dv_file':dv_file,
'text_file':text_file,
'bling_dir':bling_dir,
'format':self.options.dv_format,
'video_frames':1,
'audio_frames':1 }
print parms
# make a text file to use as encoder input
text = ["ABCDEFG", ]
tf = open(text_file,'w')
tf.write('\n'.join(text))
tf.close()
# create dv file from text and generated noise
cmd = "melt \
-profile %(format)s \
-audio-track -producer noise out=%(audio_frames)s \
-video-track %(input_file)s out=%(video_frames)s \
-consumer avformat:%(dv_file)s \
pix_fmt=yuv411p" % parms
self.run_cmd(cmd.split())
# grab a frame
# make_test_data does:
# client.credits="00000001.png"
cmd = "mplayer \
-frames 1 \
-ao null \
-vo png:outdir=%(bling_dir)s \
%(dv_file)s" % parms
self.run_cmd(cmd.split())
# "00000001.png"
return
@callme_maybe
def add_dv(self):
# add the dv files to the db
import adddv
p=adddv.add_dv()
p.main()
import tsdv
p=tsdv.ts_rf()
p.main()
return
@callme_maybe
def make_thumbs(self):
# make thumbnails and preview ogv
import mkthumbs
p=mkthumbs.add_dv()
p.main()
import dv2ogv
p=dv2ogv.mkpreview()
p.main()
return
@callme_maybe
def make_cut_list(self):
# make cut list
# this should associate clips2,3,4 with the test episode
# from main.views import mk_cuts
# cuts = mk_cuts(episode)
print "assing dv..."
import assocdv
p=assocdv.ass_dv()
p.main()
print p.cuts
cut=p.cuts[1]
# cut=cuts[1]
print cut
# cut.start="0:0:1"
# cut.end="0:0:10"
# cut.apply=False
# cut.save()
return
@callme_maybe
def encode(self):
# encode the test episode
# create a title, use clips 2,3,4 as source, maybe a credits trailer
import enc
p=enc.enc()
p.set_options(
upload_formats=self.upload_formats,
rm_temp=False, debug_log=False)
p.main()
self.episode = p.episode
return
@callme_maybe
def ck_errors(self):
# check for encoding errors
# python ck_invalid.py -v --client test_client --show test_show --push
import ck_invalid
p=ck_invalid.ckbroke()
p.main()
return
@callme_maybe
def play_vid(self):
# show the user what was made
# todo: (speed up, we don't have all day)
import play_vids
p=play_vids.play_vids()
p.main()
@callme_maybe
def post_blip(self):
# post it to blip test account (password is in pw.py)
import post_blip as post
p=post.post()
p.set_options(
upload_formats=self.upload_formats,
debug_log=True,
)
p.main()
# post.py does: self.last_url = post_url.text
# self.run_cmd(["firefox",p.last_url])
return p.las
@callme_maybe
def push(self):
# rsync to data center box
import push
p=push.push()
p.set_options(
upload_formats=self.upload_formats,
)
p.main()
ret = p.ret
return ret
@callme_maybe
def mk_audio_png(self):
import mk_audio_png
p=mk_audio_png.mk_audio_png()
p.set_options(
cloud_user='testact',
upload_formats=self.upload_formats,
)
p.main()
ret = p.ret
return ret
@callme_maybe
def post_yt(self):
# post it to youtube test account (password is in pw.py)
import post_yt as post
p=post.post()
p.set_options(
upload_formats=self.upload_formats,
debug_log=True,
)
p.private=True
p.main()
# post.py does: self.last_url = post_url.text
# print p.last_url
# self.run_cmd(["firefox",p.last_url])
return p.last_url
@callme_maybe
def add_to_richard(self):
# add the test to pyvideo.org:9000 test instance
import add_to_richard
p=add_to_richard.add_to_richard()
p.set_options(
upload_formats=self.upload_formats,
)
p.private=True
p.main()
ret = p.pvo_url
return ret
@callme_maybe
def email_url(self):
# add the test to pyvideo.org:9000 test instance
import email_url
p=email_url.email_url()
ret = p.main()
return ret
@callme_maybe
def tweet(self):
# tell the world (test account)
import tweet
p=tweet.tweet()
p.main()
tweet_url = "http://twitter.com/#!/squid/status/%s" % (p.last_tweet["id"],)
return tweet_url
@callme_maybe
def csv(self):
# make csv and other data files
import mkcvs
p=mkcvs.csv()
p.main()
return
@callme_maybe
def ocr_test(self):
# ocr an output file, check for ABCDEFG
tmp_dir = os.path.join("/tmp/veyepar_test/")
if not os.path.exists(tmp_dir): os.makedirs(tmp_dir)
ext = self.upload_formats[0]
filename = os.path.join(
self.show_dir, ext, "%s.%s" % (self.episode.slug,ext) )
parms = {
"tmp_dir":tmp_dir,
'filename':filename,
}
cmd = "mplayer \
-ss 12 \
-vf framestep=20 \
-ao null \
-vo pnm:outdir=%(tmp_dir)s \
%(filename)s" % parms
print cmd
self.run_cmd(cmd.split())
test_file = os.path.join(tmp_dir, "00000006.ppm" )
gocr_outs = self.run_cmd(['gocr', test_file], True )
text = gocr_outs['sout']
print text
# not sure what is tacking on the \n, but it is there, so it is here.
result = (text in ["ABCDEFG\n","_BCDEFG\n"])
return result
@callme_maybe
def sphinx_test(self):
# sphinx transcribe an output file, check for GO FORWARD TEN METERS
# someday this will wget the m4v from blip to see what they made
ext = self.upload_formats[0]
filename = os.path.join(self.show_dir, ext, "%s.%s" % (self.episode.slug,ext) )
tmp_dir = os.path.join("/tmp/veyepar_test/")
if not os.path.exists(tmp_dir): os.makedirs(tmp_dir)
wav_file = os.path.join(tmp_dir,'test.wav')
raw_file = os.path.join(tmp_dir,'test.16k')
ctl_file = os.path.join(tmp_dir,'test.ctl')
parms = {
'filename':filename,
"wav_file":wav_file,
"raw_file":raw_file,
}
cmd = "melt %(filename)s in=92 out=178 -consumer avformat:%(wav_file)s" % parms
self.run_cmd(cmd.split())
cmd = "sox %(filename)s -b 16 -r 16k -e signed -c 1 -t raw %(raw_file)s" % parms
self.run_cmd(cmd.split())
# open(ctl_file,'w').write(raw_file)
open(ctl_file,'w').write('test')
parms = {
'HMM':'/usr/share/sphinx2/model/hmm/6k',
'TURT':'/usr/share/sphinx2/model/lm/turtle',
'TASK':tmp_dir,
"ctl_file":ctl_file,
}
cmd = """sphinx2-continuous -verbose 9 -adcin TRUE -adcext 16k -ctlfn %(ctl_file)s -ctloffset 0 -ctlcount 100000000 -datadir %(TASK)s -agcmax TRUE -langwt 6.5 -fwdflatlw 8.5 -rescorelw 9.5 -ugwt 0.5 -fillpen 1e-10 -silpen 0.005 -inspen 0.65 -top 1 -topsenfrm 3 -topsenthresh -70000 -beam 2e-06 -npbeam 2e-06 -lpbeam 2e-05 -lponlybeam 0.0005 -nwbeam 0.0005 -fwdflat FALSE -fwdflatbeam 1e-08 -fwdflatnwbeam 0.0003 -bestpath TRUE -kbdumpdir %(TASK)s -lmfn %(TURT)s/turtle.lm -dictfn %(TURT)s/turtle.dic -ndictfn %(HMM)s/noisedict -phnfn %(HMM)s/phone -mapfn %(HMM)s/map -hmmdir %(HMM)s -hmmdirlist %(HMM)s -8bsen TRUE -sendumpfn %(HMM)s/sendump -cbdir %(HMM)s """ % parms
# print cmd
sphinx_outs = self.run_cmd(cmd.split(),True)
text = sphinx_outs['serr']
# print text
for line in text.split('\n'):
if "BESTPATH" in line:
words = line.split()
print words
text = words[3:-2]
result = ( text == ['GO', 'FORWARD', 'TEN', 'METERS'] )
return result
@callme_maybe
def size_test(self):
sizes = {
'ogv':602392,
'mp4':1636263,
'webm':311874,
}
ret = True
for ext in self.upload_formats:
expected_size = sizes[ext]
fullpathname = os.path.join( self.show_dir, ext,
"%s.%s" % (self.episode.slug, ext))
st = os.stat(fullpathname)
actual_size=st.st_size
delta = expected_size - actual_size
# is it off by more than some %
tolerance = 2
err = abs(delta * 100 / expected_size )
if err > tolerance or self.options.verbose:
ret = False
print ext
print "expectected: %15d" % expected_size
print "actual: %15d" % actual_size
print "delta: %15d" % delta
print "error: %15d%%" % err
return ret
def main():
result={}
t=Run_Tests()
t.upload_formats=["webm",]
# t.upload_formats=["webm", "mp4",]
# t.upload_formats=["flac",]
t.title = "Let's make a Test"
t.slug = "Lets_make_a_Test"
t.make_test_user()
t.setup_test_data()
t.make_dirs() # don't skip this, it sets self.show_dir and stuff
t.make_source_dvs()
t.make_source_footer()
t.add_dv()
# t.make_thumbs() ## this jackes up gstreamer1.0 things, like mk_audio
t.make_cut_list()
## test missing dv files
# os.remove('/home/carl/Videos/veyepar/test_client/test_show/dv/test_loc/2010-05-21/00_00_03.dv')
t.encode()
# t.ck_errors() ## jacks gstreamer1.0 things...
t.play_vid()
result['push'] = t.push()
result['mk_audio_png'] = t.mk_audio_png()
result['url'] = t.post_yt()
result['richard'] = t.add_to_richard()
result['email'] = t.email_url()
result['tweet'] = t.tweet()
t.csv()
result['video'] = t.ocr_test()
# result['audio'] = t.sphinx_test() # sphinx no longer packaged :(
result['sizes'] = t.size_test()
print
print 'test results',
pprint.pprint(result)
if not os.path.exists(test_filename):
print '\n'.join(fnames)
open(test_filename,'w').write('\n'.join(fnames))
if __name__=='__main__':
main()
| {
"content_hash": "d24b75a849cc2c1fede7fffe9db33607",
"timestamp": "",
"source": "github",
"line_count": 569,
"max_line_length": 670,
"avg_line_length": 26.244288224956062,
"alnum_prop": 0.6016875376682516,
"repo_name": "EricSchles/veyepar",
"id": "8a6062cd5127365fe7251184c300236f9bf56f4f",
"size": "14952",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dj/scripts/run_tests.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1772"
},
{
"name": "HTML",
"bytes": "73422"
},
{
"name": "JavaScript",
"bytes": "38788"
},
{
"name": "Python",
"bytes": "619994"
},
{
"name": "Ruby",
"bytes": "7581"
},
{
"name": "Shell",
"bytes": "80531"
}
],
"symlink_target": ""
} |
#include "postgres.h"
#include "fmgr.h"
#include "utils/builtins.h"
#include "utils/uuid.h"
/* for ntohl/htonl */
#include <netinet/in.h>
#include <arpa/inet.h>
/*
* It's possible that there's more than one uuid.h header file present.
* We expect configure to set the HAVE_ symbol for only the one we want.
*
* BSD includes a uuid_hash() function that conflicts with the one in
* builtins.h; we #define it out of the way.
*/
#define uuid_hash bsd_uuid_hash
#if defined(HAVE_UUID_H)
#include <uuid.h>
#elif defined(HAVE_OSSP_UUID_H)
#include <ossp/uuid.h>
#elif defined(HAVE_UUID_UUID_H)
#include <uuid/uuid.h>
#else
#error "please use configure's --with-uuid switch to select a UUID library"
#endif
#undef uuid_hash
/*
* Some BSD variants offer md5 and sha1 implementations but Linux does not,
* so we use a copy of the ones from pgcrypto. Not needed with OSSP, though.
*/
#ifndef HAVE_UUID_OSSP
#include "md5.h"
#include "sha1.h"
#endif
/* Check our UUID length against OSSP's; better both be 16 */
#if defined(HAVE_UUID_OSSP) && (UUID_LEN != UUID_LEN_BIN)
#error UUID length mismatch
#endif
/* Define some constants like OSSP's, to make the code more readable */
#ifndef HAVE_UUID_OSSP
#define UUID_MAKE_MC 0
#define UUID_MAKE_V1 1
#define UUID_MAKE_V2 2
#define UUID_MAKE_V3 3
#define UUID_MAKE_V4 4
#define UUID_MAKE_V5 5
#endif
/*
* A DCE 1.1 compatible source representation of UUIDs, derived from
* the BSD implementation. BSD already has this; OSSP doesn't need it.
*/
#ifdef HAVE_UUID_E2FS
typedef struct
{
uint32_t time_low;
uint16_t time_mid;
uint16_t time_hi_and_version;
uint8_t clock_seq_hi_and_reserved;
uint8_t clock_seq_low;
uint8_t node[6];
} dce_uuid_t;
#else
#define dce_uuid_t uuid_t
#endif
/* If not OSSP, we need some endianness-manipulation macros */
#ifndef HAVE_UUID_OSSP
#define UUID_TO_NETWORK(uu) \
do { \
uu.time_low = htonl(uu.time_low); \
uu.time_mid = htons(uu.time_mid); \
uu.time_hi_and_version = htons(uu.time_hi_and_version); \
} while (0)
#define UUID_TO_LOCAL(uu) \
do { \
uu.time_low = ntohl(uu.time_low); \
uu.time_mid = ntohs(uu.time_mid); \
uu.time_hi_and_version = ntohs(uu.time_hi_and_version); \
} while (0)
#define UUID_V3_OR_V5(uu, v) \
do { \
uu.time_hi_and_version &= 0x0FFF; \
uu.time_hi_and_version |= (v << 12); \
uu.clock_seq_hi_and_reserved &= 0x3F; \
uu.clock_seq_hi_and_reserved |= 0x80; \
} while(0)
#endif /* !HAVE_UUID_OSSP */
PG_MODULE_MAGIC;
PG_FUNCTION_INFO_V1(uuid_nil);
PG_FUNCTION_INFO_V1(uuid_ns_dns);
PG_FUNCTION_INFO_V1(uuid_ns_url);
PG_FUNCTION_INFO_V1(uuid_ns_oid);
PG_FUNCTION_INFO_V1(uuid_ns_x500);
PG_FUNCTION_INFO_V1(uuid_generate_v1);
PG_FUNCTION_INFO_V1(uuid_generate_v1mc);
PG_FUNCTION_INFO_V1(uuid_generate_v3);
PG_FUNCTION_INFO_V1(uuid_generate_v4);
PG_FUNCTION_INFO_V1(uuid_generate_v5);
#ifdef HAVE_UUID_OSSP
static void
pguuid_complain(uuid_rc_t rc)
{
char *err = uuid_error(rc);
if (err != NULL)
ereport(ERROR,
(errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
errmsg("OSSP uuid library failure: %s", err)));
else
ereport(ERROR,
(errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
errmsg("OSSP uuid library failure: error code %d", rc)));
}
/*
* We create a uuid_t object just once per session and re-use it for all
* operations in this module. OSSP UUID caches the system MAC address and
* other state in this object. Reusing the object has a number of benefits:
* saving the cycles needed to fetch the system MAC address over and over,
* reducing the amount of entropy we draw from /dev/urandom, and providing a
* positive guarantee that successive generated V1-style UUIDs don't collide.
* (On a machine fast enough to generate multiple UUIDs per microsecond,
* or whatever the system's wall-clock resolution is, we'd otherwise risk
* collisions whenever random initialization of the uuid_t's clock sequence
* value chanced to produce duplicates.)
*
* However: when we're doing V3 or V5 UUID creation, uuid_make needs two
* uuid_t objects, one holding the namespace UUID and one for the result.
* It's unspecified whether it's safe to use the same uuid_t for both cases,
* so let's cache a second uuid_t for use as the namespace holder object.
*/
static uuid_t *
get_cached_uuid_t(int which)
{
static uuid_t *cached_uuid[2] = {NULL, NULL};
if (cached_uuid[which] == NULL)
{
uuid_rc_t rc;
rc = uuid_create(&cached_uuid[which]);
if (rc != UUID_RC_OK)
{
cached_uuid[which] = NULL;
pguuid_complain(rc);
}
}
return cached_uuid[which];
}
static char *
uuid_to_string(const uuid_t *uuid)
{
char *buf = palloc(UUID_LEN_STR + 1);
void *ptr = buf;
size_t len = UUID_LEN_STR + 1;
uuid_rc_t rc;
rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
if (rc != UUID_RC_OK)
pguuid_complain(rc);
return buf;
}
static void
string_to_uuid(const char *str, uuid_t *uuid)
{
uuid_rc_t rc;
rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
if (rc != UUID_RC_OK)
pguuid_complain(rc);
}
static Datum
special_uuid_value(const char *name)
{
uuid_t *uuid = get_cached_uuid_t(0);
char *str;
uuid_rc_t rc;
rc = uuid_load(uuid, name);
if (rc != UUID_RC_OK)
pguuid_complain(rc);
str = uuid_to_string(uuid);
return DirectFunctionCall1(uuid_in, CStringGetDatum(str));
}
/* len is unused with OSSP, but we want to have the same number of args */
static Datum
uuid_generate_internal(int mode, const uuid_t *ns, const char *name, int len)
{
uuid_t *uuid = get_cached_uuid_t(0);
char *str;
uuid_rc_t rc;
rc = uuid_make(uuid, mode, ns, name);
if (rc != UUID_RC_OK)
pguuid_complain(rc);
str = uuid_to_string(uuid);
return DirectFunctionCall1(uuid_in, CStringGetDatum(str));
}
static Datum
uuid_generate_v35_internal(int mode, pg_uuid_t *ns, text *name)
{
uuid_t *ns_uuid = get_cached_uuid_t(1);
string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out,
UUIDPGetDatum(ns))),
ns_uuid);
return uuid_generate_internal(mode,
ns_uuid,
text_to_cstring(name),
0);
}
#else /* !HAVE_UUID_OSSP */
static Datum
uuid_generate_internal(int v, unsigned char *ns, char *ptr, int len)
{
char strbuf[40];
switch (v)
{
case 0: /* constant-value uuids */
strlcpy(strbuf, ptr, 37);
break;
case 1: /* time/node-based uuids */
{
#ifdef HAVE_UUID_E2FS
uuid_t uu;
uuid_generate_time(uu);
uuid_unparse(uu, strbuf);
/*
* PTR, if set, replaces the trailing characters of the uuid;
* this is to support v1mc, where a random multicast MAC is
* used instead of the physical one
*/
if (ptr && len <= 36)
strcpy(strbuf + (36 - len), ptr);
#else /* BSD */
uuid_t uu;
uint32_t status = uuid_s_ok;
char *str = NULL;
uuid_create(&uu, &status);
if (status == uuid_s_ok)
{
uuid_to_string(&uu, &str, &status);
if (status == uuid_s_ok)
{
strlcpy(strbuf, str, 37);
/*
* PTR, if set, replaces the trailing characters of
* the uuid; this is to support v1mc, where a random
* multicast MAC is used instead of the physical one
*/
if (ptr && len <= 36)
strcpy(strbuf + (36 - len), ptr);
}
if (str)
free(str);
}
if (status != uuid_s_ok)
ereport(ERROR,
(errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
errmsg("uuid library failure: %d",
(int) status)));
#endif
break;
}
case 3: /* namespace-based MD5 uuids */
case 5: /* namespace-based SHA1 uuids */
{
dce_uuid_t uu;
#ifdef HAVE_UUID_BSD
uint32_t status = uuid_s_ok;
char *str = NULL;
#endif
if (v == 3)
{
MD5_CTX ctx;
MD5Init(&ctx);
MD5Update(&ctx, ns, sizeof(uu));
MD5Update(&ctx, (unsigned char *) ptr, len);
/* we assume sizeof MD5 result is 16, same as UUID size */
MD5Final((unsigned char *) &uu, &ctx);
}
else
{
SHA1_CTX ctx;
unsigned char sha1result[SHA1_RESULTLEN];
SHA1Init(&ctx);
SHA1Update(&ctx, ns, sizeof(uu));
SHA1Update(&ctx, (unsigned char *) ptr, len);
SHA1Final(sha1result, &ctx);
memcpy(&uu, sha1result, sizeof(uu));
}
/* the calculated hash is using local order */
UUID_TO_NETWORK(uu);
UUID_V3_OR_V5(uu, v);
#ifdef HAVE_UUID_E2FS
/* uuid_unparse expects local order */
UUID_TO_LOCAL(uu);
uuid_unparse((unsigned char *) &uu, strbuf);
#else /* BSD */
uuid_to_string(&uu, &str, &status);
if (status == uuid_s_ok)
strlcpy(strbuf, str, 37);
if (str)
free(str);
if (status != uuid_s_ok)
ereport(ERROR,
(errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
errmsg("uuid library failure: %d",
(int) status)));
#endif
break;
}
case 4: /* random uuid */
default:
{
#ifdef HAVE_UUID_E2FS
uuid_t uu;
uuid_generate_random(uu);
uuid_unparse(uu, strbuf);
#else /* BSD */
snprintf(strbuf, sizeof(strbuf),
"%08lx-%04x-%04x-%04x-%04x%08lx",
(unsigned long) arc4random(),
(unsigned) (arc4random() & 0xffff),
(unsigned) ((arc4random() & 0xfff) | 0x4000),
(unsigned) ((arc4random() & 0x3fff) | 0x8000),
(unsigned) (arc4random() & 0xffff),
(unsigned long) arc4random());
#endif
break;
}
}
return DirectFunctionCall1(uuid_in, CStringGetDatum(strbuf));
}
#endif /* HAVE_UUID_OSSP */
Datum
uuid_nil(PG_FUNCTION_ARGS)
{
#ifdef HAVE_UUID_OSSP
return special_uuid_value("nil");
#else
return uuid_generate_internal(0, NULL,
"00000000-0000-0000-0000-000000000000", 36);
#endif
}
Datum
uuid_ns_dns(PG_FUNCTION_ARGS)
{
#ifdef HAVE_UUID_OSSP
return special_uuid_value("ns:DNS");
#else
return uuid_generate_internal(0, NULL,
"6ba7b810-9dad-11d1-80b4-00c04fd430c8", 36);
#endif
}
Datum
uuid_ns_url(PG_FUNCTION_ARGS)
{
#ifdef HAVE_UUID_OSSP
return special_uuid_value("ns:URL");
#else
return uuid_generate_internal(0, NULL,
"6ba7b811-9dad-11d1-80b4-00c04fd430c8", 36);
#endif
}
Datum
uuid_ns_oid(PG_FUNCTION_ARGS)
{
#ifdef HAVE_UUID_OSSP
return special_uuid_value("ns:OID");
#else
return uuid_generate_internal(0, NULL,
"6ba7b812-9dad-11d1-80b4-00c04fd430c8", 36);
#endif
}
Datum
uuid_ns_x500(PG_FUNCTION_ARGS)
{
#ifdef HAVE_UUID_OSSP
return special_uuid_value("ns:X500");
#else
return uuid_generate_internal(0, NULL,
"6ba7b814-9dad-11d1-80b4-00c04fd430c8", 36);
#endif
}
Datum
uuid_generate_v1(PG_FUNCTION_ARGS)
{
return uuid_generate_internal(UUID_MAKE_V1, NULL, NULL, 0);
}
Datum
uuid_generate_v1mc(PG_FUNCTION_ARGS)
{
#ifdef HAVE_UUID_OSSP
char *buf = NULL;
#elif defined(HAVE_UUID_E2FS)
char strbuf[40];
char *buf;
uuid_t uu;
uuid_generate_random(uu);
/* set IEEE802 multicast and local-admin bits */
((dce_uuid_t *) &uu)->node[0] |= 0x03;
uuid_unparse(uu, strbuf);
buf = strbuf + 24;
#else /* BSD */
char buf[16];
/* set IEEE802 multicast and local-admin bits */
snprintf(buf, sizeof(buf), "-%04x%08lx",
(unsigned) ((arc4random() & 0xffff) | 0x0300),
(unsigned long) arc4random());
#endif
return uuid_generate_internal(UUID_MAKE_V1 | UUID_MAKE_MC, NULL,
buf, 13);
}
Datum
uuid_generate_v3(PG_FUNCTION_ARGS)
{
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
#ifdef HAVE_UUID_OSSP
return uuid_generate_v35_internal(UUID_MAKE_V3, ns, name);
#else
return uuid_generate_internal(UUID_MAKE_V3, (unsigned char *) ns,
VARDATA(name), VARSIZE(name) - VARHDRSZ);
#endif
}
Datum
uuid_generate_v4(PG_FUNCTION_ARGS)
{
return uuid_generate_internal(UUID_MAKE_V4, NULL, NULL, 0);
}
Datum
uuid_generate_v5(PG_FUNCTION_ARGS)
{
pg_uuid_t *ns = PG_GETARG_UUID_P(0);
text *name = PG_GETARG_TEXT_P(1);
#ifdef HAVE_UUID_OSSP
return uuid_generate_v35_internal(UUID_MAKE_V5, ns, name);
#else
return uuid_generate_internal(UUID_MAKE_V5, (unsigned char *) ns,
VARDATA(name), VARSIZE(name) - VARHDRSZ);
#endif
}
| {
"content_hash": "e563abcd6b53561697caa1ef5951285a",
"timestamp": "",
"source": "github",
"line_count": 525,
"max_line_length": 77,
"avg_line_length": 22.895238095238096,
"alnum_prop": 0.6505823627287853,
"repo_name": "ashwinstar/gpdb",
"id": "fca39d79378fffc03f2fa3df78593ec23f14f868",
"size": "12402",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "contrib/uuid-ossp/uuid-ossp.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "3724"
},
{
"name": "Awk",
"bytes": "836"
},
{
"name": "Batchfile",
"bytes": "12768"
},
{
"name": "C",
"bytes": "42705726"
},
{
"name": "C++",
"bytes": "2839973"
},
{
"name": "CMake",
"bytes": "3425"
},
{
"name": "CSS",
"bytes": "7407"
},
{
"name": "Csound Score",
"bytes": "223"
},
{
"name": "DTrace",
"bytes": "3873"
},
{
"name": "Dockerfile",
"bytes": "11990"
},
{
"name": "Emacs Lisp",
"bytes": "3488"
},
{
"name": "Fortran",
"bytes": "14863"
},
{
"name": "GDB",
"bytes": "576"
},
{
"name": "Gherkin",
"bytes": "342783"
},
{
"name": "HTML",
"bytes": "653351"
},
{
"name": "JavaScript",
"bytes": "23969"
},
{
"name": "Lex",
"bytes": "229553"
},
{
"name": "M4",
"bytes": "114378"
},
{
"name": "Makefile",
"bytes": "455445"
},
{
"name": "Objective-C",
"bytes": "38376"
},
{
"name": "PLSQL",
"bytes": "160856"
},
{
"name": "PLpgSQL",
"bytes": "5722287"
},
{
"name": "Perl",
"bytes": "798287"
},
{
"name": "PowerShell",
"bytes": "422"
},
{
"name": "Python",
"bytes": "3267988"
},
{
"name": "Raku",
"bytes": "698"
},
{
"name": "Roff",
"bytes": "32437"
},
{
"name": "Ruby",
"bytes": "81695"
},
{
"name": "SQLPL",
"bytes": "313387"
},
{
"name": "Shell",
"bytes": "453847"
},
{
"name": "TSQL",
"bytes": "3294076"
},
{
"name": "XS",
"bytes": "6983"
},
{
"name": "Yacc",
"bytes": "672568"
},
{
"name": "sed",
"bytes": "1231"
}
],
"symlink_target": ""
} |
extern crate sdl2;
use std::path::Path;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::rect::Rect;
use sdl2::rect::Point;
use std::time::Duration;
fn main() {
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
let window = video_subsystem.window("SDL2", 640, 480)
.position_centered().build().unwrap();
let mut renderer = window.renderer()
.accelerated().build().unwrap();
renderer.set_draw_color(sdl2::pixels::Color::RGBA(0,0,0,255));
let mut timer = sdl_context.timer().unwrap();
let mut event_pump = sdl_context.event_pump().unwrap();
let temp_surface = sdl2::surface::Surface::load_bmp(Path::new("assets/animate.bmp")).unwrap();
let texture = renderer.create_texture_from_surface(&temp_surface).unwrap();
let center = Point::new(320,240);
let mut source_rect = Rect::new(0, 0, 128, 82);
let mut dest_rect = Rect::new(0,0, 128, 82);
dest_rect.center_on(center);
let mut running = true;
while running {
for event in event_pump.poll_iter() {
match event {
Event::Quit {..} | Event::KeyDown {keycode: Some(Keycode::Escape), ..} => {
running = false;
},
_ => {}
}
}
let ticks = timer.ticks();
source_rect.set_x((128 * ((ticks / 100) % 6) ) as i32);
renderer.clear();
renderer.copy_ex(&texture, Some(source_rect), Some(dest_rect), 10.0, None, true, false).unwrap();
renderer.present();
std::thread::sleep(Duration::from_millis(100));
}
}
| {
"content_hash": "62da683d8993e4b24c051d90bd169ab0",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 105,
"avg_line_length": 30.5,
"alnum_prop": 0.5798421372191864,
"repo_name": "vadixidav/rust-sdl2",
"id": "8399c12eb35218b6d2c3954f4b54d5cf8ec228cf",
"size": "1647",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/animation.rs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Rust",
"bytes": "626478"
}
],
"symlink_target": ""
} |
from os import path
from behave import given, when, then
from test.behave_utils.utils import *
from mgmt_utils import *
# This file contains steps for gpaddmirrors and gpmovemirrors tests
# This class is intended to store per-Scenario state that is built up over
# a series of steps.
class MirrorMgmtContext:
def __init__(self):
self.working_directory = None
self.input_file = None
def input_file_path(self):
if self.working_directory is None:
raise Exception("working directory not set")
if self.input_file is None:
raise Exception("input file not set")
return path.normpath(path.join(self.working_directory,self.input_file))
def _generate_input_config(spread=False):
datadir_config = _write_datadir_config()
mirror_config_output_file = "/tmp/test_gpaddmirrors.config"
cmd_str = 'gpaddmirrors -a -o %s -m %s' % (mirror_config_output_file, datadir_config)
if spread:
cmd_str += " -s"
Command('generate mirror_config file', cmd_str).run(validateAfter=True)
return mirror_config_output_file
def do_write(template, config_file_path):
mirror_data_dir = make_data_directory_called('mirror')
with open(config_file_path, 'w') as fp:
contents = template.format(mirror_data_dir)
fp.write(contents)
def _write_datadir_config():
datadir_config = '/tmp/gpaddmirrors_datadir_config'
template = """
{0}
{0}
"""
do_write(template, datadir_config)
return datadir_config
def _write_datadir_config_for_three_mirrors():
datadir_config='/tmp/gpaddmirrors_datadir_config'
template = """
{0}
{0}
{0}
"""
do_write(template, datadir_config)
return datadir_config
@when("gpaddmirrors adds 3 mirrors")
def add_three_mirrors(context):
datadir_config = _write_datadir_config_for_three_mirrors()
mirror_config_output_file = "/tmp/test_gpaddmirrors.config"
cmd_str = 'gpaddmirrors -o %s -m %s' % (mirror_config_output_file, datadir_config)
Command('generate mirror_config file', cmd_str).run(validateAfter=True)
cmd = Command('gpaddmirrors ', 'gpaddmirrors -a -i %s ' % mirror_config_output_file)
cmd.run(validateAfter=True)
def add_mirrors(context, options):
context.mirror_config = _generate_input_config()
cmd = Command('gpaddmirrors ', 'gpaddmirrors -a -i %s %s' % (context.mirror_config, options))
cmd.run(validateAfter=True)
def make_data_directory_called(data_directory_name):
mdd_parent_parent = os.path.realpath(
os.getenv("MASTER_DATA_DIRECTORY") + "../../../")
mirror_data_dir = os.path.join(mdd_parent_parent, data_directory_name)
if not os.path.exists(mirror_data_dir):
os.mkdir(mirror_data_dir)
return mirror_data_dir
def _get_mirror_count():
with dbconn.connect(dbconn.DbURL(dbname='template1'), unsetSearchPath=False) as conn:
sql = """SELECT count(*) FROM gp_segment_configuration WHERE role='m'"""
count_row = dbconn.query(conn, sql).fetchone()
conn.close()
return count_row[0]
# take the item in search_item_list, search pg_hba if it contains atleast one entry
# for the item
@given('pg_hba file "{filename}" on host "{host}" contains entries for "{search_items}"')
@then('pg_hba file "{filename}" on host "{host}" contains entries for "{search_items}"')
def impl(context, search_items, host, filename):
cmd_str = "ssh %s cat %s" % (host, filename)
cmd = Command(name='Running remote command: %s' % cmd_str, cmdStr=cmd_str)
cmd.run(validateAfter=False)
search_item_list = [search_item.strip() for search_item in search_items.split(',')]
pghba_contents= cmd.get_stdout().strip().split('\n')
for search_item in search_item_list:
found = False
for entry in pghba_contents:
contents = entry.strip()
# for example: host all all hostname trust
if contents.startswith("host") and contents.endswith("trust"):
tokens = contents.split()
if len(tokens) != 5:
raise Exception("failed to parse pg_hba.conf line '%s'" % contents)
hostname = tokens[3].strip()
if search_item == hostname:
found = True
break
if not found:
raise Exception("entry for expected item %s not existing in pg_hba.conf '%s'" % (search_item, pghba_contents))
# ensure pg_hba contains only cidr addresses, exclude mandatory entries for replication samenet if existing
@given('pg_hba file "{filename}" on host "{host}" contains only cidr addresses')
@then('pg_hba file "{filename}" on host "{host}" contains only cidr addresses')
def impl(context, host, filename):
cmd_str = "ssh %s cat %s" % (host, filename)
cmd = Command(name='Running remote command: %s' % cmd_str, cmdStr=cmd_str)
cmd.run(validateAfter=False)
pghba_contents= cmd.get_stdout().strip().split('\n')
for entry in pghba_contents:
contents = entry.strip()
# for example: host all all hostname trust
if contents.startswith("host") and contents.endswith("trust"):
tokens = contents.split()
if len(tokens) != 5:
raise Exception("failed to parse pg_hba.conf line '%s'" % contents)
hostname = tokens[3].strip()
# ignore replication entries
if hostname == "samehost":
continue
if "/" in hostname:
continue
else:
raise Exception("not a valid cidr '%s' address" % hostname)
@then('verify the database has mirrors')
def impl(context):
if _get_mirror_count() == 0:
raise Exception('No mirrors found')
@given('gpaddmirrors adds mirrors with options "{options}"')
@when('gpaddmirrors adds mirrors with options "{options}"')
@given('gpaddmirrors adds mirrors')
@when('gpaddmirrors adds mirrors')
@when('gpaddmirrors adds mirrors with options ""')
@then('gpaddmirrors adds mirrors')
def impl(context, options=" "):
add_mirrors(context, options)
@given('gpaddmirrors adds mirrors with temporary data dir')
def impl(context):
context.mirror_config = _generate_input_config()
mdd = os.getenv('MASTER_DATA_DIRECTORY', "")
del os.environ['MASTER_DATA_DIRECTORY']
try:
cmd = Command('gpaddmirrors ', 'gpaddmirrors -a -i %s -d %s' % (context.mirror_config, mdd))
cmd.run(validateAfter=True)
finally:
os.environ['MASTER_DATA_DIRECTORY'] = mdd
@given('gpaddmirrors adds mirrors in spread configuration')
def impl(context):
context.mirror_config = _generate_input_config(spread=True)
cmd = Command('gpaddmirrors ', 'gpaddmirrors -a -i %s ' % context.mirror_config)
cmd.run(validateAfter=True)
@then('save the gparray to context')
def impl(context):
gparray = GpArray.initFromCatalog(dbconn.DbURL())
context.gparray = gparray
@then('mirror hostlist matches the one saved in context')
def impl(context):
gparray = GpArray.initFromCatalog(dbconn.DbURL())
old_content_to_host = {}
curr_content_to_host = {}
# Map content IDs to hostnames for every mirror, for both the saved GpArray
# and the current one.
for (array, hostMap) in [(context.gparray, old_content_to_host), (gparray, curr_content_to_host)]:
for host in array.get_hostlist(includeMaster=False):
for mirror in array.get_list_of_mirror_segments_on_host(host):
hostMap[mirror.getSegmentContentId()] = host
if len(curr_content_to_host) != len(old_content_to_host):
raise Exception("Number of mirrors doesn't match between old and new clusters")
for key in old_content_to_host.keys():
if curr_content_to_host[key] != old_content_to_host[key]:
raise Exception("Mirror host doesn't match for content %s (old host=%s) (new host=%s)"
% (key, old_content_to_host[key], curr_content_to_host[key]))
@given('a gpmovemirrors cross_subnet input file is created')
def impl(context):
context.expected_segs = []
context.expected_segs.append("sdw1-1|21500|/tmp/gpmovemirrors/data/mirror/gpseg2_moved")
context.expected_segs.append("sdw1-2|22501|/tmp/gpmovemirrors/data/mirror/gpseg3")
input_filename = "/tmp/gpmovemirrors_input_cross_subnet"
with open(input_filename, "w") as fd:
fd.write("sdw1-1|21500|/tmp/gpmovemirrors/data/mirror/gpseg2 %s\n" % context.expected_segs[0])
fd.write("sdw1-1|21501|/tmp/gpmovemirrors/data/mirror/gpseg3 %s" % context.expected_segs[1])
@then('verify that mirror segments are in new cross_subnet configuration')
def impl(context):
gparray = GpArray.initFromCatalog(dbconn.DbURL())
segs = gparray.getSegmentsAsLoadedFromDb()
actual_segs = [
"%s|%s|%s" % (seg.hostname, seg.port, seg.datadir)
for seg in segs
if seg.role == 'm' and seg.content in [2, 3]
]
if len(context.expected_segs) != len(actual_segs):
raise Exception("expected number of segs to be %d, but got %d" % (len(context.expected_segs), len(actual_segs)))
if context.expected_segs != actual_segs:
raise Exception("expected segs to be %s, but got %s" % (context.expected_segs, actual_segs))
@given('verify that mirror segments are in "{mirror_config}" configuration')
@then('verify that mirror segments are in "{mirror_config}" configuration')
def impl(context, mirror_config):
if mirror_config not in ["group", "spread"]:
raise Exception('"%s" is not a valid mirror configuration for this step; options are "group" and "spread".')
gparray = GpArray.initFromCatalog(dbconn.DbURL())
host_list = gparray.get_hostlist(includeMaster=False)
primary_to_mirror_host_map = {}
primary_content_map = {}
# Create a map from each host to the hosts holding the mirrors of all the
# primaries on the original host, e.g. the primaries for contents 0 and 1
# are on sdw1, the mirror for content 0 is on sdw2, and the mirror for
# content 1 is on sdw4, then primary_content_map[sdw1] = [sdw2, sdw4]
for segmentPair in gparray.segmentPairs:
primary_host, mirror_host = segmentPair.get_hosts()
pair_content = segmentPair.primaryDB.content
# Regardless of mirror configuration, a primary should never be mirrored on the same host
if primary_host == mirror_host:
raise Exception('Host %s has both primary and mirror for content %d' % (primary_host, pair_content))
primary_content_map[primary_host] = pair_content
if primary_host not in primary_to_mirror_host_map:
primary_to_mirror_host_map[primary_host] = set()
primary_to_mirror_host_map[primary_host].add(mirror_host)
if mirror_config == "spread":
# In spread configuration, each primary on a given host has its mirror
# on a different host, and no host has both the primary and the mirror
# for a given segment. For this to work, the cluster must have N hosts,
# where N is 1 more than the number of segments on each host.
# Thus, if the list of mirror hosts for a given primary host consists
# of exactly the list of hosts in the cluster minus that host itself,
# the mirrors in the cluster are correctly spread.
for primary_host in primary_to_mirror_host_map:
mirror_host_set = primary_to_mirror_host_map[primary_host]
other_host_set = set(host_list)
other_host_set.remove(primary_host)
if other_host_set != mirror_host_set:
raise Exception('Expected primaries on %s to be mirrored to %s, but they are mirrored to %s' %
(primary_host, other_host_set, mirror_host_set))
elif mirror_config == "group":
# In group configuration, all primaries on a given host are mirrored to
# a single other host.
# Thus, if the list of mirror hosts for a given primary host consists
# of a single host, and that host is not the same as the primary host,
# the mirrors in the cluster are correctly grouped.
for primary_host in primary_to_mirror_host_map:
num_mirror_hosts = len(primary_to_mirror_host_map[primary_host])
if num_mirror_hosts != 1:
raise Exception('Expected primaries on %s to all be mirrored to the same host, but they are mirrored to %d different hosts' %
(primary_host, num_mirror_hosts))
@given("a gpmovemirrors directory under '{parent_dir}' with mode '{mode}' is created")
def impl(context, parent_dir, mode):
make_temp_dir(context,parent_dir, mode)
context.mirror_context.working_directory = context.temp_base_dir
@given("a '{file_type}' gpmovemirrors file is created")
def impl(context, file_type):
segments = GpArray.initFromCatalog(dbconn.DbURL()).getSegmentList()
mirror = segments[0].mirrorDB
valid_config = '%s|%s|%s' % (mirror.getSegmentHostName(),
mirror.getSegmentPort(),
mirror.getSegmentDataDirectory())
if file_type == 'malformed':
contents = 'I really like coffee.'
elif file_type == 'badhost':
badhost_config = '%s|%s|%s' % ('badhost',
mirror.getSegmentPort(),
context.mirror_context.working_directory)
contents = '%s %s' % (valid_config, badhost_config)
elif file_type == 'samedir':
valid_config_with_same_dir = '%s|%s|%s' % (
mirror.getSegmentHostName(),
mirror.getSegmentPort() + 1000,
mirror.getSegmentDataDirectory()
)
contents = '%s %s' % (valid_config, valid_config_with_same_dir)
elif file_type == 'identicalAttributes':
valid_config_with_identical_attributes = '%s|%s|%s' % (
mirror.getSegmentHostName(),
mirror.getSegmentPort(),
mirror.getSegmentDataDirectory()
)
contents = '%s %s' % (valid_config, valid_config_with_identical_attributes)
elif file_type == 'good':
valid_config_with_different_dir = '%s|%s|%s' % (
mirror.getSegmentHostName(),
mirror.getSegmentPort(),
context.mirror_context.working_directory
)
contents = '%s %s' % (valid_config, valid_config_with_different_dir)
else:
raise Exception('unknown gpmovemirrors file_type specified')
context.mirror_context.input_file = "gpmovemirrors_%s.txt" % file_type
with open(context.mirror_context.input_file_path(), 'w') as fd:
fd.write(contents)
@when('the user runs gpmovemirrors')
def impl(context):
run_gpmovemirrors(context)
@when('the user runs gpmovemirrors with additional args "{extra_args}"')
def run_gpmovemirrors(context, extra_args=''):
cmd = "gpmovemirrors --input=%s %s" % (
context.mirror_context.input_file_path(), extra_args)
run_gpcommand(context, cmd)
@then('verify that mirrors are recognized after a restart')
def impl(context):
context.execute_steps( u'''
When an FTS probe is triggered
And the user runs "gpstop -a"
And wait until the process "gpstop" goes down
And the user runs "gpstart -a"
And wait until the process "gpstart" goes down
Then all the segments are running
And the segments are synchronized''')
@given('a sample gpmovemirrors input file is created in "{mirror_config}" configuration')
def impl(context, mirror_config):
if mirror_config not in ["group", "spread"]:
raise Exception('"%s" is not a valid mirror configuration for this step; options are "group" and "spread".')
# Port numbers and addresses are hardcoded to TestCluster values, assuming a 3-host 2-segment cluster.
input_filename = "/tmp/gpmovemirrors_input_%s" % mirror_config
line_template = "%s|%d|%s %s|%d|%s\n"
# The mirrors for contents 0 and 3 are excluded from the two maps below because they are the same in either configuration
# NOTE: this configuration of the GPDB cluster assumes that configuration set up in concourse's
# gpinitsystem task. The maps below are from {contentID : (port|hostname)}.
# Group mirroring (TestCluster default): sdw1 mirrors to sdw2, sdw2 mirrors to sdw3, sdw3 mirrors to sdw2
group_port_map = {0: 21000, 1: 21001, 2: 21000, 3: 21001, 4: 21000, 5: 21001}
group_address_map = {0: "sdw2", 1: "sdw2", 2: "sdw3", 3: "sdw3", 4: "sdw1", 5: "sdw1"}
# Spread mirroring: each host mirrors one primary to each of the other two hosts
spread_port_map = {0: 21000, 1: 21000, 2: 21000, 3: 21001, 4: 21001, 5: 21001}
spread_address_map = {0: "sdw2", 1: "sdw3", 2: "sdw1", 3: "sdw3", 4: "sdw1", 5: "sdw2"}
# Create a map from each host to the hosts holding the mirrors of all the
# primaries on the original host, e.g. the primaries for contents 0 and 1
# are on sdw1, the mirror for content 0 is on sdw2, and the mirror for
# content 1 is on sdw4, then primary_content_map[sdw1] = [sdw2, sdw4]
gparray = GpArray.initFromCatalog(dbconn.DbURL())
with open(input_filename, "w") as fd:
for content in [1,2,4,5]:
if mirror_config == "spread":
old_port = group_port_map[content]
old_address = group_address_map[content]
new_port = spread_port_map[content]
new_address = spread_address_map[content]
else:
old_port = spread_port_map[content]
old_address = spread_address_map[content]
new_port = group_port_map[content]
new_address = group_address_map[content]
mirrors = map(lambda segmentPair: segmentPair.mirrorDB, gparray.getSegmentList())
mirror = next(iter(filter(lambda mirror: mirror.getSegmentContentId() == content, mirrors)), None)
old_directory = mirror.getSegmentDataDirectory()
new_directory = '%s_moved' % old_directory
fd.write(line_template % (old_address, old_port, old_directory, new_address, new_port, new_directory))
fd.flush()
| {
"content_hash": "434210392765c32857dfb0aa2efdb2be",
"timestamp": "",
"source": "github",
"line_count": 420,
"max_line_length": 141,
"avg_line_length": 43.154761904761905,
"alnum_prop": 0.6518620689655172,
"repo_name": "jmcatamney/gpdb",
"id": "ad8a24d3367f13a666ebfa4c85a13896068999d4",
"size": "18125",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gpMgmt/test/behave/mgmt_utils/steps/mirrors_mgmt_utils.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "3724"
},
{
"name": "Awk",
"bytes": "836"
},
{
"name": "Batchfile",
"bytes": "12854"
},
{
"name": "C",
"bytes": "42498841"
},
{
"name": "C++",
"bytes": "14366259"
},
{
"name": "CMake",
"bytes": "38452"
},
{
"name": "Csound Score",
"bytes": "223"
},
{
"name": "DTrace",
"bytes": "3873"
},
{
"name": "Dockerfile",
"bytes": "11932"
},
{
"name": "Emacs Lisp",
"bytes": "3488"
},
{
"name": "Fortran",
"bytes": "14863"
},
{
"name": "GDB",
"bytes": "576"
},
{
"name": "Gherkin",
"bytes": "335208"
},
{
"name": "HTML",
"bytes": "53484"
},
{
"name": "JavaScript",
"bytes": "23969"
},
{
"name": "Lex",
"bytes": "229556"
},
{
"name": "M4",
"bytes": "111147"
},
{
"name": "Makefile",
"bytes": "496239"
},
{
"name": "Objective-C",
"bytes": "38376"
},
{
"name": "PLpgSQL",
"bytes": "8009512"
},
{
"name": "Perl",
"bytes": "798767"
},
{
"name": "PowerShell",
"bytes": "422"
},
{
"name": "Python",
"bytes": "3000118"
},
{
"name": "Raku",
"bytes": "698"
},
{
"name": "Roff",
"bytes": "32437"
},
{
"name": "Ruby",
"bytes": "77585"
},
{
"name": "SCSS",
"bytes": "339"
},
{
"name": "Shell",
"bytes": "451713"
},
{
"name": "XS",
"bytes": "6983"
},
{
"name": "Yacc",
"bytes": "674092"
},
{
"name": "sed",
"bytes": "1231"
}
],
"symlink_target": ""
} |
package caddytls
import (
"crypto/tls"
"reflect"
"testing"
"github.com/klauspost/cpuid"
)
func TestConvertTLSConfigProtocolVersions(t *testing.T) {
// same min and max protocol versions
config := &Config{
Enabled: true,
ProtocolMinVersion: tls.VersionTLS12,
ProtocolMaxVersion: tls.VersionTLS12,
}
err := config.buildStandardTLSConfig()
if err != nil {
t.Fatalf("Did not expect an error, but got %v", err)
}
if got, want := config.tlsConfig.MinVersion, uint16(tls.VersionTLS12); got != want {
t.Errorf("Expected min version to be %x, got %x", want, got)
}
if got, want := config.tlsConfig.MaxVersion, uint16(tls.VersionTLS12); got != want {
t.Errorf("Expected max version to be %x, got %x", want, got)
}
}
func TestConvertTLSConfigPreferServerCipherSuites(t *testing.T) {
// prefer server cipher suites
config := Config{Enabled: true, PreferServerCipherSuites: true}
err := config.buildStandardTLSConfig()
if err != nil {
t.Fatalf("Did not expect an error, but got %v", err)
}
if got, want := config.tlsConfig.PreferServerCipherSuites, true; got != want {
t.Errorf("Expected PreferServerCipherSuites==%v but got %v", want, got)
}
}
func TestMakeTLSConfigTLSEnabledDisabledError(t *testing.T) {
// verify handling when Enabled is true and false
configs := []*Config{
{Enabled: true},
{Enabled: false},
}
_, err := MakeTLSConfig(configs)
if err == nil {
t.Fatalf("Expected an error, but got %v", err)
}
}
func TestConvertTLSConfigCipherSuites(t *testing.T) {
// ensure cipher suites are unioned and
// that TLS_FALLBACK_SCSV is prepended
configs := []*Config{
{Enabled: true, Ciphers: []uint16{0xc02c, 0xc030}},
{Enabled: true, Ciphers: []uint16{0xc012, 0xc030, 0xc00a}},
{Enabled: true, Ciphers: nil},
}
defaultCiphersExpected := getPreferredDefaultCiphers()
expectedCiphers := [][]uint16{
{tls.TLS_FALLBACK_SCSV, 0xc02c, 0xc030},
{tls.TLS_FALLBACK_SCSV, 0xc012, 0xc030, 0xc00a},
append([]uint16{tls.TLS_FALLBACK_SCSV}, defaultCiphersExpected...),
}
for i, config := range configs {
err := config.buildStandardTLSConfig()
if err != nil {
t.Errorf("Test %d: Expected no error, got: %v", i, err)
}
if !reflect.DeepEqual(config.tlsConfig.CipherSuites, expectedCiphers[i]) {
t.Errorf("Test %d: Expected ciphers %v but got %v",
i, expectedCiphers[i], config.tlsConfig.CipherSuites)
}
}
}
func TestGetPreferredDefaultCiphers(t *testing.T) {
expectedCiphers := defaultCiphers
if !cpuid.CPU.AesNi() {
expectedCiphers = defaultCiphersNonAESNI
}
// Ensure ordering is correct and ciphers are what we expected.
result := getPreferredDefaultCiphers()
for i, actual := range result {
if actual != expectedCiphers[i] {
t.Errorf("Expected cipher in position %d to be %0x, got %0x", i, expectedCiphers[i], actual)
}
}
}
| {
"content_hash": "db96d9317acc63bb98f78b6ffe68884c",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 95,
"avg_line_length": 29.489583333333332,
"alnum_prop": 0.7008124337689863,
"repo_name": "joshix/caddy",
"id": "a0af137409d5b9915daf781b42dfbdc9a24c5a99",
"size": "3429",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "caddytls/config_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "1238999"
},
{
"name": "HTML",
"bytes": "1117"
},
{
"name": "PHP",
"bytes": "1948"
},
{
"name": "Smarty",
"bytes": "193"
}
],
"symlink_target": ""
} |
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'phone_number_validation'
| {
"content_hash": "e6d6725ee8e755976510d1ec29289b13",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 58,
"avg_line_length": 46.5,
"alnum_prop": 0.6881720430107527,
"repo_name": "pmoelgaard/phone_number_validation",
"id": "1b642e333f3415b4dc71608a5c83d3e1aa8edd4e",
"size": "93",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/spec_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "8459"
},
{
"name": "Shell",
"bytes": "131"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.web.project</type>
<configuration>
<buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
<extension file="rest-build.xml" id="rest.5"/>
</buildExtensions>
<data xmlns="http://www.netbeans.org/ns/web-project/3">
<name>WelcomeRESTXML</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<web-module-libraries/>
<web-module-additional-libraries/>
<source-roots>
<root id="src.dir" name="Source Packages"/>
</source-roots>
<test-roots>
<root id="test.src.dir" name="Test Packages"/>
</test-roots>
</data>
</configuration>
</project>
| {
"content_hash": "851b71adbeda4baae4420e34952079d1",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 81,
"avg_line_length": 40.80952380952381,
"alnum_prop": 0.5694282380396732,
"repo_name": "rdok/web-services",
"id": "49b59686e220f0d287c13e142326037a4528167c",
"size": "857",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "WelcomeRESTXML/nbproject/project.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "123248"
},
{
"name": "Java",
"bytes": "57454"
},
{
"name": "JavaScript",
"bytes": "80262"
}
],
"symlink_target": ""
} |
[ -f /etc/is_vagrant_vm ] || {
>&2 echo "must be run on a vagrant VM"
exit 1
}
# The test case can be executed with the Bash Automated
# Testing System tool available at https://github.com/sstephenson/bats
# Thanks to Sam Stephenson!
# Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
##################################
# Common test cases for both tar and rpm/deb based plugin tests
##################################
# This file is symlinked to both 25_tar_plugins.bats and 50_modules_and_plugins.bats so its
# executed twice - once to test plugins using the tar distribution and once to
# test files using the rpm distribution or the deb distribution, whichever the
# system uses.
# Load test utilities
load $BATS_UTILS/utils.bash
load $BATS_UTILS/modules.bash
load $BATS_UTILS/plugins.bash
setup() {
# The rules on when we should clean an reinstall are complex - all the
# jvm-example tests need cleaning because they are rough on the filesystem.
# The first and any tests that find themselves without an ESHOME need to
# clean as well.... this is going to mostly only happen on the first
# non-jvm-example-plugin-test _and_ any first test if you comment out the
# other tests. Commenting out lots of test cases seems like a reasonably
# common workflow.
if [ $BATS_TEST_NUMBER == 1 ] ||
[[ $BATS_TEST_NAME =~ install_jvm.*example ]] ||
[ ! -d "$ESHOME" ]; then
clean_before_test
install
fi
}
if [[ "$BATS_TEST_FILENAME" =~ 25_tar_plugins.bats$ ]]; then
load $BATS_UTILS/tar.bash
GROUP='TAR PLUGINS'
install() {
install_archive
verify_archive_installation
}
export ESHOME=/tmp/elasticsearch
export_elasticsearch_paths
export ESPLUGIN_COMMAND_USER=elasticsearch
else
load $BATS_UTILS/packages.bash
if is_rpm; then
GROUP='RPM PLUGINS'
elif is_dpkg; then
GROUP='DEB PLUGINS'
fi
export_elasticsearch_paths
export ESPLUGIN_COMMAND_USER=root
install() {
install_package
verify_package_installation
}
fi
@test "[$GROUP] install jvm-example plugin with a symlinked plugins path" {
# Clean up after the last time this test was run
rm -rf /tmp/plugins.*
rm -rf /tmp/old_plugins.*
rm -rf "$ESPLUGINS"
local es_plugins=$(mktemp -d -t 'plugins.XXXX')
chown -R elasticsearch:elasticsearch "$es_plugins"
ln -s "$es_plugins" "$ESPLUGINS"
install_jvm_example
start_elasticsearch_service
# check that symlinked plugin was actually picked up
curl -s localhost:9200/_cat/configured_example | sed 's/ *$//' > /tmp/installed
echo "foo" > /tmp/expected
diff /tmp/installed /tmp/expected
stop_elasticsearch_service
remove_jvm_example
unlink "$ESPLUGINS"
}
@test "[$GROUP] install jvm-example plugin with a custom CONFIG_DIR" {
# Clean up after the last time we ran this test
rm -rf /tmp/config.*
move_config
ES_PATH_CONF="$ESCONFIG" install_jvm_example
ES_PATH_CONF="$ESCONFIG" start_elasticsearch_service
diff <(curl -s localhost:9200/_cat/configured_example | sed 's/ //g') <(echo "foo")
stop_elasticsearch_service
ES_PATH_CONF="$ESCONFIG" remove_jvm_example
}
@test "[$GROUP] install jvm-example plugin from a directory with a space" {
rm -rf "/tmp/plugins with space"
mkdir -p "/tmp/plugins with space"
local zip=$(ls jvm-example-*.zip)
cp $zip "/tmp/plugins with space"
install_jvm_example "/tmp/plugins with space/$zip"
remove_jvm_example
}
@test "[$GROUP] install jvm-example plugin to elasticsearch directory with a space" {
[ "$GROUP" == "TAR PLUGINS" ] || skip "Test case only supported by TAR PLUGINS"
move_elasticsearch "/tmp/elastic search"
install_jvm_example
remove_jvm_example
}
@test "[$GROUP] fail if java executable is not found" {
[ "$GROUP" == "TAR PLUGINS" ] || skip "Test case only supported by TAR PLUGINS"
local JAVA=$(which java)
sudo chmod -x $JAVA
run "$ESHOME/bin/elasticsearch-plugin"
sudo chmod +x $JAVA
[ "$status" -eq 1 ]
local expected="could not find java; set JAVA_HOME or ensure java is in PATH"
[[ "$output" == *"$expected"* ]] || {
echo "Expected error message [$expected] but found: $output"
false
}
}
# Note that all of the tests from here to the end of the file expect to be run
# in sequence and don't take well to being run one at a time.
@test "[$GROUP] install jvm-example plugin" {
install_jvm_example
}
@test "[$GROUP] install icu plugin" {
install_and_check_plugin analysis icu icu4j-*.jar
}
@test "[$GROUP] install kuromoji plugin" {
install_and_check_plugin analysis kuromoji
}
@test "[$GROUP] install phonetic plugin" {
install_and_check_plugin analysis phonetic commons-codec-*.jar
}
@test "[$GROUP] install smartcn plugin" {
install_and_check_plugin analysis smartcn
}
@test "[$GROUP] install stempel plugin" {
install_and_check_plugin analysis stempel
}
@test "[$GROUP] install ukrainian plugin" {
install_and_check_plugin analysis ukrainian morfologik-fsa-*.jar morfologik-stemming-*.jar
}
@test "[$GROUP] install gce plugin" {
install_and_check_plugin discovery gce google-api-client-*.jar
}
@test "[$GROUP] install discovery-azure-classic plugin" {
install_and_check_plugin discovery azure-classic azure-core-*.jar
}
@test "[$GROUP] install discovery-ec2 plugin" {
install_and_check_plugin discovery ec2 aws-java-sdk-core-*.jar
}
@test "[$GROUP] install discovery-file plugin" {
install_and_check_plugin discovery file
}
@test "[$GROUP] install ingest-attachment plugin" {
# we specify the version on the poi-3.17.jar so that the test does
# not spuriously pass if the jar is missing but the other poi jars
# are present
install_and_check_plugin ingest attachment bcprov-jdk15on-*.jar tika-core-*.jar pdfbox-*.jar poi-3.17.jar poi-ooxml-3.17.jar poi-ooxml-schemas-*.jar poi-scratchpad-*.jar
}
@test "[$GROUP] install ingest-geoip plugin" {
install_and_check_plugin ingest geoip geoip2-*.jar jackson-annotations-*.jar jackson-databind-*.jar maxmind-db-*.jar
}
@test "[$GROUP] install ingest-user-agent plugin" {
install_and_check_plugin ingest user-agent
}
@test "[$GROUP] check ingest-common module" {
check_module ingest-common jcodings-*.jar joni-*.jar
}
@test "[$GROUP] check lang-expression module" {
# we specify the version on the asm-5.0.4.jar so that the test does
# not spuriously pass if the jar is missing but the other asm jars
# are present
check_secure_module lang-expression antlr4-runtime-*.jar asm-5.0.4.jar asm-commons-*.jar asm-tree-*.jar lucene-expressions-*.jar
}
@test "[$GROUP] check lang-mustache module" {
check_secure_module lang-mustache compiler-*.jar
}
@test "[$GROUP] check lang-painless module" {
check_secure_module lang-painless antlr4-runtime-*.jar asm-debug-all-*.jar
}
@test "[$GROUP] install murmur3 mapper plugin" {
install_and_check_plugin mapper murmur3
}
@test "[$GROUP] check reindex module" {
check_module reindex
}
@test "[$GROUP] install repository-hdfs plugin" {
install_and_check_plugin repository hdfs hadoop-client-*.jar hadoop-common-*.jar hadoop-annotations-*.jar hadoop-auth-*.jar hadoop-hdfs-client-*.jar htrace-core4-*.jar guava-*.jar protobuf-java-*.jar commons-logging-*.jar commons-cli-*.jar commons-collections-*.jar commons-configuration-*.jar commons-io-*.jar commons-lang-*.jar servlet-api-*.jar slf4j-api-*.jar
}
@test "[$GROUP] install size mapper plugin" {
install_and_check_plugin mapper size
}
@test "[$GROUP] install repository-azure plugin" {
install_and_check_plugin repository azure azure-storage-*.jar
}
@test "[$GROUP] install repository-gcs plugin" {
install_and_check_plugin repository gcs google-api-services-storage-*.jar
}
@test "[$GROUP] install repository-s3 plugin" {
install_and_check_plugin repository s3 aws-java-sdk-core-*.jar
}
@test "[$GROUP] install store-smb plugin" {
install_and_check_plugin store smb
}
@test "[$GROUP] install transport-nio plugin" {
install_and_check_plugin transport nio
}
@test "[$GROUP] check the installed plugins can be listed with 'plugins list' and result matches the list of plugins in plugins pom" {
"$ESHOME/bin/elasticsearch-plugin" list | cut -d'@' -f1 > /tmp/installed
compare_plugins_list "/tmp/installed" "'plugins list'"
}
@test "[$GROUP] start elasticsearch with all plugins installed" {
start_elasticsearch_service
}
@test "[$GROUP] check the installed plugins matches the list of build plugins" {
curl -s localhost:9200/_cat/plugins?h=c | sed 's/ *$//' > /tmp/installed
compare_plugins_list "/tmp/installed" "_cat/plugins"
}
@test "[$GROUP] stop elasticsearch" {
stop_elasticsearch_service
}
@test "[$GROUP] remove jvm-example plugin" {
remove_jvm_example
}
@test "[$GROUP] remove icu plugin" {
remove_plugin analysis-icu
}
@test "[$GROUP] remove kuromoji plugin" {
remove_plugin analysis-kuromoji
}
@test "[$GROUP] remove phonetic plugin" {
remove_plugin analysis-phonetic
}
@test "[$GROUP] remove smartcn plugin" {
remove_plugin analysis-smartcn
}
@test "[$GROUP] remove stempel plugin" {
remove_plugin analysis-stempel
}
@test "[$GROUP] remove ukrainian plugin" {
remove_plugin analysis-ukrainian
}
@test "[$GROUP] remove gce plugin" {
remove_plugin discovery-gce
}
@test "[$GROUP] remove discovery-azure-classic plugin" {
remove_plugin discovery-azure-classic
}
@test "[$GROUP] remove discovery-ec2 plugin" {
remove_plugin discovery-ec2
}
@test "[$GROUP] remove discovery-file plugin" {
remove_plugin discovery-file
}
@test "[$GROUP] remove ingest-attachment plugin" {
remove_plugin ingest-attachment
}
@test "[$GROUP] remove ingest-geoip plugin" {
remove_plugin ingest-geoip
}
@test "[$GROUP] remove ingest-user-agent plugin" {
remove_plugin ingest-user-agent
}
@test "[$GROUP] remove murmur3 mapper plugin" {
remove_plugin mapper-murmur3
}
@test "[$GROUP] remove size mapper plugin" {
remove_plugin mapper-size
}
@test "[$GROUP] remove repository-azure plugin" {
remove_plugin repository-azure
}
@test "[$GROUP] remove repository-gcs plugin" {
remove_plugin repository-gcs
}
@test "[$GROUP] remove repository-hdfs plugin" {
remove_plugin repository-hdfs
}
@test "[$GROUP] remove repository-s3 plugin" {
remove_plugin repository-s3
}
@test "[$GROUP] remove store-smb plugin" {
remove_plugin store-smb
}
@test "[$GROUP] remove transport-nio plugin" {
remove_plugin transport-nio
}
@test "[$GROUP] start elasticsearch with all plugins removed" {
start_elasticsearch_service
}
@test "[$GROUP] check that there are now no plugins installed" {
curl -s localhost:9200/_cat/plugins > /tmp/installed
local installedCount=$(cat /tmp/installed | wc -l)
[ "$installedCount" == "0" ] || {
echo "Expected all plugins to be removed but found $installedCount:"
cat /tmp/installed
false
}
}
@test "[$GROUP] stop elasticsearch" {
stop_elasticsearch_service
}
@test "[$GROUP] install jvm-example with different logging modes and check output" {
local relativePath=${1:-$(readlink -m jvm-example-*.zip)}
sudo -E -u $ESPLUGIN_COMMAND_USER "$ESHOME/bin/elasticsearch-plugin" install "file://$relativePath" > /tmp/plugin-cli-output
# exclude progress line
local loglines=$(cat /tmp/plugin-cli-output | grep -v "^[[:cntrl:]]" | wc -l)
[ "$loglines" -eq "2" ] || {
echo "Expected 2 lines excluding progress bar but the output had $loglines lines and was:"
cat /tmp/plugin-cli-output
false
}
remove_jvm_example
local relativePath=${1:-$(readlink -m jvm-example-*.zip)}
sudo -E -u $ESPLUGIN_COMMAND_USER ES_JAVA_OPTS="-Des.logger.level=DEBUG" "$ESHOME/bin/elasticsearch-plugin" install "file://$relativePath" > /tmp/plugin-cli-output
local loglines=$(cat /tmp/plugin-cli-output | grep -v "^[[:cntrl:]]" | wc -l)
[ "$loglines" -gt "2" ] || {
echo "Expected more than 2 lines excluding progress bar but the output had $loglines lines and was:"
cat /tmp/plugin-cli-output
false
}
remove_jvm_example
}
@test "[$GROUP] test java home with space" {
# preserve JAVA_HOME
local java_home=$JAVA_HOME
# create a JAVA_HOME with a space
local java=$(which java)
local temp=`mktemp -d --suffix="java home"`
mkdir -p "$temp/bin"
ln -s "$java" "$temp/bin/java"
export JAVA_HOME="$temp"
# this will fail if the elasticsearch-plugin script does not
# properly handle JAVA_HOME with spaces
"$ESHOME/bin/elasticsearch-plugin" list
rm -rf "$temp"
# restore JAVA_HOME
export JAVA_HOME=$java_home
}
@test "[$GROUP] test ES_JAVA_OPTS" {
# preserve ES_JAVA_OPTS
local es_java_opts=$ES_JAVA_OPTS
export ES_JAVA_OPTS="-XX:+PrintFlagsFinal"
# this will fail if ES_JAVA_OPTS is not passed through
"$ESHOME/bin/elasticsearch-plugin" list | grep MaxHeapSize
# restore ES_JAVA_OPTS
export ES_JAVA_OPTS=$es_java_opts
}
@test "[$GROUP] test umask" {
install_jvm_example $(readlink -m jvm-example-*.zip) 0077
}
@test "[$GROUP] hostname" {
local temp=`mktemp -d`
cp "$ESCONFIG"/elasticsearch.yml "$temp"
echo 'node.name: ${HOSTNAME}' >> "$ESCONFIG"/elasticsearch.yml
start_elasticsearch_service
wait_for_elasticsearch_status
[ "$(curl -XGET localhost:9200/_cat/nodes?h=name)" == "$HOSTNAME" ]
stop_elasticsearch_service
cp "$temp"/elasticsearch.yml "$ESCONFIG"/elasticsearch.yml
rm -rf "$temp"
}
| {
"content_hash": "379bcb992878aa86032602fd10a6b5a8",
"timestamp": "",
"source": "github",
"line_count": 461,
"max_line_length": 367,
"avg_line_length": 31.18655097613883,
"alnum_prop": 0.6879738471169229,
"repo_name": "fred84/elasticsearch",
"id": "fb721d5c6d9ad2ed7827649bd297b699cb6ec6cd",
"size": "14837",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "11082"
},
{
"name": "Batchfile",
"bytes": "11603"
},
{
"name": "Emacs Lisp",
"bytes": "3341"
},
{
"name": "FreeMarker",
"bytes": "45"
},
{
"name": "Groovy",
"bytes": "356024"
},
{
"name": "HTML",
"bytes": "2186"
},
{
"name": "Java",
"bytes": "44964586"
},
{
"name": "Perl",
"bytes": "11756"
},
{
"name": "Python",
"bytes": "19852"
},
{
"name": "Shell",
"bytes": "100808"
}
],
"symlink_target": ""
} |
import inspect
class VIProperty(object):
def __init__(self, server, obj):
self._server = server
self._obj = obj
self._values_set = False
self._type = obj.typecode.type[1]
def _flush_cache(self):
if not self._values_set:
return
for name in self._values.iterkeys():
try:
delattr(self, name)
except AttributeError:
pass
self._values_set = False
def _get_all(self):
#If this is a MOR we need to recurse
if self._type == 'ManagedObjectReference':
oc = self._server._get_object_properties(self._obj, get_all=True)
ps = oc.get_element_propSet()
self._values = dict([(i.Name, i.Val) for i in ps])
#Just inspect the attributes
else:
methods = getmembers(self._obj, predicate=inspect.ismethod)
self._values = {}
for name, method in methods:
try:
if name.startswith("get_element_"):
self._values[name[12:]] = method()
except AttributeError:
continue
self._values_set = True
def __getattr__(self, name):
if not self._values_set:
self._get_all()
if not name in self._values:
raise AttributeError("object has not attribute %s" % name)
ret = self._get_prop_value(self._values[name])
#cache the object
setattr(self, name, ret)
return ret
def _get_prop_value(self, prop):
basic_types = (bool, int, float, basestring, tuple, long)
class_name = prop.__class__.__name__
#Holder is also a str, so this "if" must be first
#if is a managed object reference
if class_name == "Holder" and hasattr(prop, "get_attribute_type"):
return VIProperty(self._server, prop)
#Other Holder classes as enumerations can be treated as strings
if isinstance(prop, basic_types):
return prop
if isinstance(prop, list):
ret = []
for i in prop:
ret.append(self._get_prop_value(i))
return ret
if class_name == "DynamicData_Holder":
return VIProperty(self._server, prop)
if class_name.startswith("ArrayOf") and class_name.endswith("_Holder"):
inner_prop = class_name[7:-7]
ret = []
for i in getattr(prop, "get_element_" + inner_prop)():
ret.append(self._get_prop_value(i))
return ret
else:
return prop
#PYTHON 2.5 inspect.getmembers does not catches AttributeError, this will do
def getmembers(obj, predicate=None):
"""Return all members of an object as (name, value) pairs sorted by name.
Optionally, only return members that satisfy a given predicate."""
results = []
for key in dir(obj):
try:
value = getattr(obj, key)
except AttributeError:
continue
if not predicate or predicate(value):
results.append((key, value))
results.sort()
return results | {
"content_hash": "f63c4f0aef740bd9b952c794040115ef",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 79,
"avg_line_length": 32.13131313131313,
"alnum_prop": 0.5526563973593209,
"repo_name": "devopshq/vspheretools",
"id": "6d4cad38335fe281cbb825e8112fe2e5d59e246e",
"size": "4742",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "pysphere/vi_property.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "7133253"
}
],
"symlink_target": ""
} |
#include "config.h"
#include "main.h"
#include "cfg_file.h"
#include "cfg_xml.h"
#include "util.h"
#include "smtp.h"
#include "smtp_proto.h"
#include "smtp_utils.h"
#include "map.h"
#include "message.h"
#include "settings.h"
#include "dns.h"
#include "lua/lua_common.h"
/* Max line size as it is defined in rfc2822 */
#define OUTBUFSIZ 1000
/* Upstream timeouts */
#define DEFAULT_UPSTREAM_ERROR_TIME 10
#define DEFAULT_UPSTREAM_DEAD_TIME 300
#define DEFAULT_UPSTREAM_MAXERRORS 10
#define DEFAULT_REJECT_MESSAGE "450 4.5.0 Spam message rejected"
static gboolean smtp_write_socket (void *arg);
/* Init functions */
gpointer init_smtp (struct rspamd_config *cfg);
void start_smtp (struct rspamd_worker *worker);
worker_t smtp_worker = {
"smtp", /* Name */
init_smtp, /* Init function */
start_smtp, /* Start function */
TRUE, /* Has socket */
FALSE, /* Non unique */
FALSE, /* Non threaded */
TRUE, /* Killable */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
};
static gboolean
call_stage_filters (struct smtp_session *session, enum rspamd_smtp_stage stage)
{
gboolean res = TRUE;
GList *list = session->ctx->smtp_filters[stage];
struct smtp_filter *filter;
while (list) {
filter = list->data;
if (!filter->filter (session, filter->filter_data)) {
res = FALSE;
break;
}
list = g_list_next (list);
}
return res;
}
static gboolean
read_smtp_command (struct smtp_session *session, rspamd_fstring_t *line)
{
struct smtp_command *cmd;
gchar outbuf[BUFSIZ];
gint r;
if (!parse_smtp_command (session, line, &cmd)) {
session->error = SMTP_ERROR_BAD_COMMAND;
session->errors++;
return FALSE;
}
switch (cmd->command) {
case SMTP_COMMAND_HELO:
case SMTP_COMMAND_EHLO:
if (session->state == SMTP_STATE_GREETING || session->state ==
SMTP_STATE_HELO) {
if (parse_smtp_helo (session, cmd)) {
session->state = SMTP_STATE_FROM;
}
else {
session->errors++;
}
if (!call_stage_filters (session, SMTP_STAGE_HELO)) {
return FALSE;
}
return TRUE;
}
else {
goto improper_sequence;
}
break;
case SMTP_COMMAND_QUIT:
session->state = SMTP_STATE_QUIT;
break;
case SMTP_COMMAND_NOOP:
break;
case SMTP_COMMAND_MAIL:
if (((session->state == SMTP_STATE_GREETING || session->state ==
SMTP_STATE_HELO) && !session->ctx->helo_required)
|| session->state == SMTP_STATE_FROM) {
if (parse_smtp_from (session, cmd)) {
session->state = SMTP_STATE_RCPT;
}
else {
session->errors++;
return FALSE;
}
if (!call_stage_filters (session, SMTP_STAGE_MAIL)) {
return FALSE;
}
}
else {
goto improper_sequence;
}
break;
case SMTP_COMMAND_RCPT:
if (session->state == SMTP_STATE_RCPT) {
if (parse_smtp_rcpt (session, cmd)) {
if (!call_stage_filters (session, SMTP_STAGE_RCPT)) {
return FALSE;
}
/* Make upstream connection */
if (session->upstream == NULL) {
if (!create_smtp_upstream_connection (session)) {
session->error = SMTP_ERROR_UPSTREAM;
session->state = SMTP_STATE_CRITICAL_ERROR;
return FALSE;
}
}
else {
/* Send next rcpt to upstream */
session->state = SMTP_STATE_WAIT_UPSTREAM;
session->upstream_state = SMTP_STATE_BEFORE_DATA;
rspamd_dispatcher_restore (session->upstream_dispatcher);
r = rspamd_snprintf (outbuf, sizeof (outbuf), "RCPT TO: ");
r += smtp_upstream_write_list (session->rcpt->data,
outbuf + r,
sizeof (outbuf) - r);
session->cur_rcpt = NULL;
return rspamd_dispatcher_write (
session->upstream_dispatcher,
outbuf,
r,
FALSE,
FALSE);
}
session->state = SMTP_STATE_WAIT_UPSTREAM;
return TRUE;
}
else {
session->errors++;
return FALSE;
}
}
else {
goto improper_sequence;
}
break;
case SMTP_COMMAND_RSET:
session->from = NULL;
if (session->rcpt) {
g_list_free (session->rcpt);
}
if (session->upstream) {
rspamd_session_remove_event (session->s,
smtp_upstream_finalize_connection,
session);
session->upstream = NULL;
}
session->state = SMTP_STATE_GREETING;
break;
case SMTP_COMMAND_DATA:
if (session->state == SMTP_STATE_RCPT) {
if (session->rcpt == NULL) {
session->error = SMTP_ERROR_RECIPIENTS;
session->errors++;
return FALSE;
}
if (!call_stage_filters (session, SMTP_STAGE_DATA)) {
return FALSE;
}
if (session->upstream == NULL) {
session->error = SMTP_ERROR_UPSTREAM;
session->state = SMTP_STATE_CRITICAL_ERROR;
return FALSE;
}
else {
session->upstream_state = SMTP_STATE_DATA;
rspamd_dispatcher_restore (session->upstream_dispatcher);
r = rspamd_snprintf (outbuf, sizeof (outbuf), "DATA" CRLF);
session->state = SMTP_STATE_WAIT_UPSTREAM;
session->error = SMTP_ERROR_DATA_OK;
return rspamd_dispatcher_write (session->upstream_dispatcher,
outbuf,
r,
FALSE,
FALSE);
}
}
else {
goto improper_sequence;
}
case SMTP_COMMAND_VRFY:
case SMTP_COMMAND_EXPN:
case SMTP_COMMAND_HELP:
session->error = SMTP_ERROR_UNIMPLIMENTED;
return FALSE;
}
session->error = SMTP_ERROR_OK;
return TRUE;
improper_sequence:
session->errors++;
session->error = SMTP_ERROR_SEQUENCE;
return FALSE;
}
static gboolean
process_smtp_data (struct smtp_session *session)
{
struct stat st;
gint r;
GList *cur, *t;
rspamd_fstring_t *f;
gchar *s;
if (fstat (session->temp_fd, &st) == -1) {
msg_err ("fstat failed: %s", strerror (errno));
goto err;
}
/* Now mmap temp file if it is small enough */
session->temp_size = st.st_size;
if (session->ctx->max_size == 0 || st.st_size <
(off_t)session->ctx->max_size) {
session->task = rspamd_task_new (session->worker);
session->task->resolver = session->resolver;
session->task->fin_callback = smtp_write_socket;
session->task->fin_arg = session;
session->task->msg =
rspamd_mempool_alloc (session->pool, sizeof (GString));
session->task->s = session->s;
#ifdef HAVE_MMAP_NOCORE
if ((session->task->msg->str =
mmap (NULL, st.st_size, PROT_READ, MAP_SHARED | MAP_NOCORE,
session->temp_fd, 0)) == MAP_FAILED) {
#else
if ((session->task->msg->str =
mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, session->temp_fd,
0)) == MAP_FAILED) {
#endif
msg_err ("mmap failed: %s", strerror (errno));
goto err;
}
session->task->msg->len = st.st_size;
session->task->helo = session->helo;
/* Save MAIL FROM */
cur = session->from;
if (cur) {
f = cur->data;
s = rspamd_mempool_alloc (session->pool, f->len + 1);
rspamd_strlcpy (s, f->begin, f->len + 1);
session->task->from = s;
}
/* Save recipients */
t = session->rcpt;
while (t) {
cur = t->data;
if (cur) {
f = cur->data;
s = rspamd_mempool_alloc (session->pool, f->len + 1);
rspamd_strlcpy (s, f->begin, f->len + 1);
session->task->rcpt = g_list_prepend (session->task->rcpt, s);
}
t = g_list_next (t);
}
memcpy (&session->task->from_addr, &session->client_addr,
sizeof (struct in_addr));
session->task->cmd = CMD_CHECK;
if (rspamd_message_parse (session->task) == -1) {
msg_err ("cannot process message");
munmap (session->task->msg->str, st.st_size);
goto err;
}
if (session->task->cfg->pre_filters == NULL) {
r = rspamd_process_filters (session->task);
if (r == -1) {
msg_err ("cannot process message");
munmap (session->task->msg->str, st.st_size);
goto err;
}
}
else {
rspamd_lua_call_pre_filters (session->task);
/* We want fin_task after pre filters are processed */
session->task->s->wanna_die = TRUE;
session->task->state = WAIT_PRE_FILTER;
rspamd_session_pending (session->task->s);
}
}
else {
msg_info ("not scan message as it is %z bytes and maximum is %z",
st.st_size,
session->ctx->max_size);
session->task = NULL;
return smtp_send_upstream_message (session);
}
return TRUE;
err:
session->error = SMTP_ERROR_FILE;
session->state = SMTP_STATE_CRITICAL_ERROR;
if (!rspamd_dispatcher_write (session->dispatcher, session->error, 0, FALSE,
TRUE)) {
return FALSE;
}
rspamd_session_destroy (session->s);
return FALSE;
}
/*
* Callback that is called when there is data to read in buffer
*/
static gboolean
smtp_read_socket (rspamd_fstring_t * in, void *arg)
{
struct smtp_session *session = arg;
switch (session->state) {
case SMTP_STATE_RESOLVE_REVERSE:
case SMTP_STATE_RESOLVE_NORMAL:
case SMTP_STATE_DELAY:
session->error = make_smtp_error (session->pool,
550,
"%s Improper use of SMTP command pipelining",
"5.5.0");
session->state = SMTP_STATE_ERROR;
break;
case SMTP_STATE_GREETING:
case SMTP_STATE_HELO:
case SMTP_STATE_FROM:
case SMTP_STATE_RCPT:
case SMTP_STATE_DATA:
read_smtp_command (session, in);
if (session->state != SMTP_STATE_WAIT_UPSTREAM) {
if (session->errors > session->ctx->max_errors) {
session->error = SMTP_ERROR_LIMIT;
session->state = SMTP_STATE_CRITICAL_ERROR;
if (!rspamd_dispatcher_write (session->dispatcher,
session->error, 0, FALSE, TRUE)) {
return FALSE;
}
rspamd_session_destroy (session->s);
return FALSE;
}
if (!smtp_write_socket (session)) {
return FALSE;
}
}
break;
case SMTP_STATE_AFTER_DATA:
if (in->len == 0) {
return TRUE;
}
if (in->len == 3 &&
memcmp (in->begin, DATA_END_TRAILER, in->len) == 0) {
return process_smtp_data (session);
}
if (write (session->temp_fd, in->begin, in->len) != (ssize_t)in->len) {
msg_err ("cannot write to temp file: %s", strerror (errno));
session->error = SMTP_ERROR_FILE;
session->state = SMTP_STATE_CRITICAL_ERROR;
if (!rspamd_dispatcher_write (session->dispatcher, session->error,
0, FALSE, TRUE)) {
return FALSE;
}
rspamd_session_destroy (session->s);
return FALSE;
}
break;
case SMTP_STATE_WAIT_UPSTREAM:
rspamd_dispatcher_pause (session->dispatcher);
break;
default:
session->error = make_smtp_error (session->pool,
550,
"%s Internal error",
"5.5.0");
session->state = SMTP_STATE_ERROR;
break;
}
if (session->state == SMTP_STATE_QUIT) {
rspamd_session_destroy (session->s);
return FALSE;
}
else if (session->state == SMTP_STATE_WAIT_UPSTREAM) {
rspamd_dispatcher_pause (session->dispatcher);
}
return TRUE;
}
/*
* Callback for socket writing
*/
static gboolean
smtp_write_socket (void *arg)
{
struct smtp_session *session = arg;
if (session->state == SMTP_STATE_CRITICAL_ERROR) {
if (session->error != NULL) {
if (!rspamd_dispatcher_write (session->dispatcher, session->error,
0, FALSE, TRUE)) {
return FALSE;
}
}
rspamd_session_destroy (session->s);
return FALSE;
}
else if (session->state == SMTP_STATE_END) {
if (session->task != NULL) {
return write_smtp_reply (session);
}
else {
if (session->error != NULL) {
if (!rspamd_dispatcher_write (session->dispatcher,
session->error, 0, FALSE, TRUE)) {
return FALSE;
}
}
}
}
else {
if (session->error != NULL) {
if (!rspamd_dispatcher_write (session->dispatcher, session->error,
0, FALSE, TRUE)) {
return FALSE;
}
}
}
return TRUE;
}
/*
* Called if something goes wrong
*/
static void
smtp_err_socket (GError * err, void *arg)
{
struct smtp_session *session = arg;
msg_info ("abnormally closing connection, error: %s", err->message);
/* Free buffers */
rspamd_session_destroy (session->s);
}
/*
* Write greeting to client
*/
static gboolean
write_smtp_greeting (struct smtp_session *session)
{
if (session->ctx->smtp_banner) {
if (!rspamd_dispatcher_write (session->dispatcher,
session->ctx->smtp_banner, 0, FALSE, TRUE)) {
return FALSE;
}
}
return TRUE;
}
/*
* Return from a delay
*/
static void
smtp_delay_handler (gint fd, short what, void *arg)
{
struct smtp_session *session = arg;
rspamd_session_remove_event (session->s,
(event_finalizer_t)event_del,
session->delay_timer);
if (session->state == SMTP_STATE_DELAY) {
session->state = SMTP_STATE_GREETING;
write_smtp_greeting (session);
}
else {
session->state = SMTP_STATE_CRITICAL_ERROR;
(void)smtp_write_socket (session);
}
}
/*
* Make delay for a client
*/
static void
smtp_make_delay (struct smtp_session *session)
{
struct event *tev;
struct timeval *tv;
gint32 jitter;
if (session->ctx->smtp_delay != 0 && session->state == SMTP_STATE_DELAY) {
tev = rspamd_mempool_alloc (session->pool, sizeof (struct event));
tv = rspamd_mempool_alloc (session->pool, sizeof (struct timeval));
if (session->ctx->delay_jitter != 0) {
jitter = g_random_int_range (0, session->ctx->delay_jitter);
msec_to_tv (session->ctx->smtp_delay + jitter, tv);
}
else {
msec_to_tv (session->ctx->smtp_delay, tv);
}
evtimer_set (tev, smtp_delay_handler, session);
evtimer_add (tev, tv);
rspamd_session_add_event (session->s,
(event_finalizer_t)event_del,
tev,
g_quark_from_static_string ("smtp proxy"));
session->delay_timer = tev;
}
else if (session->state == SMTP_STATE_DELAY) {
session->state = SMTP_STATE_GREETING;
write_smtp_greeting (session);
}
}
/*
* Handle DNS replies
*/
static void
smtp_dns_cb (struct rspamd_dns_reply *reply, void *arg)
{
struct smtp_session *session = arg;
gint res = 0;
union rspamd_reply_element *elt;
GList *cur;
switch (session->state) {
case SMTP_STATE_RESOLVE_REVERSE:
/* Parse reverse reply and start resolve of this ip */
if (reply->code != RDNS_RC_NOERROR) {
rspamd_conditional_debug (rspamd_main->logger,
session->client_addr.s_addr,
__FUNCTION__,
"DNS error: %s",
dns_strerror (reply->code));
if (reply->code == RDNS_RC_NXDOMAIN) {
session->hostname = rspamd_mempool_strdup (session->pool,
XCLIENT_HOST_UNAVAILABLE);
}
else {
session->hostname = rspamd_mempool_strdup (session->pool,
XCLIENT_HOST_TEMPFAIL);
}
session->state = SMTP_STATE_DELAY;
smtp_make_delay (session);
}
else {
if (reply->elements) {
elt = reply->elements->data;
session->hostname = rspamd_mempool_strdup (session->pool,
elt->ptr.name);
session->state = SMTP_STATE_RESOLVE_NORMAL;
make_dns_request (session->resolver, session->s, session->pool,
smtp_dns_cb, session, RDNS_REQUEST_A, session->hostname);
}
}
break;
case SMTP_STATE_RESOLVE_NORMAL:
if (reply->code != RDNS_RC_NOERROR) {
rspamd_conditional_debug (rspamd_main->logger,
session->client_addr.s_addr,
__FUNCTION__,
"DNS error: %s",
dns_strerror (reply->code));
if (reply->code == RDNS_RC_NXDOMAIN) {
session->hostname = rspamd_mempool_strdup (session->pool,
XCLIENT_HOST_UNAVAILABLE);
}
else {
session->hostname = rspamd_mempool_strdup (session->pool,
XCLIENT_HOST_TEMPFAIL);
}
session->state = SMTP_STATE_DELAY;
smtp_make_delay (session);
}
else {
res = 0;
cur = reply->elements;
while (cur) {
elt = cur->data;
if (memcmp (&session->client_addr, &elt->a.addr[0],
sizeof (struct in_addr)) == 0) {
res = 1;
session->resolved = TRUE;
break;
}
cur = g_list_next (cur);
}
if (res == 0) {
msg_info ("cannot find address for hostname: %s, ip: %s",
session->hostname,
inet_ntoa (session->client_addr));
session->hostname = rspamd_mempool_strdup (session->pool,
XCLIENT_HOST_UNAVAILABLE);
}
session->state = SMTP_STATE_DELAY;
smtp_make_delay (session);
}
break;
case SMTP_STATE_ERROR:
session->state = SMTP_STATE_WRITE_ERROR;
smtp_write_socket (session);
break;
default:
/*
* This callback is called on unknown state, usually this indicates
* an error (invalid pipelining)
*/
break;
}
}
/*
* Accept new connection and construct task
*/
static void
accept_socket (gint fd, short what, void *arg)
{
struct rspamd_worker *worker = (struct rspamd_worker *)arg;
union sa_union su;
struct smtp_session *session;
struct smtp_worker_ctx *ctx;
socklen_t addrlen = sizeof (su.ss);
gint nfd;
if ((nfd =
accept_from_socket (fd, (struct sockaddr *)&su.ss, &addrlen)) == -1) {
msg_warn ("accept failed: %s", strerror (errno));
return;
}
/* Check for EAGAIN */
if (nfd == 0) {
return;
}
ctx = worker->ctx;
session = g_malloc0 (sizeof (struct smtp_session));
session->pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
if (su.ss.ss_family == AF_UNIX) {
msg_info ("accepted connection from unix socket");
session->client_addr.s_addr = INADDR_NONE;
}
else if (su.ss.ss_family == AF_INET) {
msg_info ("accepted connection from %s port %d",
inet_ntoa (su.s4.sin_addr), ntohs (su.s4.sin_port));
memcpy (&session->client_addr, &su.s4.sin_addr,
sizeof (struct in_addr));
}
session->sock = nfd;
session->temp_fd = -1;
session->worker = worker;
session->ctx = ctx;
session->cfg = worker->srv->cfg;
session->session_time = time (NULL);
session->resolver = ctx->resolver;
session->ev_base = ctx->ev_base;
worker->srv->stat->connections_count++;
/* Resolve client's addr */
/* Set up async session */
session->s = rspamd_session_create (session->pool,
NULL,
NULL,
free_smtp_session,
session);
session->state = SMTP_STATE_RESOLVE_REVERSE;
if (!make_dns_request (session->resolver, session->s, session->pool,
smtp_dns_cb, session, RDNS_REQUEST_PTR, &session->client_addr)) {
msg_err ("cannot resolve %s", inet_ntoa (session->client_addr));
g_free (session);
close (nfd);
return;
}
else {
session->dispatcher = rspamd_create_dispatcher (session->ev_base,
nfd,
BUFFER_LINE,
smtp_read_socket,
smtp_write_socket,
smtp_err_socket,
&session->ctx->smtp_timeout,
session);
session->dispatcher->peer_addr = session->client_addr.s_addr;
}
}
static void
parse_smtp_banner (struct smtp_worker_ctx *ctx, const gchar *line)
{
gint hostmax, banner_len = sizeof ("220 ") - 1;
gchar *p, *t, *hostbuf = NULL;
gboolean has_crlf = FALSE;
p = (gchar *)line;
while (*p) {
if (*p == '%') {
p++;
switch (*p) {
case 'n':
/* Assume %n as CRLF */
banner_len += sizeof (CRLF) - 1 + sizeof ("220 -") - 1;
has_crlf = TRUE;
break;
case 'h':
hostmax = sysconf (_SC_HOST_NAME_MAX) + 1;
hostbuf = alloca (hostmax);
gethostname (hostbuf, hostmax);
hostbuf[hostmax - 1] = '\0';
banner_len += strlen (hostbuf);
break;
case '%':
banner_len += 1;
break;
default:
banner_len += 2;
break;
}
}
else {
banner_len++;
}
p++;
}
if (has_crlf) {
banner_len += sizeof (CRLF "220 " CRLF);
}
else {
banner_len += sizeof (CRLF);
}
ctx->smtp_banner = rspamd_mempool_alloc (ctx->pool, banner_len + 1);
t = ctx->smtp_banner;
p = (gchar *)line;
if (has_crlf) {
t = g_stpcpy (t, "220-");
}
else {
t = g_stpcpy (t, "220 ");
}
while (*p) {
if (*p == '%') {
p++;
switch (*p) {
case 'n':
/* Assume %n as CRLF */
*t++ = CR; *t++ = LF;
t = g_stpcpy (t, "220-");
p++;
break;
case 'h':
t = g_stpcpy (t, hostbuf);
p++;
break;
case '%':
*t++ = '%';
p++;
break;
default:
/* Copy all %<gchar> to dest */
*t++ = *(p - 1); *t++ = *p;
break;
}
}
else {
*t++ = *p++;
}
}
if (has_crlf) {
t = g_stpcpy (t, CRLF "220 " CRLF);
}
else {
t = g_stpcpy (t, CRLF);
}
}
static void
make_capabilities (struct smtp_worker_ctx *ctx, const gchar *line)
{
gchar **strv, *p, *result, *hostbuf;
guint32 num, i, len, hostmax;
strv = g_strsplit_set (line, ",;", -1);
num = g_strv_length (strv);
hostmax = sysconf (_SC_HOST_NAME_MAX) + 1;
hostbuf = alloca (hostmax);
gethostname (hostbuf, hostmax);
hostbuf[hostmax - 1] = '\0';
len = sizeof ("250-") + strlen (hostbuf) + sizeof (CRLF) - 1;
for (i = 0; i < num; i++) {
p = strv[i];
len += sizeof ("250-") + sizeof (CRLF) + strlen (p) - 2;
}
result = rspamd_mempool_alloc (ctx->pool, len);
ctx->smtp_capabilities = result;
p = result;
if (num == 0) {
p += rspamd_snprintf (p, len - (p - result), "250 %s" CRLF, hostbuf);
}
else {
p += rspamd_snprintf (p, len - (p - result), "250-%s" CRLF, hostbuf);
for (i = 0; i < num; i++) {
if (i != num - 1) {
p += rspamd_snprintf (p,
len - (p - result),
"250-%s" CRLF,
strv[i]);
}
else {
p += rspamd_snprintf (p,
len - (p - result),
"250 %s" CRLF,
strv[i]);
}
}
}
g_strfreev (strv);
}
gpointer
init_smtp (struct rspamd_config *cfg)
{
struct smtp_worker_ctx *ctx;
GQuark type;
type = g_quark_try_string ("smtp");
ctx = g_malloc0 (sizeof (struct smtp_worker_ctx));
ctx->pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
/* Set default values */
ctx->smtp_timeout_raw = 300000;
ctx->smtp_delay = 0;
ctx->smtp_banner = "220 ESMTP Ready." CRLF;
bzero (ctx->smtp_filters, sizeof (GList *) * SMTP_STAGE_MAX);
ctx->max_errors = DEFAULT_MAX_ERRORS;
ctx->reject_message = DEFAULT_REJECT_MESSAGE;
rspamd_rcl_register_worker_option (cfg, type, "upstreams",
rspamd_rcl_parse_struct_string, ctx,
G_STRUCT_OFFSET (struct smtp_worker_ctx, upstreams_str), 0);
rspamd_rcl_register_worker_option (cfg, type, "banner",
rspamd_rcl_parse_struct_string, ctx,
G_STRUCT_OFFSET (struct smtp_worker_ctx, smtp_banner_str), 0);
rspamd_rcl_register_worker_option (cfg, type, "timeout",
rspamd_rcl_parse_struct_time, ctx,
G_STRUCT_OFFSET (struct smtp_worker_ctx,
smtp_timeout_raw), RSPAMD_CL_FLAG_TIME_UINT_32);
rspamd_rcl_register_worker_option (cfg, type, "delay",
rspamd_rcl_parse_struct_time, ctx,
G_STRUCT_OFFSET (struct smtp_worker_ctx,
smtp_delay), RSPAMD_CL_FLAG_TIME_UINT_32);
rspamd_rcl_register_worker_option (cfg, type, "jitter",
rspamd_rcl_parse_struct_time, ctx,
G_STRUCT_OFFSET (struct smtp_worker_ctx,
delay_jitter), RSPAMD_CL_FLAG_TIME_UINT_32);
rspamd_rcl_register_worker_option (cfg, type, "capabilities",
rspamd_rcl_parse_struct_string, ctx,
G_STRUCT_OFFSET (struct smtp_worker_ctx, smtp_capabilities_str), 0);
rspamd_rcl_register_worker_option (cfg, type, "xclient",
rspamd_rcl_parse_struct_boolean, ctx,
G_STRUCT_OFFSET (struct smtp_worker_ctx, use_xclient), 0);
rspamd_rcl_register_worker_option (cfg, type, "reject_message",
rspamd_rcl_parse_struct_string, ctx,
G_STRUCT_OFFSET (struct smtp_worker_ctx, reject_message), 0);
rspamd_rcl_register_worker_option (cfg, type, "max_errors",
rspamd_rcl_parse_struct_integer, ctx,
G_STRUCT_OFFSET (struct smtp_worker_ctx,
max_errors), RSPAMD_CL_FLAG_INT_32);
rspamd_rcl_register_worker_option (cfg, type, "max_size",
rspamd_rcl_parse_struct_integer, ctx,
G_STRUCT_OFFSET (struct smtp_worker_ctx,
max_size), RSPAMD_CL_FLAG_INT_SIZE);
return ctx;
}
/* Make post-init configuration */
static gboolean
config_smtp_worker (struct rspamd_worker *worker)
{
struct smtp_worker_ctx *ctx = worker->ctx;
gchar *value;
/* Init timeval */
msec_to_tv (ctx->smtp_timeout_raw, &ctx->smtp_timeout);
/* Init upstreams */
if ((value = ctx->upstreams_str) != NULL) {
if (!parse_upstreams_line (ctx->pool, ctx->upstreams, value,
&ctx->upstream_num)) {
return FALSE;
}
}
else {
msg_err ("no upstreams defined, don't know what to do");
return FALSE;
}
/* Create smtp banner */
if ((value = ctx->smtp_banner_str) != NULL) {
parse_smtp_banner (ctx, value);
}
/* Parse capabilities */
if ((value = ctx->smtp_capabilities_str) != NULL) {
make_capabilities (ctx, value);
}
return TRUE;
}
/*
* Start worker process
*/
void
start_smtp (struct rspamd_worker *worker)
{
struct smtp_worker_ctx *ctx = worker->ctx;
ctx->ev_base = rspamd_prepare_worker (worker, "smtp_worker", accept_socket);
/* Set smtp options */
if ( !config_smtp_worker (worker)) {
msg_err ("cannot configure smtp worker, exiting");
exit (EXIT_SUCCESS);
}
/* Maps events */
rspamd_map_watch (worker->srv->cfg, ctx->ev_base);
/* DNS resolver */
ctx->resolver = dns_resolver_init (ctx->ev_base, worker->srv->cfg);
/* Set umask */
umask (S_IWGRP | S_IWOTH | S_IROTH | S_IRGRP);
event_base_loop (ctx->ev_base, 0);
rspamd_log_close (rspamd_main->logger);
exit (EXIT_SUCCESS);
}
void
register_smtp_filter (struct smtp_worker_ctx *ctx,
enum rspamd_smtp_stage stage,
smtp_filter_t filter,
gpointer filter_data)
{
struct smtp_filter *new;
new = rspamd_mempool_alloc (ctx->pool, sizeof (struct smtp_filter));
new->filter = filter;
new->filter_data = filter_data;
if (stage >= SMTP_STAGE_MAX) {
msg_err ("invalid smtp stage: %d", stage);
}
else {
ctx->smtp_filters[stage] =
g_list_prepend (ctx->smtp_filters[stage], new);
}
}
/*
* vi:ts=4
*/
| {
"content_hash": "b9a2d9baa91361f3e38a219d4e947788",
"timestamp": "",
"source": "github",
"line_count": 1015,
"max_line_length": 79,
"avg_line_length": 24.45320197044335,
"alnum_prop": 0.630781627719581,
"repo_name": "andrejzverev/rspamd",
"id": "07e28a4de0b2680765e1bac6048c5adef1969938",
"size": "25418",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/smtp.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "286880"
},
{
"name": "C",
"bytes": "5205279"
},
{
"name": "C++",
"bytes": "25866"
},
{
"name": "CMake",
"bytes": "108617"
},
{
"name": "CSS",
"bytes": "13824"
},
{
"name": "HTML",
"bytes": "14776"
},
{
"name": "Java",
"bytes": "13174"
},
{
"name": "JavaScript",
"bytes": "49261"
},
{
"name": "Lua",
"bytes": "403521"
},
{
"name": "Makefile",
"bytes": "12428"
},
{
"name": "Objective-C",
"bytes": "784"
},
{
"name": "PHP",
"bytes": "59960"
},
{
"name": "Perl",
"bytes": "35442"
},
{
"name": "Ragel in Ruby Host",
"bytes": "15286"
},
{
"name": "Shell",
"bytes": "17957"
},
{
"name": "SourcePawn",
"bytes": "3450"
},
{
"name": "Standard ML",
"bytes": "128"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "fe7f69fdaf6e38eb0decfa562346b1f7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "29c45e9660ab5970db50735b5a697b8a6881312d",
"size": "177",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Burseraceae/Haplolobus/Haplolobus robustus/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
namespace blink {
class CSSParserObserver;
class CSSSelectorList;
class Element;
class ImmutableStylePropertySet;
class MutableStylePropertySet;
class StyleColor;
class StyleRuleBase;
class StyleRuleKeyframe;
class StyleSheetContents;
// This class serves as the public API for the css/parser subsystem
class CORE_EXPORT CSSParser {
STATIC_ONLY(CSSParser);
public:
// As well as regular rules, allows @import and @namespace but not @charset
static PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(const CSSParserContext&, StyleSheetContents*, const String&);
static void parseSheet(const CSSParserContext&, StyleSheetContents*, const String&);
static CSSSelectorList parseSelector(const CSSParserContext&, StyleSheetContents*, const String&);
static CSSSelectorList parsePageSelector(const CSSParserContext&, StyleSheetContents*, const String&);
static bool parseDeclarationList(const CSSParserContext&, MutableStylePropertySet*, const String&);
// Returns whether anything was changed.
static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedProperty, const String&, bool important, StyleSheetContents*);
static bool parseValueForCustomProperty(MutableStylePropertySet*, const AtomicString& propertyName, const String& value, bool important, StyleSheetContents*);
// This is for non-shorthands only
static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID, const String&, const CSSParserContext& = strictCSSParserContext());
static PassRefPtrWillBeRawPtr<CSSValue> parseFontFaceDescriptor(CSSPropertyID, const String&, const CSSParserContext&);
static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const String&, Element*);
static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&);
static PassRefPtrWillBeRawPtr<StyleRuleKeyframe> parseKeyframeRule(const CSSParserContext&, const String&);
static bool parseSupportsCondition(const String&);
// The color will only be changed when string contains a valid CSS color, so callers
// can set it to a default color and ignore the boolean result.
static bool parseColor(Color&, const String&, bool strict = false);
static bool parseSystemColor(Color&, const String&);
static void parseSheetForInspector(const CSSParserContext&, StyleSheetContents*, const String&, CSSParserObserver&);
static void parseDeclarationListForInspector(const CSSParserContext&, const String&, CSSParserObserver&);
private:
static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedProperty, const String&, bool important, const CSSParserContext&);
};
} // namespace blink
#endif // CSSParser_h
| {
"content_hash": "2a91a4d11c359ad09174aa202b2550b6",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 162,
"avg_line_length": 50.25925925925926,
"alnum_prop": 0.7991893883566691,
"repo_name": "ds-hwang/chromium-crosswalk",
"id": "01b441f9002c57826ff4b66e3082861ced51abeb",
"size": "3097",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "third_party/WebKit/Source/core/css/parser/CSSParser.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package org.smartdeveloperhub.harvesters.scm.backend.pojos;
import java.util.ArrayList;
import java.util.List;
public class Commits extends Pojo {
private List<String> commitIds = new ArrayList<String>();
public List<String> getCommitIds() {
return this.commitIds;
}
public void setCommitIds(final List<String> commitIds) {
this.commitIds = commitIds;
}
}
| {
"content_hash": "aaacffc89f6262172f7699061b6468f2",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 59,
"avg_line_length": 19.57894736842105,
"alnum_prop": 0.7553763440860215,
"repo_name": "SmartDeveloperHub/sdh-scm-harvester",
"id": "c51ccc40f5af6bed5065e3fb71f7aa5b0551ee0a",
"size": "1729",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/src/main/java/org/smartdeveloperhub/harvesters/scm/backend/pojos/Commits.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3325"
},
{
"name": "HTML",
"bytes": "3915"
},
{
"name": "Java",
"bytes": "934325"
},
{
"name": "JavaScript",
"bytes": "6732"
},
{
"name": "Shell",
"bytes": "7276"
}
],
"symlink_target": ""
} |
<?php
namespace Exposure\Tests\Model;
use Exposure\Model\ProjectWant,
Exposure\Model\Project,
Exposure\Model\User,
Exposure\Model\SponsorOrganisation;
class ProjectWantTest extends \PHPUnit_Framework_TestCase {
protected $projectWant;
protected $dateTime;
protected $sponsorOrganisation;
protected $project;
public function setUp() {
$this->projectWant = new ProjectWant();
$this->dateTime = new \DateTime();
$this->sponsorOrganisation = new SponsorOrganisation();
$this->project = new Project();
}
public function test__construct() {
$this->assertInstanceOf('Exposure\Model\ProjectWant', $this->projectWant);
}
public function testSetGetDateTime() {
$this->assertEquals($this->dateTime,
$this->projectWant->setDateTime($this->dateTime));
$this->assertEquals($this->dateTime, $this->projectWant->getDateTime());
}
public function testSetGetSponsorOrganisation() {
$this->assertEquals($this->sponsorOrganisation,
$this->projectWant->setSponsorOrganisation($this->sponsorOrganisation));
$this->assertEquals($this->sponsorOrganisation,
$this->projectWant->getSponsorOrganisation());
}
public function testSetGetProject() {
$this->assertEquals($this->project, $this->projectWant->setProject($this->project));
$this->assertEquals($this->project, $this->projectWant->getProject());
}
public function testValidate_missingdatetime() {
$this->assertEquals($this->sponsorOrganisation,
$this->projectWant->setSponsorOrganisation($this->sponsorOrganisation));
$this->assertEquals($this->project, $this->projectWant->setProject($this->project));
$this->setExpectedException('Exposure\Model\ProjectWantException',
ProjectWant::EXCEPTION_INVALID_DATE_TIME);
$this->projectWant->validate();
}
public function testValidate_missingsponsororganisation() {
$this->assertEquals($this->dateTime, $this->projectWant->setDateTime($this->dateTime));
$this->assertEquals($this->project, $this->projectWant->setProject($this->project));
$this->setExpectedException('Exposure\Model\ProjectWantException',
ProjectWant::EXCEPTION_INVALID_SPONSOR_ORGANISATION);
$this->projectWant->validate();
}
public function testValidate_missingproject() {
$this->assertEquals($this->dateTime, $this->projectWant->setDateTime($this->dateTime));
$this->assertEquals($this->sponsorOrganisation, $this->projectWant->setSponsorOrganisation($this->sponsorOrganisation));
$this->setExpectedException('Exposure\Model\ProjectWantException',
ProjectWant::EXCEPTION_INVALID_PROJECT);
$this->projectWant->validate();
}
public function testValidate() {
$this->assertEquals($this->dateTime, $this->projectWant->setDateTime($this->dateTime));
$this->assertEquals($this->sponsorOrganisation, $this->projectWant->setSponsorOrganisation($this->sponsorOrganisation));
$this->assertEquals($this->project, $this->projectWant->setProject($this->project));
$this->projectWant->validate();
}
public function tearDown() {
unset($this->projectWant);
}
}
?>
| {
"content_hash": "f9cb005bbf03ec18ac792ecbff84ac65",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 128,
"avg_line_length": 38.76136363636363,
"alnum_prop": 0.6625622984462035,
"repo_name": "spujadas/exposure",
"id": "ad50d5c03b8344d4e7a51a74ec0c8c2353868573",
"size": "3636",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/Exposure/Tests/Model/ProjectWantTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "136805"
},
{
"name": "JavaScript",
"bytes": "189737"
},
{
"name": "PHP",
"bytes": "941654"
}
],
"symlink_target": ""
} |
Otto is a library written by Coraid QA engineers to enable Appliance testing. It was used for remotely controlling
infrastructure components like Linux, Solaris, and Windows servers as well as switches and the appliances themselves.
Documentation can be found on [Readthedocs](https://otto-docs.readthedocs.org "oTTo")
| {
"content_hash": "65d749d4b03e036f8e9a0924aa5452cd",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 117,
"avg_line_length": 80,
"alnum_prop": 0.815625,
"repo_name": "mennis/oTTo",
"id": "07e063c98a585fd2b13c8c6a7c77e4ad5c586826",
"size": "327",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "731249"
}
],
"symlink_target": ""
} |
<?php
/*
Safe sample
input : Uses popen to read the file /tmp/tainted.txt using cat command
sanitize : check if there is only numbers
construction : use of sprintf via a %u
*/
/*Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.*/
$handle = popen('/bin/cat /tmp/tainted.txt', 'r');
$tainted = fread($handle, 4096);
pclose($handle);
$re = "/^[0-9]*$/";
if(preg_match($re, $tainted) == 1){
$tainted = $tainted;
}
else{
$tainted = "";
}
$query = sprintf("SELECT Trim(a.FirstName) & ' ' & Trim(a.LastName) AS employee_name, a.city, a.street & (' ' +a.housenum) AS address FROM Employees AS a WHERE a.supervisor=%u", $tainted);
$conn = mysql_connect('localhost', 'mysql_user', 'mysql_password'); // Connection to the database (address, user, password)
mysql_select_db('dbname') ;
echo "query : ". $query ."<br /><br />" ;
$res = mysql_query($query); //execution
while($data =mysql_fetch_array($res)){
print_r($data) ;
echo "<br />" ;
}
mysql_close($conn);
?> | {
"content_hash": "cc215ee75382593de57734de6762967c",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 189,
"avg_line_length": 25.661971830985916,
"alnum_prop": 0.7195389681668496,
"repo_name": "stivalet/PHP-Vulnerability-test-suite",
"id": "161df4a0856e19262bad8fff3f5006567e54f387",
"size": "1822",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Injection/CWE_89/safe/CWE_89__popen__func_preg_match-only_numbers__multiple_AS-sprintf_%u.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "64184004"
}
],
"symlink_target": ""
} |
simpleSAMLphp installed on a vagrant virtual machine and hosted in Docker.
##Introduction
This is plug and play. Run the installation and SimpleSAMLphp will be waiting
## Prerequisites
This setup uses VirtualBox and VagrantUp to instanciate the virtual machines
- Install [VirtualBox](https://www.virtualbox.org/)
- Install [VagrantUp](http://www.vagrantup.com/)
## Installation
The following commands will download the Ubuntu Images and provision the virtual
machine. All software will be installed and once completed SimpleSAMLphp will
be ready to use.
``` bash
git clone https://github.com/jnyryan/docker-simplesamlphp.git
cd docker-simplesamlphp
vagrant up
vagrant ssh
```
## Usage
From the host machine the following ports are forwarded to the Vagrant VM.
- 58080
- 58443
To get to either the HTTP or HTTPS setup hit the following endpoints:
- http://localhost:58080/simplesaml
- https://localhost:58443/simplesaml
To access simpleSAMLphp from the browser:
```
username: admin
password: password
```
---
# Edit and create your own SimpleSAMLphp in a Docker Container
Docker is a lightweight container that I use to host simpleSAMLphp running under
apache as an experiment. All the work down below is already done in the Vagrant
setup, the details are included if you would like to further develop it.
## Prerequisites
- Install [Docker](https://www.docker.com/)
```
sudo apt-get install -y docker.io
sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker
sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io
```
## Install from DockerHub
Rather than build it yourself, the full container is available on [DockerHub](https://registry.hub.docker.com/u/jnyryan/simplesamlphp/)
``` bash
sudo docker pull jnyryan/simplesamlphp
sudo docker run -d -p 58080:80 -p 58443:443 jnyryan/simplesamlphp
```
To access simpleSAMLphp from the host server:
```
http://localhost:50081/simplesaml/
username: admin
password: password
```
To use your own configs stored on the host in /var/simplesamlphp
``` bash
sudo docker run -d -p 58080:80 -p 58443:443 \
-v /var/simplesamlphp/config/:/var/simplesamlphp/config/ -v /var/simplesamlphp/metadata/:/var/simplesamlphp/metadata/ -v /var/simplesamlphp/cert/:/var/simplesamlphp/cert/ \
jnyryan/simplesamlphp
```˛
## Build the Package and Publish it to Dockerhub
Build the package locally and push it to dockerhub
``` bash
sudo docker login
sudo docker pull jnyryan/simplesamlphp
sudo docker build -t jnyryan/simplesamlphp /vagrant/.
sudo docker push jnyryan/simplesamlphp
```
### Cleanup
This will clean up any old images built
``` bash
sudo bash
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -a -q)
exit
```
### References
[simpleSAMLphp Installation and Configuration](https://simplesamlphp.org/docs/stable/simplesamlphp-install)
[How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu)
[Using SimpleSAMLphp to Authenticate against ADFS 2.0 IdP](https://groups.google.com/forum/#!msg/simplesamlphp/I8IiDpeKSvY/URSlh-ssXQ4J)
[Configuring HTTPS on Apache with GnuTLS](https://help.ubuntu.com/community/GnuTLS)
| {
"content_hash": "1e6578d6fc4ca154f51d5fefe2106b62",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 174,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.7625,
"repo_name": "jnyryan/docker-simplesamlphp",
"id": "1070e4b2792f9fbddae4eac3cf2604c184ee0261",
"size": "3305",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "2083"
},
{
"name": "PHP",
"bytes": "44789"
},
{
"name": "Shell",
"bytes": "338"
}
],
"symlink_target": ""
} |
'use strict';
var normalisers = require('./normalisers');
var EACH_NORMALISER_NAME = 'each';
var NESTED_OBJECT_NORMALISER_NAME = 'object';
function _getKeys(obj) {
return Object.keys(obj);
}
function _isObject(value) {
return value === Object(value);
}
function _isArray(value) {
return {}.toString.call(value) === '[object Array]';
}
function _applyNormaliser(param, normaliserName, options) {
var normaliser = normalisers[normaliserName];
if (!normaliser) {
throw new Error('Unknown normaliser \'' + normaliserName + '\' specified');
}
return normaliser(param, options);
}
function _handleNestedObject(nestedObj, normaliserOptions) {
if (_isObject(nestedObj) && !_isArray(nestedObj)) {
traverseNormaliser(nestedObj, normaliserOptions);
}
}
function _handleArray(array, normaliserOptions) {
if (!_isArray(array)) {
return;
}
var normaliserNames = _getKeys(normaliserOptions);
if (normaliserNames.indexOf(NESTED_OBJECT_NORMALISER_NAME) > -1) {
// If there is a nested object normaliser, apply it to each value in the array.
for (var i = 0; i < array.length; ++i) {
traverseNormaliser(array[i], normaliserOptions[NESTED_OBJECT_NORMALISER_NAME]);
}
} else {
// Apply each normaliser to each array value.
for (var _i = 0; _i < array.length; ++_i) {
for (var j = 0; j < normaliserNames.length; ++j) {
// TODO options???
array[_i] = _applyNormaliser(array[_i], normaliserNames[j]);
}
}
}
}
function traverseNormaliser(params, normaliser) {
if (params === null || params === undefined) {
return;
}
// Loop through the names of all the properties to normalise at this recursion level.
_getKeys(normaliser).forEach(function (propertyName) {
// Loop through all the normalisers to apply to the property.
_getKeys(normaliser[propertyName]).forEach(function (normaliserName) {
var options = normaliser[propertyName][normaliserName];
if (normaliserName === EACH_NORMALISER_NAME) {
// This property should be an array.
_handleArray(params[propertyName], options);
} else if (normaliserName === NESTED_OBJECT_NORMALISER_NAME) {
// This property should be a nested object; recurse into it if it is.
_handleNestedObject(params[propertyName], options);
} else {
// Overwrite the current property value with the processed value.
params[propertyName] = _applyNormaliser(params[propertyName], normaliserName, options);
}
});
});
}
module.exports = exports = traverseNormaliser; | {
"content_hash": "d73fe8298bda08f4639624454e7630af",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 103,
"avg_line_length": 33.107142857142854,
"alnum_prop": 0.6245954692556634,
"repo_name": "stevejay/normalise-request",
"id": "03c19aabdf94a951f23637d8176f2cf23ba36db2",
"size": "2781",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dist/src/traverse-normaliser.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "26021"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "59e73a239c18995c1797ea7cb8292082",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "83ca886b049f8b8c8816d5ff86fbe5ffb2575e7e",
"size": "189",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Dendrobium/Dendrobium subulatum/ Syn. Aporum undulatum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package telemetry
import (
"context"
"fmt"
"io"
"net/http"
"time"
"github.com/influxdata/influxdb/v2/prometheus"
dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/expfmt"
"go.uber.org/zap"
)
const (
// DefaultTimeout is the length of time servicing the metrics before canceling.
DefaultTimeout = 10 * time.Second
// DefaultMaxBytes is the largest request body read.
DefaultMaxBytes = 1024000
)
var (
// ErrMetricsTimestampPresent is returned when the prometheus metrics has timestamps set.
// Not sure why, but, pushgateway does not allow timestamps.
ErrMetricsTimestampPresent = fmt.Errorf("pushed metrics must not have timestamp")
)
// PushGateway handles receiving prometheus push metrics and forwards them to the Store.
// If Format is not set, the format of the inbound metrics are used.
type PushGateway struct {
Timeout time.Duration // handler returns after this duration with an error; defaults to 5 seconds
MaxBytes int64 // maximum number of bytes to read from the body; defaults to 1024000
log *zap.Logger
Store Store
Transformers []prometheus.Transformer
Encoder prometheus.Encoder
}
// NewPushGateway constructs the PushGateway.
func NewPushGateway(log *zap.Logger, store Store, xforms ...prometheus.Transformer) *PushGateway {
if len(xforms) == 0 {
xforms = append(xforms, &AddTimestamps{})
}
return &PushGateway{
Store: store,
Transformers: xforms,
log: log,
Timeout: DefaultTimeout,
MaxBytes: DefaultMaxBytes,
}
}
// Handler accepts prometheus metrics send via the Push client and sends those
// metrics into the store.
func (p *PushGateway) Handler(w http.ResponseWriter, r *http.Request) {
// redirect to agreement to give our users information about
// this collected data.
switch r.Method {
case http.MethodGet, http.MethodHead:
http.Redirect(w, r, "https://www.influxdata.com/telemetry", http.StatusSeeOther)
return
case http.MethodPost, http.MethodPut:
default:
w.Header().Set("Allow", "GET, HEAD, PUT, POST")
http.Error(w,
http.StatusText(http.StatusMethodNotAllowed),
http.StatusMethodNotAllowed,
)
return
}
if p.Timeout == 0 {
p.Timeout = DefaultTimeout
}
if p.MaxBytes == 0 {
p.MaxBytes = DefaultMaxBytes
}
if p.Encoder == nil {
p.Encoder = &prometheus.Expfmt{
Format: expfmt.FmtText,
}
}
ctx, cancel := context.WithTimeout(
r.Context(),
p.Timeout,
)
defer cancel()
r = r.WithContext(ctx)
defer r.Body.Close()
format, err := metricsFormat(r.Header)
if err != nil {
p.log.Error("Metrics format not support", zap.Error(err))
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
mfs, err := decodePostMetricsRequest(r.Body, format, p.MaxBytes)
if err != nil {
p.log.Error("Unable to decode metrics", zap.Error(err))
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
if err := valid(mfs); err != nil {
p.log.Error("Invalid metrics", zap.Error(err))
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
for _, transformer := range p.Transformers {
mfs = transformer.Transform(mfs)
}
data, err := p.Encoder.Encode(mfs)
if err != nil {
p.log.Error("Unable to encode metric families", zap.Error(err))
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
if err := p.Store.WriteMessage(ctx, data); err != nil {
p.log.Error("Unable to write to store", zap.Error(err))
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusAccepted)
}
func metricsFormat(headers http.Header) (expfmt.Format, error) {
format := expfmt.ResponseFormat(headers)
if format == expfmt.FmtUnknown {
return "", fmt.Errorf("unknown format metrics format")
}
return format, nil
}
func decodePostMetricsRequest(body io.Reader, format expfmt.Format, maxBytes int64) ([]*dto.MetricFamily, error) {
// protect against reading too many bytes
r := io.LimitReader(body, maxBytes)
mfs, err := prometheus.DecodeExpfmt(r, format)
if err != nil {
return nil, err
}
return mfs, nil
}
// prom's pushgateway does not allow timestamps for some reason.
func valid(mfs []*dto.MetricFamily) error {
// Checks if any timestamps have been specified.
for i := range mfs {
for j := range mfs[i].Metric {
if mfs[i].Metric[j].TimestampMs != nil {
return ErrMetricsTimestampPresent
}
}
}
return nil
}
| {
"content_hash": "d41f20fbdff191e87d3ce03dea8ee991",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 114,
"avg_line_length": 26.208333333333332,
"alnum_prop": 0.7104247104247104,
"repo_name": "influxdata/influxdb",
"id": "e4f1469757395339eb98e127afade50b9cd5aace",
"size": "4403",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "telemetry/handler.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "658"
},
{
"name": "FLUX",
"bytes": "43865"
},
{
"name": "Go",
"bytes": "12623645"
},
{
"name": "HCL",
"bytes": "3205"
},
{
"name": "Makefile",
"bytes": "7020"
},
{
"name": "Shell",
"bytes": "84448"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageButton
android:id="@+id/eyes1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:src="@drawable/eye1b" />
<ImageButton
android:id="@+id/eyes2"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:src="@drawable/eye2b" />
<ImageButton
android:id="@+id/eyes3"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:src="@drawable/eye3b" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageButton
android:id="@+id/eyes4"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:src="@drawable/eye4b" />
<ImageButton
android:id="@+id/eyes5"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:src="@drawable/eye5b" />
<ImageButton
android:id="@+id/eyes6"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:src="@drawable/eye6b" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageButton
android:id="@+id/eyes7"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:src="@drawable/eye7b" />
<ImageButton
android:id="@+id/eyes8"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:src="@drawable/eye8b" />
<ImageButton
android:id="@+id/eyes9"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:src="@drawable/eye9b" />
</LinearLayout>
</LinearLayout>
| {
"content_hash": "c0686b060597fcfae9308866b7a73634",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 72,
"avg_line_length": 31.2183908045977,
"alnum_prop": 0.5585419734904271,
"repo_name": "zhongbaitu/MAKEYOURFACE",
"id": "e2a16e8fe69c8e34f024af008c0eaf9cea98fe7d",
"size": "2716",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "res/layout/eyelayout.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "562888"
}
],
"symlink_target": ""
} |
#ifndef QmitkToFScreenshotMaker_h
#define QmitkToFScreenshotMaker_h
#include <ui_QmitkToFScreenshotMakerControls.h>
#include <QmitkAbstractView.h>
#include <QStringList>
#include <ui_QmitkToFUtilViewControls.h>
/*!
\brief QmitkToFScreenshotMaker Select a ToF image source in the GUI to make a screenshot of the provided data.
If a camera is active, the Make Screenshot button will become enabled. Select the data including format you
want to save at the given path. To activate a camera, you can for example use the ToF Util view. Note you can
only select data which is provided by the device. Screenshots will be saved at the respective path with a
counter indicating the order.
\ingroup ToFUtil
*/
class QmitkToFScreenshotMaker : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFScreenshotMaker();
~QmitkToFScreenshotMaker() override;
void SetFocus() override;
void CreateQtPartControl(QWidget *parent) override;
protected slots:
/**
* @brief OnMakeScreenshotClicked Slot called when the "Make screenshot" button is pressed.
*/
void OnMakeScreenshotClicked();
/**
* @brief OnSelectCamera Slot called to update the GUI according to the selected image source.
*/
void OnSelectCamera();
protected:
Ui::QmitkToFScreenshotMakerControls m_Controls;
private:
/**
* @brief UpdateGUIElements Internal helper method to update the GUI.
* @param device The device of the selected image source.
* @param ToFImageType Type of the image (e.g. depth, RGB, intensity, etc.)
* @param saveCheckBox Checkbox indicating whether the type should be saved.
* @param saveTypeComboBox Combobox to chose in which format the data should be saved (e.g. nrrd)
* @param fileExentions Other possible file extensions.
* @param preferredFormat Default format for this type (e.g. png for RGB).
*/
void UpdateGUIElements(mitk::ToFCameraDevice* device, const char *ToFImageType, QCheckBox *saveCheckBox,
QComboBox *saveTypeComboBox, QStringList fileExentions, const char *preferredFormat);
/**
* @brief SaveImage Saves a ToF image.
* @param image The image to save.
* @param saveImage Should it be saved?
* @param path Path where to save the image.
* @param name Name of the image.
* @param extension Type extension (e.g. .nrrd).
*/
void SaveImage(mitk::Image::Pointer image, bool saveImage, std::string path, std::string name, std::string extension);
/**
* @brief m_SavingCounter Internal counter for saving images with higher number.
*/
int m_SavingCounter;
};
#endif // QmitkToFScreenshotMaker_h
| {
"content_hash": "e2870f866d026f8d813d6782858b36dd",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 120,
"avg_line_length": 33.02325581395349,
"alnum_prop": 0.7302816901408451,
"repo_name": "MITK/MITK",
"id": "d1fa29018ec4dbebcdbe9be16c6c4afb5639600f",
"size": "3221",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "60"
},
{
"name": "C",
"bytes": "160965"
},
{
"name": "C++",
"bytes": "29329826"
},
{
"name": "CMake",
"bytes": "997356"
},
{
"name": "CSS",
"bytes": "5894"
},
{
"name": "HTML",
"bytes": "78294"
},
{
"name": "JavaScript",
"bytes": "1044"
},
{
"name": "Makefile",
"bytes": "788"
},
{
"name": "Objective-C",
"bytes": "8783"
},
{
"name": "Python",
"bytes": "545"
},
{
"name": "SWIG",
"bytes": "28530"
},
{
"name": "Shell",
"bytes": "56972"
}
],
"symlink_target": ""
} |
package de.learnlib.algorithms.oml.ttt.pt;
import java.util.HashMap;
import java.util.Map;
import de.learnlib.algorithms.oml.ttt.dt.DTLeaf;
import net.automatalib.words.Word;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* @author fhowar
*/
public class PTNodeImpl<I, D> implements PTNode<I, D> {
private final @Nullable PTNodeImpl<I, D> parent;
private final @Nullable I symbol;
private final Map<I, PTNodeImpl<I, D>> children;
private DTLeaf<I, D> state;
public PTNodeImpl(@Nullable PTNodeImpl<I, D> parent, @Nullable I symbol) {
this.parent = parent;
this.symbol = symbol;
this.children = new HashMap<>();
}
@Override
public Word<I> word() {
return toWord(Word.epsilon());
}
@Override
public PTNode<I, D> append(I i) {
assert !children.containsKey(i);
PTNodeImpl<I, D> n = new PTNodeImpl<>(this, i);
children.put(i, n);
return n;
}
@Override
public void setState(DTLeaf<I, D> node) {
this.state = node;
}
@Override
public DTLeaf<I, D> state() {
return state;
}
private Word<I> toWord(Word<I> suffix) {
if (symbol == null || parent == null) {
return suffix;
}
return parent.toWord(suffix.prepend(symbol));
}
@Override
public @Nullable PTNode<I, D> succ(I a) {
return children.get(a);
}
@Override
public void makeShortPrefix() {
this.state.makeShortPrefix(this);
}
}
| {
"content_hash": "079fa7480907951a15f614633fe0b599",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 78,
"avg_line_length": 22.63235294117647,
"alnum_prop": 0.6081871345029239,
"repo_name": "LearnLib/learnlib",
"id": "1200b090f17178ce853f70afb41ab45f0e836a78",
"size": "2198",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "algorithms/active/oml/src/main/java/de/learnlib/algorithms/oml/ttt/pt/PTNodeImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "892"
},
{
"name": "Java",
"bytes": "2159589"
},
{
"name": "Python",
"bytes": "1499"
}
],
"symlink_target": ""
} |
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-docblock/src'),
'Whoops\\' => array($vendorDir . '/filp/whoops/src/Whoops'),
'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Polyfill\\Iconv\\' => array($vendorDir . '/symfony/polyfill-iconv'),
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
'Symfony\\Component\\DomCrawler\\' => array($vendorDir . '/symfony/dom-crawler'),
'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'),
'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'),
'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
'Symfony\\Component\\BrowserKit\\' => array($vendorDir . '/symfony/browser-kit'),
'Stecman\\Component\\Symfony\\Console\\BashCompletion\\' => array($vendorDir . '/stecman/symfony-console-completion/src'),
'Seld\\CliPrompt\\' => array($vendorDir . '/seld/cli-prompt/src'),
'RocketTheme\\Toolbox\\StreamWrapper\\' => array($vendorDir . '/rockettheme/toolbox/StreamWrapper/src'),
'RocketTheme\\Toolbox\\Session\\' => array($vendorDir . '/rockettheme/toolbox/Session/src'),
'RocketTheme\\Toolbox\\ResourceLocator\\' => array($vendorDir . '/rockettheme/toolbox/ResourceLocator/src'),
'RocketTheme\\Toolbox\\File\\' => array($vendorDir . '/rockettheme/toolbox/File/src'),
'RocketTheme\\Toolbox\\Event\\' => array($vendorDir . '/rockettheme/toolbox/Event/src'),
'RocketTheme\\Toolbox\\DI\\' => array($vendorDir . '/rockettheme/toolbox/DI/src'),
'RocketTheme\\Toolbox\\Blueprints\\' => array($vendorDir . '/rockettheme/toolbox/Blueprints/src'),
'RocketTheme\\Toolbox\\ArrayTraits\\' => array($vendorDir . '/rockettheme/toolbox/ArrayTraits/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
'MatthiasMullie\\PathConverter\\' => array($vendorDir . '/matthiasmullie/path-converter/src'),
'MatthiasMullie\\Minify\\' => array($vendorDir . '/matthiasmullie/minify/src'),
'League\\CLImate\\' => array($vendorDir . '/league/climate/src'),
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
'Grav\\' => array($baseDir . '/system/src/Grav'),
'Faker\\' => array($vendorDir . '/fzaninotto/faker/src/Faker'),
'Facebook\\WebDriver\\' => array($vendorDir . '/facebook/webdriver/lib'),
'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'),
'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'),
'DebugBar\\' => array($vendorDir . '/maximebf/debugbar/src/DebugBar'),
'Codeception\\Extension\\' => array($vendorDir . '/codeception/codeception/ext'),
'Codeception\\' => array($vendorDir . '/codeception/codeception/src/Codeception'),
'' => array($vendorDir . '/antoligy/dom-string-iterators/src'),
);
| {
"content_hash": "4cf821dddae164395a2f1ee15f5a94c3",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 200,
"avg_line_length": 74.5,
"alnum_prop": 0.6685596282911719,
"repo_name": "cbeard87/preservation",
"id": "d583a8ca3ae223ca9a1f0353c4e80c048175aa1c",
"size": "3874",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/composer/autoload_psr4.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3034"
},
{
"name": "CSS",
"bytes": "653176"
},
{
"name": "CoffeeScript",
"bytes": "1764"
},
{
"name": "HTML",
"bytes": "346071"
},
{
"name": "JavaScript",
"bytes": "264400"
},
{
"name": "Logos",
"bytes": "816"
},
{
"name": "Nginx",
"bytes": "1443"
},
{
"name": "PHP",
"bytes": "1590182"
},
{
"name": "Shell",
"bytes": "1221"
}
],
"symlink_target": ""
} |
package io.novaordis.gld.api.mock.configuration;
import io.novaordis.gld.api.configuration.Configuration;
import io.novaordis.gld.api.configuration.LoadConfiguration;
import io.novaordis.gld.api.configuration.OutputConfiguration;
import io.novaordis.gld.api.configuration.ServiceConfiguration;
import io.novaordis.gld.api.configuration.StoreConfiguration;
import io.novaordis.gld.api.service.ServiceType;
/**
* @author Ovidiu Feodorov <ovidiu@novaordis.com>
* @since 12/9/16
*/
public class MockConfiguration implements Configuration {
// Constants -------------------------------------------------------------------------------------------------------
// Static ----------------------------------------------------------------------------------------------------------
// Attributes ------------------------------------------------------------------------------------------------------
private MockServiceConfiguration serviceConfiguration;
private MockLoadConfiguration loadConfiguration;
private MockStoreConfiguration storeConfiguration;
private MockOutputConfiguration outputConfiguration;
// Constructors ----------------------------------------------------------------------------------------------------
public MockConfiguration() throws Exception {
serviceConfiguration = new MockServiceConfiguration();
loadConfiguration = new MockLoadConfiguration(ServiceType.mock);
storeConfiguration = new MockStoreConfiguration();
outputConfiguration = new MockOutputConfiguration();
}
// Configuration implementation ------------------------------------------------------------------------------------
@Override
public ServiceConfiguration getServiceConfiguration() {
return serviceConfiguration;
}
@Override
public LoadConfiguration getLoadConfiguration() {
return loadConfiguration;
}
@Override
public StoreConfiguration getStoreConfiguration() {
return storeConfiguration;
}
@Override
public OutputConfiguration getOutputConfiguration() {
return outputConfiguration;
}
// Public ----------------------------------------------------------------------------------------------------------
public void setOutputConfiguration(MockOutputConfiguration oc) {
this.outputConfiguration = oc;
}
// Package protected -----------------------------------------------------------------------------------------------
// Protected -------------------------------------------------------------------------------------------------------
// Private ---------------------------------------------------------------------------------------------------------
// Inner classes ---------------------------------------------------------------------------------------------------
}
| {
"content_hash": "049dbdd6ac4f3665d6cbea4ac954ae6e",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 120,
"avg_line_length": 35.9875,
"alnum_prop": 0.4789857589440778,
"repo_name": "NovaOrdis/gld",
"id": "0014588376ff6c69d899dcb0c39a591d189fe8be",
"size": "3479",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/load-driver/src/test/java/io/novaordis/gld/api/mock/configuration/MockConfiguration.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1983846"
},
{
"name": "Shell",
"bytes": "15581"
}
],
"symlink_target": ""
} |
import { Component } from '@angular/core';
import { Router} from "@angular/router";
@Component({
templateUrl: './app/components/home/home.tpl.html'
})
export class HomeComponent {
public pageHeading = "Welcome";
}
| {
"content_hash": "dbe70f5ace3e3c43135c925575035e65",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 52,
"avg_line_length": 20,
"alnum_prop": 0.7045454545454546,
"repo_name": "ravi221/rkProfile",
"id": "6d87ab54fcbea1d372ce4f8ed88111a770a7cd81",
"size": "220",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/components/home/home.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "230675"
},
{
"name": "HTML",
"bytes": "59724"
},
{
"name": "JavaScript",
"bytes": "34008"
},
{
"name": "PHP",
"bytes": "511660"
},
{
"name": "Shell",
"bytes": "4440"
},
{
"name": "TypeScript",
"bytes": "32677"
}
],
"symlink_target": ""
} |
(function( window ) {
var QUnit,
assert,
config,
onErrorFnPrev,
testId = 0,
fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""),
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty,
// Keep a local reference to Date (GH-283)
Date = window.Date,
setTimeout = window.setTimeout,
defined = {
setTimeout: typeof window.setTimeout !== "undefined",
sessionStorage: (function() {
var x = "qunit-test-string";
try {
sessionStorage.setItem( x, x );
sessionStorage.removeItem( x );
return true;
} catch( e ) {
return false;
}
}())
},
/**
* Provides a normalized error string, correcting an issue
* with IE 7 (and prior) where Error.prototype.toString is
* not properly implemented
*
* Based on http://es5.github.com/#x15.11.4.4
*
* @param {String|Error} error
* @return {String} error message
*/
errorString = function( error ) {
var name, message,
errorString = error.toString();
if ( errorString.substring( 0, 7 ) === "[object" ) {
name = error.name ? error.name.toString() : "Error";
message = error.message ? error.message.toString() : "";
if ( name && message ) {
return name + ": " + message;
} else if ( name ) {
return name;
} else if ( message ) {
return message;
} else {
return "Error";
}
} else {
return errorString;
}
},
/**
* Makes a clone of an object using only Array or Object as base,
* and copies over the own enumerable properties.
*
* @param {Object} obj
* @return {Object} New object with only the own properties (recursively).
*/
objectValues = function( obj ) {
// Grunt 0.3.x uses an older version of jshint that still has jshint/jshint#392.
/*jshint newcap: false */
var key, val,
vals = QUnit.is( "array", obj ) ? [] : {};
for ( key in obj ) {
if ( hasOwn.call( obj, key ) ) {
val = obj[key];
vals[key] = val === Object(val) ? objectValues(val) : val;
}
}
return vals;
};
function Test( settings ) {
extend( this, settings );
this.assertions = [];
this.testNumber = ++Test.count;
}
Test.count = 0;
Test.prototype = {
init: function() {
var a, b, li,
tests = id( "qunit-tests" );
if ( tests ) {
b = document.createElement( "strong" );
b.innerHTML = this.nameHtml;
// `a` initialized at top of scope
a = document.createElement( "a" );
a.innerHTML = "Rerun";
a.href = QUnit.url({ testNumber: this.testNumber });
li = document.createElement( "li" );
li.appendChild( b );
li.appendChild( a );
li.className = "running";
li.id = this.id = "qunit-test-output" + testId++;
tests.appendChild( li );
}
},
setup: function() {
if (
// Emit moduleStart when we're switching from one module to another
this.module !== config.previousModule ||
// They could be equal (both undefined) but if the previousModule property doesn't
// yet exist it means this is the first test in a suite that isn't wrapped in a
// module, in which case we'll just emit a moduleStart event for 'undefined'.
// Without this, reporters can get testStart before moduleStart which is a problem.
!hasOwn.call( config, "previousModule" )
) {
if ( hasOwn.call( config, "previousModule" ) ) {
runLoggingCallbacks( "moduleDone", QUnit, {
name: config.previousModule,
failed: config.moduleStats.bad,
passed: config.moduleStats.all - config.moduleStats.bad,
total: config.moduleStats.all
});
}
config.previousModule = this.module;
config.moduleStats = { all: 0, bad: 0 };
runLoggingCallbacks( "moduleStart", QUnit, {
name: this.module
});
}
config.current = this;
this.testEnvironment = extend({
setup: function() {},
teardown: function() {}
}, this.moduleTestEnvironment );
this.started = +new Date();
runLoggingCallbacks( "testStart", QUnit, {
name: this.testName,
module: this.module
});
/*jshint camelcase:false */
/**
* Expose the current test environment.
*
* @deprecated since 1.12.0: Use QUnit.config.current.testEnvironment instead.
*/
QUnit.current_testEnvironment = this.testEnvironment;
/*jshint camelcase:true */
if ( !config.pollution ) {
saveGlobal();
}
if ( config.notrycatch ) {
this.testEnvironment.setup.call( this.testEnvironment, QUnit.assert );
return;
}
try {
this.testEnvironment.setup.call( this.testEnvironment, QUnit.assert );
} catch( e ) {
QUnit.pushFailure( "Setup failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) );
}
},
run: function() {
config.current = this;
var running = id( "qunit-testresult" );
if ( running ) {
running.innerHTML = "Running: <br/>" + this.nameHtml;
}
if ( this.async ) {
QUnit.stop();
}
this.callbackStarted = +new Date();
if ( config.notrycatch ) {
this.callback.call( this.testEnvironment, QUnit.assert );
this.callbackRuntime = +new Date() - this.callbackStarted;
return;
}
try {
this.callback.call( this.testEnvironment, QUnit.assert );
this.callbackRuntime = +new Date() - this.callbackStarted;
} catch( e ) {
this.callbackRuntime = +new Date() - this.callbackStarted;
QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + ( e.message || e ), extractStacktrace( e, 0 ) );
// else next test will carry the responsibility
saveGlobal();
// Restart the tests if they're blocking
if ( config.blocking ) {
QUnit.start();
}
}
},
teardown: function() {
config.current = this;
if ( config.notrycatch ) {
if ( typeof this.callbackRuntime === "undefined" ) {
this.callbackRuntime = +new Date() - this.callbackStarted;
}
this.testEnvironment.teardown.call( this.testEnvironment, QUnit.assert );
return;
} else {
try {
this.testEnvironment.teardown.call( this.testEnvironment, QUnit.assert );
} catch( e ) {
QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) );
}
}
checkPollution();
},
finish: function() {
config.current = this;
if ( config.requireExpects && this.expected === null ) {
QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack );
} else if ( this.expected !== null && this.expected !== this.assertions.length ) {
QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack );
} else if ( this.expected === null && !this.assertions.length ) {
QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack );
}
var i, assertion, a, b, time, li, ol,
test = this,
good = 0,
bad = 0,
tests = id( "qunit-tests" );
this.runtime = +new Date() - this.started;
config.stats.all += this.assertions.length;
config.moduleStats.all += this.assertions.length;
if ( tests ) {
ol = document.createElement( "ol" );
ol.className = "qunit-assert-list";
for ( i = 0; i < this.assertions.length; i++ ) {
assertion = this.assertions[i];
li = document.createElement( "li" );
li.className = assertion.result ? "pass" : "fail";
li.innerHTML = assertion.message || ( assertion.result ? "okay" : "failed" );
ol.appendChild( li );
if ( assertion.result ) {
good++;
} else {
bad++;
config.stats.bad++;
config.moduleStats.bad++;
}
}
// store result when possible
if ( QUnit.config.reorder && defined.sessionStorage ) {
if ( bad ) {
sessionStorage.setItem( "qunit-test-" + this.module + "-" + this.testName, bad );
} else {
sessionStorage.removeItem( "qunit-test-" + this.module + "-" + this.testName );
}
}
if ( bad === 0 ) {
addClass( ol, "qunit-collapsed" );
}
// `b` initialized at top of scope
b = document.createElement( "strong" );
b.innerHTML = this.nameHtml + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>";
addEvent(b, "click", function() {
var next = b.parentNode.lastChild,
collapsed = hasClass( next, "qunit-collapsed" );
( collapsed ? removeClass : addClass )( next, "qunit-collapsed" );
});
addEvent(b, "dblclick", function( e ) {
var target = e && e.target ? e.target : window.event.srcElement;
if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) {
target = target.parentNode;
}
if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
window.location = QUnit.url({ testNumber: test.testNumber });
}
});
// `time` initialized at top of scope
time = document.createElement( "span" );
time.className = "runtime";
time.innerHTML = this.runtime + " ms";
// `li` initialized at top of scope
li = id( this.id );
li.className = bad ? "fail" : "pass";
li.removeChild( li.firstChild );
a = li.firstChild;
li.appendChild( b );
li.appendChild( a );
li.appendChild( time );
li.appendChild( ol );
} else {
for ( i = 0; i < this.assertions.length; i++ ) {
if ( !this.assertions[i].result ) {
bad++;
config.stats.bad++;
config.moduleStats.bad++;
}
}
}
runLoggingCallbacks( "testDone", QUnit, {
name: this.testName,
module: this.module,
failed: bad,
passed: this.assertions.length - bad,
total: this.assertions.length,
duration: this.runtime
});
QUnit.reset();
config.current = undefined;
},
queue: function() {
var bad,
test = this;
synchronize(function() {
test.init();
});
function run() {
// each of these can by async
synchronize(function() {
test.setup();
});
synchronize(function() {
test.run();
});
synchronize(function() {
test.teardown();
});
synchronize(function() {
test.finish();
});
}
// `bad` initialized at top of scope
// defer when previous test run passed, if storage is available
bad = QUnit.config.reorder && defined.sessionStorage &&
+sessionStorage.getItem( "qunit-test-" + this.module + "-" + this.testName );
if ( bad ) {
run();
} else {
synchronize( run, true );
}
}
};
// Root QUnit object.
// `QUnit` initialized at top of scope
QUnit = {
// call on start of module test to prepend name to all tests
module: function( name, testEnvironment ) {
config.currentModule = name;
config.currentModuleTestEnvironment = testEnvironment;
config.modules[name] = true;
},
asyncTest: function( testName, expected, callback ) {
if ( arguments.length === 2 ) {
callback = expected;
expected = null;
}
QUnit.test( testName, expected, callback, true );
},
test: function( testName, expected, callback, async ) {
var test,
nameHtml = "<span class='test-name'>" + escapeText( testName ) + "</span>";
if ( arguments.length === 2 ) {
callback = expected;
expected = null;
}
if ( config.currentModule ) {
nameHtml = "<span class='module-name'>" + escapeText( config.currentModule ) + "</span>: " + nameHtml;
}
test = new Test({
nameHtml: nameHtml,
testName: testName,
expected: expected,
async: async,
callback: callback,
module: config.currentModule,
moduleTestEnvironment: config.currentModuleTestEnvironment,
stack: sourceFromStacktrace( 2 )
});
if ( !validTest( test ) ) {
return;
}
test.queue();
},
// Specify the number of expected assertions to guarantee that failed test (no assertions are run at all) don't slip through.
expect: function( asserts ) {
if (arguments.length === 1) {
config.current.expected = asserts;
} else {
return config.current.expected;
}
},
start: function( count ) {
// QUnit hasn't been initialized yet.
// Note: RequireJS (et al) may delay onLoad
if ( config.semaphore === undefined ) {
QUnit.begin(function() {
// This is triggered at the top of QUnit.load, push start() to the event loop, to allow QUnit.load to finish first
setTimeout(function() {
QUnit.start( count );
});
});
return;
}
config.semaphore -= count || 1;
// don't start until equal number of stop-calls
if ( config.semaphore > 0 ) {
return;
}
// ignore if start is called more often then stop
if ( config.semaphore < 0 ) {
config.semaphore = 0;
QUnit.pushFailure( "Called start() while already started (QUnit.config.semaphore was 0 already)", null, sourceFromStacktrace(2) );
return;
}
// A slight delay, to avoid any current callbacks
if ( defined.setTimeout ) {
setTimeout(function() {
if ( config.semaphore > 0 ) {
return;
}
if ( config.timeout ) {
clearTimeout( config.timeout );
}
config.blocking = false;
process( true );
}, 13);
} else {
config.blocking = false;
process( true );
}
},
stop: function( count ) {
config.semaphore += count || 1;
config.blocking = true;
if ( config.testTimeout && defined.setTimeout ) {
clearTimeout( config.timeout );
config.timeout = setTimeout(function() {
QUnit.ok( false, "Test timed out" );
config.semaphore = 1;
QUnit.start();
}, config.testTimeout );
}
}
};
// `assert` initialized at top of scope
// Assert helpers
// All of these must either call QUnit.push() or manually do:
// - runLoggingCallbacks( "log", .. );
// - config.current.assertions.push({ .. });
// We attach it to the QUnit object *after* we expose the public API,
// otherwise `assert` will become a global variable in browsers (#341).
assert = {
/**
* Asserts rough true-ish result.
* @name ok
* @function
* @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
*/
ok: function( result, msg ) {
if ( !config.current ) {
throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) );
}
result = !!result;
msg = msg || (result ? "okay" : "failed" );
var source,
details = {
module: config.current.module,
name: config.current.testName,
result: result,
message: msg
};
msg = "<span class='test-message'>" + escapeText( msg ) + "</span>";
if ( !result ) {
source = sourceFromStacktrace( 2 );
if ( source ) {
details.source = source;
msg += "<table><tr class='test-source'><th>Source: </th><td><pre>" + escapeText( source ) + "</pre></td></tr></table>";
}
}
runLoggingCallbacks( "log", QUnit, details );
config.current.assertions.push({
result: result,
message: msg
});
},
/**
* Assert that the first two arguments are equal, with an optional message.
* Prints out both actual and expected values.
* @name equal
* @function
* @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" );
*/
equal: function( actual, expected, message ) {
/*jshint eqeqeq:false */
QUnit.push( expected == actual, actual, expected, message );
},
/**
* @name notEqual
* @function
*/
notEqual: function( actual, expected, message ) {
/*jshint eqeqeq:false */
QUnit.push( expected != actual, actual, expected, message );
},
/**
* @name propEqual
* @function
*/
propEqual: function( actual, expected, message ) {
actual = objectValues(actual);
expected = objectValues(expected);
QUnit.push( QUnit.equiv(actual, expected), actual, expected, message );
},
/**
* @name notPropEqual
* @function
*/
notPropEqual: function( actual, expected, message ) {
actual = objectValues(actual);
expected = objectValues(expected);
QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message );
},
/**
* @name deepEqual
* @function
*/
deepEqual: function( actual, expected, message ) {
QUnit.push( QUnit.equiv(actual, expected), actual, expected, message );
},
/**
* @name notDeepEqual
* @function
*/
notDeepEqual: function( actual, expected, message ) {
QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message );
},
/**
* @name strictEqual
* @function
*/
strictEqual: function( actual, expected, message ) {
QUnit.push( expected === actual, actual, expected, message );
},
/**
* @name notStrictEqual
* @function
*/
notStrictEqual: function( actual, expected, message ) {
QUnit.push( expected !== actual, actual, expected, message );
},
"throws": function( block, expected, message ) {
var actual,
expectedOutput = expected,
ok = false;
// 'expected' is optional
if ( typeof expected === "string" ) {
message = expected;
expected = null;
}
config.current.ignoreGlobalErrors = true;
try {
block.call( config.current.testEnvironment );
} catch (e) {
actual = e;
}
config.current.ignoreGlobalErrors = false;
if ( actual ) {
// we don't want to validate thrown error
if ( !expected ) {
ok = true;
expectedOutput = null;
// expected is a regexp
} else if ( QUnit.objectType( expected ) === "regexp" ) {
ok = expected.test( errorString( actual ) );
// expected is a constructor
} else if ( actual instanceof expected ) {
ok = true;
// expected is a validation function which returns true is validation passed
} else if ( expected.call( {}, actual ) === true ) {
expectedOutput = null;
ok = true;
}
QUnit.push( ok, actual, expectedOutput, message );
} else {
QUnit.pushFailure( message, null, "No exception was thrown." );
}
}
};
/**
* @deprecated since 1.8.0
* Kept assertion helpers in root for backwards compatibility.
*/
extend( QUnit, assert );
/**
* @deprecated since 1.9.0
* Kept root "raises()" for backwards compatibility.
* (Note that we don't introduce assert.raises).
*/
QUnit.raises = assert[ "throws" ];
/**
* @deprecated since 1.0.0, replaced with error pushes since 1.3.0
* Kept to avoid TypeErrors for undefined methods.
*/
QUnit.equals = function() {
QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" );
};
QUnit.same = function() {
QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" );
};
// We want access to the constructor's prototype
(function() {
function F() {}
F.prototype = QUnit;
QUnit = new F();
// Make F QUnit's constructor so that we can add to the prototype later
QUnit.constructor = F;
}());
/**
* Config object: Maintain internal state
* Later exposed as QUnit.config
* `config` initialized at top of scope
*/
config = {
// The queue of tests to run
queue: [],
// block until document ready
blocking: true,
// when enabled, show only failing tests
// gets persisted through sessionStorage and can be changed in UI via checkbox
hidepassed: false,
// by default, run previously failed tests first
// very useful in combination with "Hide passed tests" checked
reorder: true,
// by default, modify document.title when suite is done
altertitle: true,
// by default, scroll to top of the page when suite is done
scrollTop: true,
// when enabled, all tests must call expect()
requireExpects: false,
// add checkboxes that are persisted in the query-string
// when enabled, the id is set to `true` as a `QUnit.config` property
urlConfig: [
{
id: "noglobals",
label: "Check for Globals",
tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings."
},
{
id: "notrycatch",
label: "No try-catch",
tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings."
}
],
// Set of all modules.
modules: {},
// logging callback queues
begin: [],
done: [],
log: [],
testStart: [],
testDone: [],
moduleStart: [],
moduleDone: []
};
// Export global variables, unless an 'exports' object exists,
// in that case we assume we're in CommonJS (dealt with on the bottom of the script)
if ( typeof exports === "undefined" ) {
extend( window, QUnit.constructor.prototype );
// Expose QUnit object
window.QUnit = QUnit;
}
// Initialize more QUnit.config and QUnit.urlParams
(function() {
var i,
location = window.location || { search: "", protocol: "file:" },
params = location.search.slice( 1 ).split( "&" ),
length = params.length,
urlParams = {},
current;
if ( params[ 0 ] ) {
for ( i = 0; i < length; i++ ) {
current = params[ i ].split( "=" );
current[ 0 ] = decodeURIComponent( current[ 0 ] );
// allow just a key to turn on a flag, e.g., test.html?noglobals
current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true;
urlParams[ current[ 0 ] ] = current[ 1 ];
}
}
QUnit.urlParams = urlParams;
// String search anywhere in moduleName+testName
config.filter = urlParams.filter;
// Exact match of the module name
config.module = urlParams.module;
config.testNumber = parseInt( urlParams.testNumber, 10 ) || null;
// Figure out if we're running the tests from a server or not
QUnit.isLocal = location.protocol === "file:";
}());
// Extend QUnit object,
// these after set here because they should not be exposed as global functions
extend( QUnit, {
assert: assert,
config: config,
// Initialize the configuration options
init: function() {
extend( config, {
stats: { all: 0, bad: 0 },
moduleStats: { all: 0, bad: 0 },
started: +new Date(),
updateRate: 1000,
blocking: false,
autostart: true,
autorun: false,
filter: "",
queue: [],
semaphore: 1
});
var tests, banner, result,
qunit = id( "qunit" );
if ( qunit ) {
qunit.innerHTML =
"<h1 id='qunit-header'>" + escapeText( document.title ) + "</h1>" +
"<h2 id='qunit-banner'></h2>" +
"<div id='qunit-testrunner-toolbar'></div>" +
"<h2 id='qunit-userAgent'></h2>" +
"<ol id='qunit-tests'></ol>";
}
tests = id( "qunit-tests" );
banner = id( "qunit-banner" );
result = id( "qunit-testresult" );
if ( tests ) {
tests.innerHTML = "";
}
if ( banner ) {
banner.className = "";
}
if ( result ) {
result.parentNode.removeChild( result );
}
if ( tests ) {
result = document.createElement( "p" );
result.id = "qunit-testresult";
result.className = "result";
tests.parentNode.insertBefore( result, tests );
result.innerHTML = "Running...<br/> ";
}
},
// Resets the test setup. Useful for tests that modify the DOM.
/*
DEPRECATED: Use multiple tests instead of resetting inside a test.
Use testStart or testDone for custom cleanup.
This method will throw an error in 2.0, and will be removed in 2.1
*/
reset: function() {
var fixture = id( "qunit-fixture" );
if ( fixture ) {
fixture.innerHTML = config.fixture;
}
},
// Trigger an event on an element.
// @example triggerEvent( document.body, "click" );
triggerEvent: function( elem, type, event ) {
if ( document.createEvent ) {
event = document.createEvent( "MouseEvents" );
event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
elem.dispatchEvent( event );
} else if ( elem.fireEvent ) {
elem.fireEvent( "on" + type );
}
},
// Safe object type checking
is: function( type, obj ) {
return QUnit.objectType( obj ) === type;
},
objectType: function( obj ) {
if ( typeof obj === "undefined" ) {
return "undefined";
// consider: typeof null === object
}
if ( obj === null ) {
return "null";
}
var match = toString.call( obj ).match(/^\[object\s(.*)\]$/),
type = match && match[1] || "";
switch ( type ) {
case "Number":
if ( isNaN(obj) ) {
return "nan";
}
return "number";
case "String":
case "Boolean":
case "Array":
case "Date":
case "RegExp":
case "Function":
return type.toLowerCase();
}
if ( typeof obj === "object" ) {
return "object";
}
return undefined;
},
push: function( result, actual, expected, message ) {
if ( !config.current ) {
throw new Error( "assertion outside test context, was " + sourceFromStacktrace() );
}
var output, source,
details = {
module: config.current.module,
name: config.current.testName,
result: result,
message: message,
actual: actual,
expected: expected
};
message = escapeText( message ) || ( result ? "okay" : "failed" );
message = "<span class='test-message'>" + message + "</span>";
output = message;
if ( !result ) {
expected = escapeText( QUnit.jsDump.parse(expected) );
actual = escapeText( QUnit.jsDump.parse(actual) );
output += "<table><tr class='test-expected'><th>Expected: </th><td><pre>" + expected + "</pre></td></tr>";
if ( actual !== expected ) {
output += "<tr class='test-actual'><th>Result: </th><td><pre>" + actual + "</pre></td></tr>";
output += "<tr class='test-diff'><th>Diff: </th><td><pre>" + QUnit.diff( expected, actual ) + "</pre></td></tr>";
}
source = sourceFromStacktrace();
if ( source ) {
details.source = source;
output += "<tr class='test-source'><th>Source: </th><td><pre>" + escapeText( source ) + "</pre></td></tr>";
}
output += "</table>";
}
runLoggingCallbacks( "log", QUnit, details );
config.current.assertions.push({
result: !!result,
message: output
});
},
pushFailure: function( message, source, actual ) {
if ( !config.current ) {
throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) );
}
var output,
details = {
module: config.current.module,
name: config.current.testName,
result: false,
message: message
};
message = escapeText( message ) || "error";
message = "<span class='test-message'>" + message + "</span>";
output = message;
output += "<table>";
if ( actual ) {
output += "<tr class='test-actual'><th>Result: </th><td><pre>" + escapeText( actual ) + "</pre></td></tr>";
}
if ( source ) {
details.source = source;
output += "<tr class='test-source'><th>Source: </th><td><pre>" + escapeText( source ) + "</pre></td></tr>";
}
output += "</table>";
runLoggingCallbacks( "log", QUnit, details );
config.current.assertions.push({
result: false,
message: output
});
},
url: function( params ) {
params = extend( extend( {}, QUnit.urlParams ), params );
var key,
querystring = "?";
for ( key in params ) {
if ( hasOwn.call( params, key ) ) {
querystring += encodeURIComponent( key ) + "=" +
encodeURIComponent( params[ key ] ) + "&";
}
}
return window.location.protocol + "//" + window.location.host +
window.location.pathname + querystring.slice( 0, -1 );
},
extend: extend,
id: id,
addEvent: addEvent,
addClass: addClass,
hasClass: hasClass,
removeClass: removeClass
// load, equiv, jsDump, diff: Attached later
});
/**
* @deprecated: Created for backwards compatibility with test runner that set the hook function
* into QUnit.{hook}, instead of invoking it and passing the hook function.
* QUnit.constructor is set to the empty F() above so that we can add to it's prototype here.
* Doing this allows us to tell if the following methods have been overwritten on the actual
* QUnit object.
*/
extend( QUnit.constructor.prototype, {
// Logging callbacks; all receive a single argument with the listed properties
// run test/logs.html for any related changes
begin: registerLoggingCallback( "begin" ),
// done: { failed, passed, total, runtime }
done: registerLoggingCallback( "done" ),
// log: { result, actual, expected, message }
log: registerLoggingCallback( "log" ),
// testStart: { name }
testStart: registerLoggingCallback( "testStart" ),
// testDone: { name, failed, passed, total, duration }
testDone: registerLoggingCallback( "testDone" ),
// moduleStart: { name }
moduleStart: registerLoggingCallback( "moduleStart" ),
// moduleDone: { name, failed, passed, total }
moduleDone: registerLoggingCallback( "moduleDone" )
});
if ( typeof document === "undefined" || document.readyState === "complete" ) {
config.autorun = true;
}
QUnit.load = function() {
runLoggingCallbacks( "begin", QUnit, {} );
// Initialize the config, saving the execution queue
var banner, filter, i, label, len, main, ol, toolbar, userAgent, val,
urlConfigCheckboxesContainer, urlConfigCheckboxes, moduleFilter,
numModules = 0,
moduleNames = [],
moduleFilterHtml = "",
urlConfigHtml = "",
oldconfig = extend( {}, config );
QUnit.init();
extend(config, oldconfig);
config.blocking = false;
len = config.urlConfig.length;
for ( i = 0; i < len; i++ ) {
val = config.urlConfig[i];
if ( typeof val === "string" ) {
val = {
id: val,
label: val,
tooltip: "[no tooltip available]"
};
}
config[ val.id ] = QUnit.urlParams[ val.id ];
urlConfigHtml += "<input id='qunit-urlconfig-" + escapeText( val.id ) +
"' name='" + escapeText( val.id ) +
"' type='checkbox'" + ( config[ val.id ] ? " checked='checked'" : "" ) +
" title='" + escapeText( val.tooltip ) +
"'><label for='qunit-urlconfig-" + escapeText( val.id ) +
"' title='" + escapeText( val.tooltip ) + "'>" + val.label + "</label>";
}
for ( i in config.modules ) {
if ( config.modules.hasOwnProperty( i ) ) {
moduleNames.push(i);
}
}
numModules = moduleNames.length;
moduleNames.sort( function( a, b ) {
return a.localeCompare( b );
});
moduleFilterHtml += "<label for='qunit-modulefilter'>Module: </label><select id='qunit-modulefilter' name='modulefilter'><option value='' " +
( config.module === undefined ? "selected='selected'" : "" ) +
">< All Modules ></option>";
for ( i = 0; i < numModules; i++) {
moduleFilterHtml += "<option value='" + escapeText( encodeURIComponent(moduleNames[i]) ) + "' " +
( config.module === moduleNames[i] ? "selected='selected'" : "" ) +
">" + escapeText(moduleNames[i]) + "</option>";
}
moduleFilterHtml += "</select>";
// `userAgent` initialized at top of scope
userAgent = id( "qunit-userAgent" );
if ( userAgent ) {
userAgent.innerHTML = navigator.userAgent;
}
// `banner` initialized at top of scope
banner = id( "qunit-header" );
if ( banner ) {
banner.innerHTML = "<a href='" + QUnit.url({ filter: undefined, module: undefined, testNumber: undefined }) + "'>" + banner.innerHTML + "</a> ";
}
// `toolbar` initialized at top of scope
toolbar = id( "qunit-testrunner-toolbar" );
if ( toolbar ) {
// `filter` initialized at top of scope
filter = document.createElement( "input" );
filter.type = "checkbox";
filter.id = "qunit-filter-pass";
addEvent( filter, "click", function() {
var tmp,
ol = id( "qunit-tests" );
if ( filter.checked ) {
ol.className = ol.className + " hidepass";
} else {
tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " ";
ol.className = tmp.replace( / hidepass /, " " );
}
if ( defined.sessionStorage ) {
if (filter.checked) {
sessionStorage.setItem( "qunit-filter-passed-tests", "true" );
} else {
sessionStorage.removeItem( "qunit-filter-passed-tests" );
}
}
});
if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem( "qunit-filter-passed-tests" ) ) {
filter.checked = true;
// `ol` initialized at top of scope
ol = id( "qunit-tests" );
ol.className = ol.className + " hidepass";
}
toolbar.appendChild( filter );
// `label` initialized at top of scope
label = document.createElement( "label" );
label.setAttribute( "for", "qunit-filter-pass" );
label.setAttribute( "title", "Only show tests and assertions that fail. Stored in sessionStorage." );
label.innerHTML = "Hide passed tests";
toolbar.appendChild( label );
urlConfigCheckboxesContainer = document.createElement("span");
urlConfigCheckboxesContainer.innerHTML = urlConfigHtml;
urlConfigCheckboxes = urlConfigCheckboxesContainer.getElementsByTagName("input");
// For oldIE support:
// * Add handlers to the individual elements instead of the container
// * Use "click" instead of "change"
// * Fallback from event.target to event.srcElement
addEvents( urlConfigCheckboxes, "click", function( event ) {
var params = {},
target = event.target || event.srcElement;
params[ target.name ] = target.checked ? true : undefined;
window.location = QUnit.url( params );
});
toolbar.appendChild( urlConfigCheckboxesContainer );
if (numModules > 1) {
moduleFilter = document.createElement( "span" );
moduleFilter.setAttribute( "id", "qunit-modulefilter-container" );
moduleFilter.innerHTML = moduleFilterHtml;
addEvent( moduleFilter.lastChild, "change", function() {
var selectBox = moduleFilter.getElementsByTagName("select")[0],
selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value);
window.location = QUnit.url({
module: ( selectedModule === "" ) ? undefined : selectedModule,
// Remove any existing filters
filter: undefined,
testNumber: undefined
});
});
toolbar.appendChild(moduleFilter);
}
}
// `main` initialized at top of scope
main = id( "qunit-fixture" );
if ( main ) {
config.fixture = main.innerHTML;
}
if ( config.autostart ) {
QUnit.start();
}
};
addEvent( window, "load", QUnit.load );
// `onErrorFnPrev` initialized at top of scope
// Preserve other handlers
onErrorFnPrev = window.onerror;
// Cover uncaught exceptions
// Returning true will suppress the default browser handler,
// returning false will let it run.
window.onerror = function ( error, filePath, linerNr ) {
var ret = false;
if ( onErrorFnPrev ) {
ret = onErrorFnPrev( error, filePath, linerNr );
}
// Treat return value as window.onerror itself does,
// Only do our handling if not suppressed.
if ( ret !== true ) {
if ( QUnit.config.current ) {
if ( QUnit.config.current.ignoreGlobalErrors ) {
return true;
}
QUnit.pushFailure( error, filePath + ":" + linerNr );
} else {
QUnit.test( "global failure", extend( function() {
QUnit.pushFailure( error, filePath + ":" + linerNr );
}, { validTest: validTest } ) );
}
return false;
}
return ret;
};
function done() {
config.autorun = true;
// Log the last module results
if ( config.currentModule ) {
runLoggingCallbacks( "moduleDone", QUnit, {
name: config.currentModule,
failed: config.moduleStats.bad,
passed: config.moduleStats.all - config.moduleStats.bad,
total: config.moduleStats.all
});
}
delete config.previousModule;
var i, key,
banner = id( "qunit-banner" ),
tests = id( "qunit-tests" ),
runtime = +new Date() - config.started,
passed = config.stats.all - config.stats.bad,
html = [
"Tests completed in ",
runtime,
" milliseconds.<br/>",
"<span class='passed'>",
passed,
"</span> assertions of <span class='total'>",
config.stats.all,
"</span> passed, <span class='failed'>",
config.stats.bad,
"</span> failed."
].join( "" );
if ( banner ) {
banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" );
}
if ( tests ) {
id( "qunit-testresult" ).innerHTML = html;
}
if ( config.altertitle && typeof document !== "undefined" && document.title ) {
// show ✖ for good, ✔ for bad suite result in title
// use escape sequences in case file gets loaded with non-utf-8-charset
document.title = [
( config.stats.bad ? "\u2716" : "\u2714" ),
document.title.replace( /^[\u2714\u2716] /i, "" )
].join( " " );
}
// clear own sessionStorage items if all tests passed
if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) {
// `key` & `i` initialized at top of scope
for ( i = 0; i < sessionStorage.length; i++ ) {
key = sessionStorage.key( i++ );
if ( key.indexOf( "qunit-test-" ) === 0 ) {
sessionStorage.removeItem( key );
}
}
}
// scroll back to top to show results
if ( config.scrollTop && window.scrollTo ) {
window.scrollTo(0, 0);
}
runLoggingCallbacks( "done", QUnit, {
failed: config.stats.bad,
passed: passed,
total: config.stats.all,
runtime: runtime
});
}
/** @return Boolean: true if this test should be ran */
function validTest( test ) {
var include,
filter = config.filter && config.filter.toLowerCase(),
module = config.module && config.module.toLowerCase(),
fullName = (test.module + ": " + test.testName).toLowerCase();
// Internally-generated tests are always valid
if ( test.callback && test.callback.validTest === validTest ) {
delete test.callback.validTest;
return true;
}
if ( config.testNumber ) {
return test.testNumber === config.testNumber;
}
if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) {
return false;
}
if ( !filter ) {
return true;
}
include = filter.charAt( 0 ) !== "!";
if ( !include ) {
filter = filter.slice( 1 );
}
// If the filter matches, we need to honour include
if ( fullName.indexOf( filter ) !== -1 ) {
return include;
}
// Otherwise, do the opposite
return !include;
}
// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions)
// Later Safari and IE10 are supposed to support error.stack as well
// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack
function extractStacktrace( e, offset ) {
offset = offset === undefined ? 3 : offset;
var stack, include, i;
if ( e.stacktrace ) {
// Opera
return e.stacktrace.split( "\n" )[ offset + 3 ];
} else if ( e.stack ) {
// Firefox, Chrome
stack = e.stack.split( "\n" );
if (/^error$/i.test( stack[0] ) ) {
stack.shift();
}
if ( fileName ) {
include = [];
for ( i = offset; i < stack.length; i++ ) {
if ( stack[ i ].indexOf( fileName ) !== -1 ) {
break;
}
include.push( stack[ i ] );
}
if ( include.length ) {
return include.join( "\n" );
}
}
return stack[ offset ];
} else if ( e.sourceURL ) {
// Safari, PhantomJS
// hopefully one day Safari provides actual stacktraces
// exclude useless self-reference for generated Error objects
if ( /qunit.js$/.test( e.sourceURL ) ) {
return;
}
// for actual exceptions, this is useful
return e.sourceURL + ":" + e.line;
}
}
function sourceFromStacktrace( offset ) {
try {
throw new Error();
} catch ( e ) {
return extractStacktrace( e, offset );
}
}
/**
* Escape text for attribute or text content.
*/
function escapeText( s ) {
if ( !s ) {
return "";
}
s = s + "";
// Both single quotes and double quotes (for attributes)
return s.replace( /['"<>&]/g, function( s ) {
switch( s ) {
case "'":
return "'";
case "\"":
return """;
case "<":
return "<";
case ">":
return ">";
case "&":
return "&";
}
});
}
function synchronize( callback, last ) {
config.queue.push( callback );
if ( config.autorun && !config.blocking ) {
process( last );
}
}
function process( last ) {
function next() {
process( last );
}
var start = new Date().getTime();
config.depth = config.depth ? config.depth + 1 : 1;
while ( config.queue.length && !config.blocking ) {
if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) {
config.queue.shift()();
} else {
setTimeout( next, 13 );
break;
}
}
config.depth--;
if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) {
done();
}
}
function saveGlobal() {
config.pollution = [];
if ( config.noglobals ) {
for ( var key in window ) {
if ( hasOwn.call( window, key ) ) {
// in Opera sometimes DOM element ids show up here, ignore them
if ( /^qunit-test-output/.test( key ) ) {
continue;
}
config.pollution.push( key );
}
}
}
}
function checkPollution() {
var newGlobals,
deletedGlobals,
old = config.pollution;
saveGlobal();
newGlobals = diff( config.pollution, old );
if ( newGlobals.length > 0 ) {
QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") );
}
deletedGlobals = diff( old, config.pollution );
if ( deletedGlobals.length > 0 ) {
QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") );
}
}
// returns a new Array with the elements that are in a but not in b
function diff( a, b ) {
var i, j,
result = a.slice();
for ( i = 0; i < result.length; i++ ) {
for ( j = 0; j < b.length; j++ ) {
if ( result[i] === b[j] ) {
result.splice( i, 1 );
i--;
break;
}
}
}
return result;
}
function extend( a, b ) {
for ( var prop in b ) {
if ( hasOwn.call( b, prop ) ) {
// Avoid "Member not found" error in IE8 caused by messing with window.constructor
if ( !( prop === "constructor" && a === window ) ) {
if ( b[ prop ] === undefined ) {
delete a[ prop ];
} else {
a[ prop ] = b[ prop ];
}
}
}
}
return a;
}
/**
* @param {HTMLElement} elem
* @param {string} type
* @param {Function} fn
*/
function addEvent( elem, type, fn ) {
// Standards-based browsers
if ( elem.addEventListener ) {
elem.addEventListener( type, fn, false );
// IE
} else {
elem.attachEvent( "on" + type, fn );
}
}
/**
* @param {Array|NodeList} elems
* @param {string} type
* @param {Function} fn
*/
function addEvents( elems, type, fn ) {
var i = elems.length;
while ( i-- ) {
addEvent( elems[i], type, fn );
}
}
function hasClass( elem, name ) {
return (" " + elem.className + " ").indexOf(" " + name + " ") > -1;
}
function addClass( elem, name ) {
if ( !hasClass( elem, name ) ) {
elem.className += (elem.className ? " " : "") + name;
}
}
function removeClass( elem, name ) {
var set = " " + elem.className + " ";
// Class name may appear multiple times
while ( set.indexOf(" " + name + " ") > -1 ) {
set = set.replace(" " + name + " " , " ");
}
// If possible, trim it for prettiness, but not necessarily
elem.className = typeof set.trim === "function" ? set.trim() : set.replace(/^\s+|\s+$/g, "");
}
function id( name ) {
return !!( typeof document !== "undefined" && document && document.getElementById ) &&
document.getElementById( name );
}
function registerLoggingCallback( key ) {
return function( callback ) {
config[key].push( callback );
};
}
// Supports deprecated method of completely overwriting logging callbacks
function runLoggingCallbacks( key, scope, args ) {
var i, callbacks;
if ( QUnit.hasOwnProperty( key ) ) {
QUnit[ key ].call(scope, args );
} else {
callbacks = config[ key ];
for ( i = 0; i < callbacks.length; i++ ) {
callbacks[ i ].call( scope, args );
}
}
}
// Test for equality any JavaScript type.
// Author: Philippe Rathé <prathe@gmail.com>
QUnit.equiv = (function() {
// Call the o related callback with the given arguments.
function bindCallbacks( o, callbacks, args ) {
var prop = QUnit.objectType( o );
if ( prop ) {
if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) {
return callbacks[ prop ].apply( callbacks, args );
} else {
return callbacks[ prop ]; // or undefined
}
}
}
// the real equiv function
var innerEquiv,
// stack to decide between skip/abort functions
callers = [],
// stack to avoiding loops from circular referencing
parents = [],
parentsB = [],
getProto = Object.getPrototypeOf || function ( obj ) {
/*jshint camelcase:false */
return obj.__proto__;
},
callbacks = (function () {
// for string, boolean, number and null
function useStrictEquality( b, a ) {
/*jshint eqeqeq:false */
if ( b instanceof a.constructor || a instanceof b.constructor ) {
// to catch short annotation VS 'new' annotation of a
// declaration
// e.g. var i = 1;
// var j = new Number(1);
return a == b;
} else {
return a === b;
}
}
return {
"string": useStrictEquality,
"boolean": useStrictEquality,
"number": useStrictEquality,
"null": useStrictEquality,
"undefined": useStrictEquality,
"nan": function( b ) {
return isNaN( b );
},
"date": function( b, a ) {
return QUnit.objectType( b ) === "date" && a.valueOf() === b.valueOf();
},
"regexp": function( b, a ) {
return QUnit.objectType( b ) === "regexp" &&
// the regex itself
a.source === b.source &&
// and its modifiers
a.global === b.global &&
// (gmi) ...
a.ignoreCase === b.ignoreCase &&
a.multiline === b.multiline &&
a.sticky === b.sticky;
},
// - skip when the property is a method of an instance (OOP)
// - abort otherwise,
// initial === would have catch identical references anyway
"function": function() {
var caller = callers[callers.length - 1];
return caller !== Object && typeof caller !== "undefined";
},
"array": function( b, a ) {
var i, j, len, loop, aCircular, bCircular;
// b could be an object literal here
if ( QUnit.objectType( b ) !== "array" ) {
return false;
}
len = a.length;
if ( len !== b.length ) {
// safe and faster
return false;
}
// track reference to avoid circular references
parents.push( a );
parentsB.push( b );
for ( i = 0; i < len; i++ ) {
loop = false;
for ( j = 0; j < parents.length; j++ ) {
aCircular = parents[j] === a[i];
bCircular = parentsB[j] === b[i];
if ( aCircular || bCircular ) {
if ( a[i] === b[i] || aCircular && bCircular ) {
loop = true;
} else {
parents.pop();
parentsB.pop();
return false;
}
}
}
if ( !loop && !innerEquiv(a[i], b[i]) ) {
parents.pop();
parentsB.pop();
return false;
}
}
parents.pop();
parentsB.pop();
return true;
},
"object": function( b, a ) {
/*jshint forin:false */
var i, j, loop, aCircular, bCircular,
// Default to true
eq = true,
aProperties = [],
bProperties = [];
// comparing constructors is more strict than using
// instanceof
if ( a.constructor !== b.constructor ) {
// Allow objects with no prototype to be equivalent to
// objects with Object as their constructor.
if ( !(( getProto(a) === null && getProto(b) === Object.prototype ) ||
( getProto(b) === null && getProto(a) === Object.prototype ) ) ) {
return false;
}
}
// stack constructor before traversing properties
callers.push( a.constructor );
// track reference to avoid circular references
parents.push( a );
parentsB.push( b );
// be strict: don't ensure hasOwnProperty and go deep
for ( i in a ) {
loop = false;
for ( j = 0; j < parents.length; j++ ) {
aCircular = parents[j] === a[i];
bCircular = parentsB[j] === b[i];
if ( aCircular || bCircular ) {
if ( a[i] === b[i] || aCircular && bCircular ) {
loop = true;
} else {
eq = false;
break;
}
}
}
aProperties.push(i);
if ( !loop && !innerEquiv(a[i], b[i]) ) {
eq = false;
break;
}
}
parents.pop();
parentsB.pop();
callers.pop(); // unstack, we are done
for ( i in b ) {
bProperties.push( i ); // collect b's properties
}
// Ensures identical properties name
return eq && innerEquiv( aProperties.sort(), bProperties.sort() );
}
};
}());
innerEquiv = function() { // can take multiple arguments
var args = [].slice.apply( arguments );
if ( args.length < 2 ) {
return true; // end transition
}
return (function( a, b ) {
if ( a === b ) {
return true; // catch the most you can
} else if ( a === null || b === null || typeof a === "undefined" ||
typeof b === "undefined" ||
QUnit.objectType(a) !== QUnit.objectType(b) ) {
return false; // don't lose time with error prone cases
} else {
return bindCallbacks(a, callbacks, [ b, a ]);
}
// apply transition with (1..n) arguments
}( args[0], args[1] ) && innerEquiv.apply( this, args.splice(1, args.length - 1 )) );
};
return innerEquiv;
}());
/**
* jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com |
* http://flesler.blogspot.com Licensed under BSD
* (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008
*
* @projectDescription Advanced and extensible data dumping for Javascript.
* @version 1.0.0
* @author Ariel Flesler
* @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
*/
QUnit.jsDump = (function() {
function quote( str ) {
return "\"" + str.toString().replace( /"/g, "\\\"" ) + "\"";
}
function literal( o ) {
return o + "";
}
function join( pre, arr, post ) {
var s = jsDump.separator(),
base = jsDump.indent(),
inner = jsDump.indent(1);
if ( arr.join ) {
arr = arr.join( "," + s + inner );
}
if ( !arr ) {
return pre + post;
}
return [ pre, inner + arr, base + post ].join(s);
}
function array( arr, stack ) {
var i = arr.length, ret = new Array(i);
this.up();
while ( i-- ) {
ret[i] = this.parse( arr[i] , undefined , stack);
}
this.down();
return join( "[", ret, "]" );
}
var reName = /^function (\w+)/,
jsDump = {
// type is used mostly internally, you can fix a (custom)type in advance
parse: function( obj, type, stack ) {
stack = stack || [ ];
var inStack, res,
parser = this.parsers[ type || this.typeOf(obj) ];
type = typeof parser;
inStack = inArray( obj, stack );
if ( inStack !== -1 ) {
return "recursion(" + (inStack - stack.length) + ")";
}
if ( type === "function" ) {
stack.push( obj );
res = parser.call( this, obj, stack );
stack.pop();
return res;
}
return ( type === "string" ) ? parser : this.parsers.error;
},
typeOf: function( obj ) {
var type;
if ( obj === null ) {
type = "null";
} else if ( typeof obj === "undefined" ) {
type = "undefined";
} else if ( QUnit.is( "regexp", obj) ) {
type = "regexp";
} else if ( QUnit.is( "date", obj) ) {
type = "date";
} else if ( QUnit.is( "function", obj) ) {
type = "function";
} else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) {
type = "window";
} else if ( obj.nodeType === 9 ) {
type = "document";
} else if ( obj.nodeType ) {
type = "node";
} else if (
// native arrays
toString.call( obj ) === "[object Array]" ||
// NodeList objects
( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) )
) {
type = "array";
} else if ( obj.constructor === Error.prototype.constructor ) {
type = "error";
} else {
type = typeof obj;
}
return type;
},
separator: function() {
return this.multiline ? this.HTML ? "<br />" : "\n" : this.HTML ? " " : " ";
},
// extra can be a number, shortcut for increasing-calling-decreasing
indent: function( extra ) {
if ( !this.multiline ) {
return "";
}
var chr = this.indentChar;
if ( this.HTML ) {
chr = chr.replace( /\t/g, " " ).replace( / /g, " " );
}
return new Array( this.depth + ( extra || 0 ) ).join(chr);
},
up: function( a ) {
this.depth += a || 1;
},
down: function( a ) {
this.depth -= a || 1;
},
setParser: function( name, parser ) {
this.parsers[name] = parser;
},
// The next 3 are exposed so you can use them
quote: quote,
literal: literal,
join: join,
//
depth: 1,
// This is the list of parsers, to modify them, use jsDump.setParser
parsers: {
window: "[Window]",
document: "[Document]",
error: function(error) {
return "Error(\"" + error.message + "\")";
},
unknown: "[Unknown]",
"null": "null",
"undefined": "undefined",
"function": function( fn ) {
var ret = "function",
// functions never have name in IE
name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1];
if ( name ) {
ret += " " + name;
}
ret += "( ";
ret = [ ret, QUnit.jsDump.parse( fn, "functionArgs" ), "){" ].join( "" );
return join( ret, QUnit.jsDump.parse(fn,"functionCode" ), "}" );
},
array: array,
nodelist: array,
"arguments": array,
object: function( map, stack ) {
/*jshint forin:false */
var ret = [ ], keys, key, val, i;
QUnit.jsDump.up();
keys = [];
for ( key in map ) {
keys.push( key );
}
keys.sort();
for ( i = 0; i < keys.length; i++ ) {
key = keys[ i ];
val = map[ key ];
ret.push( QUnit.jsDump.parse( key, "key" ) + ": " + QUnit.jsDump.parse( val, undefined, stack ) );
}
QUnit.jsDump.down();
return join( "{", ret, "}" );
},
node: function( node ) {
var len, i, val,
open = QUnit.jsDump.HTML ? "<" : "<",
close = QUnit.jsDump.HTML ? ">" : ">",
tag = node.nodeName.toLowerCase(),
ret = open + tag,
attrs = node.attributes;
if ( attrs ) {
for ( i = 0, len = attrs.length; i < len; i++ ) {
val = attrs[i].nodeValue;
// IE6 includes all attributes in .attributes, even ones not explicitly set.
// Those have values like undefined, null, 0, false, "" or "inherit".
if ( val && val !== "inherit" ) {
ret += " " + attrs[i].nodeName + "=" + QUnit.jsDump.parse( val, "attribute" );
}
}
}
ret += close;
// Show content of TextNode or CDATASection
if ( node.nodeType === 3 || node.nodeType === 4 ) {
ret += node.nodeValue;
}
return ret + open + "/" + tag + close;
},
// function calls it internally, it's the arguments part of the function
functionArgs: function( fn ) {
var args,
l = fn.length;
if ( !l ) {
return "";
}
args = new Array(l);
while ( l-- ) {
// 97 is 'a'
args[l] = String.fromCharCode(97+l);
}
return " " + args.join( ", " ) + " ";
},
// object calls it internally, the key part of an item in a map
key: quote,
// function calls it internally, it's the content of the function
functionCode: "[code]",
// node calls it internally, it's an html attribute value
attribute: quote,
string: quote,
date: quote,
regexp: literal,
number: literal,
"boolean": literal
},
// if true, entities are escaped ( <, >, \t, space and \n )
HTML: false,
// indentation unit
indentChar: " ",
// if true, items in a collection, are separated by a \n, else just a space.
multiline: true
};
return jsDump;
}());
// from jquery.js
function inArray( elem, array ) {
if ( array.indexOf ) {
return array.indexOf( elem );
}
for ( var i = 0, length = array.length; i < length; i++ ) {
if ( array[ i ] === elem ) {
return i;
}
}
return -1;
}
/*
* Javascript Diff Algorithm
* By John Resig (http://ejohn.org/)
* Modified by Chu Alan "sprite"
*
* Released under the MIT license.
*
* More Info:
* http://ejohn.org/projects/javascript-diff-algorithm/
*
* Usage: QUnit.diff(expected, actual)
*
* QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
*/
QUnit.diff = (function() {
/*jshint eqeqeq:false, eqnull:true */
function diff( o, n ) {
var i,
ns = {},
os = {};
for ( i = 0; i < n.length; i++ ) {
if ( !hasOwn.call( ns, n[i] ) ) {
ns[ n[i] ] = {
rows: [],
o: null
};
}
ns[ n[i] ].rows.push( i );
}
for ( i = 0; i < o.length; i++ ) {
if ( !hasOwn.call( os, o[i] ) ) {
os[ o[i] ] = {
rows: [],
n: null
};
}
os[ o[i] ].rows.push( i );
}
for ( i in ns ) {
if ( hasOwn.call( ns, i ) ) {
if ( ns[i].rows.length === 1 && hasOwn.call( os, i ) && os[i].rows.length === 1 ) {
n[ ns[i].rows[0] ] = {
text: n[ ns[i].rows[0] ],
row: os[i].rows[0]
};
o[ os[i].rows[0] ] = {
text: o[ os[i].rows[0] ],
row: ns[i].rows[0]
};
}
}
}
for ( i = 0; i < n.length - 1; i++ ) {
if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null &&
n[ i + 1 ] == o[ n[i].row + 1 ] ) {
n[ i + 1 ] = {
text: n[ i + 1 ],
row: n[i].row + 1
};
o[ n[i].row + 1 ] = {
text: o[ n[i].row + 1 ],
row: i + 1
};
}
}
for ( i = n.length - 1; i > 0; i-- ) {
if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null &&
n[ i - 1 ] == o[ n[i].row - 1 ]) {
n[ i - 1 ] = {
text: n[ i - 1 ],
row: n[i].row - 1
};
o[ n[i].row - 1 ] = {
text: o[ n[i].row - 1 ],
row: i - 1
};
}
}
return {
o: o,
n: n
};
}
return function( o, n ) {
o = o.replace( /\s+$/, "" );
n = n.replace( /\s+$/, "" );
var i, pre,
str = "",
out = diff( o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/) ),
oSpace = o.match(/\s+/g),
nSpace = n.match(/\s+/g);
if ( oSpace == null ) {
oSpace = [ " " ];
}
else {
oSpace.push( " " );
}
if ( nSpace == null ) {
nSpace = [ " " ];
}
else {
nSpace.push( " " );
}
if ( out.n.length === 0 ) {
for ( i = 0; i < out.o.length; i++ ) {
str += "<del>" + out.o[i] + oSpace[i] + "</del>";
}
}
else {
if ( out.n[0].text == null ) {
for ( n = 0; n < out.o.length && out.o[n].text == null; n++ ) {
str += "<del>" + out.o[n] + oSpace[n] + "</del>";
}
}
for ( i = 0; i < out.n.length; i++ ) {
if (out.n[i].text == null) {
str += "<ins>" + out.n[i] + nSpace[i] + "</ins>";
}
else {
// `pre` initialized at top of scope
pre = "";
for ( n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++ ) {
pre += "<del>" + out.o[n] + oSpace[n] + "</del>";
}
str += " " + out.n[i].text + nSpace[i] + pre;
}
}
}
return str;
};
}());
// for CommonJS environments, export everything
if ( typeof exports !== "undefined" ) {
extend( exports, QUnit.constructor.prototype );
}
// get at whatever the global object is, like window in browsers
}( (function() {return this;}.call()) ));
| {
"content_hash": "4b83963c6761a0f2e906d3a95450cd6e",
"timestamp": "",
"source": "github",
"line_count": 2207,
"max_line_length": 179,
"avg_line_length": 26.56728590847304,
"alnum_prop": 0.5991574854180168,
"repo_name": "MarcDiethelm/xtc-site",
"id": "a3d3fbfe75ce6037620836ca339f5cf8b6bd03f8",
"size": "58857",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "frontend/_public/lib/test/qunit-90afd90147.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "35234"
},
{
"name": "JavaScript",
"bytes": "201956"
}
],
"symlink_target": ""
} |
class StocksController < ApplicationController
def index
@stocks = Stock.all
end
def new
@stock = Stock.new
end
def create
Stock.create(stock_params)
redirect_to stocks_url
end
def edit
find_models
end
def update
find_models
@stock.update_attributes(stock_params)
redirect_to stocks_url
end
private
def find_models
@stock = Stock.find(params[:id])
end
def stock_params #scary internet people
params.require(:stock).permit(:ticker_symbol, :company_name, :price)
end
end
| {
"content_hash": "f02d47823f87a09ab69f3a0e1b159f8e",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 72,
"avg_line_length": 15.628571428571428,
"alnum_prop": 0.6782449725776966,
"repo_name": "icstunna/wsot",
"id": "3264e8d4e340f7b698ddfbde58177dfcdf90b6e3",
"size": "547",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/controllers/stocks_controller.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1408"
},
{
"name": "CoffeeScript",
"bytes": "844"
},
{
"name": "HTML",
"bytes": "15023"
},
{
"name": "JavaScript",
"bytes": "661"
},
{
"name": "Ruby",
"bytes": "54165"
}
],
"symlink_target": ""
} |
<?php
namespace app\modules\shop\models;
use Yii;
/**
* This is the model class for table "products".
*
* @property integer $id
* @property string $type
* @property string $title
* @property string $description
* @property double $price
*/
class Product extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'products';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['title', 'description', 'price'], 'required'],
[['price'], 'number'],
[['type'], 'string', 'max' => 30],
[['title'], 'string', 'max' => 500],
[['description'], 'string', 'max' => 1000]
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'type' => 'Тип',
'title' => 'Заголовок',
'description' => 'Описание',
'price' => 'Цена',
];
}
}
| {
"content_hash": "6579c11c84515c79c2ad537da1556750",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 60,
"avg_line_length": 19.60377358490566,
"alnum_prop": 0.4706448508180943,
"repo_name": "Makc197/mysite.loc",
"id": "28aca12087d8ec0a0f11500259a61bd59064ae59",
"size": "1063",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/shop/models/Product.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1030"
},
{
"name": "CSS",
"bytes": "1418"
},
{
"name": "JavaScript",
"bytes": "2324"
},
{
"name": "PHP",
"bytes": "116722"
}
],
"symlink_target": ""
} |
@class NSFont;
#else
class NSFont;
#endif
// Provides functionality to transmit fonts over IPC.
//
// Note about font formats: .dfont (datafork suitcase) fonts are currently not
// supported by this code since CGFontCreateWithDataProvider() can't handle them
// directly.
class FontLoader {
public:
// Load a font specified by |font_to_encode| into a shared memory buffer
// suitable for sending over IPC.
//
// On return:
// returns true on success, false on failure.
// |font_data| - shared memory buffer containing the raw data for the font
// file.
// |font_data_size| - size of data contained in |font_data|.
// |font_id| - unique identifier for the on-disk file we load for the font.
CONTENT_EXPORT
static bool LoadFontIntoBuffer(NSFont* font_to_encode,
base::SharedMemory* font_data,
uint32* font_data_size,
uint32* font_id);
// Given a shared memory buffer containing the raw data for a font file, load
// the font and return a CGFontRef.
//
// |data| - A shared memory handle pointing to the raw data from a font file.
// |data_size| - Size of |data|.
//
// On return:
// returns true on success, false on failure.
// |out| - A CGFontRef corresponding to the designated font.
// The caller is responsible for releasing this value via CGFontRelease()
// when done.
CONTENT_EXPORT
static bool CGFontRefFromBuffer(base::SharedMemoryHandle font_data,
uint32 font_data_size,
CGFontRef* out);
};
#endif // CONTENT_COMMON_MAC_FONT_LOADER_H_
| {
"content_hash": "44e57b07b55cc613807e6233661ac9b1",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 80,
"avg_line_length": 36.32608695652174,
"alnum_prop": 0.6391382405745063,
"repo_name": "gavinp/chromium",
"id": "0b6441746b505899eb701c3c7a3ed5b6d7783ac9",
"size": "2085",
"binary": false,
"copies": "2",
"ref": "refs/heads/trunk",
"path": "content/common/mac/font_loader.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "1178292"
},
{
"name": "C",
"bytes": "72353788"
},
{
"name": "C++",
"bytes": "117593783"
},
{
"name": "F#",
"bytes": "381"
},
{
"name": "Go",
"bytes": "10440"
},
{
"name": "Java",
"bytes": "24087"
},
{
"name": "JavaScript",
"bytes": "8781314"
},
{
"name": "Objective-C",
"bytes": "5340290"
},
{
"name": "PHP",
"bytes": "97796"
},
{
"name": "Perl",
"bytes": "918286"
},
{
"name": "Python",
"bytes": "5942009"
},
{
"name": "R",
"bytes": "524"
},
{
"name": "Shell",
"bytes": "4149832"
},
{
"name": "Tcl",
"bytes": "255109"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.