code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
module MapsHelper
def table_measures(width, height, count)
columns, rows = 1, 1
column_width, row_height = width, height
while count > columns * rows
if column_width > row_height
column_width = column_width * columns / (columns + 1)
columns += 1
else
row_height = row_height * rows / (rows + 1)
rows += 1
end
end
[columns, rows, column_width, row_height]
end
def cell_color(metric, divergence)
if !metric
"#FFFFFF"
elsif !divergence
"#F0F0F0"
elsif divergence <= 1 && divergence >= -1
"#FFFFFF"
elsif divergence > 1
red_blue = (255 - (-1 / (((divergence - 1) / 4) + 1) + 1) * 255).to_i.to_s(16)
red_blue = "0#{red_blue}" if red_blue.size == 1
"##{red_blue}FF#{red_blue}"
else
green_blue = (255 - (-1 / (((-divergence - 1) / 4) + 1) + 1) * 255).to_i.to_s(16)
green_blue = "0#{green_blue}" if green_blue.size == 1
"#FF#{green_blue}#{green_blue}"
end
end
def format_divergence(metric, divergence)
if !metric
nil
elsif divergence
if divergence >= 0
"+#{divergence.round(2)}"
else
"#{divergence.round(2)}"
end
else
''
end
end
def chart_url(metric, time)
url = "https://metrics.librato.com/metrics/#{metric.name}?duration=864000"
url += "&end_time=#{(time - 1.hour).to_i}" if time
url
end
end
| marcelrf/shepherd | app/helpers/maps_helper.rb | Ruby | mit | 1,428 |
<?php
/*
* This file is part of the YiiImage package.
*
* (c) Igor Golovanov <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Base font event.
*
* @author Igor Golovanov <[email protected]>
*
* @property-read YiiImageFont $font Font.
*/
class YiiImageFontEvent extends CEvent
{
/**
* Font.
*
* @var YiiImageFont
*/
private $_font;
/**
* Constructor.
*
* @param YiiImageFont $font
* @param mixed $sender
* @param mixed $params
*/
public function __construct(YiiImageFont $font, $sender = null,
$params = null)
{
$this->_font = $font;
parent::__construct($sender, $params);
}
/**
* Font.
*
* @return YiiImageFont
*/
public function getFont()
{
return $this->_font;
}
}
| golovanov/php-ext-zendframework | yii-image/YiiImageFontEvent.php | PHP | mit | 981 |
#ifndef OPTIONSMODEL_H
#define OPTIONSMODEL_H
#include <QAbstractListModel>
/** Interface from Qt to configuration data structure for Bitcoin client.
To Qt, the options are presented as a list with the different options
laid out vertically.
This can be changed to a tree once the settings become sufficiently
complex.
*/
class OptionsModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit OptionsModel(QObject *parent = 0);
enum OptionID {
StartAtStartup, // bool
MinimizeToTray, // bool
MapPortUPnP, // bool
MinimizeOnClose, // bool
ProxyUse, // bool
ProxyIP, // QString
ProxyPort, // int
ProxySocksVersion, // int
Fee, // qint64
DisplayUnit, // BitcoinUnits::Unit
DisplayAddresses, // bool
DisplayDateTimeISO,// bool
DetachDatabases, // bool
Language, // QString
CoinControlFeatures, // bool
OptionIDRowCount,
};
void Init();
/* Migrate settings from wallet.dat after app initialization */
bool Upgrade(); /* returns true if settings upgraded */
int rowCount(const QModelIndex & parent = QModelIndex()) const;
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
/* Explicit getters */
qint64 getTransactionFee();
bool getMinimizeToTray();
bool getMinimizeOnClose();
int getDisplayUnit();
bool getDisplayAddresses();
bool getDisplayDateTimeISO();
bool getCoinControlFeatures();
QString getLanguage() { return language; }
private:
int nDisplayUnit;
bool bDisplayAddresses;
bool bDisplayDateTimeISO;
bool fMinimizeToTray;
bool fMinimizeOnClose;
bool fCoinControlFeatures;
QString language;
signals:
void displayUnitChanged(int unit);
void transactionFeeChanged(qint64);
void coinControlFeaturesChanged(bool);
};
#endif // OPTIONSMODEL_H
| zeitcoin/zeitcoin | src/qt/optionsmodel.h | C | mit | 2,098 |
"use strict";
var database = require('../database');
var AddPager = require('../views/AddPager');
var IndexAction = require("./index");
var LoginAction = require('./login');
var post = require('./post');
module.exports = function (req, res) {
if(!(req.session.isLogined)) {
LoginAction(req,res);
return;
}
if(req.method == 'GET') {
res.end(new AddPager({},req.session.isLogined).render());
} else {
post(req).then(function (data) {
var errors = {};
if(!(data.title && data.title.length>=5)) {
errors.title = "title char length >= 5";
}
if(!(data.body && data.body.length>=10)) {
errors.body = "body char length >= 10";
}
if(Object.keys(errors).length) {
res.end(new AddPager(errors,req.session.isLogined).render());
} else{
database.add(data);
IndexAction(req,res);
}
})
}
}; | jcshawn/jc-lesson | action/add.js | JavaScript | mit | 1,014 |
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<ul>
<li>Bullet 1</li>
<li>Bullet 5</li>
</ul>
| jstransformers/jstransformer-ect | test/test2/expected.html | HTML | mit | 87 |
require 'extlib'
class Object
def present?
!blank?
end
end
| genki/extlib-present | lib/extlib-present/present.rb | Ruby | mit | 68 |
// Require Node modules in the browser thanks to Browserify: http://browserify.org
var bespoke = require('bespoke'),
classes = require('bespoke-classes'),
keys = require('bespoke-keys'),
touch = require('bespoke-touch'),
bullets = require('bespoke-bullets'),
backdrop = require('bespoke-backdrop'),
scale = require('bespoke-scale'),
hash = require('bespoke-hash'),
progress = require('bespoke-progress');
// Bespoke.js
bespoke.from('article', [
classes(),
keys(),
touch(),
bullets('li, .bullet'),
backdrop(),
scale(),
hash(),
progress()
]);
// Prism syntax highlighting
// This is actually loaded from "bower_components" thanks to
// debowerify: https://github.com/eugeneware/debowerify
require('prism');
| FlxPeters/git-flow | src/scripts/main.js | JavaScript | mit | 740 |
'use strict';
// Imageuploaders controller
angular.module('imageuploaders').controller('ImageuploadersController', [
'$scope', '$stateParams', '$location', 'Authentication', 'Upload', '$http',
function($scope, $stateParams, $location, Authentication, Upload, $http) {
$scope.authentication = Authentication;
}
]).directive("fileread", [function () {
return {
scope: {
fileread: "="
},
link: function (scope, element, attributes) {
element.bind("change", function (changeEvent) {
scope.$apply(function () {
scope.fileread = changeEvent.target.files[0];
// or all selected files:
// scope.fileread = changeEvent.target.files;
});
});
}
};
}]);
| H3rN4n/mascoteros | public/modules/imageuploaders/controllers/imageuploaders.client.controller.js | JavaScript | mit | 763 |
<?php
declare(strict_types = 1);
namespace Tests\Innmind\TimeContinuum\Earth\Timezone\Asia;
use Innmind\TimeContinuum\{
Earth\Timezone\Asia\Yekaterinburg,
Timezone,
};
use PHPUnit\Framework\TestCase;
class YekaterinburgTest extends TestCase
{
public function testInterface()
{
$zone = new Yekaterinburg;
$this->assertInstanceOf(Timezone::class, $zone);
}
}
| Innmind/TimeContinuum | tests/Earth/Timezone/Asia/YekaterinburgTest.php | PHP | mit | 397 |
/*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2015 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
//Provides default renderer for control sap.ui.table.DataTable
sap.ui.define(['jquery.sap.global', 'sap/ui/core/Renderer', './TreeTableRenderer'],
function(jQuery, Renderer, TreeTableRenderer) {
"use strict";
/**
* DataTableRenderer
* @namespace
*/
var DataTableRenderer = Renderer.extend(TreeTableRenderer);
return DataTableRenderer;
}, /* bExport= */ true);
| marinho/german-articles | webapp/resources/sap/ui/table/DataTableRenderer-dbg.js | JavaScript | mit | 563 |
package com.zhanghedr.adapter;
/**
* USB to TypeC for 2016 MacBook Pro
*
* @author hzhang
*/
public class PortAdapter implements Usb {
private Typec typec;
public PortAdapter(Typec typec) {
this.typec = typec;
}
@Override
public void pluginUsb() {
typec.pluginTypec();
}
}
| zhanghedr/design-pattern | src/main/java/com/zhanghedr/adapter/PortAdapter.java | Java | mit | 343 |
"%MLAB_ROOT%\MeVis\Foundation\BuildTools\Scripts\createProject.bat" flann
| hjkuijf/MeVisLab-Hausdorff-distance | ISI/ThirdParty/Sources/flann/flann.bat | Batchfile | mit | 76 |
using Newtonsoft.Json;
namespace PayantDotNet.Invoice
{
public class InvoiceHistoryResponse
{
[JsonProperty("status")]
public string Status { get; set; }
[JsonProperty("data")]
public InvoiceHistory Data { get; set; }
}
} | TNkemdilim/Payant.NET | PayantCSharp/Invoice/InvoiceHistoryResponse.cs | C# | mit | 270 |
<?php
/**
* Created by PhpStorm.
* User: baldez
* Date: 12/07/16
* Time: 15:13
*/
class Login_Model extends CI_Model
{
private $table = "tb_usuario";
function __construct(){
parent::__construct();
}
public function verifica($login, $senha){
$result = $this->db->query("SELECT
tb_usuario.id,
tb_usuario.nome as nome,
tb_usuario.login as login,
tb_usuario.id_perfil as id_perfil,
tb_perfil.nome as perfil,
tb_empresa.nome_fantasia as empresa,
tb_usuario.id_empresa as id_empresa,
tb_usuario.ativo as ativo
FROM {$this->table}
INNER JOIN tb_perfil ON tb_perfil.id = tb_usuario.id_perfil
INNER JOIN tb_empresa ON tb_empresa.id = tb_usuario.id_empresa
WHERE tb_usuario.login = '{$login}' AND tb_usuario.senha = '{$senha}'
");
return $result->result();
}
} | pablospfc/salao | application/models/Login_Model.php | PHP | mit | 1,336 |
package com.squad.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.squad.model.User;
@Controller
@RequestMapping("/")
public class SecurityNavigationController extends MainController {
public static final String USER_PROFILE_JSP = "userProfile";
public static final String USERNAME = "username";
@RequestMapping(value = "default", method = RequestMethod.GET)
public ModelAndView defaultAfterLogin(HttpServletRequest request) {
request.getSession().setAttribute(USERNAME, request.getUserPrincipal().getName());
return new ModelAndView(USER_PROFILE_JSP).addObject(USER, new User());
}
@RequestMapping(value = "login", method = RequestMethod.GET)
public ModelAndView loginForm() {
return new ModelAndView(INDEX_JSP);
}
@RequestMapping(value = "login/failure", method = RequestMethod.GET)
public ModelAndView loginFailure(HttpServletRequest request) {
ModelAndView modelAndView = new ModelAndView(INDEX_JSP);
return modelAndView;
}
@RequestMapping(value = { "logout" }, method = RequestMethod.GET)
public String successLogut(HttpServletRequest request) {
return "redirect:/";
}
@RequestMapping(value = "/", method = RequestMethod.GET)
public ModelAndView index(HttpServletRequest request) {
ModelAndView modelAndView = new ModelAndView(INDEX_JSP);
createMenu(request, modelAndView);
return modelAndView;
}
} | adrianaoana13/RealEstateManagement | src/main/java/com/squad/controller/SecurityNavigationController.java | Java | mit | 1,598 |
'use strict';
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var PropTypes = _interopDefault(require('prop-types'));
var React = require('react');
var React__default = _interopDefault(React);
var ReactDOM = _interopDefault(require('react-dom'));
Object.assign = Object.assign ||
function(target) {
var arguments$1 = arguments;
for (var i = 1; i < arguments.length; i++) {
var source = arguments$1[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
function mask(value, precision, decimalSeparator, thousandSeparator, allowNegative, prefix, suffix){
if ( precision === void 0 ) precision = 2;
if ( decimalSeparator === void 0 ) decimalSeparator = '.';
if ( thousandSeparator === void 0 ) thousandSeparator = ',';
if ( allowNegative === void 0 ) allowNegative = false;
if ( prefix === void 0 ) prefix = '';
if ( suffix === void 0 ) suffix = '';
// provide some default values and arg validation.
if (precision < 0) { precision = 0; } // precision cannot be negative
if (precision > 20) { precision = 20; } // precision cannot be greater than 20
if (value === null || value===undefined) {
return {
value: 0,
maskedValue: ''
};
}
value = String(value); //if the given value is a Number, let's convert into String to manipulate that
if (value.length == 0) {
return {
value: 0,
maskedValue: ''
};
}
// extract digits. if no digits, fill in a zero.
var digits = value.match(/\d/g) || ['0'];
var numberIsNegative = false;
if (allowNegative) {
var negativeSignCount = (value.match(/-/g) || []).length;
// number will be negative if we have an odd number of "-"
// ideally, we should only ever have 0, 1 or 2 (positive number, making a number negative
// and making a negative number positive, respectively)
numberIsNegative = negativeSignCount % 2 === 1;
// if every digit in the array is '0', then the number should never be negative
var allDigitsAreZero = true;
for (var idx=0; idx < digits.length; idx += 1) {
if(digits[idx] !== '0') {
allDigitsAreZero = false;
break;
}
}
if (allDigitsAreZero) {
numberIsNegative = false;
}
}
// zero-pad a input
while (digits.length <= precision) { digits.unshift('0'); }
if (precision > 0) {
// add the decimal separator
digits.splice(digits.length - precision, 0, ".");
}
// clean up extraneous digits like leading zeros.
digits = Number(digits.join('')).toFixed(precision).split('');
var raw = Number(digits.join(''));
var decimalpos = digits.length - precision - 1; // -1 needed to position the decimal separator before the digits.
if (precision > 0) {
// set the final decimal separator
digits[decimalpos] = decimalSeparator;
} else {
// when precision is 0, there is no decimal separator.
decimalpos = digits.length;
}
// add in any thousand separators
for (var x=decimalpos - 3; x > 0; x = x - 3) {
digits.splice(x, 0, thousandSeparator);
}
// if we have a prefix or suffix, add them in.
if (prefix.length > 0) { digits.unshift(prefix); }
if (suffix.length > 0) { digits.push(suffix); }
// if the number is negative, insert a "-" to
// the front of the array and negate the raw value
if (allowNegative && numberIsNegative) {
digits.unshift('-');
raw = -raw;
}
return {
value: raw,
maskedValue: digits.join('').trim()
};
}
// IE* parseFloat polyfill
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseFloat#Polyfill
Number.parseFloat = parseFloat;
var CurrencyInput = (function (Component$$1) {
function CurrencyInput(props) {
Component$$1.call(this, props);
this.prepareProps = this.prepareProps.bind(this);
this.handleChange = this.handleChange.bind(this);
this.handleFocus = this.handleFocus.bind(this);
this.state = this.prepareProps(this.props);
this.inputSelectionStart = 1;
this.inputSelectionEnd = 1;
}
if ( Component$$1 ) CurrencyInput.__proto__ = Component$$1;
CurrencyInput.prototype = Object.create( Component$$1 && Component$$1.prototype );
CurrencyInput.prototype.constructor = CurrencyInput;
/**
* Exposes the current masked value.
*
* @returns {String}
*/
CurrencyInput.prototype.getMaskedValue = function getMaskedValue () {
return this.state.maskedValue;
};
/**
* General function used to cleanup and define the final props used for rendering
* @returns {{ maskedValue: {String}, value: {Number}, customProps: {Object} }}
*/
CurrencyInput.prototype.prepareProps = function prepareProps (props) {
var customProps = Object.assign({}, props); // babeljs converts to Object.assign, then polyfills.
delete customProps.onChange;
delete customProps.onChangeEvent;
delete customProps.value;
delete customProps.decimalSeparator;
delete customProps.thousandSeparator;
delete customProps.precision;
delete customProps.inputType;
delete customProps.allowNegative;
delete customProps.allowEmpty;
delete customProps.prefix;
delete customProps.suffix;
delete customProps.selectAllOnFocus;
delete customProps.autoFocus;
var initialValue = props.value;
if (initialValue === null) {
initialValue = props.allowEmpty? null : '';
}else{
if (typeof initialValue == 'string') {
// Some people, when confronted with a problem, think "I know, I'll use regular expressions."
// Now they have two problems.
// Strip out thousand separators, prefix, and suffix, etc.
if (props.thousandSeparator === "."){
// special handle the . thousand separator
initialValue = initialValue.replace(/\./g, '');
}
if (props.decimalSeparator != "."){
// fix the decimal separator
initialValue = initialValue.replace(new RegExp(props.decimalSeparator, 'g'), '.');
}
//Strip out anything that is not a digit, -, or decimal separator
initialValue = initialValue.replace(/[^0-9-.]/g, '');
// now we can parse.
initialValue = Number.parseFloat(initialValue);
}
initialValue = Number(initialValue).toLocaleString(undefined, {
style : 'decimal',
minimumFractionDigits: props.precision,
maximumFractionDigits: props.precision
});
}
var ref = mask(
initialValue,
props.precision,
props.decimalSeparator,
props.thousandSeparator,
props.allowNegative,
props.prefix,
props.suffix
);
var maskedValue = ref.maskedValue;
var value = ref.value;
return { maskedValue: maskedValue, value: value, customProps: customProps };
};
/**
* Component lifecycle function.
* Invoked when a component is receiving new props. This method is not called for the initial render.
*
* @param nextProps
* @see https://facebook.github.io/react/docs/component-specs.html#updating-componentwillreceiveprops
*/
CurrencyInput.prototype.componentWillReceiveProps = function componentWillReceiveProps (nextProps) {
this.setState(this.prepareProps(nextProps));
};
/**
* Component lifecycle function.
* @returns {XML}
* @see https://facebook.github.io/react/docs/react-component.html#componentdidmount
*/
CurrencyInput.prototype.componentDidMount = function componentDidMount (){
var node = ReactDOM.findDOMNode(this.theInput);
var selectionStart, selectionEnd;
if (this.props.autoFocus) {
this.theInput.focus();
selectionEnd = this.state.maskedValue.length - this.props.suffix.length;
selectionStart = selectionEnd;
} else {
selectionEnd = Math.min(node.selectionEnd, this.theInput.value.length - this.props.suffix.length);
selectionStart = Math.min(node.selectionStart, selectionEnd);
}
node.setSelectionRange(selectionStart, selectionEnd);
};
/**
* Component lifecycle function
* @returns {XML}
* @see https://facebook.github.io/react/docs/react-component.html#componentwillupdate
*/
CurrencyInput.prototype.componentWillUpdate = function componentWillUpdate () {
var node = ReactDOM.findDOMNode(this.theInput);
this.inputSelectionStart = node.selectionStart;
this.inputSelectionEnd = node.selectionEnd;
};
/**
* Component lifecycle function.
* @returns {XML}
* @see https://facebook.github.io/react/docs/react-component.html#componentdidupdate
*/
CurrencyInput.prototype.componentDidUpdate = function componentDidUpdate (prevProps, prevState){
var ref = this.props;
var decimalSeparator = ref.decimalSeparator;
var node = ReactDOM.findDOMNode(this.theInput);
var isNegative = (this.theInput.value.match(/-/g) || []).length % 2 === 1;
var minPos = this.props.prefix.length + (isNegative ? 1 : 0);
var selectionEnd = Math.max(minPos, Math.min(this.inputSelectionEnd, this.theInput.value.length - this.props.suffix.length));
var selectionStart = Math.max(minPos, Math.min(this.inputSelectionEnd, selectionEnd));
var regexEscapeRegex = /[-[\]{}()*+?.,\\^$|#\s]/g;
var separatorsRegex = new RegExp(decimalSeparator.replace(regexEscapeRegex, '\\$&') + '|' + this.props.thousandSeparator.replace(regexEscapeRegex, '\\$&'), 'g');
var currSeparatorCount = (this.state.maskedValue.match(separatorsRegex) || []).length;
var prevSeparatorCount = (prevState.maskedValue.match(separatorsRegex) || []).length;
var adjustment = Math.max(currSeparatorCount - prevSeparatorCount, 0);
selectionEnd = selectionEnd + adjustment;
selectionStart = selectionStart + adjustment;
var precision = Number(this.props.precision);
var baselength = this.props.suffix.length
+ this.props.prefix.length
+ (precision > 0 ? decimalSeparator.length : 0) // if precision is 0 there will be no decimal part
+ precision
+ 1; // This is to account for the default '0' value that comes before the decimal separator
if (this.state.maskedValue.length == baselength){
// if we are already at base length, position the cursor at the end.
selectionEnd = this.theInput.value.length - this.props.suffix.length;
selectionStart = selectionEnd;
}
node.setSelectionRange(selectionStart, selectionEnd);
this.inputSelectionStart = selectionStart;
this.inputSelectionEnd = selectionEnd;
};
/**
* onChange Event Handler
* @param event
*/
CurrencyInput.prototype.handleChange = function handleChange (event) {
var this$1 = this;
event.preventDefault();
var ref = mask(
event.target.value,
this.props.precision,
this.props.decimalSeparator,
this.props.thousandSeparator,
this.props.allowNegative,
this.props.prefix,
this.props.suffix
);
var maskedValue = ref.maskedValue;
var value = ref.value;
event.persist(); // fixes issue #23
this.setState({ maskedValue: maskedValue, value: value }, function () {
this$1.props.onChange(maskedValue, value, event);
this$1.props.onChangeEvent(event, maskedValue, value);
});
};
/**
* onFocus Event Handler
* @param event
*/
CurrencyInput.prototype.handleFocus = function handleFocus (event) {
if (!this.theInput) { return; }
//Whenever we receive focus check to see if the position is before the suffix, if not, move it.
var selectionEnd = this.theInput.value.length - this.props.suffix.length;
var isNegative = (this.theInput.value.match(/-/g) || []).length % 2 === 1;
var selectionStart = this.props.prefix.length + (isNegative ? 1 : 0);
this.props.selectAllOnFocus && event.target.setSelectionRange(selectionStart, selectionEnd);
this.inputSelectionStart = selectionStart;
this.inputSelectionEnd = selectionEnd;
};
CurrencyInput.prototype.handleBlur = function handleBlur (event) {
this.inputSelectionStart = 0;
this.inputSelectionEnd = 0;
};
/**
* Component lifecycle function.
* @returns {XML}
* @see https://facebook.github.io/react/docs/component-specs.html#render
*/
CurrencyInput.prototype.render = function render () {
var this$1 = this;
return (
React__default.createElement( 'input', Object.assign({},
{ ref: function (input) { this$1.theInput = input; }, type: this.props.inputType, value: this.state.maskedValue, onChange: this.handleChange, onFocus: this.handleFocus, onMouseUp: this.handleFocus }, this.state.customProps))
)
};
return CurrencyInput;
}(React.Component));
/**
* Prop validation.
* @see https://facebook.github.io/react/docs/component-specs.html#proptypes
*/
CurrencyInput.propTypes = {
onChange: PropTypes.func,
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
decimalSeparator: PropTypes.string,
thousandSeparator: PropTypes.string,
precision: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
inputType: PropTypes.string,
allowNegative: PropTypes.bool,
allowEmpty: PropTypes.bool,
prefix: PropTypes.string,
suffix: PropTypes.string,
selectAllOnFocus: PropTypes.bool
};
CurrencyInput.defaultProps = {
onChange: function(maskValue, value, event) {/*no-op*/},
onChangeEvent: function(event, maskValue, value) {/*no-op*/},
autoFocus: false,
value: '0',
decimalSeparator: '.',
thousandSeparator: ',',
precision: '2',
inputType: 'text',
allowNegative: false,
prefix: '',
suffix: '',
selectAllOnFocus: false
};
module.exports = CurrencyInput;
//# sourceMappingURL=react-currency-input.cjs.js.map
| jsillitoe/react-currency-input | lib/react-currency-input.cjs.js | JavaScript | mit | 14,978 |
"""
Django settings for runnerreads project.
Generated by 'django-admin startproject' using Django 1.11.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
import dj_database_url
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '*n^9kvgsf!bej+znd@fleewok6l9868rc7k(0$ubbd90psb6^2'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
# Allow all host headers
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'reads.apps.ReadsConfig',
'rest_framework.authtoken',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
# Simplified static file serving.
# https://warehouse.python.org/project/whitenoise/
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'runnerreads.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'runnerreads.wsgi.application'
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
'rest_framework.authentication.SessionAuthentication',
)
}
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Update database configuration with $DATABASE_URL.
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
DATABASES['default']['TEST'] = {'NAME': DATABASES['default']['NAME']}
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'America/New_York'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
STATIC_URL = '/static/'
# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(PROJECT_ROOT, 'static'),
)
# Simplified static file serving.
# https://warehouse.python.org/project/whitenoise/
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
| mguarascio/runnerreads-com | runnerreads/settings.py | Python | mit | 4,189 |
---
layout: default
---

#Above you see a logo I created using Adobe Illustrator. Using there preset shapes and addtional tools such as the pen tool and marquese tool, as well as some downloaded fonts from [DaFont] (https://dafont.com).
| jhermida/jhermida.github.io | project1.md | Markdown | mit | 318 |
html, body {
margin: 10px 20px 0;
background-color: lightgray;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
header {
margin: 0;
padding-top: 15px;
padding-bottom: 20px;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
margin-top: 10px;
margin-bottom: 6px;
}
.outer-container {
margin: 0;
padding: 0;
}
.command-line-frame {
font-family: "Courier New", Courier, monospace;
}
.cliwe-terminal-container {
box-sizing: border-box;
width: 70%;
float: left;
padding-right: 10px;
}
.cliwe-pin-board-container {
box-sizing: border-box;
width: 30%;
float: left;
padding-left: 10px;
}
.cliwe-terminal {
height: 400px;
border: solid 1px black;
overflow: auto;
position: relative;
background-color: white;
}
.cliwe-terminal-control {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
text-align: right;
margin: 5px 0 5px;
}
.multi-line-tip {
display: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: grey;
margin: 0 10px 0 10px;
}
.control-button {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
margin: 0 10px 0 10px;
}
.cliwe-pin-board {
min-height: 400px;
border: solid 1px black;
overflow: auto;
background-color: white;
}
.cliwe-completions {
color: cornflowerblue;
background-color: lightgray;
}
.cliwe-selected {
color: white;
background-color: cornflowerblue;
}
.cliwe-completion:hover {
color: white;
background-color: cadetblue;
}
.cliwe {
font-family: "Courier New", Courier, monospace;
}
.black {
color: black;
}
.orange {
color: orange;
}
.green {
color: green;
}
.trade-price, .trade-button {
text-align: right;
}
.trading-engine {
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
font-size: 12px;
}
.trade-price {
font-weight: bold;
}
.up-tick {
color: darkgreen;
}
.down-tick {
color: red;
}
input {
text-align: right;
}
.quantity {
width: 100%;
}
.header {
font-weight: bolder;
}
| lsgro/cliwe | cliwe-sample/public/stylesheets/main.css | CSS | mit | 2,282 |
<?php
/**
* @license MIT
* Full license text in LICENSE file
*/
namespace Eadrax\Core\Usecase\Project\Track;
use Eadrax\Core\Data;
use Eadrax\Core\Tool;
use Eadrax\Core\Exception;
class Fan extends Data\User
{
public $id;
private $repository;
private $authenticator;
public function __construct(Repository $repository, Tool\Authenticator $authenticator)
{
$fan = $authenticator->get_user();
$this->id = $fan->id;
$this->repository = $repository;
$this->authenticator = $authenticator;
}
public function authorise()
{
if ( ! $this->authenticator->logged_in())
throw new Exception\Authorisation('You need to be logged in');
}
public function get_number_of_projects_owned_by_author($author_id)
{
return $this->repository->get_number_of_tracked_projects_owned_by_author($this->id, $author_id);
}
}
| Moult/eadrax-old | src/Eadrax/Core/Usecase/Project/Track/Fan.php | PHP | mit | 910 |
# NoVo Pi
## Automation project using Raspberry Pi for the discipline IA 351 of the School of Electrical Engineering and Computation.
### Goal: Build an WiFi audio system powered by Raspberry Pi.
### [Google Drive Folder](https://drive.google.com/drive/folders/0Bya8k2QmcALYYzMxWENRRXh2UGc?usp=sharing)
### Original Members:
* Arthur Zanatta da Costa RA: 116194
* Mauricio Donatti RA: 092374
* Ricardo Zago RA: 118570
### Professors:
* Fabiano Fruett
* Lucas H. Gabrielli
| ricardozago/NoVo-Pi | README.md | Markdown | mit | 479 |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
* Copyright (c) 2016, Globo.com (https://github.com/globocom)
*
* License: MIT
*/
var _default = function (_React$Component) {
_inherits(_default, _React$Component);
function _default() {
_classCallCheck(this, _default);
return _possibleConstructorReturn(this, (_default.__proto__ || Object.getPrototypeOf(_default)).apply(this, arguments));
}
_createClass(_default, [{
key: "render",
value: function render() {
return _react2.default.createElement(
"svg",
{ width: "24", height: "24", viewBox: "0 0 24 24" },
_react2.default.createElement("path", { d: "M5 5v3h5v11h3V8h5V5z", fill: "currentColor", fillRule: "evenodd" })
);
}
}]);
return _default;
}(_react2.default.Component);
exports.default = _default; | YesElf/megadraft | lib/icons/h2.js | JavaScript | mit | 4,511 |
<!doctype html>
<!--
Minimal Mistakes Jekyll Theme 4.18.1 by Michael Rose
Copyright 2013-2019 Michael Rose - mademistakes.com | @mmistakes
Free for personal and commercial use under the MIT license
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE
-->
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<!-- begin _includes/seo.html --><title>첫 라이브 공연 (N.EX.T - 날아라 병아리, McFly - All About You) - 申Nani?</title>
<meta name="description" content="라이브공연 기록 #1 - N.EX.T : 날아라 병아리, McFly : All About You ">
<meta name="author" content="Nani Shin">
<meta property="og:type" content="article">
<meta property="og:locale" content="en_US">
<meta property="og:site_name" content="申Nani?">
<meta property="og:title" content="첫 라이브 공연 (N.EX.T - 날아라 병아리, McFly - All About You)">
<meta property="og:url" content="https://nanishin.github.io/music/performance-fly-chick-and-all-about-you-cover/">
<meta property="og:description" content="라이브공연 기록 #1 - N.EX.T : 날아라 병아리, McFly : All About You ">
<meta property="og:image" content="https://nanishin.github.io/assets/images/nanishin.jpg">
<meta property="article:published_time" content="2010-07-28T23:30:00+09:00">
<link rel="canonical" href="https://nanishin.github.io/music/performance-fly-chick-and-all-about-you-cover/">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"name": "Nani Shin",
"url": "https://nanishin.github.io/"
}
</script>
<!-- end _includes/seo.html -->
<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="申Nani? Feed">
<!-- https://t.co/dKP3o1e -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
</script>
<!-- For all browsers -->
<link rel="stylesheet" href="/assets/css/main.css">
<!--[if IE]>
<style>
/* old IE unsupported flexbox fixes */
.greedy-nav .site-title {
padding-right: 3em;
}
.greedy-nav button {
position: absolute;
top: 0;
right: 0;
height: 100%;
}
</style>
<![endif]-->
<!-- start custom head snippets -->
<!-- insert favicons. use https://realfavicongenerator.net/ -->
<!-- end custom head snippets -->
</head>
<body class="layout--single">
<nav class="skip-links">
<h2 class="screen-reader-text">Skip links</h2>
<ul>
<li><a href="#site-nav" class="screen-reader-shortcut">Skip to primary navigation</a></li>
<li><a href="#main" class="screen-reader-shortcut">Skip to content</a></li>
<li><a href="#footer" class="screen-reader-shortcut">Skip to footer</a></li>
</ul>
</nav>
<!--[if lt IE 9]>
<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>
<![endif]-->
<div class="masthead">
<div class="masthead__inner-wrap">
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
<a class="site-title" href="/">
申Nani?
</a>
<ul class="visible-links"><li class="masthead__menu-item">
<a href="/about/" >about</a>
</li><li class="masthead__menu-item">
<a href="/categories/music/" >music</a>
</li><li class="masthead__menu-item">
<a href="/categories/maker/" >maker</a>
</li><li class="masthead__menu-item">
<a href="/categories/tip/" >tip</a>
</li></ul>
<button class="greedy-nav__toggle hidden" type="button">
<span class="visually-hidden">Toggle menu</span>
<div class="navicon"></div>
</button>
<ul class="hidden-links hidden"></ul>
</nav>
</div>
</div>
</div>
<div class="initial-content">
<div id="main" role="main">
<div class="sidebar sticky">
<div itemscope itemtype="https://schema.org/Person">
<div class="author__avatar">
<img src="/assets/images/nanishin.jpg" alt="Nani Shin" itemprop="image">
</div>
<div class="author__content">
<h3 class="author__name" itemprop="name">Nani Shin</h3>
<div class="author__bio" itemprop="description">
<p>Daddy of two daughters, Action for sustainable life, Maker with upcycling, Let’s live a life to reach spiritual enlightenment</p>
</div>
</div>
<div class="author__urls-wrapper">
<button class="btn btn--inverse">Follow</button>
<ul class="author__urls social-icons">
<li itemprop="homeLocation" itemscope itemtype="https://schema.org/Place">
<i class="fas fa-fw fa-map-marker-alt" aria-hidden="true"></i> <span itemprop="name">South Korea</span>
</li>
<li><a href="mailto:[email protected]" rel="nofollow noopener noreferrer"><i class="fas fa-fw fa-envelope-square" aria-hidden="true"></i> Email</a></li>
<li><a href="https://nanishin.github.io" rel="nofollow noopener noreferrer"><i class="fas fa-fw fa-link" aria-hidden="true"></i> Website</a></li>
<li><a href="https://github.com/nanishin" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-github" aria-hidden="true"></i> GitHub</a></li>
<li><a href="https://instagram.com/nanishin" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-instagram" aria-hidden="true"></i> Instagram</a></li>
<!--
<li>
<a href="http://link-to-whatever-social-network.com/user/" itemprop="sameAs" rel="nofollow noopener noreferrer">
<i class="fas fa-fw" aria-hidden="true"></i> Custom Social Profile Link
</a>
</li>
-->
</ul>
</div>
</div>
</div>
<article class="page" itemscope itemtype="https://schema.org/CreativeWork">
<meta itemprop="headline" content="첫 라이브 공연 (N.EX.T - 날아라 병아리, McFly - All About You)">
<meta itemprop="description" content="라이브공연 기록 #1 - N.EX.T : 날아라 병아리, McFly : All About You">
<meta itemprop="datePublished" content="2010-07-28T23:30:00+09:00">
<div class="page__inner-wrap">
<header>
<h1 id="page-title" class="page__title" itemprop="headline">첫 라이브 공연 (N.EX.T - 날아라 병아리, McFly - All About You)
</h1>
<p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i>
less than 1 minute read
</p>
</header>
<section class="page__content" itemprop="text">
<aside class="sidebar__right sticky">
<nav class="toc">
<header><h4 class="nav__title"><i class="fas fa-file-alt"></i> On this page</h4></header>
</nav>
<nav class="toc-custom">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Recommended Style -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8174347775628935"
data-ad-slot="1733352839"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</nav>
</aside>
<p>라이브공연 기록 #1 - N.EX.T : 날아라 병아리, McFly : All About You</p>
<p>언플러그드 동호회 기타 강습 후 제 1회 정기 발표회에서 A반 공연 참석</p>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/LJYumaSMJqU" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
</section>
<footer class="page__meta">
<p class="page__taxonomy">
<strong><i class="fas fa-fw fa-tags" aria-hidden="true"></i> Tags: </strong>
<span itemprop="keywords">
<a href="/tags/#all-about-you" class="page__taxonomy-item" rel="tag">All About You</a><span class="sep">, </span>
<a href="/tags/#mcfly" class="page__taxonomy-item" rel="tag">McFly</a><span class="sep">, </span>
<a href="/tags/#n-ex-t" class="page__taxonomy-item" rel="tag">N.EX.T</a><span class="sep">, </span>
<a href="/tags/#%EB%82%A0%EC%95%84%EB%9D%BC-%EB%B3%91%EC%95%84%EB%A6%AC" class="page__taxonomy-item" rel="tag">날아라 병아리</a>
</span>
</p>
<p class="page__taxonomy">
<strong><i class="fas fa-fw fa-folder-open" aria-hidden="true"></i> Categories: </strong>
<span itemprop="keywords">
<a href="/categories/#music" class="page__taxonomy-item" rel="tag">music</a>
</span>
</p>
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> Updated:</strong> <time datetime="2010-07-28T23:30:00+09:00">July 28, 2010</time></p>
</footer>
<section class="page__share">
<h4 class="page__share-title">Share on</h4>
<a href="https://twitter.com/intent/tweet?text=%EC%B2%AB+%EB%9D%BC%EC%9D%B4%EB%B8%8C+%EA%B3%B5%EC%97%B0+%28N.EX.T+-+%EB%82%A0%EC%95%84%EB%9D%BC+%EB%B3%91%EC%95%84%EB%A6%AC%2C+McFly+-+All+About+You%29%20https%3A%2F%2Fnanishin.github.io%2Fmusic%2Fperformance-fly-chick-and-all-about-you-cover%2F" class="btn btn--twitter" onclick="window.open(this.href, 'window', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on Twitter"><i class="fab fa-fw fa-twitter" aria-hidden="true"></i><span> Twitter</span></a>
<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fnanishin.github.io%2Fmusic%2Fperformance-fly-chick-and-all-about-you-cover%2F" class="btn btn--facebook" onclick="window.open(this.href, 'window', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on Facebook"><i class="fab fa-fw fa-facebook" aria-hidden="true"></i><span> Facebook</span></a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fnanishin.github.io%2Fmusic%2Fperformance-fly-chick-and-all-about-you-cover%2F" class="btn btn--linkedin" onclick="window.open(this.href, 'window', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on LinkedIn"><i class="fab fa-fw fa-linkedin" aria-hidden="true"></i><span> LinkedIn</span></a>
</section>
<nav class="pagination">
<a href="#" class="pagination--pager disabled">Previous</a>
<a href="/music/performance-magic-cover/" class="pagination--pager" title="라이브 공연 (시크릿 - Magic)
">Next</a>
</nav>
</div>
<div class="page__comments">
<h4 class="page__comments-title">Leave a comment</h4>
<section id="disqus_thread"></section>
</div>
</article>
<div class="page__related">
<h4 class="page__related-title">You may also enjoy</h4>
<div class="grid__wrapper">
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<div class="archive__item-teaser">
<img src=
"/assets/images/final_sequencer_of_bts_oh_nae_money.png"
alt="">
</div>
<h2 class="archive__item-title" itemprop="headline">
<a href="/maker/diy-tesla-lightshow-custom/" rel="permalink">Tesla Custom Light Show 만들기 (BTS 피땀눈물 리믹스)
</a>
</h2>
<p class="page__meta"><i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i> December 31 2021</p>
<p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i>
1 minute read
</p>
<p class="archive__item-excerpt" itemprop="description">V10 이후 2년 만에 2021년 크리스마스 선물로 월드와이드 배포된 Tesla OS V11
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<div class="archive__item-teaser">
<img src=
"/assets/images/teslamate_telegram_bot.png"
alt="">
</div>
<h2 class="archive__item-title" itemprop="headline">
<a href="/tip/howto-use-teslamate-telegram-bot/" rel="permalink">TeslaMate Telegram Bot으로 테슬라 상태 정보 얻기
</a>
</h2>
<p class="page__meta"><i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i> October 25 2021</p>
<p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i>
3 minute read
</p>
<p class="archive__item-excerpt" itemprop="description">메이커 입장에서 테슬라 차량은 Arduino/RaspberryPi/ESP 등을 활용하는 실험/재미를 넘어서서 상업적인 대량생산까지 성공한 최신 IoT 기기의 끝판왕이라 할 수 있음. 특히나 제로마진을 설파했던 제러미 리프킨이 언급한 좌초자산의 관점에서 보더라도 더이상 신규 내연기관...</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<div class="archive__item-teaser">
<img src=
"/assets/images/nanishin.jpg"
alt="">
</div>
<h2 class="archive__item-title" itemprop="headline">
<a href="/maker/diy-squid-game-square-manager-mask/" rel="permalink">오징어게임 네모 관리자 마스크 출력
</a>
</h2>
<p class="page__meta"><i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i> October 17 2021</p>
<p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i>
less than 1 minute read
</p>
<p class="archive__item-excerpt" itemprop="description">오징어게임의 전세계적인 열풍에 2021년 할로윈 시즌도 다가오고 해서 자연스레 마스크 출력에 관심을 가지던 중 발빠른 한국인 메이커가 실제 드라마처럼 접고 펼 수 있는 고퀄의 마스크를 올려서 바로 다운로드 후 며칠에 걸쳐 출력~
</p>
</article>
</div>
<div class="grid__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<div class="archive__item-teaser">
<img src=
"/assets/images/nanishin.jpg"
alt="">
</div>
<h2 class="archive__item-title" itemprop="headline">
<a href="/tip/howto-build-rpi-ffmpeg-with-docker/" rel="permalink">Docker로 라즈베리파이용 ffmpeg 빌드하기
</a>
</h2>
<p class="page__meta"><i class="far fa-fw fa-calendar-alt" aria-hidden="true"></i> September 12 2021</p>
<p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i>
less than 1 minute read
</p>
<p class="archive__item-excerpt" itemprop="description">2018년 중반 메이커 활동을 본격화하면서 라즈베리파이3 내 ffmpeg 환경으로 어항방송 구축한 뒤 큰 업데이트 없이 소소한 튜닝 정도만 적용하면서 그대로 SmartThings 자동화와 연동해서 사용한 지 어언 3년…
</p>
</article>
</div>
</div>
</div>
</div>
</div>
<div id="footer" class="page__footer">
<footer>
<!-- start custom footer snippets -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Recommended Style -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8174347775628935"
data-ad-slot="1733352839"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<!-- end custom footer snippets -->
<div class="page__footer-follow">
<ul class="social-icons">
<li><strong>Follow:</strong></li>
<li><a href="/feed.xml"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li>
</ul>
</div>
<div class="page__footer-copyright">© 2021 Nani Shin. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> & <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
</footer>
</div>
<script src="/assets/js/main.min.js"></script>
<script src="https://kit.fontawesome.com/4eee35f757.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-90337089-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-90337089-1', { 'anonymize_ip': false});
</script>
<script>
var disqus_config = function () {
this.page.url = "https://nanishin.github.io/music/performance-fly-chick-and-all-about-you-cover/"; /* Replace PAGE_URL with your page's canonical URL variable */
this.page.identifier = "/music/performance-fly-chick-and-all-about-you-cover"; /* Replace PAGE_IDENTIFIER with your page's unique identifier variable */
};
(function() { /* DON'T EDIT BELOW THIS LINE */
var d = document, s = d.createElement('script');
s.src = 'https://nanishin.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</body>
</html>
| nanishin/nanishin.github.io | _site/music/performance-fly-chick-and-all-about-you-cover/index.html | HTML | mit | 18,742 |
<!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"/>
<title>Ginger: Class Index</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Ginger
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</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 class="current"><a href="classes.html"><span>Class Index</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Class Index</div> </div>
</div><!--header-->
<div class="contents">
<div class="qindex"><a class="qindex" href="#letter_G">G</a> | <a class="qindex" href="#letter_M">M</a> | <a class="qindex" href="#letter_P">P</a></div>
<table style="margin: 10px; white-space: nowrap;" align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
<tr><td rowspan="2" valign="bottom"><a name="letter_G"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  G  </div></td></tr></table>
</td><td valign="top"><a class="el" href="structseqan_1_1_g_match.html">GMatch</a> (seqan)   </td><td rowspan="2" valign="bottom"><a name="letter_P"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  P  </div></td></tr></table>
</td><td></td></tr>
<tr><td valign="top"><a class="el" href="structseqan_1_1_g_score_storage.html">GScoreStorage</a> (seqan)   </td><td></td></tr>
<tr><td valign="top"><a class="el" href="structseqan_1_1_g_fasta_record.html">GFastaRecord</a> (seqan)   </td><td rowspan="2" valign="bottom"><a name="letter_M"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  M  </div></td></tr></table>
</td><td valign="top"><a class="el" href="structseqan_1_1_performance_sample.html">PerformanceSample</a> (seqan)   </td><td></td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td></td><td valign="top"><a class="el" href="structseqan_1_1_memory_sample.html">MemorySample</a> (seqan)   </td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
</table>
<div class="qindex"><a class="qindex" href="#letter_G">G</a> | <a class="qindex" href="#letter_M">M</a> | <a class="qindex" href="#letter_P">P</a></div>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a></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>
<hr class="footer"/><address class="footer"><small>
Generated on Wed May 22 2013 08:59:00 for Ginger by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>
| bkahlert/seqan-research | raw/pmsb13/pmsb13-data-20130530/sources/qhuulr654q26tohr/2013-05-22T09-35-12.633+0200/sandbox/PMSB_group6/documentation/html/classes.html | HTML | mit | 5,506 |
#undef SEQAN_ENABLE_TESTING
#define SEQAN_ENABLE_TESTING 1
#include <seqan/find.h>
#include <seqan/basic.h>
#include <seqan/sequence.h>
#include <seqan/index.h>
#include <seqan/seq_io.h>
#include "demultiplex.h"
using namespace seqan;
SEQAN_DEFINE_TEST(check_test)
{
StringSet<String<Dna5Q> > seqs;
appendValue(seqs, "TACGTAGCTACTGACTGACT");
appendValue(seqs, "G");
appendValue(seqs, "TACGTCTGACT");
appendValue(seqs, "");
appendValue(seqs, "ATCGA");
StringSet<String<char> > ids;
appendValue(ids, "ErsteSeq");
appendValue(ids, "LoeschenEins");
appendValue(ids, "ZweiteSeq");
appendValue(ids, "LoeschenLeer");
appendValue(ids, "LoeschenFuenf");
StringSet<String<Dna> > barcodesFalse;
appendValue(barcodesFalse, "ACGAGT");
appendValue(barcodesFalse, "TGCATC");
appendValue(barcodesFalse, "AGCTAAT");
appendValue(barcodesFalse, "GTGACA");
StringSet<String<Dna> > barcodesTrue;
appendValue(barcodesTrue, "ACGAGT");
appendValue(barcodesTrue, "TGCATC");
appendValue(barcodesTrue, "AGCTAA");
appendValue(barcodesTrue, "GTGACA");
StringSet<String<Dna5Q> > exspectedSeqs;
appendValue(exspectedSeqs, "TACGTAGCTACTGACTGACT");
appendValue(exspectedSeqs, "TACGTCTGACT");
StringSet<String<char> > exspectedIds;
appendValue(exspectedIds, "ErsteSeq");
appendValue(exspectedIds, "ZweiteSeq");
bool resF = check(seqs, ids, barcodesFalse);
bool resT = check(seqs, ids, barcodesTrue);
SEQAN_ASSERT_EQ(false, resF);
SEQAN_ASSERT_EQ(true, resT);
SEQAN_ASSERT_EQ(2, length(seqs));
SEQAN_ASSERT_EQ(2, length(ids));
SEQAN_ASSERT_EQ(exspectedSeqs[0], seqs[0]);
SEQAN_ASSERT_EQ(exspectedIds[0], ids[0]);
SEQAN_ASSERT_EQ(exspectedSeqs[1], seqs[1]);
SEQAN_ASSERT_EQ(exspectedIds[1], ids[1]);
}
SEQAN_DEFINE_TEST(getPrefix_test) //Tests if the prefices are propperly extracted and too short sequences are excluded
{
StringSet<String<Dna5Q> > given;
appendValue(given, "GATACAGACTGAGCATGTGATCGAC");
//appendValue(given, "GAT"); //checked beforehand by different function (TODO)
appendValue(given, "AATTCCGTACGTAGCTACGTACGTACGTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGC");
appendValue(given, "GTTGGAGTACGTAGCTACGTACGTACGTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGC");
StringSet<String<Dna5Q> > exspectedSet;
appendValue(exspectedSet, "GATACAGACTGAGCATGTGATCGAC");
appendValue(exspectedSet, "AATTCCGTACGTAGCTACGTACGTACGTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGC");
appendValue(exspectedSet, "GTTGGAGTACGTAGCTACGTACGTACGTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGC");
StringSet<String<Dna5Q> > exspected;
appendValue(exspected, "GATACA");
appendValue(exspected, "AATTCC");
appendValue(exspected, "GTTGGA");
StringSet<String<Dna5Q> > res = getPrefix(given, 6);
for(unsigned i = 0; i < length(exspected); ++i)
{
SEQAN_ASSERT_EQ(exspected[i], res[i]);
SEQAN_ASSERT_EQ(exspectedSet[i], given[i]);
}
}
SEQAN_DEFINE_TEST(findExactIndex_test) //Tests the exact search for a single prefix in the barcode index (therfore implicitly checks the construction of the index)
{
StringSet<String<Dna> > barcodes;
appendValue(barcodes, "AAAAAA");
appendValue(barcodes, "CCCCCC");
appendValue(barcodes, "GGGGGG");
appendValue(barcodes, "TTTTTT");
appendValue(barcodes, "ACGTAC");
StringSet<String<Dna5Q> > readPieces;
appendValue(readPieces, "CCCCCC");
appendValue(readPieces, "AAAAAA");
appendValue(readPieces, "TTTTTT");
appendValue(readPieces, "GGGGGG");
appendValue(readPieces, "CCCNCC");
appendValue(readPieces, "GATACA");
appendValue(readPieces, "ACGTAC");
appendValue(readPieces, "ATGACNAANG"); //can't happen in the first place...
Index<StringSet<String<Dna> >, IndexEsa<> > indexSet(barcodes);
Finder<Index<StringSet<String<Dna> >, IndexEsa<> > > esaFinder(indexSet);
int exspected[] = {1,0,3,2,-1,-1,4,-1};
for (unsigned i = 0; i < length(readPieces); ++i)
{
int res = findExactIndex(readPieces[i], esaFinder);
SEQAN_ASSERT_EQ(exspected[i], res);
}
}
SEQAN_DEFINE_TEST(findAllExactIndex_test) //Tests the exact search for a all prefices in the barcode index (therfore implicitly checks the construction of the index)
{
StringSet<String<Dna> > barcodes;
appendValue(barcodes, "AAAAAA");
appendValue(barcodes, "CCCCCC");
appendValue(barcodes, "GGGGGG");
appendValue(barcodes, "TTTTTT");
appendValue(barcodes, "ACGTAC");
StringSet<String<Dna5Q> > readPieces;
appendValue(readPieces, "CCCCCC");
appendValue(readPieces, "AAAAAA");
appendValue(readPieces, "TTTTTT");
appendValue(readPieces, "GGGGGG");
appendValue(readPieces, "CCCNCC");
appendValue(readPieces, "GATACA");
appendValue(readPieces, "ACGTAC");
Index<StringSet<String<Dna> >, IndexEsa<> > indexSet(barcodes);
Finder<Index<StringSet<String<Dna> >, IndexEsa<> > > esaFinder(indexSet);
int exspected[] = {1,0,3,2,-1,-1,4,};
std::vector<int> res = findAllExactIndex(readPieces, esaFinder);
for(unsigned i = 0; i < length(res); ++i)
{
SEQAN_ASSERT_EQ(exspected[i], res[i]);
}
}
SEQAN_DEFINE_TEST(findApprox_test) //Tests the approxmiate search for a single prefix in the barcodes
{
StringSet<String<Dna5Q> > barcodes;
appendValue(barcodes, "CCCCCC");
appendValue(barcodes, "AAAAAA");
appendValue(barcodes, "ACGTCA");
appendValue(barcodes, "GATACA");
std::vector<Pattern<String<Dna>, DPSearch<SimpleScore> > > patterns = makePatterns(barcodes);
StringSet<String<Dna5Q> > readPieces;
appendValue(readPieces, "CCCNCC");
appendValue(readPieces, "CNCNCC");
appendValue(readPieces, "CCCCC");
appendValue(readPieces, "CCCNCC");
appendValue(readPieces, "AAAAAA");
appendValue(readPieces, "NAAAAA");
appendValue(readPieces, "AAAAA");
int exspected[] = {0, -1, -1, 0, 1, 1,-1};
for(unsigned i = 0; i < length(readPieces); ++i)
{
int res = findApprox(readPieces[i], patterns);
SEQAN_ASSERT_EQ(exspected[i], res);
}
}
SEQAN_DEFINE_TEST(findAllApprox_test) //Tests the approxmiate search for all prefices in the barcodes
{
StringSet<String<Dna5Q> > barcodes;
appendValue(barcodes, "CCCCCC");
appendValue(barcodes, "AAAAAA");
appendValue(barcodes, "ACGTCA");
appendValue(barcodes, "GATACA");
std::vector<Pattern<String<Dna>, DPSearch<SimpleScore> > > patterns = makePatterns(barcodes);
StringSet<String<Dna5Q> > readPieces;
appendValue(readPieces, "CCCNCC");
appendValue(readPieces, "CNCNCC");
appendValue(readPieces, "CCCCC");
appendValue(readPieces, "CCCNCC");
appendValue(readPieces, "AAAAAA");
appendValue(readPieces, "NAAAAA");
appendValue(readPieces, "AAAAA");
int exspected[] = {0, -1, -1, 0, 1, 1,-1};
std::vector<int> res = findAllApprox(readPieces, patterns);
for(unsigned i = 0; i < length(res); ++i)
{
SEQAN_ASSERT_EQ(exspected[i], res[i]);
}
}
SEQAN_DEFINE_TEST(clipBarcodes_test) //Tests if barcodes are propperly clipped
{
StringSet<String<Dna5Q> > seqs;
appendValue(seqs, "AAAAAAGTGACTGATCGTACGACTG");
appendValue(seqs, "GGGGGGGGGGGGGGGG");
std::vector<int> matches;
appendValue(matches, 0);
appendValue(matches, -1);
StringSet<String<Dna5Q> > exspected ;
appendValue(seqs, "GTGACTGATCGTACGACTG");
appendValue(seqs, "GGGGGGGGGGGGGGGG");
clipBarcodes(seqs, matches, 6);
for(unsigned i = 0; i < length(exspected); ++i)
{
SEQAN_ASSERT_EQ(exspected[i], seqs[i]);
}
}
SEQAN_DEFINE_TEST(clipBarcodesStrict_test) //Tests if the barcodes are propperly clipped using the strict clipping overload of clipBarcode
{
StringSet<String<Dna5Q> > seqs;
appendValue(seqs, "AAAAAAGTGACTGATCGTACGACTG");
appendValue(seqs, "GGGGGGGGGGGGGGGG");
StringSet<String<Dna5Q> > exspected ;
appendValue(seqs, "GTGACTGATCGTACGACTG");
appendValue(seqs, "GGGGGGGGGG");
clipBarcodes(seqs, 6);
for(unsigned i = 0; i < length(exspected); ++i)
{
SEQAN_ASSERT_EQ(exspected[i], seqs[i]);
}
}
SEQAN_DEFINE_TEST(group_test) //Tests if the grouping function returns correct groups. Implicitly tests kickEmptyGroups
{
StringSet<String<Dna5Q> > seqs;
appendValue(seqs, "NANANANANANANANANANANANANANANANAN");
appendValue(seqs, "NCNCNCNCNCNCNCNCNCNCNCNCN");
appendValue(seqs, "NGNGNGNGNGNGNGNGNGNGNGNGNGNGNGNGN");
appendValue(seqs, "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN");
appendValue(seqs, "GGGGGGGGGGGGG");
appendValue(seqs, "NTNTNTNTNTNTNTNTNTNTNTNTNTNTNTNTNTNTNTNTNTNTNTN");
StringSet<String<Dna> > barcodes;
appendValue(barcodes, "AAAAAA");
appendValue(barcodes, "GGGGGG");
appendValue(barcodes, "TTTTTT");
appendValue(barcodes, "GAGAGA"); //barcode without matching sequences
appendValue(barcodes, "CCCCCC");
std::vector<int> matches;
appendValue(matches, 0);
appendValue(matches, 4);
appendValue(matches, 1);
appendValue(matches, -1);
appendValue(matches, 1);
appendValue(matches, 2);
std::vector<std::vector<String<Dna5Q>* > > exspected;
resize(exspected, 7);
appendValue(exspected[0], &(seqs[3]));
appendValue(exspected[1], &(seqs[0]));
appendValue(exspected[2], &(seqs[2]));
appendValue(exspected[2], &(seqs[4])); //expected[4] is left empty since the barcode has no matching sequences
appendValue(exspected[3], &(seqs[5]));
appendValue(exspected[5], &(seqs[1]));
std::vector<std::vector<String<Dna5Q>* > > res = group(seqs, matches, barcodes);
for(unsigned i = 0; i < length(exspected); ++i)
{
for(unsigned j = 0; j < length(exspected[i]); ++j)
{
SEQAN_ASSERT_EQ(exspected[i][j], res[i][j]);
}
}
}
SEQAN_BEGIN_TESTSUITE(test_my_app_funcs)
{
SEQAN_CALL_TEST(check_test);
SEQAN_CALL_TEST(getPrefix_test);
SEQAN_CALL_TEST(findExactIndex_test);
SEQAN_CALL_TEST(findAllExactIndex_test);
SEQAN_CALL_TEST(findApprox_test);
SEQAN_CALL_TEST(findAllApprox_test);
SEQAN_CALL_TEST(clipBarcodes_test);
SEQAN_CALL_TEST(clipBarcodesStrict_test);
SEQAN_CALL_TEST(group_test);
}
SEQAN_END_TESTSUITE | bkahlert/seqan-research | raw/pmsb13/pmsb13-data-20130530/sources/24xc47o54r0zzgyu/2013-05-13T15-29-45.583+0200/sandbox/my_sandbox/apps/SeqDPT/demultiplex_test.cpp | C++ | mit | 9,608 |
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ShareFile.Sample.Vb.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace
| citrix/ShareFile-NET | Samples/ShareFile.Sample/ShareFile.Sample.Vb.Console/My Project/Resources.Designer.vb | Visual Basic | mit | 2,725 |
---
redirect_from: /docs/latest/interfaces/state.targetstatedef.html
---
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>TargetStateDef | @uirouter/angularjs</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<link rel="stylesheet" href="../assets/css/uirouter.css">
<script src="../assets/js/modernizr.js"></script>
<script src="../assets/js/reset.js"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@uirouter/angularjs</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<!--
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
-->
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Internal UI-Router API</label>
<!--
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
-->
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">@uirouter/angularjs</a>
</li>
<li>
<a href="../modules/state.html">state</a>
</li>
<li>
<a href="state.targetstatedef.html">TargetStateDef</a>
</li>
</ul>
<h1>Interface TargetStateDef</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">TargetStateDef</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="state.targetstatedef.html#options" class="tsd-kind-icon">options</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="state.targetstatedef.html#params" class="tsd-kind-icon">params</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="state.targetstatedef.html#state" class="tsd-kind-icon">state</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="options" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> options</h3>
-->
<div class="tsd-signature tsd-kind-icon">options<span class="tsd-signature-symbol">:</span> <a href="transition.transitionoptions.html" class="tsd-signature-type">TransitionOptions</a></div>
<div class="tsd-declaration">
</div>
<aside class="tsd-sources">
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-core/src/state/interface.ts:22</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="params" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagOptional">Optional</span> params</h3>
-->
<div class="tsd-signature tsd-kind-icon">params<span class="tsd-signature-symbol">:</span> <a href="params.rawparams.html" class="tsd-signature-type">RawParams</a></div>
<div class="tsd-declaration">
</div>
<aside class="tsd-sources">
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-core/src/state/interface.ts:21</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="state" class="tsd-anchor"></a>
<!--
<h3>state</h3>
-->
<div class="tsd-signature tsd-kind-icon">state<span class="tsd-signature-symbol">:</span> <a href="../modules/state.html#stateorname" class="tsd-signature-type">StateOrName</a></div>
<div class="tsd-declaration">
</div>
<aside class="tsd-sources">
<ul>
<li>Defined in private/var/folders/4n/ys7v20b52y9gyyx7kfdb93580000gp/T/tmp-531520k5WmpgJSf63/ui-router-core/src/state/interface.ts:20</li>
</ul>
</aside>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../index.html"><em>@uirouter/angularjs</em></a>
</li>
<li class="label tsd-is-external">
<span>Public API</span>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/common.html">common</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/core.html">core</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/directives.html">directives</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/injectables.html">injectables</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/ng1.html">ng1</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/ng1_state_events.html">ng1_<wbr>state_<wbr>events</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/params.html">params</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/resolve.html">resolve</a>
</li>
<li class="current tsd-kind-external-module">
<a href="../modules/state.html">state</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/transition.html">transition</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/url.html">url</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/view.html">view</a>
</li>
<li class="label tsd-is-external">
<span>Internal UI-<wbr><wbr>Router API</span>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/_ui_router_core_src_common_safeconsole_.html">"ui-<wbr>router-<wbr>core/src/common/safe<wbr>Console"</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/_ui_router_core_src_common_trace_.html">"ui-<wbr>router-<wbr>core/src/common/trace"</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/common_hof.html">common_<wbr>hof</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/common_predicates.html">common_<wbr>predicates</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/common_strings.html">common_<wbr>strings</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/hooks.html">hooks</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/path.html">path</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/vanilla.html">vanilla</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="../classes/state.statebuilder.html" class="tsd-kind-icon">State<wbr>Builder</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module">
<a href="../classes/state.statematcher.html" class="tsd-kind-icon">State<wbr>Matcher</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module">
<a href="../classes/state.stateobject.html" class="tsd-kind-icon">State<wbr>Object</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="../classes/state.statequeuemanager.html" class="tsd-kind-icon">State<wbr>Queue<wbr>Manager</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module">
<a href="../classes/state.stateregistry.html" class="tsd-kind-icon">State<wbr>Registry</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module">
<a href="../classes/state.stateservice.html" class="tsd-kind-icon">State<wbr>Service</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module">
<a href="../classes/state.targetstate.html" class="tsd-kind-icon">Target<wbr>State</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-not-exported">
<a href="state.builders.html" class="tsd-kind-icon">Builders</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="state.hrefoptions.html" class="tsd-kind-icon">Href<wbr>Options</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="state.lazyloadresult.html" class="tsd-kind-icon">Lazy<wbr>Load<wbr>Result</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="state.statedeclaration.html" class="tsd-kind-icon">State<wbr>Declaration</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface tsd-parent-kind-external-module">
<a href="state.targetstatedef.html" class="tsd-kind-icon">Target<wbr>State<wbr>Def</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="state.targetstatedef.html#options" class="tsd-kind-icon">options</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="state.targetstatedef.html#params" class="tsd-kind-icon">params</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="state.targetstatedef.html#state" class="tsd-kind-icon">state</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="state.transitionpromise.html" class="tsd-kind-icon">Transition<wbr>Promise</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="state._viewdeclaration.html" class="tsd-kind-icon">_<wbr>View<wbr>Declaration</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module">
<a href="../modules/state.html#builderfunction" class="tsd-kind-icon">Builder<wbr>Function</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module">
<a href="../modules/state.html#oninvalidcallback" class="tsd-kind-icon">On<wbr>Invalid<wbr>Callback</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module">
<a href="../modules/state.html#redirecttoresult" class="tsd-kind-icon">Redirect<wbr>ToResult</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module">
<a href="../modules/state.html#resolvetypes" class="tsd-kind-icon">Resolve<wbr>Types</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module">
<a href="../modules/state.html#stateorname" class="tsd-kind-icon">State<wbr>OrName</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module">
<a href="../modules/state.html#stateregistrylistener" class="tsd-kind-icon">State<wbr>Registry<wbr>Listener</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module">
<a href="../modules/state.html#_statedeclaration" class="tsd-kind-icon">_<wbr>State<wbr>Declaration</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/state.html#databuilder" class="tsd-kind-icon">data<wbr>Builder</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/state.html#getnavigablebuilder" class="tsd-kind-icon">get<wbr>Navigable<wbr>Builder</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/state.html#getparamsbuilder" class="tsd-kind-icon">get<wbr>Params<wbr>Builder</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/state.html#geturlbuilder" class="tsd-kind-icon">get<wbr>Url<wbr>Builder</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/state.html#includesbuilder" class="tsd-kind-icon">includes<wbr>Builder</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/state.html#namebuilder" class="tsd-kind-icon">name<wbr>Builder</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/state.html#parseurl" class="tsd-kind-icon">parse<wbr>Url</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/state.html#pathbuilder" class="tsd-kind-icon">path<wbr>Builder</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module">
<a href="../modules/state.html#resolvablesbuilder" class="tsd-kind-icon">resolvables<wbr>Builder</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/state.html#selfbuilder" class="tsd-kind-icon">self<wbr>Builder</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="http://typedoc.io" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html> | ui-router/ui-router.github.io | _ng1_docs/latest/interfaces/state.targetstatedef.html | HTML | mit | 20,428 |
require 'cucumber/formatter/progress'
module Cucumber
module Formatter
# The formatter used for <tt>--format usage</tt>
class Usage < Ast::Visitor
include Console
def initialize(step_mother, io, options)
super(step_mother)
@io = io
@options = options
@step_definitions = Hash.new { |h,step_definition| h[step_definition] = [] }
@all_step_definitions = step_mother.step_definitions.dup
@locations = []
end
def visit_features(features)
super
print_summary(features)
end
def visit_step(step)
@step = step
super
end
def visit_step_name(keyword, step_match, status, source_indent, background)
if step_match.step_definition
location = @step.file_colon_line
return if @locations.index(location)
@locations << location
description = format_step(keyword, step_match, status, nil)
length = (keyword + step_match.format_args).jlength
@step_definitions[step_match.step_definition] << [step_match, description, length, location]
@all_step_definitions.delete(step_match.step_definition)
end
end
def print_summary(features)
sorted_defs = @step_definitions.keys.sort_by{|step_definition| step_definition.backtrace_line}
sorted_defs.each do |step_definition|
step_matches_and_descriptions = @step_definitions[step_definition].sort_by do |step_match_and_description|
step_match = step_match_and_description[0]
step_match.step_definition.regexp.inspect
end
step_matches = step_matches_and_descriptions.map{|step_match_and_description| step_match_and_description[0]}
lengths = step_matches_and_descriptions.map do |step_match_and_description|
step_match_and_description[2]
end
lengths << step_definition.text_length
max_length = lengths.max
@io.print step_definition.regexp.inspect
@io.puts format_string(" # #{step_definition.file_colon_line}".indent(max_length - step_definition.text_length), :comment)
da = step_matches_and_descriptions.map do |step_match_and_description|
step_match = step_match_and_description[0]
description = step_match_and_description[1]
length = step_match_and_description[2]
file_colon_line = step_match_and_description[3]
" #{description}" + format_string(" # #{file_colon_line}".indent(max_length - length), :comment)
end
da.sort.each{|d| puts d}
end
print_unused_step_definitions
end
def print_unused_step_definitions
if @all_step_definitions.any?
max_length = @all_step_definitions.map{|step_definition| step_definition.text_length}.max
@io.puts format_string("(::) UNUSED (::)", :failed)
@all_step_definitions.each do |step_definition|
@io.print format_string(step_definition.regexp.inspect, :failed)
@io.puts format_string(" # #{step_definition.file_colon_line}".indent(max_length - step_definition.text_length), :comment)
end
end
end
end
end
end
| technoweenie/gemcutter | vendor/gems/cucumber-0.3.101/lib/cucumber/formatter/usage.rb | Ruby | mit | 3,312 |
require_relative '../../spec_helper'
require_lib 'reek/report/location_formatter'
RSpec.describe Reek::Report::BlankLocationFormatter do
let(:warning) { build_smell_warning(lines: [11, 9, 250, 100]) }
describe '.format' do
it 'returns a blank String regardless of the warning' do
expect(described_class.format(warning)).to eq('')
end
end
end
RSpec.describe Reek::Report::DefaultLocationFormatter do
let(:warning) { build_smell_warning(lines: [11, 9, 250, 100]) }
describe '.format' do
it 'returns a prefix with sorted line numbers' do
expect(described_class.format(warning)).to eq('[9, 11, 100, 250]:')
end
end
end
RSpec.describe Reek::Report::SingleLineLocationFormatter do
let(:warning) { build_smell_warning(lines: [11, 9, 250, 100]) }
describe '.format' do
it 'returns the first line where the smell was found' do
expect(described_class.format(warning)).to eq('dummy_file:9: ')
end
end
end
| troessner/reek | spec/reek/report/location_formatter_spec.rb | Ruby | mit | 960 |
<html>
<head>
<title>OS Checklist - A dynamic checklist to help set up computers</title>
<link rel="stylesheet" href="css/pure-min-0.6.0.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/style.css">
<script>
if (!String.prototype.format) {
String.prototype.format = function() {
var args = arguments;
return this.replace(/{(\d+)}/g, function(match, number) {
return typeof args[number] != 'undefined' ? args[number] : match ;
});
};
}
var version = 0; // later will be used in conjunction with load() to update invalid save data
var Tasks = [
["", "Install the browser you will be using for this list. Or open this on another computer (and wipe the saved data, if present).<br />(<a href='https://www.mozilla.org/en-US/firefox/new/?scene=2#download-fx'>Firefox</a>, <a href='https://www.google.com/chrome/'>Chrome</a>, <a href='http://www.opera.com/'>Opera</a>, <a href='https://www.waterfoxproject.org/'>Waterfox</a>, <a href='https://www.torproject.org/projects/torbrowser.html.en'>Tor Browser</a> (warning: you'll end up on a watchlist and may not be able to download all the programs you want to))"],
["", "Set up username and password."],
["", "Windows 7?", [
["", "Get <a href='https://www.microsoft.com/en-us/windows/windows-10-upgrade'>Windows 10</a>?<br />While generally a smoother and more up-to-date OS, 10 suffers from a glitchy settings system, broken updating, and a system that likes pop-ups, distractions, and other annoying stuff™."],
["", "Don't want anything in your network except what you use? Install <a href='http://tinywall.pados.hu/download.php'>TinyWall</a>, and only allow the programs you actually use to work."]
]],
["", "Windows 10", [
["", "Skip connecting to WiFi (or do it)."],
//["", "<b>CUSTOMIZE</b> settings. Do not accept recommended settings (very privacy invasive).<br />Alternately, use <a href='http://downloadserver4.novicorp.com/ded5f59811726173/Novicorp%20Remove%20Windows%2010%20Spying%20Features%201.2.0000%20Portable.zip'>this anti-spyware tool</a> (<a href='https://wintoflash.com/forum/viewtopic.php?f=7&t=42295'>source</a>) later."],
["", "Stop Windows spying on you?", [
["", "First, get <a href='http://downloadserver4.novicorp.com/ded5f59811726173/Novicorp%20Remove%20Windows%2010%20Spying%20Features%201.2.0000%20Portable.zip'>this anti-spyware tool</a> (<a href='https://wintoflash.com/forum/viewtopic.php?f=7&t=42295'>source</a>) to fix certain key settings and disable spying services."],
["", "(Optionally) Then, install <a href='http://tinywall.pados.hu/download.php'>TinyWall</a>, and only allow the programs you actually use to network."]
]],
["", "Remove tiles from Start Menu (or at least the ones you don't want)."],
["", "Uninstall tiles (apps) from Star Menu->All Apps that you don't want. (Alternately, if you really want to get rid of these, use <a href=''>this anti-spyware's uninstaller</a> (<a href='https://wintoflash.com/forum/viewtopic.php?f=7&t=42295'>source</a>).)"],
["", "Link Microsoft account?"],
["", "Looking to find replacements for shitty default apps?", [
["", "Image viewers: <a href='http://www.irfanview.com/main_download_engl.htm'>IrfanViewer</a>, <a href='http://www.howtogeek.com/225844/how-to-make-windows-photo-viewer-your-default-image-viewer-on-windows-10/'>restore win7 photo viewer</a>"],
["", "Music players: <a href='https://www.foobar2000.org/download'>foobar2000</a>"],
["", "Video players: <a href='https://www.videolan.org/vlc/download-windows.html'>VLC</a>"]
]]
]],
//NOTE this section kinda unnecessary
["", "Is it an HP? <sub>I'm so sorry.</sub>", [
["", "Uninstall HP crapware."],
["", "Uninstall anything you don't want (except Microsoft, Intel, RealTek items, & Synaptics (driver) if it's a laptop).<br />(Be careful with this if you don't know what you're doing!)"],
["", "Uninstall Norton/McAfee malware..unless you want that kind of thing.<br />(If removing McAfee, don't forget <a href='http://us.mcafee.com/apps/supporttools/mcpr/mcpr.asp'>this tool</a> to completely remove everything (<a href='https://service.mcafee.com/webcenter/portal/cp/home/articleview?articleId=TS101331'>source</a>).)"]
]],
["", "Uninstall bloatware."],
["", "Install anti-malware?", [
["", "<a href='http://free.antivirus.com/us/#cleanup-and-prevention'>Trend Micro's software</a> (several useful tools located here).<br />(At time of writing, I recommend HouseCall & <a href='http://sourceforge.net/projects/hjt/'>HiJack This</a>.)"],
["", "Not on Windows 10?", [
//TODO linkify this list of antivirus and add more!
["", "Install antivirus! (Specially, check out Microsoft's own <a href='http://windows.microsoft.com/en-us/windows/security-essentials-download'>Security Essentials</a>, or your own favorite brand: AVG, Malwarebytes, Avast)"]
]]
]],
["", "Install programs?", [
["", "Dropbox?", [
["", "Okay, now go remove it from autoplay."],
["", "Plug in a USB / Take a screenshot with print screen. (So you can cancel its popups and get rid of them.)"]
//NOTE may need to also use CD, SD, etc to get rid of all that crap
]],
["", "Password manager/database?", [
["", "<a href='http://keepass.info/download.html'>KeePass</a>?"]
//TODO add LastPass here
]],
["", "Utilites? (Launchers, Stats, Other)", [
["", "<a href='http://www.7-zip.org/'>7-zip</a> (none of that shitty <a href='http://www.rarlab.com/download.htm'>WinRAR</a> in here)<br /><b>Note</b>: Does not create a .7z file association."],
//TODO list more torrent clients
["", "Torrent client: The best is <a href='http://www.fosshub.com/qBittorrent.html'>qBittorrent</a>, but there's also INSERT LIST HERE"],
["", "<a href='https://www.piriform.com/ccleaner/download'>CCleaner</a><br />(Crap cleaner: Cleans registry, cookies, various deitrus that builds up when using Windows.)"],
["", "Quick launcher? (<a href='http://www.launchy.net/download.php'>Launchy</a>, <a href='http://rocketdock.com/download'>RocketDock</a>)"],
["", "<a href='https://www.piriform.com/speccy'>Speccy</a>? Find info about drivers, PC specs, etc, all with one tool!"],
["", "<a href='http://www.fosshub.com/WinDirStat.html'>WinDirStat</a> gives an intuitive, accurate view of what's on your PC and how much space it's taking up."],
["", "<a href='https://www.teamviewer.com/en/download/windows.aspx'>TeamViewer</a>, for remote access from here to there, or there to here."]
]],
["", "Office stuff? (<a href='https://www.libreoffice.org/download/'>LibreOffice</a>, <a href='https://portal.office.com/Home'>Office 365</a>)"],
["", "Programming / dev tools?", [
//TODO remove the notes about suggesting a new thing, and add permanently displayed note about this!
["", "Editor? (<a href='https://atom.io/'>Atom</a>, <a href='https://notepad-plus-plus.org/download/'>Notepad++</a>, <a href='https://www.sublimetext.com/2'>Sublime Text</a>)<br />(Submit an <a href='https://github.com/oschecklist/oschecklist.github.io/issues/new'>issue</a> to have one added to this list?)"],
["", "VCS tools? (<a href='https://git-scm.com/download/'>Git</a>, <a href='https://desktop.github.com/'>GitHub Desktop</a>, <a href='https://git-scm.com/downloads/guis'>other git guis</a>)<br />(Submit an <a href='https://github.com/oschecklist/oschecklist.github.io/issues/new'>issue</a> to have one added to this list?)"]
]]
["", "Gaming software?", [
["", "Install <a href='http://store.steampowered.com/about/'>Steam</a>!"],
["", "Install <a href='https://www.origin.com/en-us/download'>Origin</a>?"],
["", "Install <a href='https://itch.io/app'>Itch.io's app</a>!"],
["", "Install <a href='http://www.desura.com/install'>Desura</a>? (Which may or may not exist.)"]
]],
["", "Communications software: <a href='https://www.teamspeak.com/downloads'>TeamSpeak</a>, <a href='https://discordapp.com/apps'>Discord</a>, <a href='https://www.skype.com/en/download-skype/skype-for-computer/'>Skype</a>"],
["", "Image viewing / editing software?", [
["", "<a href='http://www.irfanview.com/main_download_engl.htm'>IrfanViewer</a> (image viewing++)"],
["", "<a href='http://www.dotpdn.com/downloads/pdn.html'>Paint.NET</a> (MS Paint++)"],
["", "<a href='https://www.gimp.org/downloads/'>The GIMP</a> editor. Lots of tools for image editing."]
]],
["", "Audio programs (listen/edit)", [
["", "<a href='https://www.foobar2000.org/download'>foobar2000</a>? (And plugins? <a href='http://skipyrich.com/wiki/Foobar2000:Now_Playing_Simple'>Now Playing Simple</a> (for livestreaming w music), <a href='http://www.unkempt.co.uk/fb2k/foo_podcatcher.html'>foo_podcatcher</a> (podcasts))"],
["", "<a href='https://www.videolan.org/vlc/download-windows.html'>VLC</a> is also a music player."],
["", "<a href='http://audacityteam.org/download/windows'>Audacity</a>? (Plus <a href='http://lame.buanzo.org/#lamewindl'>LAME (Lame for Windows.exe)</a> (for MP3 export) and <a href='http://lame.buanzo.org/#lamewindl'>FFmpeg (FFmpeg for Audacity on Windows.exe)</a> (for importing audio from MP4..and for other formats))"],
["", "<a href='http://www.apple.com/itunes/download/'>iTunes</a>? (Ewww...)"]
]],
["", "Video programs (watch/edit)", [
["", "<a href='https://www.videolan.org/vlc/download-windows.html'>VLC</a> for playing video/audio."],
["", "<a href='https://sites.google.com/site/deezja/tools/twitch-multi-stream-viewer'>Twitch Multi-Stream Viewer</a> does exactly what it says, and also has a downloader, and search, and some other features."]
]],
["", "Livestreaming?", [
["", "<a href='https://obsproject.com/'>Open Broadcaster Software</a> is essential."],
["", "<a href='https://sites.google.com/site/deezja/tools/teeboard'>TeeBoard</a> has a bunch of tools for managing on Twitch and adding things to your stream."],
["", "If you use foobar2000 for playing audio, <a href='http://skipyrich.com/wiki/Foobar2000:Now_Playing_Simple'>Now Playing Simple</a> will let you put what you're playing on the stream."]
]]
]],
["", "Turn autoplay off (unless you want that).<br />(On Windows 10: Settings->Devices->AutoPlay)"],
["", "Delete those pesky desktop shortcuts you've accumulated by now."]
];
//TODO add a thing that goes if "" -> "default.png"
var Save = {
version: 0,
current: [0],
skipped: [],
ignored: []
};
function load() {
var loaded = localStorage.getItem("oschecklist");
if (loaded != null) {
Save = JSON.parse(loaded);
console.log("Task data loaded:");
console.log(Save);
} else {
console.log("Task data not loaded (doesn't exist or invalid).");
}
}
function save() {
var saveable = JSON.stringify(Save);
localStorage.setItem("oschecklist", saveable);
console.log("Saved task data.")
}
function getTask() {
var task = Tasks[Save.current[0]]; //no preceding 2
if (task === undefined) {
return ["icon.png", "All tasks complete!"];
}
for (var i = 1; i < Save.current.length; i++) {
task = task[2][Save.current[i]];
}
console.log("Got task:");
console.log(task);
return task;
}
function getNextTask() {
Save.current[Save.current.length - 1]++;
var task = Tasks[Save.current[0]]; //no preceding 2
if (task === undefined) {
return ["icon.png", "All tasks complete!"];
}
for (var i = 1; i < Save.current.length; i++) {
if (task[2][Save.current[i]] !== undefined) {
task = task[2][Save.current[i]];
} else {
Save.current.pop();
return getNextTask();
}
}
console.log("Got (next) task:");
console.log(task);
return task;
}
function display(task) {
if ((task.length == 2) && ! (task[1] == "All tasks complete!")) {
document.getElementById("current").innerHTML = "<td style='width:10%;'><button class='pure-button button-complete' onclick='javascript:completeTask();' title='Task complete.'><span class='fa fa-check'></span></button></td><td class='task'><img src='{0}'><p>{1}</p></td><td style='width:10%;'><button class='pure-button button-later' onclick='javascript:skipTask();' title='Do this later.'><span class='fa fa-clock-o'></span></button></td><td style='width:10%;'><button class='pure-button button-ignore' onclick='javascript:ignoreTask();' title='I\'m not doing this.'><span class='fa fa-times'></span></button></td>".format(task[0], task[1]);
} else {
document.getElementById("current").innerHTML = "<td style='width:10%;'><button class='pure-button button-complete' onclick='javascript:completeTask();' title='I\'m doing this.'><span class='fa fa-check'></span></button></td><td colspan='2' class='task'><img src='{0}'><p>{1}</p></td><td style='width:10%;'><button class='pure-button button-ignore' onclick='javascript:ignoreTask();' title='I\'m not doing this.'><span class='fa fa-times'></span></button></td>".format(task[0], task[1]);
}
console.log("Displayed task:");
console.log(task);
}
function completeTask() {
console.log("Completing task:");
console.log(getTask());
if (getTask()[2] !== undefined) {
// if question -> do question
Save.current.push(0);
display(getTask());
} else {
// else -> next
display(getNextTask());
}
}
function ignoreTask() {
console.log("Ignoring task:");
console.log(getTask());
// we only save ignored questions
// (so updates to the question doesn't give us new tasks we don't want)
if (getTask()[2] !== undefined) {
Save.ignored.push(Save.current);
}
display(getNextTask());
}
var nextID = 0; // used in skipTask() and lateTask()
function skipTask() {
var id = "id" + nextID++;
Save.skipped.push([id, Save.current]);
console.log("Skipping task:");
var task = getTask();
console.log(task);
var skipped = document.createElement("tr");
skipped.setAttribute("id", "id" + id);
skipped.innerHTML = "<td style='width:10%;'><button class='pure-button button-complete' onclick='javascript:lateTask({0});' title='Task complete.'><span class='fa fa-check'></span></button></td><td colspan='2' class='task'><img src='{1}'><p>{2}</p></td><td style='width:10%;'><button class='pure-button button-ignore' onclick='javascript:lateTask({0});' title='I\'m not doing this.'><span class='fa fa-times'></span></button></td>".format("id" + id, task[0], task[1]);
document.getElementById("skipped").appendChild(skipped);
display(getNextTask());
}
function lateTask(id) {
console.log("Removing late task...");
// take off of our list
for (var i = 0; i < Save.skipped.length; i++) {
if (Save.skipped[i][0] == id) {
Save.skipped.splice(i, 1);
break;
}
}
// remove element with specified ID
var element = document.getElementById(id);
element.parentNode.removeChild(element);
console.log("Task data:");
console.log(Save);
}
window.onload = function() {
setTimeout(function() {
load();
display(getTask());
}, 1);
/*
if (window.addEventListener) {
window.addEventListener("storage", handleStorage, false);
} else {
window.attachEvent("onstorage", handleStorage);
}
*/
};
window.onunload = function() {
//save(); //disabled until ready for testing
}
</script>
</head>
<body>
<table class="pure-table pure-table-horizontal centered">
<tbody>
<tr>
<th colspan="4">Current Task:</th>
</tr>
<tr id="current"></tr>
<tr>
<th colspan="4">Skipped Tasks:</th>
</tr>
</tbody>
<tfoot id="skipped"></tfoot>
</table>
</body>
</html>
| oschecklist/oschecklist.github.io | index.html | HTML | mit | 18,377 |
# encoding: utf-8
module Dugout
module Math
module Parser
class Op
include Katuv::Node
multiple Attribute
# the operator to use when using the fancyparser (the thing that converts from
# 'a + b * c ** 2' => \
#
# Addition.new(
# Variable.new(:a),
# Multiplication.new(
# Variable.new(:b),
# Power.new(
# Variable.new(:c),
# Literal.new(2)
# )
# )
# )
terminal Operator
# defaults to:
# normal inspect, to_s
terminal DisplayFunction
def attributes
Array(children[Attribute])
end
def operator_name
children[Operator].name.to_sym
end
end
class PrimitiveOp < Op
def self.name
'primitive_op'
end
end
class DerivedOp < Op
def self.name
'derived_op'
end
terminal Implementation
end
end
end
end
| jfredett/dugout | lib/dugout/math/parser/op.rb | Ruby | mit | 1,037 |
import {ChangeDetectorRef, Component, ElementRef, ViewChild} from '@angular/core';
import {GadgetInstanceService} from '../../grid/grid.service';
import {RuntimeService} from '../../services/runtime.service';
import {GadgetPropertyService} from '../_common/gadget-property.service';
import {EndPointService} from '../../configuration/tab-endpoint/endpoint.service';
import {GadgetBase} from '../_common/gadget-base';
import {BarChartService} from './service';
import {Router} from '@angular/router';
import {OptionsService} from "../../configuration/tab-options/service";
import {startWith, switchMap} from "rxjs/operators";
import {interval} from "rxjs";
import {ConfigurationService} from "../../services/configuration.service";
declare var jQuery: any;
@Component({
selector: 'app-dynamic-component',
moduleId: module.id,
templateUrl: './view.html',
styleUrls: ['../_common/styles-gadget.css']
})
export class BarChartGadgetComponent extends GadgetBase {
@ViewChild('chartOptionsSideBar_tag') chartOptionsSideBarRef: ElementRef;
chartOptionsSideBar: any;
// chart options
showXAxis: boolean;
showYAxis: boolean;
gradient: boolean;
showLegend: boolean;
showXAxisLabel: boolean;
showYAxisLabel: boolean;
barChartType: string;
showDataLabel: boolean;
yAxisLabel: string;
xAxisLabel: string;
view: any[];
colorScheme: any = {
domain: ['#0AFF16', '#B2303B'] //todo - control color from property page
};
//////////////////
data: any[] = [];
subscription: any;
state: string;
RUN_STATE = 'run';
STOP_STATE = 'stop';
POLL_INTERVAL = 15000;
constructor(protected _runtimeService: RuntimeService,
protected _gadgetInstanceService: GadgetInstanceService,
protected _propertyService: GadgetPropertyService,
protected _endPointService: EndPointService,
protected _barChartService: BarChartService,
private _changeDetectionRef: ChangeDetectorRef,
protected _optionsService: OptionsService,
private _configService: ConfigurationService,
private _route: Router
) {
super(_runtimeService,
_gadgetInstanceService,
_propertyService,
_endPointService,
_changeDetectionRef,
_optionsService);
}
public preRun() {
/**
* the base class initializes the common property gadgets. Prerun gives
* us a chance to initialize any of the gadgets unique properties.
*/
this.initializeTheRemainderOfTheProperties();
if (this.getPropFromPropertyPages('state') == this.RUN_STATE) {
this.run();
}
}
initializeTheRemainderOfTheProperties() {
this.gradient = this.getPropFromPropertyPages('gradient');
this.showXAxis = this.getPropFromPropertyPages('showXAxis');
this.showYAxis = this.getPropFromPropertyPages('showYAxis');
this.showLegend = this.getPropFromPropertyPages('showLegend');
this.showXAxisLabel = this.getPropFromPropertyPages('showXAxisLabel');
this.showYAxisLabel = this.getPropFromPropertyPages('showYAxisLabel');
this.barChartType = this.getPropFromPropertyPages('barChartType');
this.showDataLabel = this.getPropFromPropertyPages('showDataLabel');
this.yAxisLabel = this.getPropFromPropertyPages('yAxisLabel');
this.xAxisLabel = this.getPropFromPropertyPages('xAxisLabel');
}
public run() {
this.clearChartData();
this.initializeRunState(true);
this.updateData(null);
this.saveState(this.RUN_STATE);
}
clearChartData() {
this.data = [];
}
public stop() {
this.stopWithoutStateSave();
this.saveState(this.STOP_STATE);
}
/**
* The state is being saved to allow the board to load with the last state. Also, when the gadget is moved
* within the board we need to carry the gadget's state along.
* @param state
*/
public saveState(state: string) {
this.updateProperties('{\"state\":\"' + state + '\"}');
this.persistTheChangeInInternalState();
}
/**
* When the gadget is destroyed (see ngOnDestroy) there is no need to
* save the state. We just want to stop any API calls.
*/
public stopWithoutStateSave() {
if (this.subscription) {
this.subscription.unsubscribe();
}
const data = [];
Object.assign(this, {data});
this.setStopState(false);
}
public updateData(someData: any[]) {
this.data.length = 0;
/**
* poll every 15 seconds
* todo - change this to a websocket
*/
this.subscription = interval(this.POLL_INTERVAL).pipe(
startWith(0), switchMap(() => this._barChartService.getData(this.endpointObject.address)))
.subscribe(data => {
Object.assign(this, {data});
},
error => this.handleError(error));
}
public drillDown(data) {
this.stopWithoutStateSave();
this._route.navigate(['/detail'], {
queryParams:
{
chartType:"bar",
chartSeries: data.series,
chartMetric: data.name,
endPointName: this.endpointObject.name
}
});
}
private setInternalProperties(updatedPropsObject: any) {
this.state = updatedPropsObject.state;
if (updatedPropsObject.title != undefined) {
this.title = updatedPropsObject.title;
this.showXAxis = updatedPropsObject.showXAxis;
this.showYAxis = updatedPropsObject.showYAxis;
this.gradient = updatedPropsObject.gradient;
this.showLegend = updatedPropsObject.showLegend;
this.showXAxisLabel = updatedPropsObject.showXAxisLabel;
this.showYAxisLabel = updatedPropsObject.showYAxisLabel;
this.barChartType = updatedPropsObject.barChartType;
this.showDataLabel = updatedPropsObject.showDataLabel;
this.xAxisLabel = updatedPropsObject.xAxisLabel;
this.yAxisLabel = updatedPropsObject.yAxisLabel;
this.setEndPoint(updatedPropsObject.endpoint);
this.showOperationControls = true;
}
}
/**
* todo
* This is called from the dynamic property page form or when the internal running state changes
* A similar operation exists on the procmman-config-service
* whenever the property page form is saved, the in memory board model
* is updated as well as the gadget instance properties
* which is what the code below does. This can be eliminated with code added to the
* config service or the property page service.
*
* **/
public updateProperties(updatedProperties: any) {
const updatedPropsObject = JSON.parse(updatedProperties);
/**
* update this tools property pages
*/
this.propertyPages.forEach(function (propertyPage) {
for (let x = 0; x < propertyPage.properties.length; x++) {
for (const prop in updatedPropsObject) {
if (updatedPropsObject.hasOwnProperty(prop)) {
if (prop === propertyPage.properties[x].key) {
propertyPage.properties[x].value = updatedPropsObject[prop];
}
}
}
}
});
/**
* update the tools internal state
*/
this.setInternalProperties(updatedPropsObject);
}
public ngOnDestroy() {
this.stopWithoutStateSave();
}
/**
* todo - need to improve how internal state is saved to persistant store
*/
private persistTheChangeInInternalState() {
let payLoad =
"{\"instanceId\":" + this.instanceId
+ ",\"title\":\"" + this.title
+ "\",\"state\":\"" + this.state
+ "\",\"endpoint\":\"" + this.endpointObject.name
+ "\",\"gradient\":" + this.gradient
+ ",\"showXAxis\":" + this.showXAxis
+ ",\"showYAxis\":" + this.showYAxis
+ ",\"showLegend\":" + this.showLegend
+ ",\"showXAxisLabel\":" + this.showXAxisLabel
+ ",\"showYAxisLabel\":" + this.showYAxisLabel
+ ",\"showDataLabel\":" + this.showDataLabel
+ ",\"barChartType\":\"" + this.barChartType
+ "\",\"yAxisLabel\":\"" + this.yAxisLabel
+ "\",\"xAxisLabel\":\"" + this.xAxisLabel
+ "\"}";
this._configService.notifyGadgetOnPropertyChange(payLoad, this.instanceId);
}
toggleChartProperties() {
if (this.globalOptions.displayGadgetOptionsInSideBar == false) {
this.toggleConfigMode();
return;
}
this.chartOptionsSideBar = jQuery(this.chartOptionsSideBarRef.nativeElement);
this.chartOptionsSideBar.sidebar('setting', 'transition', 'overlay');
this.chartOptionsSideBar.sidebar('toggle');
}
}
| catalogicsoftware/Angular-4-Plus-Dashboard-Framework | src/app/gadgets/barchart/barchart-gadget.component.ts | TypeScript | mit | 9,298 |
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const safe = {w: "majority", wtimeout: 100};
const EventSchema = new Schema({
ts: Number,
player: String,
move: String,
state: Schema.Types.Mixed,
pongId: Schema.Types.ObjectId
}, {safe: safe});
module.exports = mongoose.model('Event', EventSchema); | levelcap/infinipong | app/models/event.js | JavaScript | mit | 342 |
/*
* Copyright (c) 2015 by Rafael Angel Aznar Aparici (rafaaznar at gmail dot com)
*
* andamio: The stunning micro-library that helps you to develop easily
* AJAX web applications by using Angular.js 1.x & andamio-server
* andamio is distributed under the MIT License (MIT)
* Sources at https://github.com/rafaelaznar/andamio
*
* 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.
*/
'use strict';
//-------------
var andamio = angular.module('myApp', [
'ngRoute',
'Filters',
'Services',
'Directives',
'systemControllers',
'userControllers',
'avisoControllers',
'valoracionControllers',
'usertypeControllers',
'postControllers',
'productControllers',
'producttypeControllers',
'prioridadControllers',
'proyectoControllers',
'estadoControllers',
'tareaControllers',
'ui.bootstrap',
'ngSanitize'
]);
//-------------
//---html5 mode off; setting up pushState needs server urlrewritting, so quitting...-------
//andamio.config(['$locationProvider', function ($locationProvider) {
// $locationProvider.html5Mode({
// //requireBase: false,
// enabled: true
// });
// }]);
//-------------
andamio.config(['$httpProvider', function ($httpProvider) {
$httpProvider.defaults.withCredentials = true;
}]);
//-------------
andamio.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/', {templateUrl: 'js/system/home.html', controller: 'HomeController'});
//------------
$routeProvider.when('/login', {templateUrl: 'js/system/login.html', controller: 'LoginController'});
$routeProvider.when('/logout', {templateUrl: 'js/system/logout.html', controller: 'LogoutController'});
$routeProvider.when('/home', {templateUrl: 'js/system/home.html', controller: 'HomeController'});
$routeProvider.when('/license', {templateUrl: 'js/system/license.html', controller: 'LicenseController'});
$routeProvider.when('/passchange', {templateUrl: 'js/system/passchange.html', controller: 'PasschangeController'});
//------------
$routeProvider.when('/user/view/:id', {templateUrl: 'js/user/view.html', controller: 'UserViewController'});
$routeProvider.when('/user/new/:id?', {templateUrl: 'js/user/new.html', controller: 'UserNewController'});
$routeProvider.when('/user/edit/:id', {templateUrl: 'js/user/edit.html', controller: 'UserEditController'});
$routeProvider.when('/user/remove/:id', {templateUrl: 'js/user/remove.html', controller: 'UserRemoveController'});
$routeProvider.when('/user/plist/:page?/:rpp?', {templateUrl: 'js/user/plist.html', controller: 'UserPListController'});
$routeProvider.when('/user/selection/:page?/:rpp?', {templateUrl: 'js/user/selection.html', controller: 'UserSelectionController'});
//------------
$routeProvider.when('/post/view/:id', {templateUrl: 'js/post/view.html', controller: 'PostViewController'});
$routeProvider.when('/post/new/:id?', {templateUrl: 'js/post/new.html', controller: 'PostNewController'});
$routeProvider.when('/post/edit/:id', {templateUrl: 'js/post/edit.html', controller: 'PostEditController'});
$routeProvider.when('/post/remove/:id', {templateUrl: 'js/post/remove.html', controller: 'PostRemoveController'});
$routeProvider.when('/post/plist/:page?/:rpp?', {templateUrl: 'js/post/plist.html', controller: 'PostPListController'});
$routeProvider.when('/post/selection/:page?/:rpp?', {templateUrl: 'js/post/selection.html', controller: 'PostSelectionController'});
//------------
$routeProvider.when('/usertype/view/:id', {templateUrl: 'js/usertype/view.html', controller: 'UsertypeViewController'});
$routeProvider.when('/usertype/new/:id?', {templateUrl: 'js/usertype/new.html', controller: 'UsertypeNewController'});
$routeProvider.when('/usertype/edit/:id', {templateUrl: 'js/usertype/edit.html', controller: 'UsertypeEditController'});
$routeProvider.when('/usertype/remove/:id', {templateUrl: 'js/usertype/remove.html', controller: 'UsertypeRemoveController'});
$routeProvider.when('/usertype/plist/:page?/:rpp?', {templateUrl: 'js/usertype/plist.html', controller: 'UsertypePListController'});
$routeProvider.when('/usertype/selection/:page?/:rpp?', {templateUrl: 'js/usertype/selection.html', controller: 'UsertypeSelectionController'});
//------------
$routeProvider.when('/product/view/:id', {templateUrl: 'js/product/view.html', controller: 'ProductViewController'});
$routeProvider.when('/product/new/:id?', {templateUrl: 'js/product/new.html', controller: 'ProductNewController'});
$routeProvider.when('/product/edit/:id', {templateUrl: 'js/product/edit.html', controller: 'ProductEditController'});
$routeProvider.when('/product/remove/:id', {templateUrl: 'js/product/remove.html', controller: 'ProductRemoveController'});
$routeProvider.when('/product/plist/:page?/:rpp?', {templateUrl: 'js/product/plist.html', controller: 'ProductPListController'});
$routeProvider.when('/product/selection/:page?/:rpp?', {templateUrl: 'js/product/selection.html', controller: 'ProductSelectionController'});
//------------
$routeProvider.when('/producttype/view/:id', {templateUrl: 'js/producttype/view.html', controller: 'ProducttypeViewController'});
$routeProvider.when('/producttype/new/:id?', {templateUrl: 'js/producttype/new.html', controller: 'ProducttypeNewController'});
$routeProvider.when('/producttype/edit/:id', {templateUrl: 'js/producttype/edit.html', controller: 'ProducttypeEditController'});
$routeProvider.when('/producttype/remove/:id', {templateUrl: 'js/producttype/remove.html', controller: 'ProducttypeRemoveController'});
$routeProvider.when('/producttype/plist/:page?/:rpp?', {templateUrl: 'js/producttype/plist.html', controller: 'ProducttypePListController'});
$routeProvider.when('/producttype/selection/:page?/:rpp?', {templateUrl: 'js/producttype/selection.html', controller: 'ProducttypeSelectionController'});
//------------
$routeProvider.when('/aviso/view/:id', {templateUrl: 'js/aviso/view.html', controller: 'AvisoViewController'});
$routeProvider.when('/aviso/new/:id?', {templateUrl: 'js/aviso/new.html', controller: 'AvisoNewController'});
$routeProvider.when('/aviso/edit/:id', {templateUrl: 'js/aviso/edit.html', controller: 'AvisoEditController'});
$routeProvider.when('/aviso/remove/:id', {templateUrl: 'js/aviso/remove.html', controller: 'AvisoRemoveController'});
$routeProvider.when('/aviso/plist/:page?/:rpp?', {templateUrl: 'js/aviso/plist.html', controller: 'AvisoPListController'});
$routeProvider.when('/aviso/selection/:page?/:rpp?', {templateUrl: 'js/aviso/selection.html', controller: 'AvisoSelectionController'});
//------------
$routeProvider.when('/valoracion/view/:id', {templateUrl: 'js/valoracion/view.html', controller: 'ValoracionViewController'});
$routeProvider.when('/valoracion/new/:id?', {templateUrl: 'js/valoracion/new.html', controller: 'ValoracionNewController'});
$routeProvider.when('/valoracion/edit/:id', {templateUrl: 'js/valoracion/edit.html', controller: 'ValoracionEditController'});
$routeProvider.when('/valoracion/remove/:id', {templateUrl: 'js/valoracion/remove.html', controller: 'ValoracionRemoveController'});
$routeProvider.when('/valoracion/plist/:page?/:rpp?', {templateUrl: 'js/valoracion/plist.html', controller: 'ValoracionPListController'});
$routeProvider.when('/valoracion/selection/:page?/:rpp?', {templateUrl: 'js/valoracion/selection.html', controller: 'ValoracionSelectionController'});
//------------
$routeProvider.when('/prioridad/view/:id', {templateUrl: 'js/prioridad/view.html', controller: 'PrioridadViewController'});
$routeProvider.when('/prioridad/new/:id?', {templateUrl: 'js/prioridad/new.html', controller: 'PrioridadNewController'});
$routeProvider.when('/prioridad/edit/:id', {templateUrl: 'js/prioridad/edit.html', controller: 'PrioridadEditController'});
$routeProvider.when('/prioridad/remove/:id', {templateUrl: 'js/prioridad/remove.html', controller: 'PrioridadRemoveController'});
$routeProvider.when('/prioridad/plist/:page?/:rpp?', {templateUrl: 'js/prioridad/plist.html', controller: 'PrioridadPListController'});
$routeProvider.when('/prioridad/selection/:page?/:rpp?', {templateUrl: 'js/prioridad/selection.html', controller: 'PrioridadSelectionController'});
//------------
$routeProvider.when('/estado/view/:id', {templateUrl: 'js/estado/view.html', controller: 'EstadoViewController'});
$routeProvider.when('/estado/new/:id?', {templateUrl: 'js/estado/new.html', controller: 'EstadoNewController'});
$routeProvider.when('/estado/edit/:id', {templateUrl: 'js/estado/edit.html', controller: 'EstadoEditController'});
$routeProvider.when('/estado/remove/:id', {templateUrl: 'js/estado/remove.html', controller: 'EstadoRemoveController'});
$routeProvider.when('/estado/plist/:page?/:rpp?', {templateUrl: 'js/estado/plist.html', controller: 'EstadoPListController'});
$routeProvider.when('/estado/selection/:page?/:rpp?', {templateUrl: 'js/estado/selection.html', controller: 'EstadoSelectionController'});
//------------
$routeProvider.when('/proyecto/view/:id', {templateUrl: 'js/proyecto/view.html', controller: 'ProyectoViewController'});
$routeProvider.when('/proyecto/new/:id?', {templateUrl: 'js/proyecto/new.html', controller: 'ProyectoNewController'});
$routeProvider.when('/proyecto/edit/:id', {templateUrl: 'js/proyecto/edit.html', controller: 'ProyectoEditController'});
$routeProvider.when('/proyecto/remove/:id', {templateUrl: 'js/proyecto/remove.html', controller: 'ProyectoRemoveController'});
$routeProvider.when('/proyecto/plist/:page?/:rpp?', {templateUrl: 'js/proyecto/plist.html', controller: 'ProyectoPListController'});
$routeProvider.when('/proyecto/selection/:page?/:rpp?', {templateUrl: 'js/proyecto/selection.html', controller: 'ProyectoSelectionController'});
//------------
$routeProvider.when('/tarea/view/:id', {templateUrl: 'js/tarea/view.html', controller: 'TareaViewController'});
$routeProvider.when('/tarea/new/:id?', {templateUrl: 'js/tarea/new.html', controller: 'TareaNewController'});
$routeProvider.when('/tarea/edit/:id', {templateUrl: 'js/tarea/edit.html', controller: 'TareaEditController'});
$routeProvider.when('/tarea/remove/:id', {templateUrl: 'js/tarea/remove.html', controller: 'TareaRemoveController'});
$routeProvider.when('/tarea/plist/:page?/:rpp?', {templateUrl: 'js/tarea/plist.html', controller: 'TareaPListController'});
$routeProvider.when('/tarea/selection/:page?/:rpp?', {templateUrl: 'js/tarea/selection.html', controller: 'TareaSelectionController'});
//------------
$routeProvider.otherwise({redirectTo: '/'});
}]);
//-------------
andamio.run(function ($rootScope, $location, serverService, sessionService) {
$rootScope.$on("$routeChangeStart", function (event, next, current) {
sessionService.setSessionInactive();
sessionService.setUsername('');
serverService.getSessionPromise().then(function (response) {
if (response['status'] == 200) {
sessionService.setSessionActive();
sessionService.setUsername(response.data.message.login);
sessionService.setId(response.data.message.id);
} else {
sessionService.setSessionInactive();
sessionService.setUsername('');
var nextUrl = next.$$route.originalPath;
if (nextUrl == '/home' || nextUrl == '/login' || nextUrl == '/license') {
} else {
$location.path("/login");
}
}
}).catch(function (data) {
sessionService.setSessionInactive();
sessionService.setUsername('');
var nextUrl = next.$$route.originalPath;
if (nextUrl == '/home' || nextUrl == '/login' || nextUrl == '/license') {
} else {
$location.path("/login");
}
});
});
});
//-------------
var moduloSistema = angular.module('systemControllers', []);
var moduloUser = angular.module('userControllers', []);
var moduloPost = angular.module('postControllers', []);
var moduloUsertype = angular.module('usertypeControllers', []);
var moduloProduct = angular.module('productControllers', []);
var moduloProducttype = angular.module('producttypeControllers', []);
var moduloAviso = angular.module('avisoControllers', []);
var moduloValoracion = angular.module('valoracionControllers', []);
var moduloPrioridad = angular.module('prioridadControllers', []);
var moduloEstado = angular.module('estadoControllers', []);
var moduloProyecto = angular.module('proyectoControllers', []);
var moduloTarea = angular.module('tareaControllers', []);
//-------------
var moduloDirectivas = angular.module('Directives', []);
var moduloServicios = angular.module('Services', []);
var moduloFiltros = angular.module('Filters', []);
| rafaelaznar/andamio-client | public_html/js/app.js | JavaScript | mit | 14,462 |
export default ({ children }) => {
return <main style={{ border: '4px dashed green' }}>{children}</main>
}
| BlancheXu/test | examples/with-dynamic-app-layout/layouts/GreenLayout.js | JavaScript | mit | 109 |
<?php
use Ramsey\Uuid\Uuid;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/
$factory->define(App\Post::class, function (Faker\Generator $faker) {
return [
'title' => $faker->sentence(4),
'content' => $faker->paragraph(4),
'user_id' => mt_rand(1, 10)
];
});
$factory->define(App\Comment::class, function (Faker\Generator $faker) {
return [
'content' => $faker->paragraph(1),
'post_id' => mt_rand(1, 50),
'user_id' => mt_rand(1, 10)
];
});
$factory->define(App\User::class, function (Faker\Generator $faker) {
$hasher = app()->make('hash');
return [
'name' => $faker->name,
'email' => $faker->email,
'password' => $hasher->make("secret"),
'is_admin' => mt_rand(0, 1)
];
});
$factory->define(App\dbxUser::class, function (Faker\Generator $faker) {
return [
'uid' => Uuid::uuid4(),
'dbid' => 'dbid:1' . Uuid::uuid4(),
'email' => $faker->email,
'display_name' => $faker->name,
'firstName' => 'firstName',
'lastName' => 'lastName',
'profile_pic_url' => 'url',
'verified' => mt_rand(0, 1),
'country' => 'USA',
'language' => 'en',
'remember_token' => 'token'
];
// $factory->define(App\subs::class, function (Faker\Generator $faker) {
//
// return [
// 'sub_id' => Uuid::uuid4(),
// 'owner' =>
// 'domain' =>
// 'status' =>
// 'provider' =>
// 'www' =>
// 'host' =>
// 'isActive' =>
// ];
});
| Subely/api.subely.com | database/factories/ModelFactory.php | PHP | mit | 1,927 |
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Dice;
namespace TestDiceRoller.Grammar
{
[TestClass]
public class CritRollShould : TestBase
{
private static RollerConfig CritConf => new RollerConfig() { GetRandomBytes = GetRNG(0, 1, 18, 19) };
[TestMethod]
public void Successfully_CritFumbleExtra()
{
EvaluateRoll("4d20cs19f2", CritConf, 4, "4d20.critical(=19).fumble(=2) => 1 + 2! + 19! + 20 => 42");
}
[TestMethod]
public void Successfully_CritFumbleExtraSeparate()
{
EvaluateRoll("4d20cs19cf2", CritConf, 4, "4d20.critical(=19).fumble(=2) => 1 + 2! + 19! + 20 => 42");
}
[TestMethod]
public void Successfully_CritFumbleFunction()
{
EvaluateRoll("4d20.critical(=19).fumble(=2)", CritConf, 4, "4d20.critical(=19).fumble(=2) => 1 + 2! + 19! + 20 => 42");
}
[TestMethod]
public void Successfully_CritExtra()
{
EvaluateRoll("4d20cs19", CritConf, 4, "4d20.critical(=19) => 1! + 2 + 19! + 20 => 42");
}
[TestMethod]
public void Successfully_CritFunction()
{
EvaluateRoll("4d20.critical(=19)", CritConf, 4, "4d20.critical(=19) => 1! + 2 + 19! + 20 => 42");
}
[TestMethod]
public void Successfully_FumbleExtra()
{
EvaluateRoll("4d20cf2", CritConf, 4, "4d20.fumble(=2) => 1 + 2! + 19 + 20! => 42");
}
[TestMethod]
public void Successfully_FumbleFunction()
{
EvaluateRoll("4d20.fumble(=2)", CritConf, 4, "4d20.fumble(=2) => 1 + 2! + 19 + 20! => 42");
}
}
}
| skizzerz/DiceRoller | TestDiceRoller/Grammar/CritRollShould.cs | C# | mit | 1,718 |
Copyright © 2002 Timothy Ritchey, http://redromelogic.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.
| tritchey/RRFractionFormatter | LICENSE.md | Markdown | mit | 1,091 |
package gemlite.core.util;
import gemlite.core.internal.support.FunctionIds;
import gemlite.core.internal.support.context.IModuleContext;
import gemlite.core.internal.support.hotdeploy.DeployParameter;
import gemlite.core.internal.support.hotdeploy.GemliteDeployer;
import java.net.URL;
import java.util.List;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
import com.gemstone.gemfire.cache.execute.Execution;
import com.gemstone.gemfire.cache.execute.FunctionService;
import com.gemstone.gemfire.cache.execute.ResultCollector;
@SuppressWarnings("rawtypes")
public class FunctionUtil
{
public final static String deploy(URL url)
{
IModuleContext mc= GemliteDeployer.getInstance().deploy(url);
DeployParameter param = new DeployParameter(mc.getModuleType(),url);
return deploy(param);
}
public final static String deploy(DeployParameter param)
{
Execution ex = FunctionService.onServers(ClientCacheFactory.getAnyInstance().getDefaultPool());
ex = ex.withArgs(param);
ResultCollector rc = ex.execute(FunctionIds.DEPLOY_FUNCTION);
List rs = (List) rc.getResult();
String str = (String) rs.get(0);
return str;
}
public final static <T> T onServer(String functionId, Class<T> T)
{
return onServer(functionId, null, T);
}
@SuppressWarnings("unchecked")
public final static <T> T onServer(String functionId, Object args, Class<T> T)
{
Execution ex = FunctionService.onServer(ClientCacheFactory.getAnyInstance().getDefaultPool());
if (args != null)
ex = ex.withArgs(args);
ResultCollector rc = ex.execute(functionId);
List<T> l = (List<T>) rc.getResult();
return l.get(0);
}
}
| iisi-nj/gemlite | util/FunctionUtil.java | Java | mit | 1,686 |
<?php
namespace Embranchment\Session;
class SessionToken {
/*
* Generate token for this session
*/
public static function Generate() {
if (!session_status()) session_start();
$_SESSION['token'] = hash('sha512',rand());
}
}
| valeriiduz/fork-framework | test/Session/SessionToken.php | PHP | mit | 253 |
/*@font-face {
font-family: 'Comfortaa';
src: url('../bundles/app/fonts/Comfortaa-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Comfortaa-Bold';
src: url('../bundles/app/fonts/Comfortaa-Bold.ttf') format('truetype');
}
@font-face {
font-family: 'Comfortaa-Light';
src: url('../bundles/app/fonts/Comfortaa-Light.ttf') format('truetype');
}
@font-face {
font-family: 'Work-Light';
src: url('../bundles/app/fonts/WorkSans-Light.ttf') format('truetype');
}
@font-face {
font-family: 'Work-Medium';
src: url('../bundles/app/fonts/WorkSans-Medium.ttf') format('truetype');
}
@font-face {
font-family: 'Work-Regular';
src: url('../bundles/app/fonts/WorkSans-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Work-SemiBold';
src: url('../bundles/app/fonts/WorkSans-SemiBold.ttf') format('truetype');
}
*/ | potogan/smartotels | src/AppBundle/Resources/public/css/fonts.css | CSS | mit | 888 |
require 'spec_helper'
module WLang
describe Parser do
def parse(input)
WLang::Parser.new.call(input)
end
let(:expected) {
[:template,
[:fn,
[:strconcat,
[:static, "Hello "],
[:wlang, "$",
[:fn,
[:static, "who"]]],
[:static, "!"]]]]
}
it 'should parse "Hello ${world}!" as expected' do
parse(hello_tpl).should eq(expected)
end
it 'should support high-order wlang' do
expected = \
[:template,
[:fn,
[:wlang, "$",
[:fn,
[:wlang, "$",
[:fn,
[:static, "who"]]]]]]]
parse("${${who}}").should eq(expected)
end
it 'should support mutli-block functions' do
expected = \
[:template,
[:fn,
[:wlang, "$",
[:fn, [:static, "first" ]],
[:fn, [:static, "second"]]]]]
parse("${first}{second}").should eq(expected)
end
it 'is idempotent' do
parse(parse(hello_tpl)).should eq(expected)
end
it 'supports a path-like object' do
parse(hello_path).should eq(expected)
end
it 'supports an IO object' do
hello_io{|io| parse(io)}.should eq(expected)
end
it 'recognizes objects that respond to :to_path' do
s = Struct.new(:to_path).new(hello_path)
parse(s).should eq(expected)
end
it 'recognizes objects that respond to :to_str' do
s = Struct.new(:to_str).new(hello_tpl)
parse(s).should eq(expected)
end
end
end | llambeau/wlang | spec/unit/compiler/test_parser.rb | Ruby | mit | 1,582 |
const compression = require('compression');
const express = require('express');
const helmet = require('helmet');
const path = require('path');
const app = express();
const port = 3334;
app.use(compression({
filter: shouldCompress
}));
app.use(helmet.xssFilter());
app.use('/', express.static(path.join(__dirname, '../client')));
app.get('/api/v1/hiring-list', function (req, res, next) {
res
.status(500)
.send({
code: 1,
msg: 'Error occurred'
});
});
app.listen(port, () => {
console.log(`Server is listening on ${port}.`);
});
function shouldCompress (req, res) {
if (req.headers['x-no-compression']) {
// don't compress responses with this request header
return false
}
// fallback to standard filter function
return compression.filter(req, res)
}
| KLx21/KL-Warehouse | interviews/fetch-rewards/server/app-error.js | JavaScript | mit | 805 |
#!/usr/bin/env bash
BRANCH=gh-pages
TARGET_REPO=Me4502/EatIt.git
WEBSITE_FOLDER=output
echo -e "Testing travis-encrypt"
echo -e "$VARNAME"
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting to deploy to Github Pages\n"
if [ "$TRAVIS" == "true" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Travis"
fi
#using token clone gh-pages branch
git clone --quiet --branch=${BRANCH} https://${GH_TOKEN}@github.com/${TARGET_REPO} built_website > /dev/null
#go into directory and copy data we're interested in to that directory
cd built_website
rsync -rv --exclude=.git ../${WEBSITE_FOLDER}/* .
#add, commit and push files
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to Github Pages"
git push -fq origin ${BRANCH} > /dev/null
echo -e "Deploy completed\n"
fi | me4502/EatIt | deploy.sh | Shell | mit | 902 |
import SpinorE3 from './SpinorE3'
export default function(R: SpinorE3, S: SpinorE3): number {
return - R.yz * S.zx + R.zx * S.yz + R.xy * S.a + R.a * S.xy
}
| geometryzen/davinci-units | src/davinci-units/math/mulSpinorE3XY.ts | TypeScript | mit | 162 |
#
# Generic and Simple GNU ARM Makefile
#
# Desinged for the gnu-arm-none-eabi tool chain
#
# Features
# - create hex file
# - create assembler listing (.dis)
#
# Limitations
# - only C-files supported
# - no automatic dependency checking (call 'make clean' if any .h files are changed)
#
# Targets:
# make
# create hex file, no upload
# make upload
# create and upload hex file
# make clean
# delete all generated files
#
# Note:
# Display list make database: make -p -f/dev/null | less
#
#================================================
# External tools
# The base directory of gcc-arm-none-eabi
# Can be empty on Ubuntu and installed gcc-arm-none-eabi
# If set, GCCBINPATH must contain a "/" at the end.
GCCBINPATH:=/usr/bin/
#================================================
# Project Information
# The name for the project
TARGETNAME:=plain
# The source files of the project
SRC:=$(wildcard *.c)
# The CPU architecture (will be used for -mcpu)
MCPU:=cortex-m0
# Include directory for the system include files
SYSINC:=../lpc_chip_11uxx_lib/inc
SYSSRC:=$(wildcard ../lpc_chip_11uxx_lib/src/*.c)
# Directory for the linker script
LDSCRIPTDIR:=.
# Name of the linker script (must be the "keep" script, because the other script is not always working)
LDSCRIPT:=lpc11u35.ld
#================================================
# Main part of the Makefile starts here. Usually no changes are needed.
# Internal Variable Names
LIBNAME:=$(TARGETNAME).a
ELFNAME:=$(TARGETNAME).elf
HEXNAME:=$(TARGETNAME).hex
BINNAME:=$(TARGETNAME).bin
DISNAME:=$(TARGETNAME).dis
MAPNAME:=$(TARGETNAME).map
OBJ:=$(SRC:.c=.o) $(SYSSRC:.c=.o)
# Replace standard build tools by avr tools
CC:=$(GCCBINPATH)arm-none-eabi-gcc
AR:=$(GCCBINPATH)arm-none-eabi-ar
OBJCOPY:=$(GCCBINPATH)arm-none-eabi-objcopy
OBJDUMP:=$(GCCBINPATH)arm-none-eabi-objdump
SIZE:=$(GCCBINPATH)arm-none-eabi-size
# Common flags
COMMON_FLAGS = -mthumb -mcpu=$(MCPU)
COMMON_FLAGS += -Wall -I. -I$(SYSINC)
# define stack size (defaults to 0x0100)
# COMMON_FLAGS += -D__STACK_SIZE=0x0100
# define constant for lpcopen library
COMMON_FLAGS += -DCORE_M0
# do not make a call to SystemInit()
# COMMON_FLAGS += -Os -flto
COMMON_FLAGS += -Os
# Do not use stand libs startup code. Uncomment this for gcclib procedures
# memcpy still works, but might be required for __aeabi_uidiv
# COMMON_FLAGS += -nostdlib
# remove unused data and function
COMMON_FLAGS += -ffunction-sections -fdata-sections
# C flags
CFLAGS:=$(COMMON_FLAGS) -std=gnu99
# LD flags
# remove unreferenced procedures and variables, but keep "arm_stack_area" and __isr_vector
GC:=-Wl,--gc-sections -Wl,--undefined=arm_stack_area -Wl,--undefined=__isr_vector
MAP:=-Wl,-Map=$(MAPNAME)
LFLAGS:=$(COMMON_FLAGS) $(GC) $(MAP)
LDLIBS:=--specs=nano.specs -lc -lc -lnosys -L$(LDSCRIPTDIR) -T $(LDSCRIPT)
# Additional Suffixes
.SUFFIXES: .elf .hex .bin .dis
# Targets
.PHONY: all
all: $(DISNAME) $(HEXNAME) $(BINNAME)
$(SIZE) $(ELFNAME)
.PHONY: upload
upload: $(DISNAME) $(HEXNAME) $(ELFNAME) $(BINNAME)
dd bs=1024 conv=nocreat,notrunc if=$(BINNAME) of="/media/$(shell echo $$USER)/CRP DISABLD/firmware.bin"
cp "/media/$(shell echo $$USER)/CRP DISABLD/firmware.bin" tmp.bin
diff tmp.bin $(BINNAME)
$(SIZE) $(ELFNAME)
.PHONY: clean
clean:
$(RM) $(OBJ) $(HEXNAME) $(ELFNAME) $(LIBNAME) $(DISNAME) $(MAPNAME) $(BINNAME)
# implicit rules
.elf.hex:
$(OBJCOPY) -O ihex $< $@
# create the binary version of the new flashfile
# extend the file with 0xff to the size of the flash ROM area
.elf.bin:
$(OBJCOPY) -O binary --gap-fill 255 --pad-to 65536 $< $@
# explicit rules
$(ELFNAME): $(LIBNAME)($(OBJ))
$(LINK.o) $(LFLAGS) $(LIBNAME) $(LDLIBS) -o $@
$(DISNAME): $(ELFNAME)
$(OBJDUMP) -D -S $< > $@
| WiseLabCMU/gridballast | Source/framework/main/u8g2/sys/arm/plain/src/Makefile | Makefile | mit | 3,868 |
# shakespeare-dynamic-opheilia
TODO: Write description here
## Installation
TODO: Write installation instructions here
## Usage
TODO: Write usage instructions here
## How to run tests
```
cabal configure --enable-tests && cabal build && cabal test
```
## Contributing
TODO: Write contribution instructions here
| smurphy8/shakespeare-dynamic | shakespeare-dynamic-opheilia/README.md | Markdown | mit | 320 |
require "ruboty/aws/actions/output_ec2_instances"
require "ruboty/aws/actions/count_ec2_running_instances"
require "ruboty/aws/actions/stop_ec2_instance"
require "ruboty/aws/actions/start_ec2_instance"
module Ruboty
module Handlers
class Aws < Base
env :AWS_ACCESS_KEY_ID, "AWS Access Key ID", optional: false
env :AWS_SECRET_ACCESS_KEY, "AWS Secret Access Key", optional: false
on /ec2 show all instances/, name: 'output_ec2_instances', description: 'Output all ec2 instances'
on /ec2 show count instances/, name: 'count_ec2_running_instances', description: 'Output number of running instances'
on /ec2 start (?<instance>.*)/, name: 'start_ec2_instance', description: 'Start ec2 instance'
on /ec2 stop (?<instance>.*)/, name: 'stop_ec2_instance', description: 'Stop ec2 instance'
def output_ec2_instances(message)
Ruboty::Aws::Actions::OutputEc2Instances.new(message).call
end
def count_ec2_running_instances(message)
Ruboty::Aws::Actions::CountEc2RunningInstances.new(message).call
end
def start_ec2_instance(message)
Ruboty::Aws::Actions::StartEc2Instance.new(message).call
end
def stop_ec2_instance(message)
Ruboty::Aws::Actions::StopEc2Instance.new(message).call
end
end
end
end
| mzp/ruboty-aws | lib/ruboty/handlers/aws.rb | Ruby | mit | 1,319 |
import json
def new(app_id=None, api_key=None, api_method=None, **payload):
if not all((app_id, api_key, api_method)):
raise RuntimeError("Missing one or more of required arguments: "
"app_id, api_key, api_method")
url = 'https://onesignal.com/api/v1/%s' % api_method
headers = {
'Content-Type': 'application/json; charset=utf-8',
'Authorization': 'Basic %s' % api_key
}
payload['app_id'] = app_id
return {
'url': url,
'headers': headers,
'data': json.dumps(payload)
}
| 05bit/python-signa | signa/providers/onesignal.py | Python | mit | 575 |
<!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) on Fri May 19 13:06:07 EEST 2006 -->
<TITLE>
Uses of Class UI.JWarHelp
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Uses of Class UI.JWarHelp";
}
</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="../../UI/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../UI/JWarHelp.html" title="class in UI"><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="../../overview-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-files/index-1.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?UI/\class-useJWarHelp.html" target="_top"><B>FRAMES</B></A>
<A HREF="JWarHelp.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>UI.JWarHelp</B></H2>
</CENTER>
No usage of UI.JWarHelp
<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="../../UI/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../UI/JWarHelp.html" title="class in UI"><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="../../overview-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-files/index-1.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?UI/\class-useJWarHelp.html" target="_top"><B>FRAMES</B></A>
<A HREF="JWarHelp.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>
</BODY>
</HTML>
| pavkam/school | JWar/doc/UI/class-use/JWarHelp.html | HTML | mit | 5,243 |
require "spec_helper"
describe GraphQL::StaticValidation::ArgumentLiteralsAreCompatible do
let(:query_string) {%|
query getCheese {
cheese(id: "aasdlkfj") { source }
cheese(id: 1) { source @skip(if: {id: 1})}
yakSource: searchDairy(product: [{source: COW, fatContent: 1.1}]) { source }
badSource: searchDairy(product: [{source: 1.1}]) { source }
missingSource: searchDairy(product: [{fatContent: 1.1}]) { source }
listCoerce: cheese(id: 1) { similarCheese(source: YAK) }
missingInputField: searchDairy(product: [{source: YAK, wacky: 1}])
}
fragment cheeseFields on Cheese {
similarCheese(source: 4.5)
}
|}
let(:validator) { GraphQL::StaticValidation::Validator.new(schema: DummySchema, rules: [GraphQL::StaticValidation::ArgumentLiteralsAreCompatible]) }
let(:query) { GraphQL::Query.new(DummySchema, query_string) }
let(:errors) { validator.validate(query) }
it "finds undefined or missing-required arguments to fields and directives" do
assert_equal(6, errors.length)
query_root_error = {
"message"=>"Argument 'id' on Field 'cheese' has an invalid value",
"locations"=>[{"line"=>3, "column"=>7}]
}
assert_includes(errors, query_root_error)
directive_error = {
"message"=>"Argument 'if' on Directive 'skip' has an invalid value",
"locations"=>[{"line"=>4, "column"=>30}]
}
assert_includes(errors, directive_error)
input_object_error = {
"message"=>"Argument 'product' on Field 'badSource' has an invalid value",
"locations"=>[{"line"=>6, "column"=>7}]
}
assert_includes(errors, input_object_error)
input_object_field_error = {
"message"=>"Argument 'source' on InputObject 'DairyProductInput' has an invalid value",
"locations"=>[{"line"=>6, "column"=>40}]
}
assert_includes(errors, input_object_field_error)
missing_required_field_error = {
"message"=>"Argument 'product' on Field 'missingSource' has an invalid value",
"locations"=>[{"line"=>7, "column"=>7}]
}
assert_includes(errors, missing_required_field_error)
fragment_error = {
"message"=>"Argument 'source' on Field 'similarCheese' has an invalid value",
"locations"=>[{"line"=>13, "column"=>7}]
}
assert_includes(errors, fragment_error)
end
end
| tribune/graphql-ruby | spec/graphql/static_validation/rules/argument_literals_are_compatible_spec.rb | Ruby | mit | 2,341 |
<?php
/**
* Performance Dashboard Extension for Magento 2
*
* PHP version 5
*
* @category MageHost
* @package MageHost\PerformanceDashboard
* @author Jeroen Vermeulen <[email protected]>
* @copyright 2019 MageHost BV (https://magehost.pro)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/magehost/performance-dashboard
* @noinspection PhpUndefinedMethodInspection
*/
namespace MageHost\PerformanceDashboard\Model\DashboardRow;
use Exception;
use MageHost\PerformanceDashboard\Model\DashboardRow;
use MageHost\PerformanceDashboard\Model\DashboardRowInterface;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Store\Model\StoreManagerInterface;
use Psr\Log\LoggerInterface;
/**
* Class HttpVersion
*
* Dashboard row to check HTTP version
*
* @category MageHost
* @package MageHost\PerformanceDashboard\Model\DashboardRow
* @author Jeroen Vermeulen <[email protected]>
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/magehost/performance-dashboard
*/
class HttpVersion extends DashboardRow implements DashboardRowInterface
{
/**
* @var RequestInterface
*/
private $request;
/**
* @var StoreManagerInterface
*/
private $storeManager;
/**
* @var LoggerInterface
*/
private $logger;
public function __construct(
RequestInterface $request,
StoreManagerInterface $storeManager,
LoggerInterface $logger,
array $data
) {
$this->request = $request;
$this->storeManager = $storeManager;
$this->logger = $logger;
parent::__construct($data);
}
/**
* Load Row, is called by DashboardRowFactory
*
* @throws NoSuchEntityException
*/
public function load()
{
$this->setTitle(__('HTTP Version'));
$this->setButtons('https://css-tricks.com/http2-real-world-performance-test-analysis/');
$frontUrl = $this->storeManager->getStore()->getBaseUrl('link', false);
if (preg_match('|^http://|', $frontUrl)) {
$this->setStatus(self::STATUS_PROBLEM);
$this->setInfo(sprintf(__("Your frontend is not HTTPS")."\n"));
$this->setAction(
__(
"Update 'Base URL' to use HTTPS.\n".
"This is required for HTTP/2\n"
)
);
$this->setButtons(
[
'label' => __('Default Config'),
'url' => 'adminhtml/system_config/edit/section/web',
'url_params' => [ '_fragment'=> 'web_unsecure-link' ]
]
);
return;
}
$httpVersion = $this->getHttpVersion();
if (null === $httpVersion) {
$this->setStatus(self::STATUS_UNKNOWN);
$this->setInfo(
__(
"Could not check if you are running HTTP/2\n".
"\$_SERVER['SERVER_PROTOCOL'] may be missing.\n"
)
);
} elseif (floatval($httpVersion) >= 2) {
$this->setStatus(self::STATUS_OK);
$this->setInfo(sprintf(__("HTTP Version: %s\n"), $httpVersion));
} else {
$this->setStatus(self::STATUS_PROBLEM);
$this->setInfo(sprintf(__("Your connection is HTTP %s")."\n", $httpVersion));
$this->setAction(
__(
"Upgrade to a web server supporting HTTP/2.\n".
"Check if HTTP/2 is enabled in your server config.\n"
)
);
}
}
/**
* @return string|null
* @throws NoSuchEntityException
*/
public function getHttpVersion()
{
// We are looking for HTTP/2 or higher.
// The $_SERVER['SERVER_PROTOCOL'] is the first place to look.
// We assume if the current request on the Admin runs on HTTP/2, the frontend does too.
$serverProtocol = $this->request->getServerValue('SERVER_PROTOCOL');
if (!empty($serverProtocol)) {
$versionSplit = explode('/', $serverProtocol);
$version = $versionSplit[1];
if (floatval($version) >= 2) {
return $version;
}
}
// However, the webserver may be behind a reverse proxy.
// If the reverse proxy is talking HTTP/2 to the client we are still happy.
// It doesn't matter if the internal connection to the webserver is HTTP/1.
return $this->getHttpVersionUsingRequest();
}
/**
* @return string|null
* @throws NoSuchEntityException
*/
public function getHttpVersionUsingRequest()
{
// We will use Curl to do a HEAD request to the frontend using HTTP/2.
// This will not work when you are debugging using XDebug because it can't handle 2 requests a the same time.
$frontUrl = $this->storeManager->getStore()->getBaseUrl();
try {
if (!defined('CURL_HTTP_VERSION_2_0')) {
define('CURL_HTTP_VERSION_2_0', 3);
}
// magento-coding-standard discourages use of Curl but it is the best way to check for HTTP/2.
$curl = curl_init();
curl_setopt_array(
$curl,
[
CURLOPT_URL => $frontUrl,
CURLOPT_NOBODY => true,
CURLOPT_HEADER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0, // Enable HTTP/2 in the request
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_CONNECTTIMEOUT => 2, // seconds
CURLOPT_TIMEOUT => 10 // seconds
]
);
$httpResponse = curl_exec($curl);
curl_close($curl);
} catch (Exception $e) {
$msg = sprintf("%s: Error fetching '%s': %s", __CLASS__, $frontUrl, $e->getMessage());
$this->logger->info($msg);
}
if (!empty($httpResponse)) {
$responseHeaders = explode("\r\n", $httpResponse);
$version = null;
foreach ($responseHeaders as $header) {
if (preg_match('|^HTTP/([\d\.]+)|', $header, $matches)) {
$version = $matches[1];
break;
}
}
if (empty($version) || floatval($version) < 2) {
foreach ($responseHeaders as $header) {
if (preg_match('|^Upgrade: h([\d\.]+)|', $header, $matches)) {
$version = $matches[1];
break;
}
}
}
return $version;
}
return null;
}
}
| magehost/performance-dashboard | Model/DashboardRow/HttpVersion.php | PHP | mit | 6,953 |
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Common Functions : CodeIgniter User Guide</title>
<style type='text/css' media='all'>@import url('../userguide.css');</style>
<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
<script type="text/javascript" src="../nav/nav.js"></script>
<script type="text/javascript" src="../nav/prototype.lite.js"></script>
<script type="text/javascript" src="../nav/moo.fx.js"></script>
<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
<meta http-equiv='expires' content='-1' />
<meta http-equiv= 'pragma' content='no-cache' />
<meta name='robots' content='all' />
<meta name='author' content='ExpressionEngine Dev Team' />
<meta name='description' content='CodeIgniter User Guide' />
</head>
<body>
<!-- START NAVIGATION -->
<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td><h1>CodeIgniter User Guide Version Location</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
</div>
<!-- END NAVIGATION -->
<!-- START BREADCRUMB -->
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td id="breadcrumb">
<a href="http://codeigniter.com/">CodeIgniter Home</a> ›
<a href="../index.html">User Guide Home</a> ›
Auto-loading Resources
</td>
<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" /> <input type="submit" class="submit" name="sa" value="Go" /></form></td>
</tr>
</table>
<!-- END BREADCRUMB -->
<br clear="all" />
<!-- START CONTENT -->
<div id="content">
<h1>Common Functions</h1>
<p>CodeIgniter uses a few functions for its operation that are globally defined, and are available to you at any point. These do not require loading any libraries or helpers.</p>
<h2>is_php('<var>version_number</var>')</h2>
<p>is_php() determines of the PHP version being used is greater than the supplied <var>version_number</var>.</p>
<code>if (is_php('5.3.0'))<br />
{<br />
$str = quoted_printable_encode($str);<br />
}</code>
<p>Returns boolean <kbd>TRUE</kbd> if the installed version of PHP is equal to or greater than the supplied version number. Returns <kbd>FALSE</kbd> if the installed version of PHP is lower than the supplied version number.</p>
<h2>is_really_writable('<var>path/to/file</var>')</h2>
<p>is_writable() returns TRUE on Windows servers when you really can't write to the file as the OS reports to PHP as FALSE only if the read-only attribute is marked. This function determines if a file is actually writable by attempting to write to it first. Generally only recommended on platforms where this information may be unreliable.</p>
<code>if (is_really_writable('file.txt'))<br />
{<br />
echo "I could write to this if I wanted to";<br />
}<br />
else<br />
{<br />
echo "File is not writable";<br />
}</code>
<h2>config_item('<var>item_key</var>')</h2>
<p>The <a href="../libraries/config.html">Config library</a> is the preferred way of accessing configuration information, however config_item() can be used to retrieve single keys. See Config library documentation for more information.</p>
<h2>show_error('<var>message</var>'), show_404('<var>page</var>'), log_message('<var>level</var>', '<samp>message</samp>')</h2>
<p>These are each outlined on the <a href="errors.html">Error Handling</a> page.</p>
<h2>set_status_header(<var>code</var>, '<var>text</var>');</h2>
<p>Permits you to manually set a server status header. Example:</p>
<code>set_status_header(401);<br />
// Sets the header as: Unauthorized</code>
<p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">See here</a> for a full list of headers.</p>
<h2>remove_invisible_characters(<var>$str</var>)</h2>
<p>This function prevents inserting null characters between ascii characters, like Java\0script.</p>
<h2>html_escape(<var>$mixed</var>)</h2>
<p>This function provides short cut for htmlspecialchars() function. It accepts string and array. To prevent Cross Site Scripting (XSS), it is very useful.</p>
</div>
<!-- END CONTENT -->
<div id="footer">
<p>
Previous Topic: <a href="autoloader.html">Auto-loading Resources</a><a href="hooks.html"></a>
·
<a href="#top">Top of Page</a> ·
<a href="../index.html">User Guide Home</a> ·
Next Topic: <a href="routing.html">URI Routing</a></p>
<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006 - 2012 · <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
</div>
</body>
</html> | ramasamys/T_Report | user_guide/general/common_functions.html | HTML | mit | 5,625 |
//
// PlayingCard.h
// Cards
//
// Created by Sanjib Ahmad on 11/3/13.
// Copyright (c) 2013 <>< ObjectCoder. All rights reserved.
//
#import "Card.h"
@interface PlayingCard : Card
@property (strong, nonatomic) NSString *suit;
@property (nonatomic) NSUInteger rank;
+ (NSArray *)validSuits;
+ (NSUInteger)maxRank;
@end
| kidla/Objective---C-Learning | IOS7-StanFord/SuperCard/Model/PlayingCard.h | C | mit | 328 |
worker_processes 3
timeout 30
preload_app true
before_fork do |server, worker|
# Replace with MongoDB or whatever
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
Rails.logger.info('Disconnected from ActiveRecord')
end
sleep 1
end
after_fork do |server, worker|
# Replace with MongoDB or whatever
if defined?(ActiveRecord::Base)
ActiveRecord::Base.establish_connection
Rails.logger.info('Connected to ActiveRecord')
end
end | digitalknk/Fotografi | config/unicorn.rb | Ruby | mit | 485 |
# Objective-C Debugger
Objective-C relies on XCode internal debugger to step through code, pretty similar to GDB or kGDB.
<br><br>
# Set Breakpoint To Pause
To initiate a stepping debugger, use the breakpoint.
<br><br>
## 1) Set Breakpoint
To set breakpoint, click the line number until a blue bar pointer appears.
<br>
---------
<br><br>
## 2) Run the app and hits the breakpoint
Run the app and ensures you hit the breakpoint. The debugger will automatically appears for stepping sequence.
<br>
---------
<br><br>
## 3) Select Your Action
You can either select STEP OVER, STEP INTO and STEP OUT on the debugging toolbar.
<br>
---------
<br><br>
## 4) Type "c" in debugger console to continue running
Inside your debugger console, type "c" or "continue" to let the process run as normal.
```
(lldb) c
Process 10408 resuming
```
<br><br>
# Resources
1. https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/UsingtheDebugger.html | hollowaykeanho/learning | ios/debugger/README.md | Markdown | mit | 985 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="htmlId">
<head>
<title>Coverage Report :: MinifyNameListFormatter</title>
<style type="text/css">
@import "../../.css/coverage.css";
</style>
</head>
<body>
<div class="header"></div>
<div class="content">
<div class="breadCrumbs">
[ <a href="../../index.html">all classes</a> ]
[ <a href="../index.html">net.sf.jabref.logic.formatter.minifier</a> ]
</div>
<h1>Coverage Summary for Class: MinifyNameListFormatter (net.sf.jabref.logic.formatter.minifier)</h1>
<table class="coverageStats">
<tr>
<th class="name">Class</th>
<th class="coverageStat
">
Class, %
</th>
<th class="coverageStat
">
Method, %
</th>
<th class="coverageStat
">
Line, %
</th>
</tr>
<tr>
<td class="name">MinifyNameListFormatter</td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(1/ 1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
14.3%
</span>
<span class="absValue">
(1/ 7)
</span>
</td>
<td class="coverageStat">
<span class="percent">
5%
</span>
<span class="absValue">
(1/ 20)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<div class="sourceCode"><i>1</i> package net.sf.jabref.logic.formatter.minifier;
<i>2</i>
<i>3</i> import java.util.Objects;
<i>4</i>
<i>5</i> import net.sf.jabref.logic.l10n.Localization;
<i>6</i> import net.sf.jabref.model.cleanup.Formatter;
<i>7</i>
<i>8</i> /**
<i>9</i> * Replaces three or more authors with and others
<i>10</i> */
<b class="fc"><i>11</i> public class MinifyNameListFormatter implements Formatter {</b>
<i>12</i> @Override
<i>13</i> public String getName() {
<b class="nc"><i>14</i> return Localization.lang("Minify list of person names");</b>
<i>15</i> }
<i>16</i>
<i>17</i> @Override
<i>18</i> public String getKey() {
<b class="nc"><i>19</i> return "minify_name_list";</b>
<i>20</i> }
<i>21</i>
<i>22</i> /**
<i>23</i> * Replaces three or more authors with and others.
<i>24</i> *
<i>25</i> * <example>
<i>26</i> * Stefan Kolb -> Stefan Kolb
<i>27</i> * Stefan Kolb and Simon Harrer -> Stefan Kolb and Simon Harrer
<i>28</i> * Stefan Kolb and Simon Harrer and Jörg Lenhard -> Stefan Kolb and others
<i>29</i> * </example>
<i>30</i> */
<i>31</i> @Override
<i>32</i> public String format(String value) {
<b class="nc"><i>33</i> Objects.requireNonNull(value);</b>
<i>34</i>
<b class="nc"><i>35</i> if (value.isEmpty()) {</b>
<i>36</i> // nothing to do
<b class="nc"><i>37</i> return value;</b>
<i>38</i> }
<i>39</i>
<b class="nc"><i>40</i> return abbreviateAuthor(value);</b>
<i>41</i> }
<i>42</i>
<i>43</i> @Override
<i>44</i> public String getDescription() {
<b class="nc"><i>45</i> return Localization.lang("Shortens lists of persons if there are more than 2 persons to \"et al.\".");</b>
<i>46</i> }
<i>47</i>
<i>48</i> @Override
<i>49</i> public String getExampleInput() {
<b class="nc"><i>50</i> return "Stefan Kolb and Simon Harrer and Oliver Kopp";</b>
<i>51</i> }
<i>52</i>
<i>53</i> private String abbreviateAuthor(String authorField) {
<i>54</i> // single author
<b class="nc"><i>55</i> String authorSeparator = " and ";</b>
<i>56</i>
<b class="nc"><i>57</i> if (!authorField.contains(authorSeparator)) {</b>
<b class="nc"><i>58</i> return authorField;</b>
<i>59</i> }
<i>60</i>
<b class="nc"><i>61</i> String[] authors = authorField.split(authorSeparator);</b>
<i>62</i>
<i>63</i> // trim authors
<b class="nc"><i>64</i> for (int i = 0; i < authors.length; i++) {</b>
<b class="nc"><i>65</i> authors[i] = authors[i].trim();</b>
<i>66</i> }
<i>67</i>
<i>68</i> // already abbreviated
<b class="nc"><i>69</i> if ("others".equals(authors[authors.length - 1]) && (authors.length == 2)) {</b>
<b class="nc"><i>70</i> return authorField;</b>
<i>71</i> }
<i>72</i>
<i>73</i> // abbreviate
<b class="nc"><i>74</i> if (authors.length < 3) {</b>
<b class="nc"><i>75</i> return authorField;</b>
<i>76</i> }
<i>77</i>
<b class="nc"><i>78</i> return authors[0] + authorSeparator + "others";</b>
<i>79</i> }
<i>80</i> }
</div>
</div>
<div class="footer">
<div style="float:right;">generated on 2017-07-15 00:44</div>
</div>
</body>
</html>
| JessicaDias/JabRef_ES2 | ReportImportTests/net.sf.jabref.logic.formatter.minifier/.classes/MinifyNameListFormatter.html | HTML | mit | 5,161 |
'use strict';
/**
* @ngdoc function
* @name anyandgoApp.controller:SectorEditCtrl
* @description
* # SectorEditCtrl
* Controller of the anyandgoApp
*/
angular.module('anyandgoApp')
.controller('SectorEditCtrl', function ($scope, $location, Restangular, sector) {
var original = sector;
$scope.sector = Restangular.copy(original);
$scope.isClean = function() {
return angular.equals(original, $scope.sector);
}
$scope.destroy = function() {
original.remove().then(function() {
if(navigator.userAgent.match(/Zombie/)) {
document.location.hash = "#/crud/sector";
} else {
$location.path('/crud/sector');
}
});
};
$scope.save = function() {
$scope.sector.put().then(function() {
if(navigator.userAgent.match(/Zombie/)) {
document.location.hash = "#/crud/sector";
} else {
$location.path('/crud/sector');
}
});
};
});
| cortezcristian/hermes | public/scripts/admin/controllers/sector-edit.js | JavaScript | mit | 936 |
package pl.grzeslowski.wykop.posts;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Preconditions;
import java.util.Date;
import java.util.List;
public class Site {
private final Id id;
private final boolean hot;
private final Score wykop;
private final Date added;
private final String author;
private final String content;
private final List<Post> posts;
public Site(@JsonProperty("id") Id id, @JsonProperty("hot") boolean hot, @JsonProperty("wykop") Score wykop,
@JsonProperty("added") Date added, @JsonProperty("author") String author, @JsonProperty("content") String content,
@JsonProperty("posts") List<Post> posts) {
this.id = Preconditions.checkNotNull(id);
this.hot = hot;
this.wykop = Preconditions.checkNotNull(wykop);
this.added = Preconditions.checkNotNull(added);
this.author = Preconditions.checkNotNull(author);
this.content = Preconditions.checkNotNull(content);
this.posts = Preconditions.checkNotNull(posts);
}
public Id getId() {
return id;
}
public boolean isHot() {
return hot;
}
public Score getWykop() {
return wykop;
}
public Date getAdded() {
return added;
}
public String getAuthor() {
return author;
}
public String getContent() {
return content;
}
public List<Post> getPosts() {
return posts;
}
}
| magx2/wykop-rater | common/src/main/java/pl/grzeslowski/wykop/posts/Site.java | Java | mit | 1,509 |
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2006,2007 Frank Scholz <[email protected]>
import os
import re
import traceback
from StringIO import StringIO
import urllib
from twisted.internet import task
from twisted.internet import defer
from twisted.web import static
from twisted.web import resource, server
#from twisted.web import proxy
from twisted.python import util
from twisted.python.filepath import FilePath
from coherence.extern.et import ET, indent
from coherence import __version__
from coherence.upnp.core.service import ServiceServer
from coherence.upnp.core.utils import StaticFile
from coherence.upnp.core.utils import ReverseProxyResource
from coherence.upnp.services.servers.connection_manager_server import ConnectionManagerServer
from coherence.upnp.services.servers.content_directory_server import ContentDirectoryServer
from coherence.upnp.services.servers.scheduled_recording_server import ScheduledRecordingServer
from coherence.upnp.services.servers.media_receiver_registrar_server import MediaReceiverRegistrarServer
from coherence.upnp.services.servers.media_receiver_registrar_server import FakeMediaReceiverRegistrarBackend
from coherence.upnp.devices.basics import BasicDeviceMixin
from coherence import log
COVER_REQUEST_INDICATOR = re.compile(".*?cover\.[A-Z|a-z]{3,4}$")
ATTACHMENT_REQUEST_INDICATOR = re.compile(".*?attachment=.*$")
TRANSCODED_REQUEST_INDICATOR = re.compile(".*/transcoded/.*$")
class MSRoot(resource.Resource, log.Loggable):
logCategory = 'mediaserver'
def __init__(self, server, store):
resource.Resource.__init__(self)
log.Loggable.__init__(self)
self.server = server
self.store = store
#def delayed_response(self, resrc, request):
# print "delayed_response", resrc, request
# body = resrc.render(request)
# print "delayed_response", body
# if body == 1:
# print "delayed_response not yet done"
# return
# request.setHeader("Content-length", str(len(body)))
# request.write(response)
# request.finish()
def getChildWithDefault(self, path, request):
self.info('%s getChildWithDefault, %s, %s, %s %s' % (self.server.device_type,
request.method, path, request.uri, request.client))
headers = request.getAllHeaders()
self.msg( request.getAllHeaders())
try:
request._dlna_transfermode = headers['transfermode.dlna.org']
except KeyError:
request._dlna_transfermode = 'Streaming'
if request.method in ('GET','HEAD'):
if COVER_REQUEST_INDICATOR.match(request.uri):
self.info("request cover for id %s" % path)
ch = self.store.get_by_id(path)
if ch is not None:
request.setResponseCode(200)
file = ch.get_cover()
if os.path.exists(file):
self.info("got cover %s" % file)
return StaticFile(file)
request.setResponseCode(404)
return static.Data('<html><p>cover requested not found</p></html>','text/html')
if ATTACHMENT_REQUEST_INDICATOR.match(request.uri):
self.info("request attachment %r for id %s" % (request.args,path))
ch = self.store.get_by_id(path)
try:
#FIXME same as below
if 'transcoded' in request.args:
if self.server.coherence.config.get('transcoding', 'no') == 'yes':
format = request.args['transcoded'][0]
type = request.args['type'][0]
self.info("request transcoding %r %r" % (format, type))
if format == 'thumb' and type == 'jpeg':
try:
from coherence.transcoder import JPEGThumbTranscoder
return JPEGThumbTranscoder(ch.item.attachments[request.args['attachment'][0]])
except:
self.debug(traceback.format_exc())
request.setResponseCode(404)
return static.Data('<html><p>the requested transcoded file was not found</p></html>','text/html')
else:
request.setResponseCode(404)
return static.Data("<html><p>This MediaServer doesn't support transcoding</p></html>",'text/html')
else:
return ch.item.attachments[request.args['attachment'][0]]
except:
request.setResponseCode(404)
return static.Data('<html><p>the requested attachment was not found</p></html>','text/html')
#if(request.method in ('GET','HEAD') and
# XBOX_TRANSCODED_REQUEST_INDICATOR.match(request.uri)):
# if self.server.coherence.config.get('transcoding', 'no') == 'yes':
# id = path[:-15].split('/')[-1]
# self.info("request transcoding to %r for id %s" % (request.args,id))
# ch = self.store.get_by_id(id)
# uri = ch.get_path()
# return MP3Transcoder(uri)
if(request.method in ('GET','HEAD') and
TRANSCODED_REQUEST_INDICATOR.match(request.uri)):
self.info("request transcoding to %s for id %s" % (request.uri.split('/')[-1],path))
if self.server.coherence.config.get('transcoding', 'no') == 'yes':
ch = self.store.get_by_id(path)
#FIXME create a generic transcoder class and sort the details there
format = request.uri.split('/')[-1] #request.args['transcoded'][0]
uri = ch.get_path()
if format == 'lpcm':
try:
from coherence.transcoder import PCMTranscoder
return PCMTranscoder(uri)
except:
self.debug(traceback.format_exc())
request.setResponseCode(404)
return static.Data('<html><p>the requested transcoded file was not found</p></html>','text/html')
if format == 'wav':
try:
from coherence.transcoder import WAVTranscoder
return WAVTranscoder(uri)
except:
self.debug(traceback.format_exc())
request.setResponseCode(404)
return static.Data('<html><p>the requested transcoded file was not found</p></html>','text/html')
if format == 'mp3':
try:
from coherence.transcoder import MP3Transcoder
return MP3Transcoder(uri)
except:
self.debug(traceback.format_exc())
request.setResponseCode(404)
return static.Data('<html><p>the requested transcoded file was not found</p></html>','text/html')
if format == 'mp4':
try:
from coherence.transcoder import MP4Transcoder
return MP4Transcoder(uri)
except:
self.debug(traceback.format_exc())
request.setResponseCode(404)
return static.Data('<html><p>the requested transcoded file was not found</p></html>','text/html')
if format == 'thumb':
type = request.args['type'][0]
if type == 'jpeg':
try:
from coherence.transcoder import JPEGThumbTranscoder
return JPEGThumbTranscoder(uri)
except:
self.debug(traceback.format_exc())
request.setResponseCode(404)
return static.Data('<html><p>the requested transcoded file was not found</p></html>','text/html')
request.setResponseCode(404)
return static.Data("<html><p>This MediaServer doesn't support transcoding</p></html>",'text/html')
if(request.method == 'POST' and
request.uri.endswith('?import')):
d = self.import_file(path,request)
if isinstance(d, defer.Deferred):
d.addBoth(self.import_response,path)
return d
return self.import_response(None,path)
if(headers.has_key('user-agent') and
(headers['user-agent'].find('Xbox/') == 0 or # XBox
headers['user-agent'].startswith("""Mozilla/4.0 (compatible; UPnP/1.0; Windows""")) and # wmp11
path in ['description-1.xml','description-2.xml']):
self.info('XBox/WMP alert, we need to simulate a Windows Media Connect server')
if self.children.has_key('xbox-description-1.xml'):
self.msg( 'returning xbox-description-1.xml')
return self.children['xbox-description-1.xml']
if self.children.has_key(path):
return self.children[path]
if request.uri == '/':
return self
return self.getChild(path, request)
def requestFinished(self, result, id, request):
self.info("finished, remove %d from connection table" % id)
self.info("finished, sentLength: %d chunked: %d code: %d" % (request.sentLength, request.chunked, request.code))
self.info("finished %r" % request.headers)
self.server.connection_manager_server.remove_connection(id)
def import_file(self,name,request):
self.info("import file, id %s" % name)
print "import file, id %s" % name
ch = self.store.get_by_id(name)
print "ch", ch
if ch is not None:
if hasattr(self.store,'backend_import'):
response_code = self.store.backend_import(ch,request.content)
if isinstance(response_code, defer.Deferred):
return response_code
request.setResponseCode(response_code)
return
request.setResponseCode(404)
def process_child(self,ch,name,request):
if ch != None:
self.info('Child found', ch)
if(request.method == 'GET' or
request.method == 'HEAD'):
headers = request.getAllHeaders()
if headers.has_key('content-length'):
self.warning('%s request with content-length %s header - sanitizing' % (
request.method,
headers['content-length']))
del request.received_headers['content-length']
self.debug('data', )
if len(request.content.getvalue()) > 0:
""" shall we remove that?
can we remove that?
"""
self.warning('%s request with %d bytes of message-body - sanitizing' % (
request.method,
len(request.content.getvalue())))
request.content = StringIO()
if hasattr(ch, "location"):
self.debug("we have a location %s" % isinstance(ch.location, resource.Resource))
if(isinstance(ch.location, ReverseProxyResource) or
isinstance(ch.location, resource.Resource)):
self.info('getChild proxy %s to %s' % (name, ch.location.uri))
new_id,_,_ = self.server.connection_manager_server.add_connection('',
'Output',
-1,
'')
self.info("startup, add %d to connection table" % new_id)
d = request.notifyFinish()
d.addBoth(self.requestFinished, new_id, request)
request.setHeader('transferMode.dlna.org', request._dlna_transfermode)
if hasattr(ch,'item') and hasattr(ch.item, 'res'):
if ch.item.res[0].protocolInfo is not None:
additional_info = ch.item.res[0].get_additional_info()
if additional_info != '*':
request.setHeader('contentFeatures.dlna.org', additional_info)
return ch.location
try:
p = ch.get_path()
except TypeError:
return self.list_content(name, ch, request)
except Exception, msg:
self.debug("error accessing items path %r" % msg)
self.debug(traceback.format_exc())
return self.list_content(name, ch, request)
if p != None and os.path.exists(p):
self.info("accessing path %r" % p)
new_id,_,_ = self.server.connection_manager_server.add_connection('',
'Output',
-1,
'')
self.info("startup, add %d to connection table" % new_id)
d = request.notifyFinish()
d.addBoth(self.requestFinished, new_id, request)
request.setHeader('transferMode.dlna.org', request._dlna_transfermode)
if hasattr(ch, 'item') and hasattr(ch.item, 'res'):
if ch.item.res[0].protocolInfo is not None:
additional_info = ch.item.res[0].get_additional_info()
if additional_info != '*':
request.setHeader('contentFeatures.dlna.org', additional_info)
ch = StaticFile(p)
else:
self.debug("accessing path %r failed" % p)
return self.list_content(name, ch, request)
if ch is None:
p = util.sibpath(__file__, name)
if os.path.exists(p):
ch = StaticFile(p)
self.info('MSRoot ch', ch)
return ch
def getChild(self, name, request):
self.info('getChild %s, %s' % (name, request))
ch = self.store.get_by_id(name)
if isinstance(ch, defer.Deferred):
ch.addCallback(self.process_child,name,request)
#ch.addCallback(self.delayed_response, request)
return ch
return self.process_child(ch,name,request)
def list_content(self, name, item, request):
self.info('list_content', name, item, request)
page = """<html><head><title>%s</title></head><body><p>%s</p>"""% \
(item.get_name().encode('ascii','xmlcharrefreplace'),
item.get_name().encode('ascii','xmlcharrefreplace'))
if( hasattr(item,'mimetype') and item.mimetype in ['directory','root']):
uri = request.uri
if uri[-1] != '/':
uri += '/'
def build_page(r,page):
#print "build_page", r
page += """<ul>"""
if r is not None:
for c in r:
if hasattr(c,'get_url'):
path = c.get_url()
self.debug('has get_url', path)
elif hasattr(c,'get_path') and c.get_path != None:
#path = c.get_path().encode('utf-8').encode('string_escape')
path = c.get_path()
if isinstance(path,unicode):
path = path.encode('ascii','xmlcharrefreplace')
else:
path = path.decode('utf-8').encode('ascii','xmlcharrefreplace')
self.debug('has get_path', path)
else:
path = request.uri.split('/')
path[-1] = str(c.get_id())
path = '/'.join(path)
self.debug('got path', path)
title = c.get_name()
self.debug( 'title is:', type(title))
try:
if isinstance(title,unicode):
title = title.encode('ascii','xmlcharrefreplace')
else:
title = title.decode('utf-8').encode('ascii','xmlcharrefreplace')
except (UnicodeEncodeError,UnicodeDecodeError):
title = c.get_name().encode('utf-8').encode('string_escape')
page += '<li><a href="%s">%s</a></li>' % \
(path, title)
page += """</ul>"""
page += """</body></html>"""
return static.Data(page,'text/html')
children = item.get_children()
if isinstance(children, defer.Deferred):
print "list_content, we have a Deferred", children
children.addCallback(build_page,page)
#children.addErrback(....) #FIXME
return children
return build_page(children,page)
elif( hasattr(item,'mimetype') and item.mimetype.find('image/') == 0):
#path = item.get_path().encode('utf-8').encode('string_escape')
path = urllib.quote(item.get_path().encode('utf-8'))
title = item.get_name().decode('utf-8').encode('ascii','xmlcharrefreplace')
page += """<p><img src="%s" alt="%s"></p>""" % \
(path, title)
else:
pass
page += """</body></html>"""
return static.Data(page,'text/html')
def listchilds(self, uri):
self.info('listchilds %s' % uri)
if uri[-1] != '/':
uri += '/'
cl = '<p><a href=%s0>content</a></p>' % uri
for c in self.children:
cl += '<li><a href=%s%s>%s</a></li>' % (uri,c,c)
return cl
def import_response(self,result,id):
return static.Data('<html><p>import of %s finished</p></html>'% id,'text/html')
def render(self,request):
#print "render", request
return '<html><p>root of the %s MediaServer</p><p><ul>%s</ul></p></html>'% \
(self.server.backend,
self.listchilds(request.uri))
class RootDeviceXML(static.Data):
def __init__(self, hostname, uuid, urlbase,
device_type='MediaServer',
version=2,
friendly_name='Coherence UPnP A/V MediaServer',
xbox_hack=False,
services=[],
devices=[],
icons=[]):
uuid = str(uuid)
root = ET.Element('root')
root.attrib['xmlns']='urn:schemas-upnp-org:device-1-0'
device_type = 'urn:schemas-upnp-org:device:%s:%d' % (device_type, int(version))
e = ET.SubElement(root, 'specVersion')
ET.SubElement(e, 'major').text = '1'
ET.SubElement(e, 'minor').text = '0'
#if version == 1:
# ET.SubElement(root, 'URLBase').text = urlbase + uuid[5:] + '/'
d = ET.SubElement(root, 'device')
ET.SubElement(d, 'deviceType').text = device_type
if xbox_hack == False:
ET.SubElement(d, 'friendlyName').text = friendly_name
else:
ET.SubElement(d, 'friendlyName').text = friendly_name + ' : 1 : Windows Media Connect'
ET.SubElement(d, 'manufacturer').text = 'beebits.net'
ET.SubElement(d, 'manufacturerURL').text = 'http://coherence.beebits.net'
ET.SubElement(d, 'modelDescription').text = 'Coherence UPnP A/V MediaServer'
if xbox_hack == False:
ET.SubElement(d, 'modelName').text = 'Coherence UPnP A/V MediaServer'
else:
ET.SubElement(d, 'modelName').text = 'Windows Media Connect'
ET.SubElement(d, 'modelNumber').text = __version__
ET.SubElement(d, 'modelURL').text = 'http://coherence.beebits.net'
ET.SubElement(d, 'serialNumber').text = '0000001'
ET.SubElement(d, 'UDN').text = uuid
ET.SubElement(d, 'UPC').text = ''
if len(icons):
e = ET.SubElement(d, 'iconList')
for icon in icons:
icon_path = ''
if icon.has_key('url'):
if icon['url'].startswith('file://'):
icon_path = os.path.basename(icon['url'])
elif icon['url'] == '.face':
icon_path = os.path.join(os.path.expanduser('~'), ".face")
else:
from pkg_resources import resource_filename
icon_path = os.path.abspath(resource_filename(__name__, os.path.join('..','..','..','misc','device-icons',icon['url'])))
if os.path.exists(icon_path) == True:
i = ET.SubElement(e, 'icon')
for k,v in icon.items():
if k == 'url':
if v.startswith('file://'):
ET.SubElement(i, k).text = '/'+uuid[5:]+'/'+os.path.basename(v)
continue
elif v == '.face':
ET.SubElement(i, k).text = '/'+uuid[5:]+'/'+'face-icon.png'
continue
else:
ET.SubElement(i, k).text = '/'+uuid[5:]+'/'+os.path.basename(v)
continue
ET.SubElement(i, k).text = str(v)
if len(services):
e = ET.SubElement(d, 'serviceList')
for service in services:
id = service.get_id()
if xbox_hack == False and id == 'X_MS_MediaReceiverRegistrar':
continue
s = ET.SubElement(e, 'service')
try:
namespace = service.namespace
except:
namespace = 'schemas-upnp-org'
if( hasattr(service,'version') and
service.version < version):
v = service.version
else:
v = version
ET.SubElement(s, 'serviceType').text = 'urn:%s:service:%s:%d' % (namespace, id, int(v))
try:
namespace = service.id_namespace
except:
namespace = 'upnp-org'
ET.SubElement(s, 'serviceId').text = 'urn:%s:serviceId:%s' % (namespace,id)
ET.SubElement(s, 'SCPDURL').text = '/' + uuid[5:] + '/' + id + '/' + service.scpd_url
ET.SubElement(s, 'controlURL').text = '/' + uuid[5:] + '/' + id + '/' + service.control_url
ET.SubElement(s, 'eventSubURL').text = '/' + uuid[5:] + '/' + id + '/' + service.subscription_url
#ET.SubElement(s, 'SCPDURL').text = id + '/' + service.scpd_url
#ET.SubElement(s, 'controlURL').text = id + '/' + service.control_url
#ET.SubElement(s, 'eventSubURL').text = id + '/' + service.subscription_url
if len(devices):
e = ET.SubElement(d, 'deviceList')
ET.SubElement(d, 'presentationURL').text = '/' + uuid[5:]
x = ET.SubElement(d, 'dlna:X_DLNADOC')
x.attrib['xmlns:dlna']='urn:schemas-dlna-org:device-1-0'
x.text = 'DMS-1.50'
x = ET.SubElement(d, 'dlna:X_DLNADOC')
x.attrib['xmlns:dlna']='urn:schemas-dlna-org:device-1-0'
x.text = 'M-DMS-1.50'
x=ET.SubElement(d, 'dlna:X_DLNACAP')
x.attrib['xmlns:dlna']='urn:schemas-dlna-org:device-1-0'
x.text = 'av-upload,image-upload,audio-upload'
#if self.has_level(LOG_DEBUG):
# indent( root)
self.xml = """<?xml version="1.0" encoding="utf-8"?>""" + ET.tostring( root, encoding='utf-8')
static.Data.__init__(self, self.xml, 'text/xml')
class MediaServer(log.Loggable,BasicDeviceMixin):
logCategory = 'mediaserver'
device_type = 'MediaServer'
def fire(self,backend,**kwargs):
if kwargs.get('no_thread_needed',False) == False:
""" this could take some time, put it in a thread to be sure it doesn't block
as we can't tell for sure that every backend is implemented properly """
from twisted.internet import threads
d = threads.deferToThread(backend, self, **kwargs)
def backend_ready(backend):
self.backend = backend
def backend_failure(x):
self.warning('backend %s not installed, MediaServer activation aborted - %s', backend, x.getErrorMessage())
self.debug(x)
d.addCallback(backend_ready)
d.addErrback(backend_failure)
# FIXME: we need a timeout here so if the signal we wait for not arrives we'll
# can close down this device
else:
self.backend = backend(self, **kwargs)
def init_complete(self, backend):
if self.backend != backend:
return
self._services = []
self._devices = []
try:
self.connection_manager_server = ConnectionManagerServer(self)
self._services.append(self.connection_manager_server)
except LookupError,msg:
self.warning( 'ConnectionManagerServer', msg)
raise LookupError,msg
try:
transcoding = False
if self.coherence.config.get('transcoding', 'no') == 'yes':
transcoding = True
self.content_directory_server = ContentDirectoryServer(self,transcoding=transcoding)
self._services.append(self.content_directory_server)
except LookupError,msg:
self.warning( 'ContentDirectoryServer', msg)
raise LookupError,msg
try:
self.media_receiver_registrar_server = MediaReceiverRegistrarServer(self,
backend=FakeMediaReceiverRegistrarBackend())
self._services.append(self.media_receiver_registrar_server)
except LookupError,msg:
self.warning( 'MediaReceiverRegistrarServer (optional)', msg)
try:
self.scheduled_recording_server = ScheduledRecordingServer(self)
self._services.append(self.scheduled_recording_server)
except LookupError,msg:
self.info( 'ScheduledRecordingServer', msg)
upnp_init = getattr(self.backend, "upnp_init", None)
if upnp_init:
upnp_init()
self.web_resource = MSRoot( self, backend)
self.coherence.add_web_resource( str(self.uuid)[5:], self.web_resource)
version = int(self.version)
while version > 0:
self.web_resource.putChild( 'description-%d.xml' % version,
RootDeviceXML( self.coherence.hostname,
str(self.uuid),
self.coherence.urlbase,
self.device_type, version,
friendly_name=self.backend.name,
services=self._services,
devices=self._devices,
icons=self.icons))
self.web_resource.putChild( 'xbox-description-%d.xml' % version,
RootDeviceXML( self.coherence.hostname,
str(self.uuid),
self.coherence.urlbase,
self.device_type, version,
friendly_name=self.backend.name,
xbox_hack=True,
services=self._services,
devices=self._devices,
icons=self.icons))
version -= 1
self.web_resource.putChild('ConnectionManager', self.connection_manager_server)
self.web_resource.putChild('ContentDirectory', self.content_directory_server)
if hasattr(self,"scheduled_recording_server"):
self.web_resource.putChild('ScheduledRecording', self.scheduled_recording_server)
if hasattr(self,"media_receiver_registrar_server"):
self.web_resource.putChild('X_MS_MediaReceiverRegistrar', self.media_receiver_registrar_server)
for icon in self.icons:
if icon.has_key('url'):
if icon['url'].startswith('file://'):
if os.path.exists(os.path.basename(icon['url'])):
self.web_resource.putChild(os.path.basename(icon['url']),
StaticFile(icon['url'][7:],defaultType=icon['mimetype']))
elif icon['url'] == '.face':
face_path = os.path.abspath(os.path.join(os.path.expanduser('~'), ".face"))
if os.path.exists(face_path):
self.web_resource.putChild('face-icon.png',StaticFile(face_path,defaultType=icon['mimetype']))
else:
from pkg_resources import resource_filename
icon_path = os.path.abspath(resource_filename(__name__, os.path.join('..','..','..','misc','device-icons',icon['url'])))
if os.path.exists(icon_path):
self.web_resource.putChild(icon['url'],StaticFile(icon_path,defaultType=icon['mimetype']))
self.register()
self.warning("%s %s (%s) activated with %s" % (self.backend.name, self.device_type, self.backend, str(self.uuid)[5:]))
| palfrey/coherence | coherence/upnp/devices/media_server.py | Python | mit | 30,641 |
# cli-tools
A variety of command-line tools
### Features
* Allows for the transmutation of text into interesting(?) shapes
* Display help with `./cli-tools` or `./cli-tools -h`
### Roadmap
* Users will be able to save time doing silly things
### What are some example use-cases?
#### transmute wrap-box
A user wants to create a box of text, like so:
```
T E S T
E S T T
S T T E
T T E S
```
* This becomes inconvenient to do manually for larger sized boxes
* Can be done with `./cli-tools -Tw 'TEST'` or `./cli-tools --transmute -w 'TEST'`
### Usage:
cli-tools {-T | --transmute} [options] <input>
options:
* `-l`, `--lower` = Sets more to lower for applicable transmutations.
* `-g` = Creates a gradient of the given input.
* `-w` = Creates a wrapped box of the given input.
* `-r` = Creates a left-ended right-angle of the input.
| Rikoru/cli-tools | README.md | Markdown | mit | 841 |
#ifndef __CURVE_SIGS_H__
#define __CURVE_SIGS_H__
#define MAX_MSG_LEN 8192
void curve25519_keygen(unsigned char* curve25519_pubkey_out, /* 32 bytes */
const unsigned char* curve25519_privkey_in); /* 32 bytes */
/* returns 0 on success */
int curve25519_sign(unsigned char* signature_out, /* 64 bytes */
const unsigned char* curve25519_privkey, /* 32 bytes */
const unsigned char* msg, const unsigned long msg_len,
const unsigned char* random); /* 64 bytes */
/* returns 0 on success */
int curve25519_verify(const unsigned char* signature, /* 64 bytes */
const unsigned char* curve25519_pubkey, /* 32 bytes */
const unsigned char* msg, const unsigned long msg_len);
/* helper function - modified version of crypto_sign() to use
explicit private key. In particular:
sk : private key
pk : public key
msg : message
prefix : 0xFE || [0xFF]*31
random : 64 bytes random
q : main subgroup order
The prefix is chosen to distinguish the two SHA512 uses below, since
prefix is an invalid encoding for R (it would encode a "field element"
of 2^255 - 2). 0xFF*32 is set aside for use in ECDH protocols, which
is why the first byte here ix 0xFE.
sig_nonce = SHA512(prefix || sk || msg || random) % q
R = g^sig_nonce
M = SHA512(R || pk || m)
S = sig_nonce + (m * sk)
signature = (R || S)
*/
int crypto_sign_modified(
unsigned char *sm,
const unsigned char *m,unsigned long long mlen,
const unsigned char *sk, /* Curve/Ed25519 private key */
const unsigned char *pk, /* Ed25519 public key */
const unsigned char *random /* 64 bytes random to hash into nonce */
);
#endif
| mgp25/curve25519-php | curve/ed25519/additions/curve_sigs.h | C | mit | 1,777 |
---
layout: none
published: true
title: 'Läksyt torstain tunnille, tiistain itsenäiset'
tags: rub5.1 läksyt
---
Tiistain tunti tehdään itsenäisesti opiskellen opettajien koulutuksesta johtuen.
PAKOLLISET:
- Tee työvihkoon tekstin 1 fraasit.
- Tee tekstiin 1 liittyvät tehtävät kirjasta s. 22 alkaen t. 4a, 6, 7a
- Tee sanajärjestyksen tehtävät kirjasta s. 136 alkean t. 2a ja 3
- Tee **pakollinen FLIPGRID-tehtävä, vlogg**, ohjeet sovelluksessa. Jos et ole käyttänyt ennen --> sign up, käytä työvihkon kannen koodia --> luo tunnukset eduouka-postilla (muut ei käy).
Videossa tulee näkyä kasvot, minipituus 1 min. maksimi 3 min. Lue ohjeet huolella!
PLUSSAT:
- kirjasta s. 24 alkaen t. 7b, 7c, 8
- kirjasta s. 138 alkaen t.5 ja 6a
POISSAOLIJAT:
- Kuuntele, lue ja suomenna teksti 1.
- tee työvihkosta s. 20-21 (konjunktiot ja sanjärjestys)
| riikkak/riikkak.github.io | _posts/2021-10-18-l-ksyt-torstain-tunnille-tiistain-itsen-iset.md | Markdown | mit | 875 |
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160815163139) do
create_table "acclaims", force: :cascade do |t|
t.string "score", limit: 255
t.string "publication", limit: 255
t.text "description", limit: 65535
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.integer "position", limit: 4
t.integer "release_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
t.date "publication_date"
end
create_table "aromas", force: :cascade do |t|
t.string "name", limit: 255
t.text "description", limit: 65535
t.integer "position", limit: 4
t.boolean "live"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "release_id", limit: 4
t.string "slug", limit: 255
end
add_index "aromas", ["release_id"], name: "index_aromas_on_release_id", using: :btree
create_table "cats", force: :cascade do |t|
t.string "name", limit: 255
t.boolean "friendly"
t.text "description", limit: 65535
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "aroma_id", limit: 4
end
create_table "coaches", force: :cascade do |t|
t.string "first_name", limit: 255
t.string "last_name", limit: 255
t.string "role", limit: 255
t.text "bio", limit: 65535
t.integer "team_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "coaches", ["team_id"], name: "index_coaches_on_team_id", using: :btree
create_table "event_releases", force: :cascade do |t|
t.integer "release_id", limit: 4
t.integer "event_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "event_releases", ["event_id"], name: "index_event_releases_on_event_id", using: :btree
add_index "event_releases", ["release_id"], name: "index_event_releases_on_release_id", using: :btree
create_table "events", force: :cascade do |t|
t.string "name", limit: 255
t.date "start_date"
t.date "end_date"
t.string "event_type", limit: 255
t.string "city", limit: 255
t.integer "person_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
t.integer "position", limit: 4
end
create_table "fae_changes", force: :cascade do |t|
t.integer "changeable_id", limit: 4
t.string "changeable_type", limit: 255
t.integer "user_id", limit: 4
t.string "change_type", limit: 255
t.text "updated_attributes", limit: 65535
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_index "fae_changes", ["changeable_id"], name: "index_fae_changes_on_changeable_id", using: :btree
add_index "fae_changes", ["changeable_type"], name: "index_fae_changes_on_changeable_type", using: :btree
add_index "fae_changes", ["user_id"], name: "index_fae_changes_on_user_id", using: :btree
create_table "fae_files", force: :cascade do |t|
t.string "name", limit: 255
t.string "asset", limit: 255
t.integer "fileable_id", limit: 4
t.string "fileable_type", limit: 255
t.integer "file_size", limit: 4
t.integer "position", limit: 4, default: 0
t.string "attached_as", limit: 255
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "required", default: false
end
add_index "fae_files", ["attached_as"], name: "index_fae_files_on_attached_as", using: :btree
add_index "fae_files", ["fileable_type", "fileable_id"], name: "index_fae_files_on_fileable_type_and_fileable_id", using: :btree
create_table "fae_images", force: :cascade do |t|
t.string "name", limit: 255
t.string "asset", limit: 255
t.integer "imageable_id", limit: 4
t.string "imageable_type", limit: 255
t.string "alt", limit: 255
t.string "caption", limit: 255
t.integer "position", limit: 4, default: 0
t.string "attached_as", limit: 255
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "file_size", limit: 4
t.boolean "required", default: false
end
add_index "fae_images", ["attached_as"], name: "index_fae_images_on_attached_as", using: :btree
add_index "fae_images", ["imageable_type", "imageable_id"], name: "index_fae_images_on_imageable_type_and_imageable_id", using: :btree
create_table "fae_options", force: :cascade do |t|
t.string "title", limit: 255
t.string "time_zone", limit: 255
t.string "colorway", limit: 255
t.string "stage_url", limit: 255
t.string "live_url", limit: 255
t.integer "singleton_guard", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "fae_options", ["singleton_guard"], name: "index_fae_options_on_singleton_guard", unique: true, using: :btree
create_table "fae_roles", force: :cascade do |t|
t.string "name", limit: 255
t.integer "position", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "fae_static_pages", force: :cascade do |t|
t.string "title", limit: 255
t.integer "position", limit: 4, default: 0
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug", limit: 255
end
add_index "fae_static_pages", ["slug"], name: "index_fae_static_pages_on_slug", using: :btree
create_table "fae_text_areas", force: :cascade do |t|
t.string "label", limit: 255
t.text "content", limit: 65535
t.integer "position", limit: 4, default: 0
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "contentable_id", limit: 4
t.string "contentable_type", limit: 255
t.string "attached_as", limit: 255
end
add_index "fae_text_areas", ["attached_as"], name: "index_fae_text_areas_on_attached_as", using: :btree
add_index "fae_text_areas", ["contentable_id"], name: "index_fae_text_areas_on_contentable_id", using: :btree
add_index "fae_text_areas", ["contentable_type"], name: "index_fae_text_areas_on_contentable_type", using: :btree
add_index "fae_text_areas", ["on_prod"], name: "index_fae_text_areas_on_on_prod", using: :btree
add_index "fae_text_areas", ["on_stage"], name: "index_fae_text_areas_on_on_stage", using: :btree
add_index "fae_text_areas", ["position"], name: "index_fae_text_areas_on_position", using: :btree
create_table "fae_text_fields", force: :cascade do |t|
t.integer "contentable_id", limit: 4
t.string "contentable_type", limit: 255
t.string "attached_as", limit: 255
t.string "label", limit: 255
t.string "content", limit: 255
t.integer "position", limit: 4, default: 0
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "fae_text_fields", ["attached_as"], name: "index_fae_text_fields_on_attached_as", using: :btree
add_index "fae_text_fields", ["contentable_type", "contentable_id"], name: "index_fae_text_fields_on_contentable_type_and_contentable_id", using: :btree
add_index "fae_text_fields", ["on_prod"], name: "index_fae_text_fields_on_on_prod", using: :btree
add_index "fae_text_fields", ["on_stage"], name: "index_fae_text_fields_on_on_stage", using: :btree
add_index "fae_text_fields", ["position"], name: "index_fae_text_fields_on_position", using: :btree
create_table "fae_users", force: :cascade do |t|
t.string "email", limit: 255, default: "", null: false
t.string "encrypted_password", limit: 255, default: "", null: false
t.string "reset_password_token", limit: 255
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", limit: 4, default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip", limit: 255
t.string "last_sign_in_ip", limit: 255
t.string "confirmation_token", limit: 255
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email", limit: 255
t.integer "failed_attempts", limit: 4, default: 0, null: false
t.string "unlock_token", limit: 255
t.datetime "locked_at"
t.string "first_name", limit: 255
t.string "last_name", limit: 255
t.integer "role_id", limit: 4
t.boolean "active"
t.datetime "created_at"
t.datetime "updated_at"
t.string "language", limit: 255
end
add_index "fae_users", ["confirmation_token"], name: "index_fae_users_on_confirmation_token", unique: true, using: :btree
add_index "fae_users", ["email"], name: "index_fae_users_on_email", unique: true, using: :btree
add_index "fae_users", ["reset_password_token"], name: "index_fae_users_on_reset_password_token", unique: true, using: :btree
add_index "fae_users", ["role_id"], name: "index_fae_users_on_role_id", using: :btree
add_index "fae_users", ["unlock_token"], name: "index_fae_users_on_unlock_token", unique: true, using: :btree
create_table "jerseys", force: :cascade do |t|
t.string "name", limit: 255
t.string "color", limit: 255
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "locations", force: :cascade do |t|
t.string "name", limit: 255
t.integer "contact_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "locations", ["contact_id"], name: "index_locations_on_contact_id", using: :btree
create_table "milestones", force: :cascade do |t|
t.integer "year", limit: 4
t.string "description", limit: 255
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "people", force: :cascade do |t|
t.string "name", limit: 255
t.datetime "created_at"
t.datetime "updated_at"
t.integer "event_id", limit: 4
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.integer "position", limit: 4
end
create_table "players", force: :cascade do |t|
t.string "first_name", limit: 255
t.string "last_name", limit: 255
t.string "number", limit: 255
t.text "bio", limit: 65535
t.integer "team_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "players", ["team_id"], name: "index_players_on_team_id", using: :btree
create_table "release_notes", force: :cascade do |t|
t.string "title", limit: 255
t.text "body", limit: 65535
t.integer "position", limit: 4
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "release_id", limit: 4
end
add_index "release_notes", ["release_id"], name: "index_release_notes_on_release_id", using: :btree
create_table "release_selling_points", force: :cascade do |t|
t.integer "release_id", limit: 4
t.integer "selling_point_id", limit: 4
t.integer "position", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "releases", force: :cascade do |t|
t.string "name", limit: 255
t.string "slug", limit: 255
t.text "intro", limit: 65535
t.text "body", limit: 65535
t.string "vintage", limit: 255
t.string "price", limit: 255
t.string "tasting_notes_pdf", limit: 255
t.integer "wine_id", limit: 4
t.integer "varietal_id", limit: 4
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.integer "position", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
t.string "video_url", limit: 255
t.boolean "featured"
t.string "weight", limit: 255
t.date "release_date"
t.date "show"
t.date "hide"
t.text "description", limit: 65535
end
create_table "selling_points", force: :cascade do |t|
t.string "name", limit: 255
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.integer "position", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "teams", force: :cascade do |t|
t.string "name", limit: 255
t.string "city", limit: 255
t.text "history", limit: 65535
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "validation_testers", force: :cascade do |t|
t.string "name", limit: 255
t.string "slug", limit: 255
t.string "second_slug", limit: 255
t.string "email", limit: 255
t.string "url", limit: 255
t.string "phone", limit: 255
t.string "zip", limit: 255
t.string "canadian_zip", limit: 255
t.string "youtube_url", limit: 255
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "second_email", limit: 255
t.string "unique_email", limit: 255
t.string "second_url", limit: 255
t.string "second_phone", limit: 255
t.string "second_zip", limit: 255
t.string "second_youtube_url", limit: 255
end
create_table "varietals", force: :cascade do |t|
t.string "name", limit: 255
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.integer "position", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "winemakers", force: :cascade do |t|
t.string "name", limit: 255
t.integer "position", limit: 4
t.integer "wine_id", limit: 4
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "region_type", limit: 4
end
add_index "winemakers", ["wine_id"], name: "index_winemakers_on_wine_id", using: :btree
create_table "wines", force: :cascade do |t|
t.string "name_en", limit: 255
t.boolean "on_stage", default: true
t.boolean "on_prod", default: false
t.integer "position", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
t.string "name_zh", limit: 255
t.string "name_ja", limit: 255
t.text "description_en", limit: 65535
t.text "description_zh", limit: 65535
t.text "description_ja", limit: 65535
t.text "food_pairing_en", limit: 65535
t.text "food_pairing_zh", limit: 65535
t.text "food_pairing_ja", limit: 65535
end
end
| emersonthis/fae | spec/dummy/db/schema.rb | Ruby | mit | 16,896 |
package com.jajuka.telnet;
/**
* Created by austinh on 12/25/13.
*/
public enum InitializationState {
TerminalType
}
| berdon/telnet-java | src/main/java/com/jajuka/telnet/InitializationState.java | Java | mit | 124 |
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>angular-oauth2-oidc</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="./images/favicon.ico">
<link rel="stylesheet" href="./styles/style.css">
<link rel="stylesheet" href="./styles/dark.css" media="(prefers-color-scheme: dark)">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="./" class="navbar-brand">angular-oauth2-oidc</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<compodoc-menu mode="normal"></compodoc-menu>
</div>
<!-- START CONTENT -->
<div class="content getting-started">
<div class="content-data">
<p>Copyright (c) 2017 Manfred Steyer</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>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.</p>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> result-matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
<!-- END CONTENT -->
</div>
</div>
<script>
var COMPODOC_CURRENT_PAGE_DEPTH = 0;
var COMPODOC_CURRENT_PAGE_CONTEXT = 'getting-started';
var COMPODOC_CURRENT_PAGE_URL = 'license.html';
var MAX_SEARCH_RESULTS = 15;
</script>
<script src="./js/libs/custom-elements.min.js"></script>
<script src="./js/libs/lit-html.js"></script>
<script type="module" src="./js/menu-wc.js" defer></script>
<script nomodule src="./js/menu-wc_es5.js" defer></script>
<script src="./js/libs/bootstrap-native.js"></script>
<script src="./js/libs/es6-shim.min.js"></script>
<script src="./js/libs/EventDispatcher.js"></script>
<script src="./js/libs/promise.min.js"></script>
<script src="./js/libs/zepto.min.js"></script>
<script src="./js/compodoc.js"></script>
<script src="./js/tabs.js"></script>
<script src="./js/menu.js"></script>
<script src="./js/libs/clipboard.min.js"></script>
<script src="./js/libs/prism.js"></script>
<script src="./js/sourceCode.js"></script>
<script src="./js/search/search.js"></script>
<script src="./js/search/lunr.min.js"></script>
<script src="./js/search/search-lunr.js"></script>
<script src="./js/search/search_index.js"></script>
<script src="./js/lazy-load-graphs.js"></script>
</body>
</html>
| manfredsteyer/angular-oauth2-oidc | docs/license.html | HTML | mit | 4,453 |
import jgh.javagraph.Edge;
import jgh.javagraph.Graph;
import jgh.javagraph.algorithms.Cycles;
import jgh.javagraph.generation.CompleteGeneration;
import jgh.javagraph.generation.NodeGeneration;
import junit.framework.Assert;
import org.junit.Test;
import java.util.ArrayList;
public class CyclesTest {
// @Test
public void CycleTest1(){
ArrayList<NodeGeneration.BasicNode> nodes =
new ArrayList<NodeGeneration.BasicNode> (NodeGeneration.generateNodes(6));
Edge e1 = new Edge(nodes.get(4), nodes.get(1));
Edge e2 = new Edge(nodes.get(4), nodes.get(0));
Edge e3 = new Edge(nodes.get(0), nodes.get(1));
Edge e4 = new Edge(nodes.get(1), nodes.get(2));
Edge e5 = new Edge(nodes.get(2), nodes.get(3));
Edge e6 = new Edge(nodes.get(3), nodes.get(4));
Edge e7 = new Edge(nodes.get(3), nodes.get(5));
ArrayList<Edge<NodeGeneration.BasicNode>> edges = new ArrayList<>();
edges.add(e1);
edges.add(e2);edges.add(e3);edges.add(e4);edges.add(e5);edges.add(e6);edges.add(e7);
Graph<NodeGeneration.BasicNode,Edge<NodeGeneration.BasicNode>> g = new Graph<NodeGeneration.BasicNode,Edge<NodeGeneration.BasicNode>>(edges);
// cycles:
// 4 1 0
// 4 1 2 3
// 4 0 1 2 3
int i = Cycles.findAllCyclesInGraph(g).size();
Assert.assertEquals(3, i);
}
// @Test
public void CycleTest2(){
Graph<NodeGeneration.BasicNode,Edge<NodeGeneration.BasicNode>> g = CompleteGeneration.create(NodeGeneration.generateNodes(4));
// Graph k4 has 7 cycles
int i = Cycles.findAllCyclesInGraph(g).size();
Assert.assertEquals(7, i);
}
}
| jonghough/JavaGraph | src/test/java/CyclesTest.java | Java | mit | 1,713 |
/*global xit,it,describe,before,after,beforeEach,afterEach*/
"use strict";
require("requirish")._(module);
var assert = require("better-assert");
var async = require("async");
var should = require("should");
var sinon = require("sinon");
var _ = require("underscore");
var opcua = require("index");
var OPCUAClient = opcua.OPCUAClient;
var AttributeIds = opcua.AttributeIds;
var resolveNodeId = opcua.resolveNodeId;
var StatusCodes = opcua.StatusCodes;
var DataType = opcua.DataType;
var TimestampsToReturn = opcua.read_service.TimestampsToReturn;
var NodeId = opcua.NodeId;
var perform_operation_on_client_session = require("test/helpers/perform_operation_on_client_session").perform_operation_on_client_session;
var perform_operation_on_subscription = require("test/helpers/perform_operation_on_client_session").perform_operation_on_subscription;
var constructEventFilter = require("lib/tools/tools_event_filter").constructEventFilter;
var callConditionRefresh = require("lib/client/alarms_and_conditions/client_tools").callConditionRefresh;
function debugLog() {
}
var construct_demo_alarm_in_address_space = require("test/helpers/alarms_and_conditions_demo").construct_demo_alarm_in_address_space;
function wait_a_little_bit_to_let_events_to_be_processed(callback) {
// setImmediate(callback);
setTimeout(callback, 200);
}
module.exports = function (test) {
describe("A&C monitoring conditions", function () {
var client;
beforeEach(function (done) {
// add a condition to the server
// Server - HasNotifier -> Tank -> HasEventSource -> TankLevel -> HasCondition -> TankLevelCondition
var addressSpace = test.server.engine.addressSpace;
construct_demo_alarm_in_address_space(test, addressSpace);
client = new OPCUAClient({});
done();
});
afterEach(function (done) {
client = null;
done();
});
function dump_field_values(fields, values) {
_.zip(fields, values).forEach(function (a) {
var e = a[0];
var v = a[1] || "null";
var str = "";
if (v.dataType == DataType.NodeId) {
var node = test.server.engine.addressSpace.findNode(v.value);
str = node ? node.browseName.toString() : " Unknown Node";
}
console.log((e + " ").substr(0, 25).cyan, v.toString() + " " + str.white.bold);
});
console.log("--------------------");
}
function extract_value_for_field(fieldName, result) {
should.exist(result);
var index = fields.indexOf(fieldName);
should(index >= 0, " cannot find fieldName in list : fiedName =" + fieldName + " list: " + fields.join(" "));
return result[index];
}
var fields = [
"EventId",
"ConditionName",
"ConditionClassName",
"ConditionClassId",
"SourceName",
"SourceNode",
"BranchId",
"EventType",
"SourceName",
"ReceiveTime",
"Severity",
"Message",
"Retain",
"Comment",
"Comment.SourceTimestamp",
"EnabledState",
"EnabledState.Id",
"EnabledState.EffectiveDisplayName",
"EnabledState.TransitionTime",
"LastSeverity",
"LastSeverity.SourceTimestamp",
"Quality",
"Quality.SourceTimestamp",
"Time",
"ClientUserId",
"AckedState",
"AckedState.Id",
"ConfirmedState",
"ConfirmedState.Id",
"LimitState",
"LimitState.Id",
"ActiveState",
"ActiveState.Id"
];
var eventFilter = constructEventFilter(fields);
function given_and_install_event_monitored_item(subscription, callback) {
var test = this;
// A spy to detect event when they are raised by the sever
test.spy_monitored_item1_changes = sinon.spy();
// let create a monitored item to monitor events emitted by the Tank and
// transmitted by the Server Object.
var readValue = {
nodeId: resolveNodeId("Server"),
attributeId: AttributeIds.EventNotifier // << EventNotifier
};
var requestedParameters = {
samplingInterval: 10,
discardOldest: true,
queueSize: 10,
filter: eventFilter
};
test.monitoredItem1 = subscription.monitor(readValue, requestedParameters, TimestampsToReturn.Both, function (err) {
// let's install the spy on the 'changed' event
test.monitoredItem1.on("changed", test.spy_monitored_item1_changes);
setTimeout(callback, 100);
});
}
it("GGG2 - Limit Alarm should trigger Event when ever the input node goes out of limit", function (done) {
perform_operation_on_subscription(client, test.endpointUrl, function (session, subscription, callback) {
async.series([
given_and_install_event_monitored_item.bind(test, subscription),
function when_tank_level_is_overfilled(callback) {
assert(test.tankLevelCondition.raiseNewCondition);
test.tankLevelCondition.raiseNewCondition = sinon.spy(test.tankLevelCondition, "raiseNewCondition");
test.tankLevelCondition.raiseNewCondition.calledOnce.should.eql(false);
// let's simulate the tankLevel going to 99%
// the alarm should be raised
test.tankLevel.setValueFromSource({
dataType: "Double",
value: 0.99
});
test.tankLevelCondition.raiseNewCondition.calledOnce.should.eql(true);
test.tankLevelCondition.limitState.getCurrentState().should.eql("HighHigh");
callback();
},
function then_we_should_check_that_alarm_is_raised(callback) {
debugLog(" then_we_should_check_that_alarm_is_raised ...");
test.monitoredItem1.once("changed", function () {
test.spy_monitored_item1_changes.callCount.should.eql(1);
callback();
});
debugLog(" ... when the value goes off limit");
test.tankLevel.setValueFromSource({
dataType: "Double",
value: 0.991
});
},
function clear_condition_retain_flag(callback) {
// ----------------------------
// Clear existing conditions
// -------------------------------
test.tankLevelCondition.currentBranch().setRetain(false);
callback();
}
], callback);
}, done);
});
it("GGG1 - ConditionRefresh", function (done) {
perform_operation_on_subscription(client, test.endpointUrl, function (session, subscription, callback) {
async.series([
given_and_install_event_monitored_item.bind(test, subscription),
function when_client_calling_ConditionRefresh(callback) {
test.spy_monitored_item1_changes.reset();
// lets add a a event handler to detect when the Event has been
// raised we we will call ConditionRefresh
test.monitoredItem1.once("changed", function () {
callback();
}); // now client send a condition refresh
// let's call condition refresh
callConditionRefresh(subscription, function (err) {
// debugLog(" condition refresh has been called");
});
},
function (callback) {
setTimeout(callback, 100);
},
function then_we_should_check_that_event_is_raised_after_client_calling_ConditionRefresh(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(3);
var values = test.spy_monitored_item1_changes.getCall(0).args[0];
values[7].value.toString().should.eql("ns=0;i=2787"); // RefreshStartEventType
// dump_field_values(fields,values);
values = test.spy_monitored_item1_changes.getCall(1).args[0];
values[7].value.toString().should.eql("ns=0;i=9341"); //ExclusiveLimitAlarmType
//xx dump_field_values(fields,values);
values = test.spy_monitored_item1_changes.getCall(2).args[0];
values[7].value.toString().should.eql("ns=0;i=2788"); // RefreshEndEventType
// dump_field_values(fields,values);
test.spy_monitored_item1_changes.reset();
callback();
},
function then_when_server_raises_a_new_condition_event(callback) {
test.monitoredItem1.once("changed", function () {
callback();
});
// ---------------------------
// create a retain condition
var tankLevelCondition = test.tankLevelCondition;
tankLevelCondition.currentBranch().setRetain(true);
tankLevelCondition.raiseNewCondition({
message: "Tank almost 80% full",
severity: 200,
quality: StatusCodes.Good
});
},
function (callback) {
setTimeout(callback, 100);
},
function (callback) {
test.spy_monitored_item1_changes.callCount.should.eql(1);
var values = test.spy_monitored_item1_changes.getCall(0).args[0];
values[7].value.toString().should.eql("ns=0;i=9341");//ExclusiveLimitAlarmType
//xx dump_field_values(fields,values);
test.spy_monitored_item1_changes.reset();
callback();
},
function when_client_calling_ConditionRefresh_again(callback) {
test.monitoredItem1.once("changed", function () {
callback();
});
// now client send a condition refresh
callConditionRefresh(subscription, function (err) {
// callback(err);
});
},
function (callback) {
setTimeout(callback, 100);
},
function then_we_should_check_that_event_is_raised_after_client_calling_ConditionRefresh_again(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(3);
var values = test.spy_monitored_item1_changes.getCall(0).args[0];
values[7].value.toString().should.eql("ns=0;i=2787"); // RefreshStartEventType
//xx dump_field_values(fields,values);
values = test.spy_monitored_item1_changes.getCall(1).args[0];
values[7].value.toString().should.eql("ns=0;i=9341");//ExclusiveLimitAlarmType
//xx dump_field_values(fields,values);
values = test.spy_monitored_item1_changes.getCall(2).args[0];
values[7].value.toString().should.eql("ns=0;i=2788"); // RefreshEndEventType
//dump_field_values(fields,values);
test.spy_monitored_item1_changes.reset();
callback();
},
function (callback) {
callback();
}
], callback)
}, done);
});
describe("test on Disabled conditions", function () {
/*
For any Condition that exists in the AddressSpace the Attributes and the following
Variables will continue to have valid values even in the Disabled state; EventId, Event
Type, Source Node, Source Name, Time, and EnabledState. Other properties may no
longer provide current valid values. All Variables that are no longer provided shall
return a status of Bad_ConditionDisabled. The Event that reports the Disabled state
should report the properties as NULL or with a status of Bad_ConditionDisabled.
*/
it("KKL should raise an event when a Condition get disabled", function (done) {
perform_operation_on_subscription(client, test.endpointUrl, function (session, subscription, callback) {
async.series([
function given_a_enabled_condition(callback) {
test.tankLevelCondition.enabledState.setValue(true);
test.tankLevelCondition.enabledState.getValue().should.eql(true);
callback();
},
given_and_install_event_monitored_item.bind(test, subscription),
function when_the_condition_is_disabled_by_the_client(callback) {
//xx test.tankLevelCondition.enabledState.setValue(false);
//xx test.tankLevelCondition.enabledState.getValue().should.eql(false);
var methodToCalls = [];
methodToCalls.push({
objectId: test.tankLevelCondition.nodeId,
methodId: opcua.coerceNodeId("ns=0;i=9028"), // ConditionType#Disable Method nodeID
inputArguments: []
});
session.call(methodToCalls, function (err, results) {
callback(err);
});
},
function then_we_should_verify_that_the_client_has_received_a_notification(callback) {
setTimeout(function () {
test.spy_monitored_item1_changes.callCount.should.eql(1);
callback();
}, 500);
},
function and_we_should_verify_that_the_propertie_are_null_or_with_status_Bad_ConditionDisabled() {
// The Event that reports the Disabled state
// should report the properties as NULL or with a status of Bad_ConditionDisabled.
var results = test.spy_monitored_item1_changes.getCall(0).args[0];
//xx dump_field_values(fields, results);
var conditionDisabledVar = new opcua.Variant({
dataType: opcua.DataType.StatusCode,
value: StatusCodes.BadConditionDisabled
});
// shall be valid EventId, EventType, SourceNode, SourceName, Time, and EnabledState
// other shall be invalid
var value_severity = extract_value_for_field("Severity", results);
debugLog("value_severity ", extract_value_for_field("Severity", results).toString());
value_severity.should.eql(conditionDisabledVar);
callback();
}
// to do : same test when disable/enable is set by the server
], callback);
}, done);
});
xit("EventId, EventType, Source Node, Source Name, Time, and EnabledState shall return valid values when condition is disabled ", function (done) {
// "EventId",
// "ConditionName",
// "ConditionClassName",
// "ConditionClassId",
// "SourceName",
// "SourceNode",
// "BranchId",
// "EventType",
// "SourceName",
// "ReceiveTime",
// "Severity",
// "Message",
// "Retain",
// "Comment",
// "Comment.SourceTimestamp",
// "EnabledState",
// "EnabledState.Id",
// "EnabledState.EffectiveDisplayName",
// "EnabledState.TransitionTime",
// "LastSeverity",
// "LastSeverity.SourceTimestamp",
// "Quality",
// "Quality.SourceTimestamp",
// "Time",
// "ClientUserId"
done();
});
xit("reading no longer provided variables of a disabled Condition shall return Bad_ConditionDisabled", function (done) {
done();
});
});
it("GGGH should raise an event when commenting a Condition ", function (done) {
var levelNode = test.tankLevel;
var alarmNode = test.tankLevelCondition;
perform_operation_on_subscription(client, test.endpointUrl, function (session, subscription, callback) {
async.series([
function given_a_enabled_condition(callback) {
alarmNode.enabledState.setValue(true);
alarmNode.enabledState.getValue().should.eql(true);
callback();
},
given_and_install_event_monitored_item.bind(test, subscription),
function when_we_set_a_comment(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(0,"no event should have been raised");
var eventId= alarmNode.eventId.readValue().value.value;
var alarmNodeId = alarmNode.nodeId;
session.addCommentCondition(alarmNodeId,eventId,"SomeComment!!!",function(err) {
callback(err);
});
},
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_an_event_has_been_raised(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(2,"an event should have been raised");
var dataValues = test.spy_monitored_item1_changes.getCall(1).args[0];
//xx dump_field_values(fields,dataValues);
var eventId_Step0 = extract_value_for_field("EventId", dataValues).value;
should(eventId_Step0).be.instanceOf(Buffer);
extract_value_for_field("BranchId", dataValues).value.should.eql(opcua.NodeId.NullNodeId);
extract_value_for_field("ConditionName", dataValues).value.should.eql("Test");
extract_value_for_field("SourceName", dataValues).value.should.eql(levelNode.browseName.toString());
extract_value_for_field("Comment", dataValues).value.text.toString().should.eql("SomeComment!!!");
alarmNode.getBranchCount().should.eql(0, " Expecting no extra branch apart from current branch");
callback();
}
],callback);
},done);
});
xit("should raise an event when acknowledging an AcknowledgeableCondition ", function (done) {
done();
});
xit("a condition should expose ReadOnly condition values", function (done) {
done();
});
function perform_test_with_condition(eventTypeNodeId,levelNode,alarmNode, done) {
// this test implements the example of the Spec 1.03 part 9 page, cited below:
// B.1.3 Server maintains previous states
// This example is for Servers that are able to maintain previous states of a Condition and
// therefore create and maintain Branches of a single Condition.
// The figure below illustrates the use of branches by a Server requiring acknowledgement of all
// transitions into Active state, not just the most recent transition.
// In this example no acknowledgement is required on a transition into an inactive state.
// All Events are coming from the same Condition instance and have therefore the same ConditionId.
//
// ___________________________________________________________________________________________
// branch-2 o-----------------------o Confirmed=true
//
// +o Acked
// o----------------------+
// o-----------------------o Active (true)
// ___________________________________________________________________________________________
// branch-1 o------------+ . +o Confirmed
// +-------------+
// +--------------o Acked
// o------------+ .
// o---------------------------o Active (true)
// ___________________________________________________._______________________________________
// . . .
// -------------------+ +---------------------------------------------------- confirmed
// +-----+ . . .
// ----------+ +---------+ +----------+ . +------------------------- Acked
// +--------+ . +---+ +------+ .
// +-----------+ . +---+ +------+ .
// ----------+ . +------+ +----------+ . +-------------------------- Active
// . . . . . . . .
// (1) (2)(3)(4) (5) (6) (8)(9) (10) (12) (13)
// (7) (11) (14)
//
// EventId BranchId Active Acked Confirmed Retain Description
// a/ null False True True False Initial state of Condition.
// 1 null True False True True Alarm goes active.
// 2 null True True True True Condition acknowledged requires Confirm
// 3 null False True False True Alarm goes inactive.
// 4 null False True True False Confirmed
// 5 null True False True True Alarm goes active.
// 6 null False True True True Alarm goes inactive.
// 7 1 True False True True b) Prior state needs acknowledgment. Branch #1 created.
// 8 null True False True True Alarm goes active again.
// 9 1 True True False True Prior state acknowledged, Confirm required.
// 10 null False True True True b) Alarm goes inactive again.
// 11 2 True False True True Prior state needs acknowledgment. Branch #2 created.
// 12 1 True True True False Prior state confirmed. Branch #1 deleted.
// 13 2 True True True False Prior state acknowledged, Auto Confirmed by system Branch #2 deleted.
// 14 Null False True True False No longer of interest.
//
// a/The first row is included to illustrate the initial state of the Condition.
// This state will not be reported by an Event.
//
// If the current state of the Condition is acknowledged then the Acked flag is set and the new state is reported (Event
// #2). If the Condition state changes before it can be acknowledged (Event #6) then a branch state is reported (Event
// #7). Timestamps for the Events #6 and #7 is identical.
// The branch state can be updated several times (Events #9) before it is cleared (Event #12).
// A single Condition can have many branch states active (Events #11)
// b/ It is recommended as in this table to leave Retain=True as long as there exist previous states (branches)
var eventId_Step0 = null;
var eventId_Step2 = null; // after acknowledge
var branch1_NodeId = null;
var branch1_EventId = null;
var branch2_NodeId = null;
var branch2_EventId = null;
var dataValues;
perform_operation_on_subscription(client, test.endpointUrl, function (session, subscription, callback) {
function initial_state_of_condition(callback) {
levelNode.setValueFromSource({dataType: "Double", value: 0.5});
alarmNode.currentBranch().setConfirmedState(true);
alarmNode.currentBranch().setAckedState(true);
alarmNode.activeState.getValue().should.eql(false);
alarmNode.confirmedState.getValue().should.eql(true, "confirmedState supposed to be set");
alarmNode.ackedState.getValue().should.eql(true, "ackedState supposed to be set");
callback();
}
function alarm_goes_active(callback) {
// sanity check - verify that previous state was inactive
levelNode.readValue().value.value.should.eql(0.5);
alarmNode.activeState.getValue().should.eql(false);
// set the value so it exceed one of the limit => alarm will be raised
levelNode.setValueFromSource({dataType: "Double", value: 0.99});
alarmNode.activeState.getValue().should.eql(true);
callback();
}
function alarm_goes_inactive(callback) {
// sanity check - verify that previous state was active
levelNode.readValue().value.value.should.eql(0.99);
alarmNode.activeState.getValue().should.eql(true);
// set the value so it is in normal range => alarm no active
levelNode.setValueFromSource({dataType: "Double", value: 0.50});
alarmNode.activeState.getValue().should.eql(false,"expecting alarm to be inactive");
callback();
}
function condition_acknowledged_requires_confirm(callback) {
should(alarmNode.nodeId).be.instanceOf(opcua.NodeId);
var conditionId = alarmNode.nodeId;
var eventId = eventId_Step0;
session.acknowledgeCondition(conditionId, eventId, "Some comment", function (err, result) {
should.not.exist(err);
result.should.eql(StatusCodes.Good);
callback(err);
});
}
function condition_is_confirmed(callback) {
var conditionId = alarmNode.nodeId;
var eventId = eventId_Step0;
session.confirmCondition(conditionId, eventId, "Some comment", function (err, result) {
should.not.exist(err);
result.should.eql(StatusCodes.Good);
callback(err);
});
}
function verify_that_branch_one_is_created(callback) {
callback();
}
function branch_two_acknowledged_and_auto_confirmed_by_system_verify_branch_two_is_deleted(callback) {
var branch = alarmNode._findBranchForEventId(branch2_EventId);
alarmNode.acknowledgeAndAutoConfirmBranch(branch, "AutoConfirm");
callback();
}
async.series([
// a/ initial_state_of_condition
initial_state_of_condition,
given_and_install_event_monitored_item.bind(test, subscription),
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_no_event_has_been_raised_yet(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(0);
alarmNode.confirmedState.getValue().should.eql(true, "confirmedState supposed to be set");
callback();
},
// 1. Alarm goes active.
alarm_goes_active,
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_an_event_has_been_raised(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(1,"an event should have been raised");
dataValues = test.spy_monitored_item1_changes.getCall(0).args[0];
//xx dump_field_values(fields,dataValues);
eventId_Step0 = extract_value_for_field("EventId", dataValues).value;
should(eventId_Step0).be.instanceOf(Buffer);
extract_value_for_field("BranchId", dataValues).value.should.eql(opcua.NodeId.NullNodeId);
extract_value_for_field("ConditionName", dataValues).value.should.eql("Test");
extract_value_for_field("SourceName", dataValues).value.should.eql(levelNode.browseName.toString());
extract_value_for_field("ActiveState", dataValues).value.text.should.eql("Active");
extract_value_for_field("ActiveState.Id", dataValues).value.should.eql(true);
extract_value_for_field("AckedState", dataValues).value.text.should.eql("Unacknowledged");
extract_value_for_field("AckedState.Id", dataValues).value.should.eql(false);
extract_value_for_field("ConfirmedState", dataValues).value.text.should.eql("Confirmed");
extract_value_for_field("ConfirmedState.Id", dataValues).value.should.eql(true);
extract_value_for_field("Retain", dataValues).value.should.eql(true);
//
alarmNode.getBranchCount().should.eql(0, " Expecting no extra branch apart from current branch");
callback();
},
function(callback) {
test.spy_monitored_item1_changes.reset();
callback();
},
// 2. Condition acknowledged requires Confirm
condition_acknowledged_requires_confirm,
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_a_second_event_has_been_raised(callback) {
// showing that alarm has been Acknowledged
// and need to be confirmed
test.spy_monitored_item1_changes.callCount.should.eql(2);
dataValues = test.spy_monitored_item1_changes.getCall(1).args[0];
//xx dump_field_values(fields,dataValues);
// ns=0;i=8944 AuditConditionAcknowledgeEventType
extract_value_for_field("EventType", dataValues).value.toString().should.eql("ns=0;i=8944");
dataValues = test.spy_monitored_item1_changes.getCall(0).args[0];
//xx dump_field_values(fields,dataValues);
eventId_Step2 = extract_value_for_field("EventId", dataValues).value;
should(eventId_Step2).be.instanceOf(Buffer);
extract_value_for_field("EventType", dataValues).value.toString().should.eql(eventTypeNodeId);
eventId_Step2.toString("hex").should.not.eql(eventId_Step0.toString("hex"), "eventId must have changed");
extract_value_for_field("BranchId", dataValues).value.should.eql(opcua.NodeId.NullNodeId);
extract_value_for_field("ConditionName", dataValues).value.should.eql("Test");
extract_value_for_field("SourceName", dataValues).value.should.eql(levelNode.browseName.toString());
extract_value_for_field("ActiveState", dataValues).value.text.should.eql("Active");
extract_value_for_field("ActiveState.Id", dataValues).value.should.eql(true);
extract_value_for_field("AckedState", dataValues).value.text.should.eql("Acknowledged");
extract_value_for_field("AckedState.Id", dataValues).value.should.eql(true);
extract_value_for_field("ConfirmedState", dataValues).value.text.should.eql("Unconfirmed");
extract_value_for_field("ConfirmedState.Id", dataValues).value.should.eql(false);
extract_value_for_field("Retain", dataValues).value.should.eql(true);
alarmNode.getBranchCount().should.eql(0, " Expecting no extra branch apart from current branch");
test.spy_monitored_item1_changes.reset();
callback();
},
// 3. Alarm goes inactive.
alarm_goes_inactive,
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_a_third_event_has_been_raised(callback) {
// showing that alarm has been Acknowledged
// and need to be confirmed
test.spy_monitored_item1_changes.callCount.should.eql(1);
dataValues = test.spy_monitored_item1_changes.getCall(0).args[0];
// dump_field_values(fields,dataValues);
eventId_Step0 = extract_value_for_field("EventId", dataValues).value;
should(eventId_Step0).be.instanceOf(Buffer);
// ns=0;i=9341 => ExclusiveLimitAlarmType
extract_value_for_field("EventType", dataValues).value.toString().should.eql(eventTypeNodeId);
extract_value_for_field("BranchId", dataValues).value.should.eql(opcua.NodeId.NullNodeId);
extract_value_for_field("ConditionName", dataValues).value.should.eql("Test");
extract_value_for_field("SourceName", dataValues).value.should.eql(levelNode.browseName.toString());
extract_value_for_field("ActiveState", dataValues).value.text.should.eql("Inactive");
extract_value_for_field("ActiveState.Id", dataValues).value.should.eql(false);
extract_value_for_field("AckedState", dataValues).value.text.should.eql("Acknowledged");
extract_value_for_field("AckedState.Id", dataValues).value.should.eql(true);
extract_value_for_field("ConfirmedState", dataValues).value.text.should.eql("Unconfirmed");
extract_value_for_field("ConfirmedState.Id", dataValues).value.should.eql(false);
extract_value_for_field("Retain", dataValues).value.should.eql(true);
//
alarmNode.getBranchCount().should.eql(0, " Expecting no extra branch apart from current branch");
test.spy_monitored_item1_changes.reset();
callback();
},
// 4. Confirmed
condition_is_confirmed,
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_a_third_event_has_been_raised(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(3);
// i=2829 => AuditConditionCommentEventType
dataValues = test.spy_monitored_item1_changes.getCall(0).args[0];
extract_value_for_field("EventType", dataValues).value.toString().should.eql("ns=0;i=2829");
// i=8961 => AuditConditionConfirmEventType
dataValues = test.spy_monitored_item1_changes.getCall(1).args[0];
extract_value_for_field("EventType", dataValues).value.toString().should.eql("ns=0;i=8961");
// i=9341 => ExclusiveLimitAlarmType
dataValues = test.spy_monitored_item1_changes.getCall(2).args[0];
extract_value_for_field("EventType", dataValues).value.toString().should.eql(eventTypeNodeId);
//xx dump_field_values(fields,dataValues);
extract_value_for_field("BranchId", dataValues).value.should.eql(opcua.NodeId.NullNodeId);
extract_value_for_field("ConditionName", dataValues).value.should.eql("Test");
extract_value_for_field("SourceName", dataValues).value.should.eql(levelNode.browseName.toString());
extract_value_for_field("ActiveState", dataValues).value.text.should.eql("Inactive");
extract_value_for_field("ActiveState.Id", dataValues).value.should.eql(false);
extract_value_for_field("AckedState", dataValues).value.text.should.eql("Acknowledged");
extract_value_for_field("AckedState.Id", dataValues).value.should.eql(true);
extract_value_for_field("ConfirmedState", dataValues).value.text.should.eql("Confirmed");
extract_value_for_field("ConfirmedState.Id", dataValues).value.should.eql(true);
extract_value_for_field("Retain", dataValues).value.should.eql(false);
alarmNode.getBranchCount().should.eql(0, " Expecting no extra branch apart from current branch");
test.spy_monitored_item1_changes.reset();
callback();
},
// 5. Alarm goes active.
alarm_goes_active,
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_a_fourth_event_has_been_raised(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(1);
dataValues = test.spy_monitored_item1_changes.getCall(0).args[0];
// i=9341 => ExclusiveLimitAlarmType
extract_value_for_field("EventType", dataValues).value.toString().should.eql(eventTypeNodeId);
//xx dump_field_values(fields,dataValues);
extract_value_for_field("BranchId", dataValues).value.should.eql(opcua.NodeId.NullNodeId);
extract_value_for_field("ConditionName", dataValues).value.should.eql("Test");
extract_value_for_field("SourceName", dataValues).value.should.eql(levelNode.browseName.toString());
extract_value_for_field("ActiveState", dataValues).value.text.should.eql("Active");
extract_value_for_field("ActiveState.Id", dataValues).value.should.eql(true);
extract_value_for_field("AckedState", dataValues).value.text.should.eql("Unacknowledged");
extract_value_for_field("AckedState.Id", dataValues).value.should.eql(false);
extract_value_for_field("ConfirmedState", dataValues).value.text.should.eql("Confirmed");
extract_value_for_field("ConfirmedState.Id", dataValues).value.should.eql(true);
extract_value_for_field("Retain", dataValues).value.should.eql(true);
alarmNode.getBranchCount().should.eql(0, " Expecting no extra branch apart from current branch");
test.spy_monitored_item1_changes.reset();
callback();
},
// 6. Alarm goes inactive.
alarm_goes_inactive,
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_a_fifth_and_sixth_event_have_been_raised(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(2);
var dataValues7 = test.spy_monitored_item1_changes.getCall(0).args[0];
//xx dump_field_values(fields,dataValues7);
// event value for branch #1 -----------------------------------------------------
// i=9341 => ExclusiveLimitAlarmType
extract_value_for_field("EventType", dataValues7).value.toString().should.eql(eventTypeNodeId);
extract_value_for_field("BranchId", dataValues7).value.should.not.eql(opcua.NodeId.NullNodeId);
extract_value_for_field("ConditionName", dataValues7).value.should.eql("Test");
extract_value_for_field("SourceName", dataValues7).value.should.eql(levelNode.browseName.toString());
branch1_NodeId = extract_value_for_field("BranchId", dataValues7).value;
branch1_EventId = extract_value_for_field("EventId", dataValues7).value;
extract_value_for_field("ActiveState", dataValues7).value.text.should.eql("Active");
extract_value_for_field("ActiveState.Id", dataValues7).value.should.eql(true);
extract_value_for_field("AckedState", dataValues7).value.text.should.eql("Unacknowledged");
extract_value_for_field("AckedState.Id", dataValues7).value.should.eql(false);
extract_value_for_field("ConfirmedState", dataValues7).value.text.should.eql("Confirmed");
extract_value_for_field("ConfirmedState.Id", dataValues7).value.should.eql(true);
extract_value_for_field("Retain", dataValues7).value.should.eql(true);
var dataValues8 = test.spy_monitored_item1_changes.getCall(1).args[0];
//xx dump_field_values(fields, dataValues8);
// i=9341 => ExclusiveLimitAlarmType
extract_value_for_field("EventType", dataValues8).value.toString().should.eql(eventTypeNodeId);
//xx dump_field_values(fields,dataValues);
extract_value_for_field("BranchId", dataValues8).value.should.eql(opcua.NodeId.NullNodeId);
extract_value_for_field("ConditionName", dataValues8).value.should.eql("Test");
extract_value_for_field("SourceName", dataValues8).value.should.eql(levelNode.browseName.toString());
extract_value_for_field("ActiveState", dataValues8).value.text.should.eql("Inactive");
extract_value_for_field("ActiveState.Id", dataValues8).value.should.eql(false);
extract_value_for_field("AckedState", dataValues8).value.text.should.eql("Acknowledged");
extract_value_for_field("AckedState.Id", dataValues8).value.should.eql(true);
extract_value_for_field("ConfirmedState", dataValues8).value.text.should.eql("Confirmed");
extract_value_for_field("ConfirmedState.Id", dataValues8).value.should.eql(true);
extract_value_for_field("Retain", dataValues8).value.should.eql(true);
alarmNode.getBranchCount().should.eql(1, " Expecting one extra branch apart from current branch");
test.spy_monitored_item1_changes.reset();
callback();
},
// 7. b) Prior state needs acknowledgment. Branch #1 created.
// Timestamps for the Events #6 and #7 is identical.
verify_that_branch_one_is_created,
// 8. Alarm goes active again.
alarm_goes_active,
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_a_new_event_is_raised(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(1);
var dataValues9 = test.spy_monitored_item1_changes.getCall(0).args[0];
// dump_field_values(fields,dataValues);
// i=9341 => ExclusiveLimitAlarmType
extract_value_for_field("EventType", dataValues9).value.toString().should.eql(eventTypeNodeId);
//xx dump_field_values(fields,dataValues);
extract_value_for_field("BranchId", dataValues9).value.should.eql(opcua.NodeId.NullNodeId);
extract_value_for_field("ConditionName", dataValues9).value.should.eql("Test");
extract_value_for_field("SourceName", dataValues9).value.should.eql(levelNode.browseName.toString());
extract_value_for_field("ActiveState", dataValues9).value.text.should.eql("Active");
extract_value_for_field("ActiveState.Id", dataValues9).value.should.eql(true);
extract_value_for_field("AckedState", dataValues9).value.text.should.eql("Unacknowledged");
extract_value_for_field("AckedState.Id", dataValues9).value.should.eql(false);
extract_value_for_field("ConfirmedState", dataValues9).value.text.should.eql("Confirmed");
extract_value_for_field("ConfirmedState.Id", dataValues9).value.should.eql(true);
extract_value_for_field("Retain", dataValues9).value.should.eql(true);
alarmNode.getBranchCount().should.eql(1, " Expecting one extra branch apart from current branch");
test.spy_monitored_item1_changes.reset();
callback();
},
// 9. Prior state acknowledged, Confirm required.
function (callback) {
debugLog("9. Prior state acknowledged, Confirm required.");
var conditionId = alarmNode.nodeId;
var eventId = branch1_EventId;
debugLog("EventId = ", eventId);
session.acknowledgeCondition(conditionId, eventId, "Branch#1 Some comment", function (err, result) {
should.not.exist(err);
result.should.eql(StatusCodes.Good);
callback(err);
});
},
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_an_event_is_raised_for_branch_and_that_confirm_is_false(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(2);
var dataValuesA = test.spy_monitored_item1_changes.getCall(1).args[0];
// dump_field_values(fields, dataValuesA);
// ns=0;i=8944 AuditConditionAcknowledgeEventType
extract_value_for_field("EventType", dataValuesA).value.toString().should.eql("ns=0;i=8944");
// xx should(extract_value_for_field("BranchId", dataValuesA).value).eql(branch1_NodeId);
var dataValuesB = test.spy_monitored_item1_changes.getCall(0).args[0];
extract_value_for_field("EventType", dataValuesB).value.toString().should.eql(eventTypeNodeId);
extract_value_for_field("BranchId", dataValuesB).value.should.eql(branch1_NodeId);
// update last known event of branch1_EventId
branch1_EventId = extract_value_for_field("EventId", dataValuesB).value;
extract_value_for_field("ActiveState", dataValuesB).value.text.should.eql("Active");
extract_value_for_field("ActiveState.Id", dataValuesB).value.should.eql(true);
extract_value_for_field("ConditionName", dataValuesB).value.should.eql("Test");
extract_value_for_field("SourceName", dataValuesB).value.should.eql(levelNode.browseName.toString());
extract_value_for_field("AckedState", dataValuesB).value.text.should.eql("Acknowledged");
extract_value_for_field("AckedState.Id", dataValuesB).value.should.eql(true);
extract_value_for_field("ConfirmedState", dataValuesB).value.text.should.eql("Unconfirmed");
extract_value_for_field("ConfirmedState.Id", dataValuesB).value.should.eql(false);
extract_value_for_field("Retain", dataValuesB).value.should.eql(true);
alarmNode.getBranchCount().should.eql(1, " Expecting one extra branch apart from current branch");
test.spy_monitored_item1_changes.reset();
callback();
},
// 10. b) Alarm goes inactive again.
alarm_goes_inactive,
wait_a_little_bit_to_let_events_to_be_processed,
// 11. Prior state needs acknowledgment. Branch #2 created.
function we_should_verify_that_a_second_branch_is_created(callback) {
test.spy_monitored_item1_changes.callCount.should.eql(2);
// ----------------------------- Event on a second Branch !
var dataValuesA = test.spy_monitored_item1_changes.getCall(0).args[0];
// i=9341 => ExclusiveLimitAlarmType
extract_value_for_field("EventType", dataValuesA).value.toString().should.eql(eventTypeNodeId);
extract_value_for_field("BranchId", dataValuesA).value.should.not.eql(NodeId.NullNodeId);
extract_value_for_field("BranchId", dataValuesA).value.should.not.eql(branch1_NodeId);
branch2_NodeId = extract_value_for_field("BranchId", dataValuesA).value;
// update last known event of branch2_NodeId
branch2_EventId = extract_value_for_field("EventId", dataValuesA).value;
extract_value_for_field("ActiveState", dataValuesA).value.text.should.eql("Active");
extract_value_for_field("ActiveState.Id", dataValuesA).value.should.eql(true);
extract_value_for_field("ConditionName", dataValuesA).value.should.eql("Test");
extract_value_for_field("SourceName", dataValuesA).value.should.eql(levelNode.browseName.toString());
extract_value_for_field("AckedState", dataValuesA).value.text.should.eql("Unacknowledged");
extract_value_for_field("AckedState.Id", dataValuesA).value.should.eql(false);
extract_value_for_field("ConfirmedState", dataValuesA).value.text.should.eql("Confirmed");
extract_value_for_field("ConfirmedState.Id", dataValuesA).value.should.eql(true);
extract_value_for_field("Retain", dataValuesA).value.should.eql(true);
// ----------------------------- Event on main branch !
var dataValuesB = test.spy_monitored_item1_changes.getCall(1).args[0];
// i=9341 => ExclusiveLimitAlarmType
extract_value_for_field("EventType", dataValuesB).value.toString().should.eql(eventTypeNodeId);
extract_value_for_field("BranchId", dataValuesB).value.should.eql(NodeId.NullNodeId);
extract_value_for_field("ActiveState", dataValuesB).value.text.should.eql("Inactive");
extract_value_for_field("ActiveState.Id", dataValuesB).value.should.eql(false);
extract_value_for_field("AckedState", dataValuesB).value.text.should.eql("Acknowledged");
extract_value_for_field("AckedState.Id", dataValuesB).value.should.eql(true);
extract_value_for_field("ConfirmedState", dataValuesB).value.text.should.eql("Confirmed");
extract_value_for_field("ConfirmedState.Id", dataValuesB).value.should.eql(true);
extract_value_for_field("Retain", dataValuesB).value.should.eql(true);
alarmNode.getBranchCount().should.eql(2, " Expecting two extra branches apart from current branch");
test.spy_monitored_item1_changes.reset();
callback();
},
// 12. Prior state confirmed. Branch #1 deleted.
function branch_one_is_confirmed_verify_branch_one_is_deleted(callback) {
debugLog("Confirming branchId with eventId = ", branch1_EventId.toString("hex"));
session.confirmCondition(alarmNode.nodeId, branch1_EventId, "Some Message", function (err, result) {
should.not.exist(err);
should(result).eql(StatusCodes.Good);
callback(err);
});
},
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_that_branch_one_is_deleted(callback) {
alarmNode.getBranchCount().should.eql(1, " Expecting one extra branch apart from current branch");
test.spy_monitored_item1_changes.callCount.should.eql(3);
// i=2829 => AuditConditionCommentEventType
dataValues = test.spy_monitored_item1_changes.getCall(0).args[0];
extract_value_for_field("EventType", dataValues).value.toString().should.eql("ns=0;i=2829");
// ns=0;i=8961 AuditConditionConfirmEventType
var dataValuesA = test.spy_monitored_item1_changes.getCall(1).args[0];
extract_value_for_field("EventType", dataValuesA).value.toString().should.eql("ns=0;i=8961");
var dataValuesB = test.spy_monitored_item1_changes.getCall(2).args[0];
// i=9341 => ExclusiveLimitAlarmType
extract_value_for_field("EventType", dataValuesB).value.toString().should.eql(eventTypeNodeId);
extract_value_for_field("BranchId", dataValuesB).value.should.eql(branch1_NodeId);
extract_value_for_field("ActiveState", dataValuesB).value.text.should.eql("Active");
extract_value_for_field("ActiveState.Id", dataValuesB).value.should.eql(true);
extract_value_for_field("AckedState", dataValuesB).value.text.should.eql("Acknowledged");
extract_value_for_field("AckedState.Id", dataValuesB).value.should.eql(true);
extract_value_for_field("ConfirmedState", dataValuesB).value.text.should.eql("Confirmed");
extract_value_for_field("ConfirmedState.Id", dataValuesB).value.should.eql(true);
extract_value_for_field("Retain", dataValuesB).value.should.eql(false);
test.spy_monitored_item1_changes.reset();
callback();
},
// 13. Prior state acknowledged, Auto Confirmed by system Branch #2 deleted.
branch_two_acknowledged_and_auto_confirmed_by_system_verify_branch_two_is_deleted,
// 14. No longer of interest.
wait_a_little_bit_to_let_events_to_be_processed,
function we_should_verify_than_branch_one_is_no_longer_here(callback) {
alarmNode.getBranchCount().should.eql(0, " Expecting no extra branch apart from current branch");
test.spy_monitored_item1_changes.callCount.should.eql(5);
var dataValues0 = test.spy_monitored_item1_changes.getCall(0).args[0];
var dataValues1 = test.spy_monitored_item1_changes.getCall(1).args[0];
var dataValues2 = test.spy_monitored_item1_changes.getCall(2).args[0];
var dataValuesA = test.spy_monitored_item1_changes.getCall(3).args[0];
// ns=0;i=8961 AuditConditionConfirmEventType
extract_value_for_field("EventType", dataValuesA).value.toString().should.eql("ns=0;i=8961");
var dataValuesB = test.spy_monitored_item1_changes.getCall(4).args[0];
// i=9341 => ExclusiveLimitAlarmType
extract_value_for_field("EventType", dataValuesB).value.toString().should.eql(eventTypeNodeId);
extract_value_for_field("BranchId", dataValuesB).value.should.eql(branch2_NodeId);
extract_value_for_field("ActiveState", dataValuesB).value.text.should.eql("Active");
extract_value_for_field("ActiveState.Id", dataValuesB).value.should.eql(true);
extract_value_for_field("AckedState", dataValuesB).value.text.should.eql("Acknowledged");
extract_value_for_field("AckedState.Id", dataValuesB).value.should.eql(true);
extract_value_for_field("ConfirmedState", dataValuesB).value.text.should.eql("Confirmed");
extract_value_for_field("ConfirmedState.Id", dataValuesB).value.should.eql(true);
extract_value_for_field("Retain", dataValuesB).value.should.eql(false);
callback();
}
], callback);
}, done);
}
it("A&C1 Example of a Condition that maintains previous states via branches - with exclusive condition", function (done) {
// ns=0;i=9341 => ExclusiveLimitAlarmType
perform_test_with_condition("ns=0;i=9341",test.tankLevel,test.tankLevelCondition, done);
});
it("A&C2 Example of a Condition that maintains previous states via branches - with non exclusive condition", function (done) {
// ns=0;i=9906 => NonExclusiveLimitAlarmType
perform_test_with_condition("ns=0;i=9906",test.tankLevel2,test.tankLevelCondition2, done);
});
});
};
| ua-ql/node-opcua | test/end_to_end/alarms_and_conditions/u_test_e2e_conditions.js | JavaScript | mit | 61,313 |
///////////////////////////////////////////////////////////////////////////////
// File: gcobjectbase.h
// Description:
// object base
#ifndef _GC_OBJECTBASE_H
#define _GC_OBJECTBASE_H
namespace gcNamespace{
class gcContainer_B_;
///////////////////////////////////////////////////////////////////////////////
// most object top base class
class gcObject_B_ {
public:
virtual void gc_mark() = 0;
virtual bool gc_is_marked() const = 0;
virtual void gc_make_unreachable() = 0;
virtual void gc_make_reachable() = 0;
virtual bool gc_is_reachable() const = 0;
virtual const gcContainer_B_* gc_get_const_childreen() const = 0;
virtual void gc_make_nonfinalizable() = 0;
virtual void gc_make_finalizable() = 0;
virtual bool gc_is_finalizable() const = 0;
virtual void gc_make_lvalue() = 0;
virtual bool gc_is_lvalue() const = 0;
virtual void gc_deallocate() = 0;
virtual bool gc_is_finalized() const = 0;
virtual ~gcObject_B_() {}
};
}
#endif // _GC_OBJECTBASE_H
| jantn/garbcol | gc/gcobjectbase.h | C | mit | 1,336 |
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>Add Contact</h1>
</div>
<div data-role="content">
<div data-role="collapsible-set" data-inset="false">
<form method="post" data-ajax="false" action="<?php echo $baseUri; ?>/save">
<input name="id" type="hidden" value="<?php echo $this->data['contact']['_id']; ?>" />
<label for="name">Name</label>
<input name="name" id="name" data-clear-btn="true" type="text" value="<?php echo $this->data['contact']['name']; ?>" />
<label for="email">Email address</label>
<input name="email" id="email" data-clear-btn="true" type="text" value="<?php echo $this->data['contact']['email']; ?>" />
<label for="phone">Phone</label>
<input name="phone" id="phone" data-clear-btn="true" type="text" value="<?php echo $this->data['contact']['phone']; ?>" />
<input name="submit" value="Save" type="submit" data-icon="check" data-inline="true" data-mini="true" data-theme="a" />
<a href="<?php echo $baseUri; ?>/index" data-role="button" data-inline="true" data-icon="back" data-mini="true" data-theme="a">Back</a>
</form>
</div>
</div>
</body>
</html>
| vvaswani/bluemix-address-book | templates/form.tpl.php | PHP | mit | 1,639 |
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="<?=base_url()?>assets/js/bootstrap.min.js"></script>
<script src="<?=base_url()?>assets/js/bootstrap-markdown.js"></script>
<script src="http://www.codingdrama.com/bootstrap-markdown/js/to-markdown.js"></script>
<script src="http://www.codingdrama.com/bootstrap-markdown/js/markdown.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//rawgit.com/jeresig/jquery.hotkeys/master/jquery.hotkeys.js"></script>
</body>
<!--ADD FOOTER
Sumber footer diambil dari http://bootsnipp.com/snippets/33WGq
-->
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<footer>
<div class="footer" id="footer">
<div class="container">
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
<h3> Lorem Ipsum </h3>
<ul>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
</ul>
</div>
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
<h3> Lorem Ipsum </h3>
<ul>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
</ul>
</div>
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
<h3> Lorem Ipsum </h3>
<ul>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
</ul>
</div>
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6">
<h3> Lorem Ipsum </h3>
<ul>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
<li> <a href="#"> Lorem Ipsum </a> </li>
</ul>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 ">
<h3> Lorem Ipsum </h3>
<ul>
<li>
<div class="input-append newsletter-box text-center">
<input type="text" class="full text-center" placeholder="Email ">
<button class="btn bg-gray" type="button"> Subscribe <i class="fa fa-long-arrow-right"> </i> </button>
</div>
</li>
</ul>
<ul class="social">
<li> <a href="https://www.facebook.com/Gatewan/"> <i class=" fa fa-facebook"> </i> </a> </li>
<li> <a href="https://twitter.com/gatewan"> <i class="fa fa-twitter"> </i> </a> </li>
<li> <a href="https://plus.google.com/u/0/+WawanBeneran"> <i class="fa fa-google-plus"> </i> </a> </li>
<li> <a href="#"> <i class="fa fa-pinterest"> </i> </a> </li>
<li> <a href="https://www.youtube.com/user/gatewawan"> <i class="fa fa-youtube"> </i> </a> </li>
</ul>
</div>
</div>
<!--/.row-->
</div>
<!--/.container-->
</div>
<!--/.footer-->
<div class="footer-bottom">
<div class="container">
<p class="pull-left"> Copyright © 12131294. All right reserved. </p>
<div class="pull-right">
<ul class="nav nav-pills payments">
<li><i class="fa fa-cc-visa"></i></li>
<li><i class="fa fa-cc-mastercard"></i></li>
<li><i class="fa fa-cc-amex"></i></li>
<li><i class="fa fa-cc-paypal"></i></li>
</ul>
</div>
</div>
</div>
<!--/.footer-bottom-->
</footer>
</html> | gatewan/myuas | application/views/user/footer.php | PHP | mit | 4,777 |
/* Copyright (C) 2012 Brandon L. Reiss
[email protected]
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.
*/
#ifndef SRC_LAYER_H
#define SRC_LAYER_H
#include "type_utils.h"
#include "static_assert.h"
#include "opencv/cv.h"
#include <sstream>
#include <iostream>
#include <limits>
#include <cmath>
#include <assert.h>
// br - Enable to perform lots of numerical checks during computation.
#define DETECT_NUMERICAL_ERRORS_ENABED
#if defined(DETECT_NUMERICAL_ERRORS_ENABED)
#define DETECT_NUMERICAL_ERRORS(cvMat) \
{ \
/* Compute the sum and norm squared. */ \
const double __detect_numerical_errors_norm_sq = (cvMat).dot((cvMat)); \
const double __detect_numerical_errors_sum = cv::sum((cvMat)).val[0]; \
const bool __detect_numerical_errors_nans = \
(my_isnan(__detect_numerical_errors_norm_sq) || my_isnan(__detect_numerical_errors_sum)); \
const bool __detect_numerical_errors_inf = \
(my_isinf(__detect_numerical_errors_norm_sq) || my_isinf(__detect_numerical_errors_sum)); \
const bool __detect_numerical_errors_valid = \
(!__detect_numerical_errors_nans && !__detect_numerical_errors_inf) && \
(-1e20 < __detect_numerical_errors_sum && __detect_numerical_errors_sum < 1e20); \
if (!__detect_numerical_errors_valid) \
{ \
std::stringstream ssMsg; \
ssMsg << __FILE__ << "(" << __LINE__ << ") : " \
<< "Detected numerical issue " \
"||" << #cvMat << "||^2 = " << __detect_numerical_errors_norm_sq << ", " \
"SUM(" << #cvMat << ") = " << __detect_numerical_errors_sum << std::endl; \
std::cout << ssMsg.str(); std::cout.flush(); \
} \
}
#else
#define DETECT_NUMERICAL_ERRORS(...)
#endif
namespace blr
{
namespace nn
{
// Numeric test function from http://www.devx.com/tips/Tip/42853.
inline
int my_isnan(double x)
{
return x != x;
}
inline
int my_isinf(double x)
{
if ((x == x) && ((x - x) != 0.0))
{
return (x < 0.0 ? -1 : 1);
}
else
{
return 0;
}
}
template <typename LayerType_>
class StandardLayer
{
public:
typedef LayerType_ LayerType;
StandardLayer();
};
template <int NumInputs_, typename NumericType_ = double>
class Passthrough
: public StandardLayer<Passthrough<NumInputs_, NumericType_> >
{
public:
// API definitions.
typedef NumericType_ NumericType;
enum { NumInputs = NumInputs_, };
enum { NumOutputs = NumInputs_, };
enum { NumParameters = 0, };
static void Forward(const cv::Mat& X, const cv::Mat& W, cv::Mat* Y);
static void Backward(const cv::Mat& X, const cv::Mat& W, const cv::Mat& Y,
const cv::Mat& dLdY, cv::Mat* dLdW, cv::Mat* dLdX);
static double ComputeTruncateL2Factor(const cv::Mat& W, NumericType maxNormSq);
};
template <int NumInputs_, int NumOutputs_, typename NumericType_ = double>
class Linear
: public StandardLayer<Linear<NumInputs_, NumOutputs_, NumericType_> >
{
public:
// API definitions.
typedef NumericType_ NumericType;
enum { NumInputs = NumInputs_, };
enum { NumOutputs = NumOutputs_, };
enum { NumParameters = (NumInputs * NumOutputs) + NumOutputs, };
// Non-API definitions.
enum { ParamsLinearMat = NumInputs * NumOutputs };
static void Forward(const cv::Mat& X, const cv::Mat& W, cv::Mat* Y);
static void Backward(const cv::Mat& X, const cv::Mat& W, const cv::Mat& Y,
const cv::Mat& dLdY, cv::Mat* dLdW, cv::Mat* dLdX);
static double ComputeTruncateL2Factor(const cv::Mat& W, NumericType maxNormSq);
};
template <int NumInputs_, typename NumericType_ = double>
class Tanh
: public StandardLayer<Tanh<NumInputs_, NumericType_> >
{
public:
// API definitions.
typedef NumericType_ NumericType;
enum { NumInputs = NumInputs_, };
enum { NumOutputs = NumInputs_, };
enum { NumParameters = 0, };
static void Forward(const cv::Mat& X, const cv::Mat& W, cv::Mat* Y);
static void Backward(const cv::Mat& X, const cv::Mat& W, const cv::Mat& Y,
const cv::Mat& dLdY, cv::Mat* dLdW, cv::Mat* dLdX);
static double ComputeTruncateL2Factor(const cv::Mat& W, NumericType maxNormSq);
};
template <int NumClasses_, typename NumericType_ = double>
class SoftMax
: public StandardLayer<SoftMax<NumClasses_, NumericType_> >
{
public:
// API definitions.
typedef NumericType_ NumericType;
enum { NumInputs = NumClasses_, };
enum { NumOutputs = NumClasses_, };
enum { NumParameters = 0, };
static void Forward(const cv::Mat& X, const cv::Mat& W, cv::Mat* Y);
static void Backward(const cv::Mat& X, const cv::Mat& W, const cv::Mat& Y,
const cv::Mat& dLdY, cv::Mat* dLdW, cv::Mat* dLdX);
static double ComputeTruncateL2Factor(const cv::Mat& W, NumericType maxNormSq);
};
struct NLLCriterion
{
template <typename NNType>
static const cv::Mat* SampleLoss(const NNType& nn, const cv::Mat& xi, const cv::Mat& yi,
double* loss, int* error);
template <typename NNType>
static void DatasetLoss(const NNType& nn, const cv::Mat& X, const cv::Mat& Y,
double* loss, int* errors);
template <typename NNType>
static const cv::Mat* SampleGradient(NNType* nn, const cv::Mat& xi, const cv::Mat& yi,
cv::Mat* dLdY, double* loss, int* error);
};
////////////////////////////////////////////////////////////////////////////////
// Inline definitions.
template <typename LayerType_>
StandardLayer<LayerType_>::StandardLayer()
{
STATIC_ASSERT(LayerType::NumInputs > 0, "NumInputs > 0");
STATIC_ASSERT(LayerType::NumOutputs > 0, "NumOutputs > 0");
STATIC_ASSERT(LayerType::NumParameters >= 0, "NumParameters >= 0");
}
template <int NumInputs_, typename NumericType_>
inline
void Passthrough<NumInputs_, NumericType_>
::Forward(const cv::Mat& X, const cv::Mat& /*W*/, cv::Mat* Y)
{
assert(X.rows == Y->rows && X.cols == Y->cols && X.type() == Y->type());
DETECT_NUMERICAL_ERRORS(X);
X.copyTo(*Y);
DETECT_NUMERICAL_ERRORS(*Y);
}
template <int NumInputs_, typename NumericType_>
inline
void Passthrough<NumInputs_, NumericType_>
::Backward(const cv::Mat& /*X*/, const cv::Mat& /*W*/, const cv::Mat& /*Y*/,
const cv::Mat& dLdY, cv::Mat* /*dLdW*/, cv::Mat* dLdX)
{
assert(dLdY.rows == dLdX->rows && dLdY.cols == dLdX->cols && dLdY.type() == dLdX->type());
DETECT_NUMERICAL_ERRORS(dLdY);
dLdY.copyTo(*dLdX);
DETECT_NUMERICAL_ERRORS(*dLdX);
}
template <int NumInputs_, typename NumericType_>
inline
double Passthrough<NumInputs_, NumericType_>
::ComputeTruncateL2Factor(const cv::Mat& /*W*/, NumericType /*maxNormSq*/)
{
return 1;
}
template <int NumInputs_, int NumOutputs_, typename NumericType_>
inline
void Linear<NumInputs_, NumOutputs_, NumericType_>
::Forward(const cv::Mat& X, const cv::Mat& W, cv::Mat* Y)
{
// Compute linear, Y = M X + B.
const cv::Mat& M = W.rowRange(0, ParamsLinearMat).reshape(1, NumOutputs);
const cv::Mat& B = W.rowRange(ParamsLinearMat, NumParameters);
assert(X.rows == M.cols && Y->rows == M.rows && Y->rows == B.rows &&
X.type() == W.type() && W.type() == Y->type());
DETECT_NUMERICAL_ERRORS(X);
DETECT_NUMERICAL_ERRORS(W);
DETECT_NUMERICAL_ERRORS(M);
DETECT_NUMERICAL_ERRORS(B);
//*Y = M * X + B;
cv::gemm(M, X, 1.0, B, 1.0, *Y);
DETECT_NUMERICAL_ERRORS(*Y);
}
template <int NumInputs_, int NumOutputs_, typename NumericType_>
inline
void Linear<NumInputs_, NumOutputs_, NumericType_>
::Backward(const cv::Mat& X, const cv::Mat& W, const cv::Mat& /*Y*/,
const cv::Mat& dLdY, cv::Mat* dLdW, cv::Mat* dLdX)
{
const cv::Mat& M = W.rowRange(0, ParamsLinearMat).reshape(1, NumOutputs);
cv::Mat dLdM = dLdW->rowRange(0, ParamsLinearMat).reshape(1, NumOutputs);
cv::Mat dLdB = dLdW->rowRange(ParamsLinearMat, NumParameters);
assert(X.rows == M.cols && dLdY.rows == M.rows && dLdY.rows == dLdB.rows &&
dLdX->rows == X.rows && dLdW->rows == W.rows &&
X.type() == W.type() && W.type() == dLdY.type() &&
dLdY.type() == dLdW->type() && dLdW->type() == dLdX->type());
DETECT_NUMERICAL_ERRORS(X);
DETECT_NUMERICAL_ERRORS(W);
DETECT_NUMERICAL_ERRORS(M);
DETECT_NUMERICAL_ERRORS(dLdY);
// dLdX = M^T dLdY
cv::gemm(M, dLdY, 1.0, cv::Mat(), 0.0, *dLdX, CV_GEMM_A_T);
// dLdM = dLdY X^T
cv::gemm(dLdY, X, 1.0, cv::Mat(), 0.0, dLdM, CV_GEMM_B_T);
// dLdB = dLdY
dLdY.copyTo(dLdB);
DETECT_NUMERICAL_ERRORS(dLdM);
DETECT_NUMERICAL_ERRORS(dLdB);
DETECT_NUMERICAL_ERRORS(*dLdW);
DETECT_NUMERICAL_ERRORS(*dLdX);
}
template <int NumInputs_, int NumOutputs_, typename NumericType_>
double Linear<NumInputs_, NumOutputs_, NumericType_>
::ComputeTruncateL2Factor(const cv::Mat& W, NumericType maxNormSq)
{
cv::Mat M = W.rowRange(0, ParamsLinearMat).reshape(1, NumOutputs);
cv::Mat B = W.rowRange(ParamsLinearMat, NumParameters);
// Check each row's norm (and his offset!).
const double scaleNumerator = std::sqrt(maxNormSq);
for (int i = 0; i < M.rows; ++i)
{
cv::Mat r = M.row(i);
cv::Mat b = B.row(i);
const double rowNormSq = r.dot(r) + b.dot(b);
if (rowNormSq > maxNormSq)
{
const double hiddenUnitRenormScale = scaleNumerator / std::sqrt(rowNormSq);
r *= hiddenUnitRenormScale;
b *= hiddenUnitRenormScale;
std::cout << "Scaling hidden unit " << i << " by " << hiddenUnitRenormScale << "\n";
assert(((maxNormSq + 1e-1) - (r.dot(r) + b.dot(b))) > 0);
}
DETECT_NUMERICAL_ERRORS(r);
DETECT_NUMERICAL_ERRORS(b);
}
return 1;
}
template <int NumInputs_, typename NumericType_>
void Tanh<NumInputs_, NumericType_>
::Forward(const cv::Mat& X, const cv::Mat& /*W*/, cv::Mat* Y)
{
assert(X.rows == Y->rows && X.type() == Y->type());
DETECT_NUMERICAL_ERRORS(X);
// Compute Tanh, Y = tanh(X)
// Perform nonlinear operation (ideally, vectorized).
cv::MatConstIterator_<NumericType> x = X.begin<NumericType>();
cv::MatIterator_<NumericType> y = Y->begin<NumericType>();
const cv::MatConstIterator_<NumericType> yEnd = Y->end<NumericType>();
for(; y != yEnd; ++x, ++y)
{
*y = std::tanh(*x);
}
DETECT_NUMERICAL_ERRORS(*Y);
}
template <int NumInputs_, typename NumericType_>
void Tanh<NumInputs_, NumericType_>
::Backward(const cv::Mat& X, const cv::Mat& /*W*/, const cv::Mat& /*Y*/,
const cv::Mat& dLdY, cv::Mat* /*dLdW*/, cv::Mat* dLdX)
{
assert(X.rows == dLdY.rows && X.rows == dLdX->rows &&
X.type() == dLdY.type() && dLdY.type() == dLdX->type());
DETECT_NUMERICAL_ERRORS(X);
DETECT_NUMERICAL_ERRORS(dLdY);
// Compute dLdx = sech^2(x).dLdY (ideally vectorized).
cv::MatConstIterator_<NumericType> x = X.begin<NumericType>();
cv::MatConstIterator_<NumericType> dy = dLdY.begin<NumericType>();
cv::MatIterator_<NumericType> dx = dLdX->begin<NumericType>();
const cv::MatConstIterator_<NumericType> dxEnd = dLdX->end<NumericType>();
for(; dx != dxEnd; ++x, ++dy, ++dx)
{
//(*dx) = static_cast<NumericType>(1.0 / std::max<double>(std::cosh(*x), 1e-100));
(*dx) = static_cast<NumericType>(1.0 / std::cosh(*x));
(*dx) *= (*dx) * (*dy);
}
DETECT_NUMERICAL_ERRORS(*dLdX);
}
template <int NumInputs_, typename NumericType_>
inline
double Tanh<NumInputs_, NumericType_>
::ComputeTruncateL2Factor(const cv::Mat& /*W*/, NumericType /*maxNormSq*/)
{
return 1;
}
namespace detail
{
template <typename NumericType>
void MaxElement(const cv::Mat& m, NumericType* maxVal, int* maxIdx)
{
// Compute index of output category.
*maxIdx = 0;
cv::MatConstIterator_<NumericType> y = m.begin<NumericType>();
const cv::MatConstIterator_<NumericType> yEnd = m.end<NumericType>();
*maxVal = *y;
int i = 1;
for (++y; y != yEnd; ++y, ++i)
{
if (*y > *maxVal)
{
*maxVal = *y;
*maxIdx = i;
}
}
}
}
template <int NumClasses_, typename NumericType_>
inline
void SoftMax<NumClasses_, NumericType_>
::Forward(const cv::Mat& X, const cv::Mat& /*W*/, cv::Mat* Y)
{
using detail::MaxElement;
assert(X.rows == Y->rows && X.type() == Y->type());
DETECT_NUMERICAL_ERRORS(X);
// Compute softmax as in Y = exp(X) / \sum{exp(X)}
int maxIdx;
NumericType maxVal;
MaxElement(X, &maxVal, &maxIdx);
*Y = X - maxVal;
cv::exp(*Y, *Y);
// Perform Gibbs normalization.
const double preNormSum = cv::sum(*Y).val[0];
const bool isNan = my_isnan(preNormSum) != 0;
assert(!isNan); (void)isNan;
const bool isInf = my_isinf(preNormSum) != 0;
assert(!isInf); (void)isInf;
// if (!isInf)
{
//const NumericType normFactor = static_cast<NumericType>(1.0 / std::max(preNormSum, 1e-100));
const NumericType normFactor = static_cast<NumericType>(1.0 / preNormSum);
(*Y) *= normFactor;
}
// else
// {
// std::stringstream ssMsg;
// ssMsg << "Whoa, bro, preNormSum = " << preNormSum << "\n";//", preNormSq = " << preNormSq << "\n";
// std::cout << ssMsg.str(); std::cout.flush();
// // Make all infinities 1, all non-infinities 0.
// cv::MatIterator_<NumericType> y = Y->begin<NumericType>();
// const cv::MatConstIterator_<NumericType> yEnd = Y->end<NumericType>();
// int infCount = 0;
// for(; y != yEnd; ++y)
// {
// if (*y > std::numeric_limits<NumericType>::max())
// {
// ++infCount;
// *y = static_cast<NumericType>(1);
// }
// else
// {
// *y = 0;
// }
// }
// if (infCount > 0)
// {
// *Y *= static_cast<NumericType>(1.0 / infCount);
// }
// else
// {
// *Y = static_cast<NumericType>(1.0 / Y->rows);
// }
// }
DETECT_NUMERICAL_ERRORS(*Y);
}
template <int NumClasses_, typename NumericType_>
void SoftMax<NumClasses_, NumericType_>
::Backward(const cv::Mat& /*X*/, const cv::Mat& /*W*/, const cv::Mat& Y,
const cv::Mat& dLdY, cv::Mat* /*dLdW*/, cv::Mat* dLdX)
{
assert(Y.rows == dLdY.rows && Y.rows == dLdX->rows &&
Y.type() == dLdY.type() && dLdY.type() == dLdX->type());
DETECT_NUMERICAL_ERRORS(Y);
DETECT_NUMERICAL_ERRORS(dLdY);
// dLdX = Y (e - Y) dLdY
cv::multiply(dLdY, Y, *dLdX);
cv::scaleAdd(Y, -Y.dot(dLdY), *dLdX, *dLdX);
DETECT_NUMERICAL_ERRORS(*dLdX);
}
template <int NumClasses_, typename NumericType_>
inline
double SoftMax<NumClasses_, NumericType_>
::ComputeTruncateL2Factor(const cv::Mat& /*W*/, NumericType /*maxNormSq*/)
{
return 1;
}
template <typename NNType>
const cv::Mat* NLLCriterion::
SampleLoss(const NNType& nn, const cv::Mat& xi, const cv::Mat& yi, double* loss, int* error)
{
using detail::MaxElement;
typedef typename NNType::NumericType NumericType;
DETECT_NUMERICAL_ERRORS(xi);
const cv::Mat* yOut = nn.Forward(xi);
const double minProb = 1e-16;
(*yOut) += cv::Scalar::all(minProb);
(*yOut) *= 1.0 / (1.0 + (yOut->rows * minProb));
DETECT_NUMERICAL_ERRORS(*yOut);
// Find max class label.
int label;
NumericType maxP;
MaxElement(*yOut, &maxP, &label);
const int trueLabel = yi.at<unsigned char>(0, 0);
*error = (trueLabel != label);
const NumericType pClass = yOut->at<NumericType>(trueLabel, 0);
assert(pClass > 0);
*loss = -std::log(pClass);
return yOut;
}
template <typename NNType>
void NLLCriterion::
DatasetLoss(const NNType& nn, const cv::Mat& X, const cv::Mat& Y, double* loss, int* errors)
{
typedef typename NNType::NumericType NumericType;
*errors = 0;
*loss = 0;
double sampleLoss;
int sampleError;
for (int i = 0; i < X.rows; ++i)
{
const cv::Mat xi = X.row(i).t();
const cv::Mat yi = Y.row(i);
SampleLoss(nn, xi, yi, &sampleLoss, &sampleError);
*loss += sampleLoss;
*errors += sampleError;
}
}
template <typename NNType>
const cv::Mat* NLLCriterion::
SampleGradient(NNType* nn, const cv::Mat& xi, const cv::Mat& yi,
cv::Mat* dLdY, double* loss, int* error)
{
typedef typename NNType::NumericType NumericType;
DETECT_NUMERICAL_ERRORS(xi);
// Forward pass.
const cv::Mat* yOut = SampleLoss(*nn, xi, yi, loss, error);
DETECT_NUMERICAL_ERRORS(*yOut);
// Compute loss gradient to get this party started.
const int trueLabel = yi.at<unsigned char>(0, 0);
const double minProb = 1e-20;
const NumericType pClass =
static_cast<NumericType>((minProb + yOut->at<NumericType>(trueLabel, 0)) / (1.0 + minProb));
assert(pClass > 0);
const NumericType nllGrad = static_cast<NumericType>(-1.0 / pClass);
*dLdY = cv::Scalar::all(0);
dLdY->at<NumericType>(trueLabel, 0) = nllGrad;
DETECT_NUMERICAL_ERRORS(*dLdY);
// Backward pass.
return nn->Backward(*dLdY);
}
} // end ns nn
using namespace nn;
} // end ns blr
#endif //SRC_LAYER_H
| blr246/nn-parallel | src/layer.h | C | mit | 18,482 |
## Quick Start
Clone project and install dependencies:
```bash
$ git clone https://github.com/TobiasSchemenz/testHapiApi.git
$ cd api
$ npm install
```
Start the server:
```bash
$ npm start -s
```
Run tests:
```bash
$ npm test
```
At http://localhost:8000/documentation you can see all the endpoints.
The books require a running mongoDB (which is not included).
| TobiasSchemenz/testHapiApi | README.md | Markdown | mit | 367 |
//
// LCGroupViewController.h
// TaiYangHua
//
// Created by Lc on 16/1/18.
// Copyright © 2016年 hhly. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LCGroupListViewController : UITableViewController
@end
| icoderRo/LCWeChat | weChat/Group(讨论组)/LCGroupListViewController.h | C | mit | 227 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>index.js - dalekjs</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="../assets/css/logo.png" title="dalekjs"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 0.0.7</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/Dalek.html">Dalek</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="../modules/DalekJS.html">DalekJS</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: index.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
/*!
*
* Copyright (c) 2013 Sebastian Golasch
*
* 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.
*
*/
'use strict';
// ext. libs
var async = require('async');
var EventEmitter2 = require('eventemitter2').EventEmitter2;
// int. libs
var Driver = require('dalek-internal-driver');
var Reporter = require('dalek-internal-reporter');
var Timer = require('dalek-internal-timer');
var Config = require('dalek-internal-config');
/**
* Default options
* @type {Object}
*/
var defaults = {
reporter: ['console'],
driver: ['native'],
browser: ['phantomjs'],
viewport: {width: 1280, height: 1024},
logLevel: 3
};
/**
* Setup all the options needed to configure dalek
*
* @param {options} opts Configuration options
* @constructor
*/
var Dalek = function (opts) {
// setup instance
this._initialize();
// register exception handler
this._registerExceptionHandler();
// normalize options
this.options = this.normalizeOptions(opts);
// getting advanced options
if (opts && opts.advanced) {
this.advancedOptions = opts.advanced;
}
// initiate config
this.config = new Config(defaults, this.options, this.advancedOptions);
// override tests if provided on the commandline
if (this.options.tests) {
this.config.config.tests = this.options.tests;
}
// prepare and load reporter(s)
this._setupReporters();
// count all passed & failed assertions
this.reporterEvents.on('report:assertion', this._onReportAssertion.bind(this));
// init the timer instance
this.timer = new Timer();
// prepare driver event emitter instance
this._setupDriverEmitter();
// check for file option, throw error if none is given
if (!Array.isArray(this.config.get('tests'))) {
this.reporterEvents.emit('error', 'No test files given!');
this.driverEmitter.emit('killAll');
process.exit(127);
}
// init the driver instance
this._initDriver();
};
/**
* Daleks base module
* Used to configure all the things
* and to start off the tests
*
* @module DalekJS
* @class Dalek
*/
Dalek.prototype = {
/**
* Runs the configured testsuites
*
* @method run
* @chainable
*/
run: function () {
// start the timer to measure the execution time
this.timer.start();
// emit the runner started event
this.reporterEvents.emit('report:runner:started');
// execute all given drivers sequentially
var drivers = this.driver.getDrivers();
async.series(drivers, this.testsuitesFinished.bind(this));
return this;
},
/**
* Reports the all testuites executed event
*
* @method testsuitesFinished
* @chainable
*/
testsuitesFinished: function () {
this.driverEmitter.emit('tests:complete');
setTimeout(this.reportRunFinished.bind(this), 0);
return this;
},
/**
* Reports the all testuites executed event
*
* @method reportRunFinished
* @chainable
*/
reportRunFinished: function () {
this.reporterEvents.emit('report:runner:finished', {
elapsedTime: this.timer.stop().getElapsedTimeFormatted(),
assertions: this.assertionsFailed + this.assertionsPassed,
assertionsFailed: this.assertionsFailed,
assertionsPassed: this.assertionsPassed,
status: this.runnerStatus
});
return this;
},
/**
* Normalizes options
*
* @method normalizeOptions
* @param {object} options Raw options
* @return {object} Normalized options
*/
normalizeOptions: function (options) {
Object.keys(options).forEach(function (key) {
if ({reporter: 1, driver: 1}[key]) {
options[key] = options[key].map(function (input) { return input.trim(); });
}
});
return options;
},
/**
* Sets up system env properties
*
* @method _initialize
* @chainable
* @private
*/
_initialize: function () {
// prepare error data
this.warnings = [];
this.errors = [];
// prepare state data for the complete test run
this.runnerStatus = true;
this.assertionsFailed = 0;
this.assertionsPassed = 0;
return this;
},
/**
* Sets up all the reporters
*
* @method _setupReporters
* @chainable
* @private
*/
_setupReporters: function () {
this.reporters = [];
this.reporterEvents = new EventEmitter2();
this.options.reporter = this.config.verifyReporters(this.config.get('reporter'), Reporter);
this.options.reporter.forEach(this._addReporter, this);
return this;
},
/**
* Adds a reporter
*
* @method _addReporter
* @param {string} reporter Name of the reporter to add
* @chainable
* @private
*/
_addReporter: function (reporter) {
this.reporters.push(Reporter.loadReporter(reporter, {events: this.reporterEvents, config: this.config, logLevel: this.config.get('logLevel')}));
return this;
},
/**
* Updates the assertion state
*
* @method _onReportAssertion
* @param {object} assertion Informations aout the runned assertions
* @chainable
* @private
*/
_onReportAssertion: function (assertion) {
if (assertion.success) {
this.assertionsPassed++;
} else {
this.runnerStatus = false;
this.assertionsFailed++;
}
return this;
},
/**
* Initizializes the driver instances
*
* @method _initDriver
* @chainable
* @private
*/
_initDriver: function () {
this.driver = new Driver({
config: this.config,
driverEmitter: this.driverEmitter,
reporterEvents: this.reporterEvents
});
this.options.driver = this.config.verifyDrivers(this.config.get('driver'), this.driver);
return this;
},
/**
* Sets up the event dispatcher for driver events
*
* @method _setupDriverEmitter
* @chainable
* @private
*/
_setupDriverEmitter: function () {
var driverEmitter = new EventEmitter2();
driverEmitter.setMaxListeners(0);
this.driverEmitter = driverEmitter;
return this;
},
/**
* Make sure to shutdown dalek & its spawned
* components, webservers gracefully if a
* runtimew error pops up
*
* @method _registerExceptionHandler
* @private
* @chainable
*/
_registerExceptionHandler: function () {
process.on('uncaughtException', this._shutdown.bind(this));
return this;
},
/**
* Shutdown on uncaught exception
*
* @method _shutdown
* @param {object} exception Runtime exception
* @private
*/
_shutdown: function (exception) {
// ios emulator hack, needs to go in the future
if (exception.message && exception.message.search('This socket has been ended by the other party') !== -1) {
return false;
}
this.driverEmitter.emit('killAll');
this.reporterEvents.emit('error', exception);
}
};
// export dalek as a module
module.exports = Dalek;
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
| dalekjs/dalekjs.github.io | package/dalekjs/master/api/files/index.js.html | HTML | mit | 11,418 |
---
layout: page
title: Ty
subtitle: null
published: true
---
<br>
<div style="text-align:center">
<img src ="/img/ty.png"/>
</div>
<br>
I was born in the year of "Hey lover", "Straight outta Compton" and "Dirty Diana", the great 1988, and raised to the soundtrack of soul music with a whiff of eighties pop and classic rock.
Even though I listen to a range of genres, hip hop has long been my true love.
A few years of rapping taught me that the stage is nice, but the studio is life. So I left the rap scene for songwriting and a job curating music for Getmixed radio, which eventually led me to host a show at the same station.
At the moment you're most likely to spot me dancing salsa at a Latin party somewhere in the Netherlands.
#### Contributor's Influences
Provide some details about what influences the contributor has. Artists they like etc.
#### Connect with Ty
<a class="fa fa-globe" href="http://www./" target="_blank"> Website </a> |
<a class="fa fa-facebook" href="https://www.facebook.com/" target="_blank"> Facebook </a> |
<a class="fa fa-twitter" href="https://twitter.com/" target="_blank"> Twitter </a> |
<a class="fa fa-youtube" href="https://www.youtube.com/" target="_blank"> Youtube </a> |
<a class="fa fa-instagram" href="https://www.instagram.com/" target="_blank"> Instagram </a> |
<a class="fa fa-soundcloud" href="https://soundcloud.com/" target="_blank"> Soundcloud </a>
#### Posts curated by Ty
[Naaz - Words](http://www.rwz.io/naaz-words/)
| rhymeswithzion/rhymeswithzion.github.io | contributors/ty.md | Markdown | mit | 1,488 |
<!-- markdownlint-disable -->
<a href="https://github.com/ArcticSnow/snowpyt/snowpyt/CAAMLv6_xml.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
# <kbd>module</kbd> `snowpyt.CAAMLv6_xml`
Created on Tue Jul 04 13:32:31 2017
@author: Simon Filhol, Guillaume Sutter
Collection of functions to import snowpit data stored in the CAAMLv6 xml standard
---
<a href="https://github.com/ArcticSnow/snowpyt/snowpyt/CAAMLv6_xml.py#L17"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `get_temperature`
```python
get_temperature(path_xml, print2term=True)
```
Function to extract temperature profile from CAAML xml file
**Args:**
- <b>`path_xml`</b> (str): path to xml file
- <b>`print2term`</b> (bool): print profile to termninal
**Returns:**
- <b>`array`</b>: temperature profile
---
<a href="https://github.com/ArcticSnow/snowpyt/snowpyt/CAAMLv6_xml.py#L55"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `get_density`
```python
get_density(path_xml, print2term=True)
```
Function to extract density profile from CAAML xml file
**Args:**
- <b>`path_xml`</b> (str): path to xml file
- <b>`print2term`</b> (bool): print profile to termninal
**Returns:**
- <b>`array`</b>: density profile
---
<a href="https://github.com/ArcticSnow/snowpyt/snowpyt/CAAMLv6_xml.py#L101"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `childValueNoneTest`
```python
childValueNoneTest(child)
```
---
<a href="https://github.com/ArcticSnow/snowpyt/snowpyt/CAAMLv6_xml.py#L107"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `has_child`
```python
has_child(node, idx=0, dtype='str', unit_ret=False, print2term=True)
```
---
<a href="https://github.com/ArcticSnow/snowpyt/snowpyt/CAAMLv6_xml.py#L139"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `is_node`
```python
is_node(node)
```
---
<a href="https://github.com/ArcticSnow/snowpyt/snowpyt/CAAMLv6_xml.py#L146"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `get_metadata`
```python
get_metadata(path_xml, print2term=True)
```
Function to extract snowpit metadata profile from CAAML xml file
**Args:**
- <b>`path_xml`</b> (str): path to xml file
- <b>`print2term`</b> (bool): print profile to termninal
**Returns:**
metadata object
---
<a href="https://github.com/ArcticSnow/snowpyt/snowpyt/CAAMLv6_xml.py#L192"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `get_layers`
```python
get_layers(path_xml, print2term=True)
```
Function to extract layers from CAAML xml file
**Args:**
- <b>`path_xml`</b> (str): path to xml file
- <b>`print2term`</b> (bool): print profile to termninal
**Returns:**
- <b>`list`</b>: layers content
---
_This file was automatically generated via [lazydocs](https://github.com/ml-tooling/lazydocs)._
| ArcticSnow/snowpyt | docs/snowpyt.CAAMLv6_xml.md | Markdown | mit | 3,473 |
#!/usr/bin/env msu
#
# Run Script
#
# MIT License
# Copyright (c) 2015-2016 GochoMugo <[email protected]>
#
# modules
msu_require "console"
# script variables
GH_PAGES_VERSION="1.0.1"
DEPS="curl travis"
ROOT=$(dirname ${BASH_SOURCE[0]}) # directory holding this file
LIB="${ROOT}/lib" # path to our lib
TEMPLATES_DIR="${GH_PAGES_TEMPLATES_DIR:-${ROOT}/templates}" # installed templates
DATA_DIR="${GH_PAGES_DATA_DIR:-.gh-pages}" # name of the directory to store data
CONFIG_FILE="${DATA_DIR}/config.sh" # configuration file
# templates
GITBOOK_URL="https://github.com/GochoMugo/gh-pages-gitbook.git"
JEKYLL_URL="https://github.com/GochoMugo/gh-pages-jekyll.git"
# github access tokens
SCOPES="[\"public_repo\"]"
# main entry point
#
# ${1} - action e.g. 'init'
function main() {
# ensure environment is ready for us.
mkdir -p "${TEMPLATES_DIR}" "${DATA_DIR}"
case ${1} in
"i" | "init" )
# copying scripts from lib to the scripts directory
cp -rf "${LIB}"/* "${LIB}"/.travis.yml "${DATA_DIR}" > /dev/null 2>&1
# we might be using a template
[ ${2} ] && {
log "using template: ${2}"
templateDir="${TEMPLATES_DIR}/${2}"
[ ! -d ${templateDir} ] && {
error "missing template ${2}"
return 1
}
cp -rf "${templateDir}"/* "${templateDir}/.travis.yml" "${DATA_DIR}" > /dev/null 2>&1
}
# ensure the `travis` command is available
command -v travis > /dev/null 2>&1 || {
error "\`travis' command missing"
error "please install \`travis' using: \`gem install travis'"
return 1
}
# if the configuration file does not exist, we create for the user
if [ ! -e "${CONFIG_FILE}" ]
then
log "please fill in these details"
DEFAULT_BRANCH="gh-pages"
DEFAULT_OUT_DIR="_out"
# if we are in a git repository
if [ -d .git ]
then
DEFAULT_USER_NAME="$(git config user.name)"
DEFAULT_USER_EMAIL="$(git config user.email)"
DEFAULT_GIT_URL="https://github.com/${DEFAULT_USER_NAME}/$(basename "$PWD").git"
fi
ask "Repository Git Url [${DEFAULT_GIT_URL}]:" GIT_URL
ask "Branch to Deploy to [${DEFAULT_BRANCH}]:" BRANCH
ask "Output Directory [${DEFAULT_OUT_DIR}]:" OUT_DIR
ask "Github Username [${DEFAULT_USER_NAME}]:" USER_NAME
ask "Email Address [${DEFAULT_USER_EMAIL}]:" USER_EMAIL
[[ -z "${GIT_URL}" ]] && GIT_URL="${DEFAULT_GIT_URL}"
[[ -z "${BRANCH}" ]] && BRANCH="${DEFAULT_BRANCH}"
[[ -z "${OUT_DIR}" ]] && OUT_DIR="${DEFAULT_OUT_DIR}"
[[ -z "${USER_NAME}" ]] && USER_NAME="${DEFAULT_USER_NAME}"
[[ -z "${USER_EMAIL}" ]] && USER_EMAIL="${DEFAULT_USER_EMAIL}"
# save the configurations to file.
rm -f "${CONFIG_FILE}"
echo "GIT_URL=\"${GIT_URL}\"" >> ${CONFIG_FILE}
echo "BRANCH=\"${BRANCH}\"" >> ${CONFIG_FILE}
echo "OUT_DIR=\"${OUT_DIR}\"" >> ${CONFIG_FILE}
echo "USER_NAME=\"${USER_NAME}\"" >> ${CONFIG_FILE}
echo "USER_EMAIL=\"${USER_EMAIL}\"" >> ${CONFIG_FILE}
echo "source \""${CONFIG_FILE}"\" ; echo \"$(cat "${DATA_DIR}/.travis.yml")\"" | \
DATA_DIR="${DATA_DIR}" bash > .travis.yml
fi
# if token file does not exist, we should create it, by getting a github token
# and placing it in the file.
if [ ! -e .token ]
then
log "We are about to create a Github personal token, just for this repository"
log "The password request is NOT saved at all"
log "Should you feel uncomfortable or this request fails due to\n\
2FA, etc., you may create a personal token at\n\
https://github.com/settings/tokens/new and place it in a\n\
file named '.token' in this directory and re-run this command."
yes_no "Continue to automated-token creation" || return 2
ask "Github Password" USER_PASS 1
log "Sending request for new access token"
curl -s \
-u ${USER_NAME}:${USER_PASS} \
-X POST https://api.github.com/authorizations \
--data "{\"scopes\": ${SCOPES}, \
\"note\": \"gh-pages: ${GIT_URL}\"}" > .res
cat .res \
| grep -Ei "\"token\": " \
| grep -Eio ": \"[a-z0-9]+" \
| grep -Eio "[a-z0-9]+" > .token
# if we failed to generate an access token.
[ "$(cat .token)" ] || {
error "failed to generate an access token from Github"
yes_no "show error response" && {
cat .res
rm -f .res .token
}
return 2
}
# we done with the response.
rm .res
fi
# read the token
GH_TOKEN="$(cat .token)"
# use `travis` to encrypt the access token.
log "encrypting token, using \`travis'"
travis encrypt GH_TOKEN=${GH_TOKEN} \
--skip-version-check --add || {
error "failed encrypting with \`travis'"
error "note that your github access token has been saved to .token"
error "ensure you do NOT commit this file"
error "RETRY! On success, .token will be auto-deleted"
return 2
}
# we have encrypted the access token unto travis servers.
rm .token
success "finished!"
;;
"t" | "template" )
[ ${2} ] || {
error "template name is required"
return 1
}
[ ${3} ] || {
error "git url is required"
return 1
}
# move to tempdir for hygiene purposes.
pushd /tmp/ > /dev/null
# if a previous run had occurred before this, ensure it is clean.
rm -rf gh-template
# clone the template's repo.
git clone ${3} gh-template > /dev/null 2>&1 && {
# remove previous installations, and install this template.
rm -rf "${TEMPLATES_DIR}/${2}"
mv gh-template "${TEMPLATES_DIR}/${2}"
tick "${2}"
} || {
error "failed to clone ${2}'s repo"
return 1
}
;;
"l" | "templates" )
for dir in "${TEMPLATES_DIR}"/*
do
template="$(basename ${dir})"
[[ "${template}" == "*" ]] && return
list "${template}"
done
;;
"r" | "recommended-templates" )
# jekyll template.
yes_no "jekyll" "y" && {
main template jekyll ${JEKYLL_URL}
}
;;
"v" | "version" )
msu version gh-pages
;;
"u" | "upgrade" )
log "upgrading to the latest version"
msu install gh:GochoMugo/gh-pages
;;
"info" | "h" | "help" | * )
echo
echo " gh-pages v${GH_PAGES_VERSION}"
echo
echo " Initialize:"
echo " ⇒ gh-pages init [template-name]"
echo
echo " Adding templates:"
echo " ⇒ gh-pages template <name> <git-url>"
echo
echo " Scripts run on Travis during each Build:"
echo " \${DATA_DIR}/deps.sh install dependencies"
echo " \${DATA_DIR}/build.sh build your website"
echo " \${DATA_DIR}/deploy.sh deploys the site"
echo
echo " Other Scripts:"
echo " \${DATA_DIR}/config.sh your configuration information"
echo
echo " Other commands:"
echo " ⇒ gh-pages templates list all installed templates"
echo " ⇒ gh-pages version show version information"
echo " ⇒ gh-pages upgrade upgrade gh-pages"
echo
echo " More Information:"
echo " You can easily install recommended templates using"
echo " ⇒ gh-pages recommended-templates"
echo " See https://github.com/GochoMugo/gh-pages for more"
echo " source code, feature requests and bugs"
echo
;;
esac
}
| GochoMugo/gh-pages | main.sh | Shell | mit | 7,449 |
/**
* Merge object b with object a.
*
* var a = { foo: 'bar' }
* , b = { bar: 'baz' };
*
* utils.merge(a, b);
* // => { foo: 'bar', bar: 'baz' }
*
* @param {Object} a
* @param {Object} b
* @return {Object}
* @api private
*/
exports.merge = function(a, b){
if (a && b) {
for (var key in b) {
a[key] = b[key];
}
}
return a;
};
/**
* Flatten the given `arr`.
*
* @param {Array} arr
* @return {Array}
* @api private
*/
exports.flatten = function(arr, ret){
var ret = ret || []
, len = arr.length;
for (var i = 0; i < len; ++i) {
if (Array.isArray(arr[i])) {
exports.flatten(arr[i], ret);
} else {
ret.push(arr[i]);
}
}
return ret;
};
/**
* Check if `path` looks absolute.
*
* @param {String} path
* @return {Boolean}
* @api private
*/
exports.isAbsolute = function(path){
if ('/' == path[0]) return true;
if (':' == path[1] && '\\' == path[2]) return true;
}
| jaredhanson/kerouac | lib/utils.js | JavaScript | mit | 970 |
<?php
namespace Base\Models;
use Phalcon\Mvc\Model;
use Phalcon\Mvc\Model\Validator\Email as EmailValidator;
use Phalcon\Mvc\Model\Validator\Uniqueness as UniquenessValidator;
use Base\Framework\Messages\Message;
use Base\Framework\Constants;
use Base\Framework\Library\String;
use Base\Resources\Common\CommonResources;
use Base\Resources\Configuration\ConfigurationResources;
/**
* Word class
*/
class Word extends BaseModel
{
/**
* language identifier
* @var int
*/
public $language_id;
/**
* word
* @var string
*/
public $word;
/**
* status id
* @var string
*/
public $status_id;
/**
* is on dictionary
* @var bool
*/
public $is_on_dictionary;
/**
* kind of word identifier
* @var int
*/
public $word_type_id;
public $description;
/**
* This model is mapped to the table users
*/
public function getSource() {
return 'word';
}
/**
* initial table relationship
*/
public function initialize() {
$this->belongsTo('language_id', 'Language', 'id');
$this->belongsTo('status_id', 'Status', 'id');
$this->belongsTo('word_type_id', 'WordType', 'id');
}
/**
* @return boolean
*/
public function validation() {
if ($this->validationHasFailed() == true) {
return false;
}
}
public function getMessages() {
$messages = array();
foreach (parent::getMessages() as $message) {
switch ($message->getType()) {
case 'PresenceOf':
$messages[] = new Message(null, Constants::getMessageType() ['Error'], String::format(CommonResources::getMessage('Msg_PresenceOf'), ConfigurationResources::getMessage($message->getField())));
break;
default:
$messages[] = new Message(null, Constants::getMessageType() ['Error'], $message->getMessage());
break;
}
}
return $messages;
}
}
| soetedja/base.framework | Base.RestAPI/Models/Word.php | PHP | mit | 2,131 |
<?php
namespace Office365\Runtime;
class Version
{
public $Major;
public $Minor;
public $Build;
public $Revision;
} | vgrem/phpSPO | src/Runtime/Version.php | PHP | mit | 135 |
/*
The MIT License (MIT)
Copyright (c) 2017 Gameblabla
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:
*/
//40,15
const char map [600] =
{
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,1,1,1,
1,0,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
};
const char map2[600] =
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,
0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,
0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,
0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,
0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,
0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,
0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,
0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,
0,0,1,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,
0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,
0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,
0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,
0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0
};
const char map3[600] =
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0
};
//50,15
const char map4 [750] =
{
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,
1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,
1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,
1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,
1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,
1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
};
/*
//20,15
const char map [300] =
{
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
};
*/
| gameblabla/evilaustralians | Consoles_port/3DO_port/Source/maps.h | C | mit | 6,587 |
<?php
declare(strict_types=1);
namespace DiContainerBenchmarks\Fixture\C;
class FixtureC795
{
public function __construct(FixtureC794 $dependency)
{
}
}
| kocsismate/php-di-container-benchmarks | src/Fixture/C/FixtureC795.php | PHP | mit | 168 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CRM Admin Panel</title>
<!-- Favicon and touch icons -->
<link rel="shortcut icon" href="assets/dist/img/ico/favicon.png" type="image/x-icon">
<!-- Start Global Mandatory Style
=====================================================================-->
<!-- jquery-ui css -->
<link href="assets/plugins/jquery-ui-1.12.1/jquery-ui.min.css" rel="stylesheet" type="text/css"/>
<!-- Bootstrap -->
<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<!-- Bootstrap rtl -->
<!--<link href="assets/bootstrap-rtl/bootstrap-rtl.min.css" rel="stylesheet" type="text/css"/>-->
<!-- Lobipanel css -->
<link href="assets/plugins/lobipanel/lobipanel.min.css" rel="stylesheet" type="text/css"/>
<!-- Pace css -->
<link href="assets/plugins/pace/flash.css" rel="stylesheet" type="text/css"/>
<!-- Font Awesome -->
<link href="assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<!-- Pe-icon -->
<link href="assets/pe-icon-7-stroke/css/pe-icon-7-stroke.css" rel="stylesheet" type="text/css"/>
<!-- Themify icons -->
<link href="assets/themify-icons/themify-icons.css" rel="stylesheet" type="text/css"/>
<!-- End Global Mandatory Style
=====================================================================-->
<!-- Start Theme Layout Style
=====================================================================-->
<!-- Theme style -->
<link href="assets/dist/css/stylecrm.css" rel="stylesheet" type="text/css"/>
<!-- Theme style rtl -->
<!--<link href="assets/dist/css/stylecrm-rtl.css" rel="stylesheet" type="text/css"/>-->
<!-- End Theme Layout Style
=====================================================================-->
</head>
<body class="hold-transition sidebar-mini">
<!--preloader-->
<div id="preloader">
<div id="status"></div>
</div>
<!-- Site wrapper -->
<div class="wrapper">
<header class="main-header">
<a href="index.html" class="logo">
<!-- Logo -->
<span class="logo-mini">
<img src="assets/dist/img/mini-logo.png" alt="">
</span>
<span class="logo-lg">
<img src="assets/dist/img/logo.png" alt="">
</span>
</a>
<!-- Header Navbar -->
<nav class="navbar navbar-static-top">
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
<!-- Sidebar toggle button-->
<span class="sr-only">Toggle navigation</span>
<span class="pe-7s-angle-left-circle"></span>
</a>
<!-- searchbar-->
<a href="#search"><span class="pe-7s-search"></span></a>
<div id="search">
<button type="button" class="close">×</button>
<form>
<input type="search" value="" placeholder="type keyword(s) here" />
<button type="submit" class="btn btn-add">Search...</button>
</form>
</div>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- Orders -->
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle admin-notification" data-toggle="dropdown">
<i class="pe-7s-cart"></i>
<span class="label label-primary">5</span>
</a>
<ul class="dropdown-menu">
<li>
<ul class="menu">
<li >
<!-- start Orders -->
<a href="#" class="border-gray">
<div class="pull-left">
<img src="assets/dist/img/basketball-jersey.png" class="img-thumbnail" alt="User Image">
</div>
<h4>polo shirt</h4>
<p><strong>total item:</strong> 21
</p>
</a>
</li>
<li>
<a href="#" class="border-gray">
<div class="pull-left">
<img src="assets/dist/img/shirt.png" class="img-thumbnail" alt="User Image">
</div>
<h4>Kits</h4>
<p><strong>total item:</strong> 11
</p>
</a>
</li>
<li>
<a href="#" class="border-gray">
<div class="pull-left">
<img src="assets/dist/img/football.png" class="img-thumbnail" alt="User Image">
</div>
<h4>Football</h4>
<p><strong>total item:</strong> 16
</p>
</a>
</li>
<li class="nav-list">
<a href="#" class="border-gray">
<div class="pull-left">
<img src="assets/dist/img/shoe.png" class="img-thumbnail" alt="User Image">
</div>
<h4>Sports sheos</h4>
<p><strong>total item:</strong> 10
</p>
</a>
</li>
</ul>
</li>
</ul>
</li>
<!-- Messages -->
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="pe-7s-mail"></i>
<span class="label label-success">4</span>
</a>
<ul class="dropdown-menu">
<li>
<ul class="menu">
<li>
<!-- start message -->
<a href="#" class="border-gray">
<div class="pull-left">
<img src="assets/dist/img/avatar.png" class="img-circle" alt="User Image">
</div>
<h4>Ronaldo</h4>
<p>Please oreder 10 pices of kits..</p>
<span class="badge badge-success badge-massege"><small>15 hours ago</small>
</span>
</a>
</li>
<li>
<a href="#" class="border-gray">
<div class="pull-left">
<img src="assets/dist/img/avatar2.png" class="img-circle" alt="User Image">
</div>
<h4>Leo messi</h4>
<p>Please oreder 10 pices of Sheos..</p>
<span class="badge badge-info badge-massege"><small>6 days ago</small>
</span>
</a>
</li>
<li>
<a href="#" class="border-gray">
<div class="pull-left" >
<img src="assets/dist/img/avatar3.png" class="img-circle" alt="User Image">
</div>
<h4>Modric</h4>
<p>Please oreder 6 pices of bats..</p>
<span class="badge badge-info badge-massege"><small>1 hour ago</small>
</span>
</a>
</li>
<li>
<a href="#" class="border-gray">
<div class="pull-left">
<img src="assets/dist/img/avatar4.png" class="img-circle" alt="User Image">
</div>
<h4>Salman</h4>
<p>Hello i want 4 uefa footballs</p>
<span class="badge badge-danger badge-massege">
<small>6 days ago</small>
</span>
</a>
</li>
<li>
<a href="#" class="border-gray">
<div class="pull-left">
<img src="assets/dist/img/avatar5.png" class="img-circle" alt="User Image">
</div>
<h4>Sergio Ramos</h4>
<p>Hello i want 9 uefa footballs</p>
<span class="badge badge-info badge-massege"><small>5 hours ago</small>
</span>
</a>
</li>
</ul>
</li>
</ul>
</li>
<!-- Notifications -->
<li class="dropdown notifications-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="pe-7s-bell"></i>
<span class="label label-warning">7</span>
</a>
<ul class="dropdown-menu">
<li>
<ul class="menu">
<li>
<a href="#" class="border-gray">
<i class="fa fa-dot-circle-o color-green"></i>Change Your font style</a>
</li>
<li><a href="#" class="border-gray">
<i class="fa fa-dot-circle-o color-red"></i>
check the system ststus..</a>
</li>
<li><a href="#" class="border-gray">
<i class="fa fa-dot-circle-o color-yellow"></i>
Add more admin...</a>
</li>
<li><a href="#" class="border-gray">
<i class="fa fa-dot-circle-o color-violet"></i> Add more clients and order</a>
</li>
<li><a href="#" class="border-gray">
<i class="fa fa-dot-circle-o color-yellow"></i>
Add more admin...</a>
</li>
<li><a href="#" class="border-gray">
<i class="fa fa-dot-circle-o color-violet"></i> Add more clients and order</a>
</li>
</ul>
</li>
</ul>
</li>
<!-- Tasks -->
<li class="dropdown tasks-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="pe-7s-note2"></i>
<span class="label label-danger">6</span>
</a>
<ul class="dropdown-menu">
<li>
<ul class="menu">
<li>
<!-- Task item -->
<a href="#" class="border-gray">
<span class="label label-success pull-right">50%</span>
<h3><i class="fa fa-check-circle"></i> Theme color should be change</h3>
</a>
</li>
<!-- end task item -->
<li>
<!-- Task item -->
<a href="#" class="border-gray">
<span class="label label-warning pull-right">90%</span>
<h3><i class="fa fa-check-circle"></i> Fix Error and bugs</h3>
</a>
</li>
<!-- end task item -->
<li>
<!-- Task item -->
<a href="#" class="border-gray">
<span class="label label-danger pull-right">80%</span>
<h3><i class="fa fa-check-circle"></i> Sidebar color change</h3>
</a>
</li>
<!-- end task item -->
<li>
<!-- Task item -->
<a href="#" class="border-gray">
<span class="label label-info pull-right">30%</span>
<h3><i class="fa fa-check-circle"></i> font-family should be change</h3>
</a>
</li>
<li>
<!-- Task item -->
<a href="#" class="border-gray">
<span class="label label-success pull-right">60%</span>
<h3><i class="fa fa-check-circle"></i> Fix the database Error</h3>
</a>
</li>
<li>
<!-- Task item -->
<a href="#" class="border-gray">
<span class="label label-info pull-right">20%</span>
<h3><i class="fa fa-check-circle"></i> data table data missing</h3>
</a>
</li>
<!-- end task item -->
</ul>
</li>
</ul>
</li>
<!-- Help -->
<li class="dropdown dropdown-help hidden-xs">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="pe-7s-settings"></i></a>
<ul class="dropdown-menu" >
<li>
<a href="profile.html">
<i class="fa fa-line-chart"></i> Networking</a>
</li>
<li><a href="#"><i class="fa fa fa-bullhorn"></i> Lan settings</a></li>
<li><a href="#"><i class="fa fa-bar-chart"></i> Settings</a></li>
<li><a href="login.html">
<i class="fa fa-wifi"></i> wifi</a>
</li>
</ul>
</li>
<!-- user -->
<li class="dropdown dropdown-user">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="assets/dist/img/avatar5.png" class="img-circle" width="45" height="45" alt="user"></a>
<ul class="dropdown-menu" >
<li>
<a href="profile.html">
<i class="fa fa-user"></i> User Profile</a>
</li>
<li><a href="#"><i class="fa fa-inbox"></i> Inbox</a></li>
<li><a href="login.html">
<i class="fa fa-sign-out"></i> Signout</a>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<!-- =============================================== -->
<!-- Left side column. contains the sidebar -->
<aside class="main-sidebar">
<!-- sidebar -->
<div class="sidebar">
<!-- sidebar menu -->
<ul class="sidebar-menu">
<li class="active">
<a href="index.html"><i class="fa fa-tachometer"></i><span>Dashboard</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-users"></i><span>Customers</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="add-customer.html">Add Customer</a></li>
<li><a href="clist.html">List</a></li>
<li><a href="group.html">Groups</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-shopping-basket"></i><span>Transaction</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="deposit.html">New Deposit</a></li>
<li><a href="expense.html">New Expense</a></li>
<li><a href="transfer.html">Transfer</a></li>
<li><a href="view-tsaction.html">View transaction</a></li>
<li><a href="balance.html">Balance Sheet</a></li>
<li><a href="treport.html">Transfer Report</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-shopping-cart"></i><span>Sales</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="invoice.html">Invoices</a></li>
<li><a href="ninvoices.html">New Invoices</a></li>
<li><a href="recurring.html">Recurring invoices</a></li>
<li><a href="nrecurring.html">New Recurring invoices</a></li>
<li><a href="quote.html">quotes</a></li>
<li><a href="nquote.html">New quote</a></li>
<li><a href="payment.html">Payments</a></li>
<li><a href="taxeport.html">Tax Rates</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-book"></i><span>Task</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="rtask.html">Running Task</a></li>
<li><a href="atask.html">Archive Task</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-shopping-bag"></i><span>Accounting</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="cpayment.html">Client payment</a></li>
<li><a href="emanage.html">Expense management</a></li>
<li><a href="ecategory.html">Expense Category</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-file-text"></i><span>Report</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="preport.html">Project Report</a></li>
<li><a href="creport.html">Client Report</a></li>
<li><a href="ereport.html">Expense Report</a></li>
<li><a href="incomexp.html">Income expense comparesion</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-bell"></i><span>Attendance</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="thistory.html">Time History</a></li>
<li><a href="timechange.html">Time Change Request</a></li>
<li><a href="atreport.html">Attendance Report</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-edit"></i><span>Recruitment</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="jpost.html">Jobs Posted</a></li>
<li><a href="japp.html">Jobs Application</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-shopping-basket"></i><span>payroll</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="salary.html">Salary Template</a></li>
<li><a href="hourly.html">Hourly</a></li>
<li><a href="managesal.html">Manage salary</a></li>
<li><a href="empsallist.html">Employee salary list</a></li>
<li><a href="mpayment.html">Make payment</a></li>
<li><a href="generatepay.html">Generate payslip</a></li>
<li><a href="paysum.html">Payroll summary</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-bitbucket-square"></i><span>Stock</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="stockcat.html">Stock category</a></li>
<li><a href="manstock.html">Manage Stock</a></li>
<li><a href="astock.html">Assign stock</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-ticket"></i><span>Tickets</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="ticanswer.html">Answered</a></li>
<li><a href="ticopen.html">Open</a></li>
<li><a href="iprocess.html">Inprocess</a></li>
<li><a href="close.html">CLosed</a></li>
<li><a href="allticket.html">All Tickets</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-list"></i>
<span>Utilities</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="ativitylog.html">Activity Log</a></li>
<li><a href="emailmes.html">Email message log</a></li>
<li><a href="systemsts.html">System status</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-bar-chart"></i><span>Charts</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li class=""><a href="charts_flot.html">Flot Chart</a></li>
<li><a href="charts_Js.html">Chart js</a></li>
<li><a href="charts_morris.html">Morris Charts</a></li>
<li><a href="charts_sparkline.html">Sparkline Charts</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-briefcase"></i>
<span>Icons</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="icons_bootstrap.html">Bootstrap Icons</a></li>
<li><a href="icons_fontawesome.html">Fontawesome Icon</a></li>
<li><a href="icons_flag.html">Flag Icons</a></li>
<li><a href="icons_material.html">Material Icons</a></li>
<li><a href="icons_weather.html">Weather Icons </a></li>
<li><a href="icons_line.html">Line Icons</a></li>
<li><a href="icons_pe.html">Pe Icons</a></li>
<li><a href="icon_socicon.html">Socicon Icons</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-list"></i> <span>Other page</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="login.html">Login</a></li>
<li><a href="register.html">Register</a></li>
<li><a href="profile.html">Profile</a></li>
<li><a href="forget_password.html">Forget password</a></li>
<li><a href="lockscreen.html">Lockscreen</a></li>
<li><a href="404.html">404 Error</a></li>
<li><a href="505.html">505 Error</a></li>
<li><a href="blank.html">Blank Page</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-bitbucket"></i><span>UI Elements</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="buttons.html">Buttons</a></li>
<li><a href="tabs.html">Tabs</a></li>
<li><a href="notification.html">Notification</a></li>
<li><a href="tree-view.html">Tree View</a></li>
<li><a href="progressbars.html">Progressber</a></li>
<li><a href="list.html">List View</a></li>
<li><a href="typography.html">Typography</a></li>
<li><a href="panels.html">Panels</a></li>
<li><a href="modals.html">Modals</a></li>
<li><a href="icheck_toggle_pagination.html">iCheck, Toggle, Pagination</a></li>
<li><a href="labels-badges-alerts.html">Labels, Badges, Alerts</a></li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-gear"></i>
<span>settings</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="gsetting.html">Genaral settings</a></li>
<li><a href="stfsetting.html">Staff settings</a></li>
<li><a href="emailsetting.html">Email settings</a></li>
<li><a href="paysetting.html">Payment</a></li>
</ul>
</li>
<li>
<a href="company.html">
<i class="fa fa-home"></i> <span>Companies</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li>
<a href="holiday.html">
<i class="fa fa-stop-circle"></i> <span>Public Holiday</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li>
<a href="user.html">
<i class="fa fa-user-circle"></i><span>User</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li>
<a href="items.html">
<i class="fa fa-file-o"></i><span>Items</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li>
<a href="department.html">
<i class="fa fa-tree"></i><span>Departments</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li>
<a href="document.html">
<i class="fa fa-file-text"></i> <span>Documents</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li>
<a href="train.html">
<i class="fa fa-clock-o"></i><span>Training</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li>
<a href="calender.html">
<i class="fa fa-calendar"></i> <span>Calender</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li>
<a href="notice.html">
<i class="fa fa-file-text"></i> <span>Notice Board</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li>
<a href="message.html">
<i class="fa fa-envelope-o"></i> <span>Message</span>
<span class="pull-right-container">
</span>
</a>
</li>
<li>
<a href="note.html">
<i class="fa fa-comment"></i> <span>Notes</span>
<span class="pull-right-container">
</span>
</a>
</li>
</ul>
</div>
<!-- /.sidebar -->
</aside>
<!-- =============================================== -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-sm-12">
<div class="mailbox">
<div class="mailbox-header">
<div class="row">
<div class="col-xs-4">
<div class="inbox-avatar">
<i class="fa fa-user-circle fa-lg"></i>
<div class="inbox-avatar-text hidden-xs hidden-sm">
<div class="avatar-name">Alrazy</div>
<div><small>Messages</small></div>
</div>
</div>
</div>
<div class="col-xs-8">
<div class="inbox-toolbar btn-toolbar">
<div class="btn-group">
<a href="compose.html" class="btn btn-add"><span class="fa fa-pencil-square-o"></span></a>
</div>
<div class="btn-group">
<a href="" class="btn btn-default"><span class="fa fa-reply"></span></a>
<a href="" class="hidden-xs hidden-sm btn btn-default"><span class="fa fa-reply-all"></span></a>
<a href="" class="btn btn-default"><span class="fa fa-share"></span></a>
</div>
<div class="hidden-xs hidden-sm btn-group">
<button type="button" class="text-center btn btn-danger"><span class="fa fa-exclamation"></span></button>
<button type="button" class="btn btn-danger"><span class="fa fa-trash"></span></button>
</div>
</div>
</div>
</div>
</div>
<div class="mailbox-body">
<div class="row m-0">
<div class="col-sm-3 p-0 inbox-nav hidden-xs hidden-sm">
<div class="mailbox-sideber">
<div class="profile-usermenu">
<h6>Messages box</h6>
<ul class="nav">
<li class="active"><a href="#"><i class="fa fa-inbox"></i>Inbox <small class="label pull-right bg-green">61</small></a></li>
<li><a href="#"><i class="fa fa-envelope-o"></i>Send Mail</a></li>
<li><a href="#"><i class="fa fa-star-o"></i>Starred</a></li>
<li><a href="#"><i class="fa fa-trash-o"></i>Tresh </a></li>
<li><a href="#"><i class="fa fa-paperclip"></i>Attachments</a></li>
</ul>
<hr>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-9 p-0 inbox-mail">
<div class="mailbox-content">
<a href="mailDetails.html" class="inbox_item unread">
<div class="inbox-avatar">
<img src="assets/dist/img/avatar.png" class="border-green hidden-xs hidden-sm" alt="">
<div class="inbox-avatar-text">
<div class="avatar-name">Naeem Khan (3)</div>
<div><small><span class="bg-green badge avatar-text">SOME LABEL</span><span><strong>Early access: </strong><span> Lorem Ipsum is simply dummy text of the printing and typesetting industry.</span></span></small></div>
</div>
<div class="inbox-date hidden-sm hidden-xs hidden-md">
<div class="date">Jan 17th</div>
<div><small>#1</small></div>
</div>
</div>
</a>
<a href="mailDetails.html" class="inbox_item">
<div class="inbox-avatar">
<img src="assets/dist/img/avatar2.png" class="border-red hidden-xs hidden-sm" alt="">
<div class="inbox-avatar-text">
<div class="avatar-name">Tuhin Sarker</div>
<div><small><span class="bg-red badge avatar-text">SOME LABEL</span><span><strong>Early access: </strong><span>It is a long established fact that a reader will be distracted by the </span></span></small></div>
</div>
<div class="inbox-date hidden-sm hidden-xs hidden-md">
<div class="date">Jan 17th</div>
<div><small>#2</small></div>
</div>
</div>
</a>
<a href="mailDetails.html" class="inbox_item unread">
<div class="inbox-avatar">
<img src="assets/dist/img/avatar3.png" class="border-violet hidden-xs hidden-sm" alt="">
<div class="inbox-avatar-text">
<div class="avatar-name">Tanjil Ahmed (6)</div>
<div><small><span class="bg-violet badge avatar-text">SOME LABEL</span><span><strong>Early access: </strong><span>Contrary to popular belief, Lorem Ipsum is not simply random text.</span></span></small></div>
</div>
<div class="inbox-date hidden-sm hidden-xs hidden-md">
<div class="date">Jan 17th</div>
<div><small>#3</small></div>
</div>
</div>
</a>
<a href="mailDetails.html" class="inbox_item unread">
<div class="inbox-avatar">
<img src="assets/dist/img/avatar4.png" class="border-gray hidden-xs hidden-sm" alt="">
<div class="inbox-avatar-text">
<div class="avatar-name">Jahangir Alam (2)</div>
<div><small><span class="bg-gray badge avatar-text">SOME LABEL</span><span><strong>Early access: </strong><span>There are many variations of passages of Lorem Ipsum available, </span></span></small></div>
</div>
<div class="inbox-date hidden-sm hidden-xs hidden-md">
<div class="date">Jan 17th</div>
<div><small>#4</small></div>
</div>
</div>
</a>
<a href="mailDetails.html" class="inbox_item">
<div class="inbox-avatar">
<img src="assets/dist/img/avatar5.png" class="border-yellow hidden-xs hidden-sm" alt="">
<div class="inbox-avatar-text">
<div class="avatar-name">Mozammel Hoque</div>
<div><small><span class="bg-yellow badge avatar-text">SOME LABEL</span><span><strong>Early access: </strong><span>Lorem Ipsum has been the industry's standard dummy text .</span></span></small></div>
</div>
<div class="inbox-date hidden-sm hidden-xs hidden-md">
<div class="date">Jan 17th</div>
<div><small>#5</small></div>
</div>
</div>
</a>
<a href="mailDetails.html" class="inbox_item">
<div class="inbox-avatar">
<img src="assets/dist/img/avatar.png" class="border-green hidden-xs hidden-sm" alt="">
<div class="inbox-avatar-text">
<div class="avatar-name">Slaah Uddin</div>
<div><small><span class="bg-green badge avatar-text">SOME LABEL</span><span><strong>Early access: </strong><span>The point of using Lorem Ipsum is that it has ....</span></span></small></div>
</div>
<div class="inbox-date hidden-sm hidden-xs hidden-md">
<div class="date">Jan 17th</div>
<div><small>#6</small></div>
</div>
</div>
</a>
<a href="mailDetails.html" class="inbox_item">
<div class="inbox-avatar">
<img src="assets/dist/img/avatar2.png" class="border-red hidden-xs hidden-sm" alt="">
<div class="inbox-avatar-text">
<div class="avatar-name">Tahmina Akther</div>
<div><small><span class="bg-red badge avatar-text">SOME LABEL</span><span><strong>Early access: </strong><span>Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia,</span></span></small></div>
</div>
<div class="inbox-date hidden-sm hidden-xs hidden-md">
<div class="date">Jan 17th</div>
<div><small>#7</small></div>
</div>
</div>
</a>
<a href="mailDetails.html" class="inbox_item">
<div class="inbox-avatar">
<img src="assets/dist/img/avatar3.png" class="border-violet hidden-xs hidden-sm" alt="">
<div class="inbox-avatar-text">
<div class="avatar-name">Jordyn Ouellet</div>
<div><small><span class="bg-violet badge avatar-text">SOME LABEL</span><span><strong>Early access: </strong><span>Quam nulla porttitor massa id neque aliquam vestibulum morbi blandit.</span></span></small></div>
</div>
<div class="inbox-date hidden-sm hidden-xs hidden-md">
<div class="date">Jan 17th</div>
<div><small>#8</small></div>
</div>
</div>
</a>
<a href="mailDetails.html" class="inbox_item">
<div class="inbox-avatar">
<img src="assets/dist/img/avatar4.png" class="border-gray hidden-xs hidden-sm" alt="">
<div class="inbox-avatar-text">
<div class="avatar-name">Facebook</div>
<div><small><span class="bg-gray badge avatar-text">SOME LABEL</span><span>Quam nulla porttitor massa id neque aliquam vestibulum morbi blandit.</span></small></div>
</div>
<div class="inbox-date hidden-sm hidden-xs hidden-md">
<div class="date">Jan 17th</div>
<div><small>#9</small></div>
</div>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
<strong>Copyright © 2016-2017 <a href="#">thememinister</a>.</strong> All rights reserved.
</footer>
</div>
<!-- ./wrapper -->
<!-- Start Core Plugins
=====================================================================-->
<!-- jQuery -->
<script src="assets/plugins/jQuery/jquery-1.12.4.min.js" type="text/javascript"></script>
<!-- jquery-ui -->
<script src="assets/plugins/jquery-ui-1.12.1/jquery-ui.min.js" type="text/javascript"></script>
<!-- Bootstrap -->
<script src="assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<!-- lobipanel -->
<script src="assets/plugins/lobipanel/lobipanel.min.js" type="text/javascript"></script>
<!-- Pace js -->
<script src="assets/plugins/pace/pace.min.js" type="text/javascript"></script>
<!-- SlimScroll -->
<script src="assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<!-- FastClick -->
<script src="assets/plugins/fastclick/fastclick.min.js" type="text/javascript"></script>
<!-- CRMadmin frame -->
<script src="assets/dist/js/custom.js" type="text/javascript"></script>
<!-- End Core Plugins
=====================================================================-->
<!-- Start Theme label Script
=====================================================================-->
<!-- Dashboard js -->
<script src="assets/dist/js/dashboard.js" type="text/javascript"></script>
<!-- End Theme label Script
=====================================================================-->
</body>
</html>
| ju3tin/phirstcv | crmadmin/message.html | HTML | mit | 51,405 |
/* Game namespace */
var game = {
// an object where to store game information
data : {
// score
score : 0,
enemyBaseHealth: 1,
playerBaseHealth: 1,
enemyCreepHealth: 2,
playerHealth: 10,
enemyCreepAttack: 1,
playerAttack: 1,
// orcBaseDamage: 10,
// orcBaseHealth: 100,
// orcBaseSpeed: 3,
// orcBaseDefense: 0,
playerAttackTimer: 1000,
creepAttackTimer: 1000,
playerMoveSpeed: 5,
creepMoveSpeed: 5,
gameTimerManager: "",
heroDeathManager:"",
player: "",
exp: 0,
gold: 0,
ability1: 0,
ability2: 0,
ability3: 0,
skill1: 0,
skill2: 0,
skill33: 0,
exp1: 0,
exp2: 0,
exp3: 0,
exp4: 0,
win: "",
pausePos:"",
buyscreen:"",
buytext:""
},
// Run on page load.
"onload" : function () {
// Initialize the video.
if (!me.video.init("screen", me.video.CANVAS, 1067, 600, true, '1.0')) {
alert("Your browser does not support HTML5 canvas.");
return;
}
// add "#debug" to the URL to enable the debug Panel
if (document.location.hash === "#debug") {
window.onReady(function () {
me.plugin.register.defer(this, debugPanel, "debug");
});
}
me.state.SPENDEXP = 112;
me.state.LOAD = 113;
me.state.NEW = 114;
// Initialize the audio.
me.audio.init("mp3,ogg");
// Set a callback to run when loading is complete.
me.loader.onload = this.loaded.bind(this);
// Load the resources.
me.loader.preload(game.resources);
// Initialize melonJS and display a loading screen.
me.state.change(me.state.LOADING);
},
// Run on game resources loaded.
// this code makes sure it appears on the screen//
"loaded" : function () {
me.pool.register("player", game.PlayerEntity,true);
me.pool.register("PlayerBase", game.PlayerBaseEntity);
me.pool.register("EnemyBase", game.EnemyBaseEntity);
me.pool.register("EnemyCreep", game.EnemyCreep, true);
me.pool.register("GameTimerManager", game.GameTimerManager);
me.pool.register("HeroDeathManager", game.HeroDeathManager);
me.pool.register("ExperienceManager", game.ExperienceManager);
me.pool.register("SpendGold", game.SpendGold);
me.state.set(me.state.MENU, new game.TitleScreen());
me.state.set(me.state.PLAY, new game.PlayScreen());
me.state.set(me.state.SPENDEXP, new game.spendExp());
me.state.set(me.state.LOAD, new game.LoadProfile());
me.state.set(me.state.NEW, new game.NewProfile());
// Start the game.
me.state.change(me.state.MENU);
}
};
| 1lazarus/lazarusawesomenauts | js/game.js | JavaScript | mit | 3,115 |
/*
* Copyright (c) (2016) Starlis LLC / Daniel Ennis (Aikar)
*
* http://aikar.co
* http://starlis.com
*
* @license MIT
*
*/
#discord a, #discord a:visited, #discord a:default, #discord a:focus {
color: #8D7625 !important;
}
.color-main-chat { color: #a6e4fc !important; }
.color-beam { color: #ff9966 !important; }
.color-livecoding { color: #83bbff !important; }
.color-hitbox { color: #00ff66 !important; }
.color-twitch { color: #cc0099 !important; }
.color-discord { color: #cc6032 !important; }
.color-IRC, .color-irc { color: #619121 !important; }
.color-0 { color: #009935 !important; }
.color-1 { color: #999999 !important; }
.color-2 { color: #cccc99 !important; }
.color-3 { color: #ebe9d9 !important; }
.color-4 { color: #0066cc !important; }
.color-5 { color: #d0ddee !important; }
.color-6 { color: #f9cede !important; }
.color-7 { color: #dec1c2 !important; }
.color-8 { color: #ffcc99 !important; }
.color-9 { color: #97d6dc !important; }
.color-10 { color: #3399cc !important; }
.color-11 { color: #99cc99 !important; }
.color-12 { color: #33ffcc !important; }
.color-13 { color: #99ffcc !important; }
.color-14 { color: #99ccff !important; }
.color-15 { color: #ed8344 !important; }
.color-16 { color: #ff99ff !important; }
#song {
background-color: #619121;
}
| aikar/streamchat | public/colors_flipped.css | CSS | mit | 1,299 |
require 'rails_helper'
RSpec.describe CourtObservers::StoriesController, type: :request do
let!(:court_observer) { create :court_observer }
before { signin_court_observer(court_observer) }
describe '#index root_path' do
subject! { get '/observer' }
it { expect(response).to be_success }
end
describe '#show' do
let!(:story) { create :story }
context 'story not found' do
subject! { get '/observer/stories/123213' }
it { expect(response).to be_redirect }
end
context 'no score record' do
subject! { get "/observer/stories/#{story.id}" }
it { expect(response).to be_redirect }
end
context 'success' do
let!(:schedule_score) { create :schedule_score, schedule_rater: court_observer, story: story }
subject! { get "/observer/stories/#{story.id}" }
it { expect(response).to be_success }
end
context 'story without schedule' do
let!(:schedule_score) { create :schedule_score, schedule_rater: court_observer, story: story, data: { start_on: '2016-09-13' } }
subject! { get "/observer/stories/#{story.id}" }
it { expect(response.body).to match('2016-09-13') }
end
end
end
| JRF-tw/sunshine.jrf.org.tw | spec/requests/court_observers/stories_controller_spec.rb | Ruby | mit | 1,187 |
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Damien P. George
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <stdio.h>
#include "py/runtime.h"
#include "py/gc.h"
#include "py/mpthread.h"
#include "gccollect.h"
#if MICROPY_PY_THREAD
// the mutex controls access to the linked list
STATIC mp_thread_mutex_t thread_mutex;
void mp_thread_init(void) {
mp_thread_mutex_init(&thread_mutex);
mp_thread_set_state(&mp_state_ctx.thread);
}
void mp_thread_gc_others(void) {
mp_thread_mutex_lock(&thread_mutex, 1);
for (pyb_thread_t *th = pyb_thread_all; th != NULL; th = th->all_next) {
gc_collect_root((void **)&th, 1);
gc_collect_root(&th->arg, 1);
gc_collect_root(&th->stack, 1);
if (th != pyb_thread_cur) {
gc_collect_root(th->stack, th->stack_len);
}
}
mp_thread_mutex_unlock(&thread_mutex);
}
void mp_thread_create(void *(*entry)(void *), void *arg, size_t *stack_size) {
if (*stack_size == 0) {
*stack_size = 4096; // default stack size
} else if (*stack_size < 2048) {
*stack_size = 2048; // minimum stack size
}
// round stack size to a multiple of the word size
size_t stack_len = *stack_size / sizeof(uint32_t);
*stack_size = stack_len * sizeof(uint32_t);
// allocate stack and linked-list node (must be done outside thread_mutex lock)
uint32_t *stack = m_new(uint32_t, stack_len);
pyb_thread_t *th = m_new_obj(pyb_thread_t);
mp_thread_mutex_lock(&thread_mutex, 1);
// create thread
uint32_t id = pyb_thread_new(th, stack, stack_len, entry, arg);
if (id == 0) {
mp_thread_mutex_unlock(&thread_mutex);
mp_raise_msg(&mp_type_OSError, "can't create thread");
}
mp_thread_mutex_unlock(&thread_mutex);
// adjust stack_size to provide room to recover from hitting the limit
*stack_size -= 1024;
}
void mp_thread_start(void) {
}
void mp_thread_finish(void) {
}
#endif // MICROPY_PY_THREAD
| pozetroninc/micropython | ports/stm32/mpthreadport.c | C | mit | 3,098 |
@font-face {
font-family: 'FiraMono';
src: url('fonts/FiraMono/FiraMono-Regular.eot');
src: url('fonts/FiraMono/FiraMono-Regular.eot?#iefix') format('embedded-opentype'),
url('fonts/FiraMono/FiraMono-Regular.woff') format('woff'),
url('fonts/FiraMono/FiraMono-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'FiraMono';
src: url('fonts/FiraMono/FiraMono-Bold.eot');
src: url('fonts/FiraMono/FiraMono-Bold.eot?#iefix') format('embedded-opentype'),
url('fonts/FiraMono/FiraMono-Bold.woff') format('woff'),
url('fonts/FiraMono/FiraMono-Bold.ttf') format('truetype');
font-weight: bold;
font-style: normal;
} | metal347/Cronometro | style/fontsMono.css | CSS | mit | 707 |
<?php
/**
* CLx Bootstrap
*
* @package CLx
* @author ScarWu
* @copyright Copyright (c) 2012-2013, ScarWu (http://scar.simcz.tw/)
* @license http://opensource.org/licenses/MIT Open Source Initiative OSI - The MIT License (MIT):Licensing
* @link http://github.com/scarwu/CLx
*/
/**
* Switch Mode
*/
if('development' === CLX_MODE || 'test' === CLX_MODE) {
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
}
else
error_reporting(0);
/**
* Require CLx Config
*/
require_once CLX_SYS_ROOT . 'Config.php';
/**
* Require CLx Autoload
*/
require_once CLX_SYS_ROOT . 'Core/Autoload.php';
// Register Autoload
\CLx\Core\Autoload::register();
/**
* Require Route Config, Setting Router and Run
*/
// Init Router
$router = new \CLx\Core\Router($_SERVER['REQUEST_METHOD'], \CLx\Core\Request::uri());
// Add Route List
$router->addList(\CLx\Core\Loader::config('Route'));
// Run Router
$router->run();
| scarwu/CLx | CLx.php | PHP | mit | 975 |
---
title: "Narrativas: O poder de uma boa história"
name: "narrativas"
date: "2015-04-22 15:16:00"
category: "blog"
layout: "post"
permalink: "/blog/narrativas"
img: "2015-04-22-narrativas/livro.jpg"
subtitle: "Como funcionam as narrativas para a comunicação"
author: "42i"
thumb: "2015-04-22-narrativas/livro-thumb.jpg"
---
<span class="dropcap">N</span>arrativas são formas de contar histórias. Na publicidade, e recentemente nas redes sociais, elas são o ponto-chave para vender um produto, ao causar empatia no consumidor e tratar aquela história como dele também. O termo possui um similar em inglês, <em>“storytelling”</em>, que está relacionado com a narrativa e sua capacidade de contar histórias relevantes. Mas como as narrativas funcionam, exatamente?
A narrativa faz uso de palavras ou recursos audiovisuais para transmitir um conteúdo, e na publicidade e no marketing ela tem como principal função promover uma marca sem fazer a venda diretamente.
Uma forma de compartilhar conhecimento, a arte de contar histórias aproxima as pessoas da empresa e nisso pode ser aplicada para vender produtos, serviços ou ideias. Estabelecemos ligações interpessoais através de uma narrativa. Convivendo diariamente sendo bombardeados com excesso de informação, cativar um potencial cliente com uma história pode ser uma alternativa para quebrar a habitual defesa que as pessoas têm com abordagens tradicionais e abertamente comerciais.
Ou seja, contar uma história pode ser melhor do que simplesmente jogar um produto diante do cliente e esperar que ele compre. Uma boa história acaba por revelar o benefício que a marca trouxe para a vida do consumidor, o que cria uma aproximação entre cliente e empresa.
Tudo isso para dizer que as pessoas na sua narrativa precisam querer algo. A história não começa até que se saiba claramente qual é o objetivo do protagonista, pois é com isso que audiência deve se importar. Isso nos leva a outro ponto: narrativas falam a linguagem da audiência. Ao contar uma história, sempre leve em consideração que você precisa se comunicar com seu público, e para isso não deve usar uma linguagem que não esteja ao alcance dele.
Narrativas ativam emoções e não apenas contam, elas mostram. É preciso mostrar um retrato, uma motivação e fazer o público sentir a história e assim se envolver com a marca que ela representa.
Ter isso em mente na hora de começar a construir um <em>storytelling</em> para a sua marca é fundamental.
| 42ipd/42ipd.github.io | _posts/pt-br/blog/2015-04-22-narrativas.md | Markdown | mit | 2,520 |
<?php
namespace Laranix\Auth\User\Token;
use Laranix\Auth\User\User;
use Laranix\Support\Database\Model;
abstract class Token extends Model
{
const TOKEN_VALID = 1;
const TOKEN_INVALID = 2;
const TOKEN_EXPIRED = 3;
/**
* @var string
*/
protected $primaryKey = 'user_id';
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['token'];
/**
* Whether token is valid or not
*
* @var int
*/
public $tokenStatus = self::TOKEN_INVALID;
/**
* Get user assigned to email verification model
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function user()
{
return $this->belongsTo(User::class);
}
/**
* Get token status
*
* @return int
*/
public function getStatusAttribute() : int
{
return $this->tokenStatus;
}
}
| samanix/laranix | src/Laranix/Auth/User/Token/Token.php | PHP | mit | 1,071 |
#!/usr/bin/env bash
# be structured bashrc
cat << '__EOF__' >> /etc/skel/.bashrc
if [ -d $HOME/.bashrc.d ]; then
for i in $HOME/.bashrc.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
__EOF__
cp /etc/skel/.bashrc $HOME/.bashrc
chown $SUDO_USER:$(groups $SUDO_USER | cut -d " " -f 3) $HOME/.bashrc
| cock1doodledoo/packer-box | scripts/base.sh | Shell | mit | 325 |
'use strict';
/**
* @ngdoc module
* @name ngRoute
* @description
*
* # ngRoute
*
* The `ngRoute` module provides routing and deeplinking services and directives for angular apps.
*
* ## Example
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
*
*
* <div doc-module-components="ngRoute"></div>
*/
/* global -ngRouteModule */
var ngRouteModule = angular.module('ngRoute', ['ng']).
provider('$route', $RouteProvider),
$routeMinErr = angular.$$minErr('ngRoute');
/**
* @ngdoc provider
* @name $routeProvider
*
* @description
*
* Used for configuring routes.
*
* ## Example
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
*
* ## Dependencies
* Requires the {@link ngRoute `ngRoute`} module to be installed.
*/
function $RouteProvider() {
function inherit(parent, extra) {
return angular.extend(Object.create(parent), extra);
}
var routes = {};
/**
* @ngdoc method
* @name $routeProvider#when
*
* @param {string} path Route path (matched against `$location.path`). If `$location.path`
* contains redundant trailing slash or is missing one, the route will still match and the
* `$location.path` will be updated to add or drop the trailing slash to exactly match the
* route definition.
*
* * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up
* to the next slash are matched and stored in `$routeParams` under the given `name`
* when the route matches.
* * `path` can contain named groups starting with a colon and ending with a star:
* e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name`
* when the route matches.
* * `path` can contain optional named groups with a question mark: e.g.`:name?`.
*
* For example, routes like `/color/:color/largecode/:largecode*\/edit` will match
* `/color/brown/largecode/code/with/slashes/edit` and extract:
*
* * `color: brown`
* * `largecode: code/with/slashes`.
*
*
* @param {Object} route Mapping information to be assigned to `$route.current` on route
* match.
*
* Object properties:
*
* - `controller` `{(string|function()=}` Controller fn that should be associated with
* newly created scope or the name of a {@link angular.Module#controller registered
* controller} if passed as a string.
* - `controllerAs` `{string=}` An identifier name for a reference to the controller.
* If present, the controller will be published to scope under the `controllerAs` name.
* - `template` `{string=|function()=}` html template as a string or a function that
* returns an html template as a string which should be used by {@link
* ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.
* This property takes precedence over `templateUrl`.
*
* If `template` is a function, it will be called with the following parameters:
*
* - `{Array.<Object>}` - route parameters extracted from the current
* `$location.path()` by applying the current route
*
* - `templateUrl` `{string=|function()=}` path or function that returns a path to an html
* template that should be used by {@link ngRoute.directive:ngView ngView}.
*
* If `templateUrl` is a function, it will be called with the following parameters:
*
* - `{Array.<Object>}` - route parameters extracted from the current
* `$location.path()` by applying the current route
*
* - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should
* be injected into the controller. If any of these dependencies are promises, the router
* will wait for them all to be resolved or one to be rejected before the controller is
* instantiated.
* If all the promises are resolved successfully, the values of the resolved promises are
* injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is
* fired. If any of the promises are rejected the
* {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. The map object
* is:
*
* - `key` `{string}`: a name of a dependency to be injected into the controller.
* - `factory` - `{string|function}`: If `string` then it is an alias for a service.
* Otherwise if function, then it is {@link auto.$injector#invoke injected}
* and the return value is treated as the dependency. If the result is a promise, it is
* resolved before its value is injected into the controller. Be aware that
* `ngRoute.$routeParams` will still refer to the previous route within these resolve
* functions. Use `$route.current.params` to access the new route parameters, instead.
*
* - `redirectTo` {(string|function())=} value to update
* {@link ng.$location $location} path with and trigger route redirection.
*
* If `redirectTo` is a function, it will be called with the following parameters:
*
* - `{Object.<string>}` - route parameters extracted from the current
* `$location.path()` by applying the current route templateUrl.
* - `{string}` - current `$location.path()`
* - `{Object}` - current `$location.search()`
*
* The custom `redirectTo` function is expected to return a string which will be used
* to update `$location.path()` and `$location.search()`.
*
* - `[reloadOnSearch=true]` - {boolean=} - reload route when only `$location.search()`
* or `$location.hash()` changes.
*
* If the option is set to `false` and url in the browser changes, then
* `$routeUpdate` event is broadcasted on the root scope.
*
* - `[caseInsensitiveMatch=false]` - {boolean=} - match routes without being case sensitive
*
* If the option is set to `true`, then the particular route can be matched without being
* case sensitive
*
* @returns {Object} self
*
* @description
* Adds a new route definition to the `$route` service.
*/
this.when = function (path, route) {
//copy original route object to preserve params inherited from proto chain
var routeCopy = angular.copy(route);
if (angular.isUndefined(routeCopy.reloadOnSearch)) {
routeCopy.reloadOnSearch = true;
}
if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) {
routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch;
}
routes[path] = angular.extend(
routeCopy,
path && pathRegExp(path, routeCopy)
);
// create redirection for trailing slashes
if (path) {
var redirectPath = (path[path.length - 1] == '/')
? path.substr(0, path.length - 1)
: path + '/';
routes[redirectPath] = angular.extend(
{ redirectTo: path },
pathRegExp(redirectPath, routeCopy)
);
}
return this;
};
/**
* @ngdoc property
* @name $routeProvider#caseInsensitiveMatch
* @description
*
* A boolean property indicating if routes defined
* using this provider should be matched using a case insensitive
* algorithm. Defaults to `false`.
*/
this.caseInsensitiveMatch = false;
/**
* @param path {string} path
* @param opts {Object} options
* @return {?Object}
*
* @description
* Normalizes the given path, returning a regular expression
* and the original path.
*
* Inspired by pathRexp in visionmedia/express/lib/utils.js.
*/
function pathRegExp(path, opts) {
var insensitive = opts.caseInsensitiveMatch,
ret = {
originalPath: path,
regexp: path
},
keys = ret.keys = [];
path = path
.replace(/([().])/g, '\\$1')
.replace(/(\/)?:(\w+)([\?\*])?/g, function (_, slash, key, option) {
var optional = option === '?' ? option : null;
var star = option === '*' ? option : null;
keys.push({ name: key, optional: !!optional });
slash = slash || '';
return ''
+ (optional ? '' : slash)
+ '(?:'
+ (optional ? slash : '')
+ (star && '(.+?)' || '([^/]+)')
+ (optional || '')
+ ')'
+ (optional || '');
})
.replace(/([\/$\*])/g, '\\$1');
ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
return ret;
}
/**
* @ngdoc method
* @name $routeProvider#otherwise
*
* @description
* Sets route definition that will be used on route change when no other route definition
* is matched.
*
* @param {Object|string} params Mapping information to be assigned to `$route.current`.
* If called with a string, the value maps to `redirectTo`.
* @returns {Object} self
*/
this.otherwise = function (params) {
if (typeof params === 'string') {
params = { redirectTo: params };
}
this.when(null, params);
return this;
};
this.$get = ['$rootScope',
'$location',
'$routeParams',
'$q',
'$injector',
'$templateRequest',
'$sce',
function ($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce) {
/**
* @ngdoc service
* @name $route
* @requires $location
* @requires $routeParams
*
* @property {Object} current Reference to the current route definition.
* The route definition contains:
*
* - `controller`: The controller constructor as define in route definition.
* - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for
* controller instantiation. The `locals` contain
* the resolved values of the `resolve` map. Additionally the `locals` also contain:
*
* - `$scope` - The current route scope.
* - `$template` - The current route template HTML.
*
* @property {Object} routes Object with all route configuration Objects as its properties.
*
* @description
* `$route` is used for deep-linking URLs to controllers and views (HTML partials).
* It watches `$location.url()` and tries to map the path to an existing route definition.
*
* Requires the {@link ngRoute `ngRoute`} module to be installed.
*
* You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.
*
* The `$route` service is typically used in conjunction with the
* {@link ngRoute.directive:ngView `ngView`} directive and the
* {@link ngRoute.$routeParams `$routeParams`} service.
*
* @example
* This example shows how changing the URL hash causes the `$route` to match a route against the
* URL, and the `ngView` pulls in the partial.
*
* <example name="$route-service" module="ngRouteExample"
* deps="angular-route.js" fixBase="true">
* <file name="index.html">
* <div ng-controller="MainController">
* Choose:
* <a href="Book/Moby">Moby</a> |
* <a href="Book/Moby/ch/1">Moby: Ch1</a> |
* <a href="Book/Gatsby">Gatsby</a> |
* <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
* <a href="Book/Scarlet">Scarlet Letter</a><br/>
*
* <div ng-view></div>
*
* <hr />
*
* <pre>$location.path() = {{$location.path()}}</pre>
* <pre>$route.current.templateUrl = {{$route.current.templateUrl}}</pre>
* <pre>$route.current.params = {{$route.current.params}}</pre>
* <pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
* <pre>$routeParams = {{$routeParams}}</pre>
* </div>
* </file>
*
* <file name="book.html">
* controller: {{name}}<br />
* Book Id: {{params.bookId}}<br />
* </file>
*
* <file name="chapter.html">
* controller: {{name}}<br />
* Book Id: {{params.bookId}}<br />
* Chapter Id: {{params.chapterId}}
* </file>
*
* <file name="script.js">
* angular.module('ngRouteExample', ['ngRoute'])
*
* .controller('MainController', function($scope, $route, $routeParams, $location) {
* $scope.$route = $route;
* $scope.$location = $location;
* $scope.$routeParams = $routeParams;
* })
*
* .controller('BookController', function($scope, $routeParams) {
* $scope.name = "BookController";
* $scope.params = $routeParams;
* })
*
* .controller('ChapterController', function($scope, $routeParams) {
* $scope.name = "ChapterController";
* $scope.params = $routeParams;
* })
*
* .config(function($routeProvider, $locationProvider) {
* $routeProvider
* .when('/Book/:bookId', {
* templateUrl: 'book.html',
* controller: 'BookController',
* resolve: {
* // I will cause a 1 second delay
* delay: function($q, $timeout) {
* var delay = $q.defer();
* $timeout(delay.resolve, 1000);
* return delay.promise;
* }
* }
* })
* .when('/Book/:bookId/ch/:chapterId', {
* templateUrl: 'chapter.html',
* controller: 'ChapterController'
* });
*
* // configure html5 to get links working on jsfiddle
* $locationProvider.html5Mode(true);
* });
*
* </file>
*
* <file name="protractor.js" type="protractor">
* it('should load and compile correct template', function() {
* element(by.linkText('Moby: Ch1')).click();
* var content = element(by.css('[ng-view]')).getText();
* expect(content).toMatch(/controller\: ChapterController/);
* expect(content).toMatch(/Book Id\: Moby/);
* expect(content).toMatch(/Chapter Id\: 1/);
*
* element(by.partialLinkText('Scarlet')).click();
*
* content = element(by.css('[ng-view]')).getText();
* expect(content).toMatch(/controller\: BookController/);
* expect(content).toMatch(/Book Id\: Scarlet/);
* });
* </file>
* </example>
*/
/**
* @ngdoc event
* @name $route#$routeChangeStart
* @eventType broadcast on root scope
* @description
* Broadcasted before a route change. At this point the route services starts
* resolving all of the dependencies needed for the route change to occur.
* Typically this involves fetching the view template as well as any dependencies
* defined in `resolve` route property. Once all of the dependencies are resolved
* `$routeChangeSuccess` is fired.
*
* The route change (and the `$location` change that triggered it) can be prevented
* by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on}
* for more details about event object.
*
* @param {Object} angularEvent Synthetic event object.
* @param {Route} next Future route information.
* @param {Route} current Current route information.
*/
/**
* @ngdoc event
* @name $route#$routeChangeSuccess
* @eventType broadcast on root scope
* @description
* Broadcasted after a route change has happened successfully.
* The `resolve` dependencies are now available in the `current.locals` property.
*
* {@link ngRoute.directive:ngView ngView} listens for the directive
* to instantiate the controller and render the view.
*
* @param {Object} angularEvent Synthetic event object.
* @param {Route} current Current route information.
* @param {Route|Undefined} previous Previous route information, or undefined if current is
* first route entered.
*/
/**
* @ngdoc event
* @name $route#$routeChangeError
* @eventType broadcast on root scope
* @description
* Broadcasted if any of the resolve promises are rejected.
*
* @param {Object} angularEvent Synthetic event object
* @param {Route} current Current route information.
* @param {Route} previous Previous route information.
* @param {Route} rejection Rejection of the promise. Usually the error of the failed promise.
*/
/**
* @ngdoc event
* @name $route#$routeUpdate
* @eventType broadcast on root scope
* @description
* The `reloadOnSearch` property has been set to false, and we are reusing the same
* instance of the Controller.
*
* @param {Object} angularEvent Synthetic event object
* @param {Route} current Current/previous route information.
*/
var forceReload = false,
preparedRoute,
preparedRouteIsUpdateOnly,
$route = {
routes: routes,
/**
* @ngdoc method
* @name $route#reload
*
* @description
* Causes `$route` service to reload the current route even if
* {@link ng.$location $location} hasn't changed.
*
* As a result of that, {@link ngRoute.directive:ngView ngView}
* creates new scope and reinstantiates the controller.
*/
reload: function () {
forceReload = true;
$rootScope.$evalAsync(function () {
// Don't support cancellation of a reload for now...
prepareRoute();
commitRoute();
});
},
/**
* @ngdoc method
* @name $route#updateParams
*
* @description
* Causes `$route` service to update the current URL, replacing
* current route parameters with those specified in `newParams`.
* Provided property names that match the route's path segment
* definitions will be interpolated into the location's path, while
* remaining properties will be treated as query params.
*
* @param {!Object<string, string>} newParams mapping of URL parameter names to values
*/
updateParams: function (newParams) {
if (this.current && this.current.$$route) {
newParams = angular.extend({}, this.current.params, newParams);
$location.path(interpolate(this.current.$$route.originalPath, newParams));
// interpolate modifies newParams, only query params are left
$location.search(newParams);
} else {
throw $routeMinErr('norout', 'Tried updating route when with no current route');
}
}
};
$rootScope.$on('$locationChangeStart', prepareRoute);
$rootScope.$on('$locationChangeSuccess', commitRoute);
return $route;
/////////////////////////////////////////////////////
/**
* @param on {string} current url
* @param route {Object} route regexp to match the url against
* @return {?Object}
*
* @description
* Check if the route matches the current url.
*
* Inspired by match in
* visionmedia/express/lib/router/router.js.
*/
function switchRouteMatcher(on, route) {
var keys = route.keys,
params = {};
if (!route.regexp) return null;
var m = route.regexp.exec(on);
if (!m) return null;
for (var i = 1, len = m.length; i < len; ++i) {
var key = keys[i - 1];
var val = m[i];
if (key && val) {
params[key.name] = val;
}
}
return params;
}
function prepareRoute($locationEvent) {
var lastRoute = $route.current;
preparedRoute = parseRoute();
preparedRouteIsUpdateOnly = preparedRoute && lastRoute && preparedRoute.$$route === lastRoute.$$route
&& angular.equals(preparedRoute.pathParams, lastRoute.pathParams)
&& !preparedRoute.reloadOnSearch && !forceReload;
if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) {
if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) {
if ($locationEvent) {
$locationEvent.preventDefault();
}
}
}
}
function commitRoute() {
var lastRoute = $route.current;
var nextRoute = preparedRoute;
if (preparedRouteIsUpdateOnly) {
lastRoute.params = nextRoute.params;
angular.copy(lastRoute.params, $routeParams);
$rootScope.$broadcast('$routeUpdate', lastRoute);
} else if (nextRoute || lastRoute) {
forceReload = false;
$route.current = nextRoute;
if (nextRoute) {
if (nextRoute.redirectTo) {
if (angular.isString(nextRoute.redirectTo)) {
$location.path(interpolate(nextRoute.redirectTo, nextRoute.params)).search(nextRoute.params)
.replace();
} else {
$location.url(nextRoute.redirectTo(nextRoute.pathParams, $location.path(), $location.search()))
.replace();
}
}
}
$q.when(nextRoute).
then(function () {
if (nextRoute) {
var locals = angular.extend({}, nextRoute.resolve),
template, templateUrl;
angular.forEach(locals, function (value, key) {
locals[key] = angular.isString(value) ?
$injector.get(value) : $injector.invoke(value, null, null, key);
});
if (angular.isDefined(template = nextRoute.template)) {
if (angular.isFunction(template)) {
template = template(nextRoute.params);
}
} else if (angular.isDefined(templateUrl = nextRoute.templateUrl)) {
if (angular.isFunction(templateUrl)) {
templateUrl = templateUrl(nextRoute.params);
}
if (angular.isDefined(templateUrl)) {
nextRoute.loadedTemplateUrl = $sce.valueOf(templateUrl);
template = $templateRequest(templateUrl);
}
}
if (angular.isDefined(template)) {
locals['$template'] = template;
}
return $q.all(locals);
}
}).
then(function (locals) {
// after route change
if (nextRoute == $route.current) {
if (nextRoute) {
nextRoute.locals = locals;
angular.copy(nextRoute.params, $routeParams);
}
$rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);
}
}, function (error) {
if (nextRoute == $route.current) {
$rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);
}
});
}
}
/**
* @returns {Object} the current active route, by matching it against the URL
*/
function parseRoute() {
// Match a route
var params, match;
angular.forEach(routes, function (route, path) {
if (!match && (params = switchRouteMatcher($location.path(), route))) {
match = inherit(route, {
params: angular.extend({}, $location.search(), params),
pathParams: params
});
match.$$route = route;
}
});
// No route matched; fallback to "otherwise" route
return match || routes[null] && inherit(routes[null], { params: {}, pathParams: {} });
}
/**
* @returns {string} interpolation of the redirect path with the parameters
*/
function interpolate(string, params) {
var result = [];
angular.forEach((string || '').split(':'), function (segment, i) {
if (i === 0) {
result.push(segment);
} else {
var segmentMatch = segment.match(/(\w+)(?:[?*])?(.*)/);
var key = segmentMatch[1];
result.push(params[key]);
result.push(segmentMatch[2] || '');
delete params[key];
}
});
return result.join('');
}
}];
}
| micdevcamp/NurseReport-2 | NurseReporting.Web/Scripts/angular-routes.js | JavaScript | mit | 29,059 |
import { Component, ComponentFactoryResolver } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Store } from '@ngrx/store';
import { CollectionsState, CollectionsActions } from '../store';
import { CollectionsSummaryComponent } from '../components/collections-summary.component';
@Component({
styles:[],
template: `
<sd-panels [component]="component" [panelData]="(collections | async)" [ready]="ready" [idealPanelWidth]="450">
<div class="swipeable-tabs-top-container">
<div class="swipeable-tab-container is-hoverable" *ngFor="let inputPanel of (collections | async); let i=index" (click)="tabClick.emit(i)">
<ion-item color="neutral" *ngIf="inputPanel">
<p *ngIf="onlyIcons" class="pL16">{{i}}</p>
<p *ngIf="!onlyIcons" class="pL16">{{(inputPanel.key || inputPanel._id || inputPanel) | capitalizeFirst}}</p>
</ion-item>
</div>
</div>
</sd-panels>
`
})
export class CollectionsPage {
ready: boolean = false;
component: any;
collections = this.store.select(store => (store as any).collections.collections)
.filter(collections=> collections.length > 0).take(1);
summaryReadyCount = this.store.select(store => (store as any).collections.collections)
.flatMap((colls) => { return Observable.of(colls.map(coll => coll.summary_rendered));})
.map(x=> { return x.filter(x => x).length;});
constructor(
private store: Store<CollectionsState>,
private resolver: ComponentFactoryResolver
) {
this.component = this.resolver.resolveComponentFactory<any>(CollectionsSummaryComponent);
this.store.dispatch(new CollectionsActions.StatusSwitch({code:0}));
this.ready = true;
/*
// Status switch is set to 1 here. Then child components get created via
// swipeable-panels > swipeable-panel > collections-summary.component and after each chart is rendered
// they dispatch SummaryRendered. When the count reaches the length of panels, trigger off the content panel here.
// Because of the delay in summary components (100ms) this action is also delayed here by 250ms to sync rendering.
Observable.combineLatest(this.collections, this.summaryReadyCount).subscribe(x=> {
this.store.dispatch(new CollectionsActions.StatusSwitch({code:1}));
if(x[1] >= x[0].length) {
setTimeout(() => {
this.store.dispatch(new CollectionsActions.StatusSwitch({code:0}));
this.ready = true;
}, 250);
}
});
*/
}
}
| sayarco/sayardocs | src/app/collections/pages/collections.page.ts | TypeScript | mit | 2,526 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exchange_portal', '0012_auto_20180210_1110'),
('exchange_portal', '0015_auto_20180208_1749'),
]
operations = [
]
| I-sektionen/i-portalen | wsgi/iportalen_django/exchange_portal/migrations/0016_merge.py | Python | mit | 313 |
require 'spec_helper'
describe Willow::SprocketsCompiler do
before do
@source = WillowTest.source_dir
@target = WillowTest.target_dir
@options = Willow.configure({
source: @source,
target: @target,
log_level: 'none'
})
@site = Willow::Site.new(@options)
@compiler = Willow::SprocketsCompiler.new(@site)
end
after do
WillowTest.clear_target
end
it "should have the correct assets path" do
@compiler.assets_path.must_equal File.expand_path(File.join(@source, 'assets'))
end
it "should have the correct target_path" do
@compiler.target_path.must_equal File.expand_path(File.join(@target, 'assets'))
end
it "should use cache busting by default" do
@compiler.use_cache_bust.must_equal true
end
it "should have the correct paths set on sprockets" do
@compiler.sprockets.paths.must_include File.expand_path(File.join(@source, 'assets', 'javascripts'))
@compiler.sprockets.paths.must_include File.expand_path(File.join(@source, 'assets', 'stylesheets'))
end
it "should capture the asset files" do
@compiler.asset_files.must_include File.expand_path(File.join(@source, 'assets', 'javascripts', 'application.js'))
@compiler.asset_files.must_include File.expand_path(File.join(@source, 'assets', 'stylesheets', 'application.css'))
@compiler.asset_files.wont_include File.expand_path(File.join(@source, 'assets', 'stylesheets', 'application.css.scss'))
end
it "should generate the javascript file" do
@compiler.render
rendered_js = File.expand_path(File.join(@target, 'assets', 'application.js'))
File.exists?(rendered_js).must_equal true, "Could not find javascript file"
end
it "should generate the stylesheet file" do
@compiler.render
rendered_css = File.expand_path(File.join(@target, 'assets', 'application.css'))
File.exists?(rendered_css).must_equal true, "Could not find stylesheet file"
end
it "should include the scss file contents in the application.css file" do
@compiler.render
rendered_css = File.expand_path(File.join(@target, 'assets', 'application.css'))
css = File.open(rendered_css) { |f| f.read }
css.must_include 'body .test'
css.must_include 'background: #ff3322;'
end
it "should generate files when compiling the site" do
@site.compile
rendered_js = File.expand_path(File.join(@target, 'assets', 'application.js'))
File.exists?(rendered_js).must_equal true, "Could not find javascript file"
rendered_css = File.expand_path(File.join(@target, 'assets', 'application.css'))
File.exists?(rendered_css).must_equal true, "Could not find stylesheet file"
end
end
| patrickward/willow | spec/willow/sprockets_compiler_spec.rb | Ruby | mit | 2,666 |
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ColorManagerTests")]
[assembly: AssemblyDescription("Color conversion library unit tests")]
[assembly: AssemblyProduct("ColorManagerTests")]
[assembly: AssemblyCopyright("Copyright © Johannes Bildstein 2015")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: ComVisible(false)]
| JBildstein/NCM | ColorManagerTests/Properties/AssemblyInfo.cs | C# | mit | 418 |
//
// sidebarConstants.h
// SpaceExampleOpenGL
//
// Created by Tim Jarratt on 7/28/13.
//
//
#pragma once
FOUNDATION_EXPORT const CGFloat sidebarWidth;
FOUNDATION_EXPORT const CGFloat sidebarCollapsedWidth; | tjarratt/SpaceFortress | SpaceExampleOpenGL/GLGSidebarConstants.h | C | mit | 212 |
/**
* DevExtreme (framework/action_executors.js)
* Version: 16.2.6
* Build date: Tue Mar 28 2017
*
* Copyright (c) 2012 - 2017 Developer Express Inc. ALL RIGHTS RESERVED
* EULA: https://www.devexpress.com/Support/EULAs/DevExtreme.xml
*/
"use strict";
var $ = require("jquery"),
dataCoreUtils = require("../core/utils/data"),
Route = require("./router").Route;
function prepareNavigateOptions(options, actionArguments) {
if (actionArguments.args) {
var sourceEventArguments = actionArguments.args[0];
options.jQueryEvent = sourceEventArguments.jQueryEvent
}
if ("dxCommand" === (actionArguments.component || {}).NAME) {
$.extend(options, actionArguments.component.option())
}
}
function preventDefaultLinkBehavior(e) {
if (!e) {
return
}
var $targetElement = $(e.target);
if ($targetElement.attr("href")) {
e.preventDefault()
}
}
var createActionExecutors = function(app) {
return {
routing: {
execute: function(e) {
var routeValues, uri, action = e.action,
options = {};
if ($.isPlainObject(action)) {
routeValues = action.routeValues;
if (routeValues && $.isPlainObject(routeValues)) {
options = action.options
} else {
routeValues = action
}
uri = app.router.format(routeValues);
prepareNavigateOptions(options, e);
preventDefaultLinkBehavior(options.jQueryEvent);
app.navigate(uri, options);
e.handled = true
}
}
},
hash: {
execute: function(e) {
if ("string" !== typeof e.action || "#" !== e.action.charAt(0)) {
return
}
var uriTemplate = e.action.substr(1),
args = e.args[0],
uri = uriTemplate;
var defaultEvaluate = function(expr) {
var getter = dataCoreUtils.compileGetter(expr),
model = e.args[0].model;
return getter(model)
};
var evaluate = args.evaluate || defaultEvaluate;
uri = uriTemplate.replace(/\{([^}]+)\}/g, function(entry, expr) {
expr = $.trim(expr);
if (expr.indexOf(",") > -1) {
expr = $.map(expr.split(","), $.trim)
}
var value = evaluate(expr);
if (void 0 === value) {
value = ""
}
value = Route.prototype.formatSegment(value);
return value
});
var options = {};
prepareNavigateOptions(options, e);
preventDefaultLinkBehavior(options.jQueryEvent);
app.navigate(uri, options);
e.handled = true
}
},
url: {
execute: function(e) {
if ("string" === typeof e.action && "#" !== e.action.charAt(0)) {
document.location = e.action
}
}
}
}
};
exports.createActionExecutors = createActionExecutors;
| raskolnikova/infomaps | node_modules/devextreme/framework/action_executors.js | JavaScript | mit | 3,519 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.