text
stringlengths 4
5.48M
| meta
stringlengths 14
6.54k
|
---|---|
"use strict";
const ccxt = require ('../../ccxt.js')
const asTable = require ('as-table')
const log = require ('ololog').configure ({ locate: false })
require ('ansicolor').nice;
//-----------------------------------------------------------------------------
process.on ('uncaughtException', e => { log.bright.red.error (e); process.exit (1) })
process.on ('unhandledRejection', e => { log.bright.red.error (e); process.exit (1) })
//-----------------------------------------------------------------------------
let test = async function (exchange) {
try {
await exchange.loadMarkets ()
log (exchange.id.green, 'loaded', exchange.symbols.length.toString ().bright.green, 'symbols')
} catch (e) {
if (e instanceof ccxt.DDoSProtection) {
log.bright.yellow (exchange.id, '[DDoS Protection] ' + e.message)
} else if (e instanceof ccxt.RequestTimeout) {
log.bright.yellow (exchange.id, '[Request Timeout] ' + e.message)
} else if (e instanceof ccxt.AuthenticationError) {
log.bright.yellow (exchange.id, '[Authentication Error] ' + e.message)
} else if (e instanceof ccxt.ExchangeNotAvailable) {
log.bright.yellow (exchange.id, '[Exchange Not Available] ' + e.message)
} else if (e instanceof ccxt.ExchangeError) {
log.bright.yellow (exchange.id, '[Exchange Error] ' + e.message)
} else if (e instanceof ccxt.NetworkError) {
log.bright.yellow (exchange.id, '[Network Error] ' + e.message)
} else {
throw e;
}
}
}
//-----------------------------------------------------------------------------
let exchanges = []
async function main () {
// instantiate all exchanges
await Promise.all (ccxt.exchanges.map (async id => {
let exchange = new (ccxt)[id] ()
exchanges.push (exchange)
await test (exchange)
}))
let succeeded = exchanges.filter (exchange => exchange.markets ? true : false).length.toString ().bright.green
let failed = exchanges.filter (exchange => exchange.markets ? false : true).length
let total = ccxt.exchanges.length.toString ().bright.white
console.log (succeeded, 'of', total, 'exchanges loaded', ('(' + failed + ' errors)').red)
}
main ()
| {'content_hash': '1c47285ef18d44ad37e662117a2dc1f0', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 114, 'avg_line_length': 37.38709677419355, 'alnum_prop': 0.5517687661777394, 'repo_name': 'tritoanst/ccxt', 'id': '211230bd8afd43161319af2ff17b5e09cc9b750f', 'size': '2318', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'examples/js/load-all-symbols-at-once.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '3955653'}, {'name': 'PHP', 'bytes': '783191'}, {'name': 'Python', 'bytes': '680573'}, {'name': 'Shell', 'bytes': '833'}]} |
<?php
namespace Skinny\Db;
/**
* Description of Where
* Where'y nie są świadome ani sql ani db, nie potrzebują tego. Dopiero przy przerabianiu go na string podaje się db.
*
* @author Daro
*/
class Where extends Bindable {
/**
* Wyrażenie WHERE w postaci stringu z ewentualnymi nazwanymi (?) lub nie (:param) parametrami.
* @var string
*/
protected $_expression;
/**
* Tablica wartości dla parametrów wyrażenia WHERE.
* @var array
*/
protected $_values;
/**
* Tworzy obiekt Where na podstawie podanego wyrażenia i ewentualnych parametrów.
* Możeliwe użycia:
* new Where('col=9');
* new Where('col=?', 9);
* new Where(array('col=?' => 9));
* new Where('col=:val', array('val' => 9))
* new Where('col between ? and ?', 9) // co nie ma dużego sensu, ale jest dozwolone - chyba powinno być... a może... nie...?
* new Where('col between ? and ?', 8, 9);
* new Where('col between ? and ?', array(8, 9));
* new Where('col between :val1 and :val2', array('val1' => 8, 'val2' => 9));
* new Where('col1 = : val1 and col2 between :val1 and :val2', array('val1' => 8, 'val2' => 9));
* @param string|array $expression
* @param array $values
*/
public function __construct($expression, array $values = array()) {
$args = func_get_args();
$this->_expression = array_shift($args);
if (count($args) == 1)
$this->_values = $values;
else
$this->_values = $args;
if (is_array($expression)) {
if (count($expression) !== 1)
throw new \InvalidArgumentException('Invalid expression: expected string or single element array.');
$this->_expression = key($expression);
array_unshift($this->_values, $expression[0]);
}
}
public function bind($params, $value = null) {
// TODO: binduje parametry w segmentach i wewnątrz nich (rekurencja)
}
protected function _assemble() {
// TODO: generowanie stringu WHERE na podstawie segmentów i typu ich złączenia
}
public static function simple($expression, $params = null) {
// prosty where jednostringowy lub z parametrami jako array
}
public static function is($expression, $sign, $value) {
// sign: <, >, =, <=, >=, <>, !=, IN, LIKE, ILIKE
}
public static function eq($expression, $value) {
return self::is($expression, '=', $value);
}
public static function equals($expression, $value) {
return self::eq($expression, $value);
}
public static function gt($expression, $value) {
return self::is($expression, '>', $value);
}
public static function graterThan($expression, $value) {
return self::gt($expression, $value);
}
public static function lt($expression, $value) {
return self::is($expression, '<', $value);
}
public static function lowerThan($expression, $value) {
return self::lt($expression, $value);
}
public static function ge($expression, $value) {
return self::is($expression, '>=', $value);
}
public static function greaterEquals($expression, $value) {
return self::ge($expression, $value);
}
public static function le($expression, $value) {
return self::is($expression, '<=', $value);
}
public static function lowerEquals($expression, $value) {
return self::le($expression, $value);
}
public static function in($expression, $values) {
// id IN (1,2,3)
// id IN (SELECT id from tab)
// TODO: quotowanie - zamiana wartości na nazwane paramsy
return self::is($expression, 'IN', implode(',', (array) $values));
}
public static function like($expression, $value) {
return self::is($expression, 'LIKE', $value);
}
public static function between($expression, $values) {
// TODO: quotowanie - zamiana wartości na nazwane paramsy
return self::is($expression, 'BETWEEN', implode(' AND ', (array) $values));
}
public static function orWhere($where1 = null, $where2 = null, $wheren = null) {
$wheres = func_get_args();
// TODO: połączenie orem i zwrot
}
public static function andWhere($where1 = null, $where2 = null, $wheren = null) {
$wheres = func_get_args();
// TODO: połączenie anddem i zwrot
}
}
| {'content_hash': '9953dd34e9ab6f966f538d8394046171', 'timestamp': '', 'source': 'github', 'line_count': 139, 'max_line_length': 129, 'avg_line_length': 32.12230215827338, 'alnum_prop': 0.5890257558790594, 'repo_name': 'd4ro/skinny-lib', 'id': '8341e99a08c5c69b815900cb284df2b7977c3040', 'size': '4490', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Db/Where.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '400433'}]} |
package com.hazelcast.scheduledexecutor.impl;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import java.io.IOException;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
public class ScheduledTaskResult
implements IdentifiedDataSerializable {
private boolean done;
private Object result;
private Throwable exception;
private boolean cancelled;
ScheduledTaskResult() {
}
ScheduledTaskResult(boolean cancelled) {
this.cancelled = cancelled;
}
ScheduledTaskResult(Throwable exception) {
this.exception = exception;
}
ScheduledTaskResult(Object result) {
this.result = result;
this.done = true;
}
public Object getReturnValue() {
return result;
}
public Throwable getException() {
return exception;
}
boolean wasCancelled() {
return cancelled;
}
void checkErroneousState() {
if (wasCancelled()) {
throw new CancellationException();
} else if (exception != null) {
throw new ExecutionExceptionDecorator(new ExecutionException(exception));
}
}
@Override
public int getFactoryId() {
return ScheduledExecutorDataSerializerHook.F_ID;
}
@Override
public int getClassId() {
return ScheduledExecutorDataSerializerHook.TASK_RESOLUTION;
}
@Override
public void writeData(ObjectDataOutput out)
throws IOException {
out.writeObject(result);
out.writeBoolean(done);
out.writeBoolean(cancelled);
out.writeObject(exception);
}
@Override
public void readData(ObjectDataInput in)
throws IOException {
result = in.readObject();
done = in.readBoolean();
cancelled = in.readBoolean();
exception = in.readObject();
}
@Override
public String toString() {
return "ScheduledTaskResult{"
+ "result=" + result
+ ", exception=" + exception
+ ", cancelled=" + cancelled
+ '}';
}
// ExecutionExceptions get peeled away during Operation response, this wrapper
// helps identifying them on the proxy and re-construct them.
public static class ExecutionExceptionDecorator
extends RuntimeException {
public ExecutionExceptionDecorator(Throwable cause) {
super(cause);
}
}
}
| {'content_hash': 'd88f011a2a10118bb9c296798fcbbbba', 'timestamp': '', 'source': 'github', 'line_count': 106, 'max_line_length': 85, 'avg_line_length': 24.528301886792452, 'alnum_prop': 0.6434615384615384, 'repo_name': 'emre-aydin/hazelcast', 'id': 'bd18c6cb19db65aa034dcbc9f55128639ab2cd2e', 'size': '3225', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'hazelcast/src/main/java/com/hazelcast/scheduledexecutor/impl/ScheduledTaskResult.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '1261'}, {'name': 'C', 'bytes': '353'}, {'name': 'Java', 'bytes': '39634758'}, {'name': 'Shell', 'bytes': '29479'}]} |
var filename = __filename.split('/').pop().replace(/\.config\.js/, '.js');
var fullConfig = require('./firenze.full.config');
var _ = require('lodash');
module.exports = _.merge(fullConfig, {
output: {
path: __dirname,
filename: filename
},
externals: {
lodash: '_',
bluebird: 'P',
async: 'async',
validator: 'validator'
}
});
| {'content_hash': '8976fb6664992a9d3f2d6af3796f94a5', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 74, 'avg_line_length': 22.5, 'alnum_prop': 0.5833333333333334, 'repo_name': 'fahad19/firenze', 'id': 'c39eefccf65741d977d75f4d88b05e2959d1020d', 'size': '360', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'dist/firenze.config.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '123015'}]} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:background="#8000">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:text="空气质量"
android:textColor="#fff"
android:textSize="20sp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<TextView
android:id="@+id/aqi_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#fff"
android:textSize="40sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="AQI指数"
android:textColor="#fff"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<TextView
android:id="@+id/pm25_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#fff"
android:textSize="40sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="PM2.5指数"
android:textColor="#fff"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout> | {'content_hash': '1c597813093ed4f29abc7941ccf377a4', 'timestamp': '', 'source': 'github', 'line_count': 84, 'max_line_length': 72, 'avg_line_length': 34.04761904761905, 'alnum_prop': 0.5370629370629371, 'repo_name': 'ruoXiao/bestweather', 'id': '1fdfca0a5a61c6a27a26ec73db46a76cba3be7bd', 'size': '2876', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/res/layout/aqi.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '32369'}]} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_112) on Thu May 04 10:12:17 BST 2017 -->
<title>io.github.teamfractal.animation.chancellor</title>
<meta name="date" content="2017-05-04">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="io.github.teamfractal.animation.chancellor";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../io/github/teamfractal/animation/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../io/github/teamfractal/desktop/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?io/github/teamfractal/animation/chancellor/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package io.github.teamfractal.animation.chancellor</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../io/github/teamfractal/animation/chancellor/TypeAnimation.html" title="class in io.github.teamfractal.animation.chancellor">TypeAnimation</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../io/github/teamfractal/animation/chancellor/WhiteStrip.html" title="class in io.github.teamfractal.animation.chancellor">WhiteStrip</a></td>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../io/github/teamfractal/animation/chancellor/WildChancellorAppear.html" title="class in io.github.teamfractal.animation.chancellor">WildChancellorAppear</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation">
<caption><span>Enum Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Enum</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../io/github/teamfractal/animation/chancellor/WildChancellorAppear.CaptureState.html" title="enum in io.github.teamfractal.animation.chancellor">WildChancellorAppear.CaptureState</a></td>
<td class="colLast">
<div class="block">All possible capture running state.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../io/github/teamfractal/animation/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../io/github/teamfractal/desktop/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?io/github/teamfractal/animation/chancellor/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {'content_hash': 'e1bfc2f4286b5e18598730ff92d4ce9c', 'timestamp': '', 'source': 'github', 'line_count': 165, 'max_line_length': 229, 'avg_line_length': 37.763636363636365, 'alnum_prop': 0.6408281174771304, 'repo_name': 'TeamFractal/TeamFractal.github.io', 'id': 'aa2a98efa32aafc1a061c6b7f0202a286bbf9830', 'size': '6231', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'assessment4/javadoc/io/github/teamfractal/animation/chancellor/package-summary.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '8255'}, {'name': 'HTML', 'bytes': '1019846'}, {'name': 'JavaScript', 'bytes': '13425'}]} |
/* $Id$ */
/*
* PHP 4 Multibyte String module "mbstring" (currently only for Japanese)
*
* History:
* 2000.5.19 Release php-4.0RC2_jstring-1.0
* 2001.4.1 Release php4_jstring-1.0.91
* 2001.4.30 Release php4-jstring-1.1 (contribute to The PHP Group)
* 2001.5.1 Renamed from jstring to mbstring ([email protected])
*/
/*
* PHP3 Internationalization support program.
*
* Copyright (c) 1999,2000 by the PHP3 internationalization team.
* All rights reserved.
*
* See README_PHP3-i18n-ja for more detail.
*
* Authors:
* Hironori Sato <[email protected]>
* Shigeru Kanemoto <[email protected]>
* Tsukada Takuya <[email protected]>
*/
#ifndef _MBSTRING_H
#define _MBSTRING_H
#ifdef COMPILE_DL_MBSTRING
#undef HAVE_MBSTRING
#define HAVE_MBSTRING 1
#endif
#include "php_version.h"
#define PHP_MBSTRING_VERSION PHP_VERSION
#ifdef PHP_WIN32
# undef MBSTRING_API
# ifdef MBSTRING_EXPORTS
# define MBSTRING_API __declspec(dllexport)
# elif defined(COMPILE_DL_MBSTRING)
# define MBSTRING_API __declspec(dllimport)
# else
# define MBSTRING_API /* nothing special */
# endif
#elif defined(__GNUC__) && __GNUC__ >= 4
# undef MBSTRING_API
# define MBSTRING_API __attribute__ ((visibility("default")))
#else
# undef MBSTRING_API
# define MBSTRING_API /* nothing special */
#endif
#if HAVE_MBSTRING
#include "libmbfl/mbfl/mbfilter.h"
#include "SAPI.h"
#define PHP_MBSTRING_API 20021024
extern zend_module_entry mbstring_module_entry;
#define mbstring_module_ptr &mbstring_module_entry
PHP_MINIT_FUNCTION(mbstring);
PHP_MSHUTDOWN_FUNCTION(mbstring);
PHP_RINIT_FUNCTION(mbstring);
PHP_RSHUTDOWN_FUNCTION(mbstring);
PHP_MINFO_FUNCTION(mbstring);
/* functions in php_unicode.c */
PHP_FUNCTION(mb_convert_case);
PHP_FUNCTION(mb_strtoupper);
PHP_FUNCTION(mb_strtolower);
/* php function registration */
PHP_FUNCTION(mb_language);
PHP_FUNCTION(mb_internal_encoding);
PHP_FUNCTION(mb_http_input);
PHP_FUNCTION(mb_http_output);
PHP_FUNCTION(mb_detect_order);
PHP_FUNCTION(mb_substitute_character);
PHP_FUNCTION(mb_preferred_mime_name);
PHP_FUNCTION(mb_parse_str);
PHP_FUNCTION(mb_output_handler);
PHP_FUNCTION(mb_strlen);
PHP_FUNCTION(mb_strpos);
PHP_FUNCTION(mb_strrpos);
PHP_FUNCTION(mb_stripos);
PHP_FUNCTION(mb_strripos);
PHP_FUNCTION(mb_strstr);
PHP_FUNCTION(mb_strrchr);
PHP_FUNCTION(mb_stristr);
PHP_FUNCTION(mb_strrichr);
PHP_FUNCTION(mb_substr_count);
PHP_FUNCTION(mb_substr);
PHP_FUNCTION(mb_strcut);
PHP_FUNCTION(mb_strwidth);
PHP_FUNCTION(mb_strimwidth);
PHP_FUNCTION(mb_convert_encoding);
PHP_FUNCTION(mb_detect_encoding);
PHP_FUNCTION(mb_list_encodings);
PHP_FUNCTION(mb_encoding_aliases);
PHP_FUNCTION(mb_convert_kana);
PHP_FUNCTION(mb_encode_mimeheader);
PHP_FUNCTION(mb_decode_mimeheader);
PHP_FUNCTION(mb_convert_variables);
PHP_FUNCTION(mb_encode_numericentity);
PHP_FUNCTION(mb_decode_numericentity);
PHP_FUNCTION(mb_send_mail);
PHP_FUNCTION(mb_get_info);
PHP_FUNCTION(mb_check_encoding);
MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
size_t nbytes, const mbfl_encoding *enc);
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
size_t nbytes);
MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length,
const char *_to_encoding,
const char *_from_encodings,
size_t *output_len);
MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list);
MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc);
MBSTRING_API size_t php_mb_mbchar_bytes(const char *s);
MBSTRING_API int php_mb_encoding_detector_ex(const char *arg_string, int arg_length,
char *arg_list);
MBSTRING_API int php_mb_encoding_converter_ex(char **str, int *len, const char *encoding_to,
const char *encoding_from);
MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding);
/* internal use only */
int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length);
ZEND_BEGIN_MODULE_GLOBALS(mbstring)
char *internal_encoding_name;
enum mbfl_no_language language;
const mbfl_encoding *internal_encoding;
const mbfl_encoding *current_internal_encoding;
const mbfl_encoding *http_output_encoding;
const mbfl_encoding *current_http_output_encoding;
const mbfl_encoding *http_input_identify;
const mbfl_encoding *http_input_identify_get;
const mbfl_encoding *http_input_identify_post;
const mbfl_encoding *http_input_identify_cookie;
const mbfl_encoding *http_input_identify_string;
const mbfl_encoding **http_input_list;
size_t http_input_list_size;
const mbfl_encoding **detect_order_list;
size_t detect_order_list_size;
const mbfl_encoding **current_detect_order_list;
size_t current_detect_order_list_size;
enum mbfl_no_encoding *default_detect_order_list;
size_t default_detect_order_list_size;
int filter_illegal_mode;
int filter_illegal_substchar;
int current_filter_illegal_mode;
int current_filter_illegal_substchar;
long func_overload;
zend_bool encoding_translation;
long strict_detection;
long illegalchars;
mbfl_buffer_converter *outconv;
void *http_output_conv_mimetypes;
#if HAVE_MBREGEX
struct _zend_mb_regex_globals *mb_regex_globals;
#endif
ZEND_END_MODULE_GLOBALS(mbstring)
#define MB_OVERLOAD_MAIL 1
#define MB_OVERLOAD_STRING 2
#define MB_OVERLOAD_REGEX 4
struct mb_overload_def {
int type;
char *orig_func;
char *ovld_func;
char *save_func;
};
#define MBSTRG(v) ZEND_MODULE_GLOBALS_ACCESSOR(mbstring, v)
#if defined(ZTS) && defined(COMPILE_DL_MBSTRING)
ZEND_TSRMLS_CACHE_EXTERN();
#endif
#else /* HAVE_MBSTRING */
#define mbstring_module_ptr NULL
#endif /* HAVE_MBSTRING */
#define phpext_mbstring_ptr mbstring_module_ptr
#endif /* _MBSTRING_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
| {'content_hash': 'c344a20c3dd3b092e880146ccffb3b2a', 'timestamp': '', 'source': 'github', 'line_count': 210, 'max_line_length': 192, 'avg_line_length': 29.023809523809526, 'alnum_prop': 0.7237079573420837, 'repo_name': 'elmoke/openshift-cartridge-php', 'id': 'a2864e3de8008a8971ea41f8bf3d8a506fc16112', 'size': '7241', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'usr/php-7.0.1/include/php/ext/mbstring/mbstring.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '1360'}, {'name': 'Awk', 'bytes': '7905'}, {'name': 'C', 'bytes': '11583938'}, {'name': 'C++', 'bytes': '5316369'}, {'name': 'HTML', 'bytes': '163539'}, {'name': 'Java', 'bytes': '35250'}, {'name': 'Makefile', 'bytes': '30323'}, {'name': 'Objective-C', 'bytes': '5818'}, {'name': 'PHP', 'bytes': '242732'}, {'name': 'Shell', 'bytes': '1749062'}, {'name': 'XSLT', 'bytes': '57296'}, {'name': 'Yacc', 'bytes': '6145'}]} |
package org.apache.hadoop.hbase.index.covered;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.regionserver.KeyValueScanner;
/**
* Store a collection of KeyValues in memory.
*/
public interface KeyValueStore {
public void add(KeyValue kv, boolean overwrite);
public KeyValueScanner getScanner();
public void rollback(KeyValue kv);
} | {'content_hash': 'f0793d1f2dc078d5f4846ed95fee0a4d', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 60, 'avg_line_length': 21.764705882352942, 'alnum_prop': 0.7756756756756756, 'repo_name': 'ramkrish86/incubator-phoenix', 'id': 'f7d04eaa6c0a4e96b8255cc3ec816505b91cb1c9', 'size': '1223', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'phoenix-core/src/main/java/org/apache/hadoop/hbase/index/covered/KeyValueStore.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '5668294'}, {'name': 'Shell', 'bytes': '10530'}]} |
package org.gradle.internal.hash;
/**
* Hash function that can create new {@link Hasher}s and {@link PrimitiveHasher}s on demand.
* Inspired by the Google Guava project – https://github.com/google/guava.
*/
public interface HashFunction {
/**
* Returns a primitive hasher using the hash function.
*/
PrimitiveHasher newPrimitiveHasher();
/**
* Returns a prefixing hasher using the hash function.
*/
Hasher newHasher();
/**
* Hash the given bytes using the hash function.
*/
HashCode hashBytes(byte[] bytes);
/**
* Hash the given string using the hash function.
*/
HashCode hashString(CharSequence string);
}
| {'content_hash': '8aa77657442299988ebb8a3a11d7bf0c', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 92, 'avg_line_length': 23.75862068965517, 'alnum_prop': 0.6560232220609579, 'repo_name': 'robinverduijn/gradle', 'id': '0f5de9e89fb0b9caddc0d87da74e715db4bac3d4', 'size': '1306', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'subprojects/hashing/src/main/java/org/gradle/internal/hash/HashFunction.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '277'}, {'name': 'Brainfuck', 'bytes': '54'}, {'name': 'C', 'bytes': '98580'}, {'name': 'C++', 'bytes': '1805886'}, {'name': 'CSS', 'bytes': '188237'}, {'name': 'CoffeeScript', 'bytes': '620'}, {'name': 'GAP', 'bytes': '424'}, {'name': 'Gherkin', 'bytes': '191'}, {'name': 'Groovy', 'bytes': '25537093'}, {'name': 'HTML', 'bytes': '77104'}, {'name': 'Java', 'bytes': '24906063'}, {'name': 'JavaScript', 'bytes': '209481'}, {'name': 'Kotlin', 'bytes': '2846791'}, {'name': 'Objective-C', 'bytes': '840'}, {'name': 'Objective-C++', 'bytes': '441'}, {'name': 'Perl', 'bytes': '37849'}, {'name': 'Python', 'bytes': '57'}, {'name': 'Ruby', 'bytes': '16'}, {'name': 'Scala', 'bytes': '29814'}, {'name': 'Shell', 'bytes': '7212'}, {'name': 'Swift', 'bytes': '6972'}, {'name': 'XSLT', 'bytes': '42845'}]} |
unless ENV["CI"]
require "minitest/reporters"
MiniTest::Reporters.use! MiniTest::Reporters::ProgressReporter.new
end
| {'content_hash': '46a33b65410e884e0ba85f80845b11fd', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 68, 'avg_line_length': 30.25, 'alnum_prop': 0.7768595041322314, 'repo_name': 'rubycastsio/ruby-playing-cards', 'id': '3d44b112d38053f9126a13354d550970871c82bd', 'size': '121', 'binary': False, 'copies': '10', 'ref': 'refs/heads/master', 'path': 'test/support/minitest_reporters.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '9363'}, {'name': 'Shell', 'bytes': '344'}]} |
namespace OGLWRAP_NAMESPACE_NAME {
namespace enums {
enum class Capability : GLenum {
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_BLEND)
kBlend = GL_BLEND,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_CLIP_DISTANCE)
kClipDistance = GL_CLIP_DISTANCE,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_COLOR_LOGIC_OP)
kColorLogicOp = GL_COLOR_LOGIC_OP,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_CULL_FACE)
kCullFace = GL_CULL_FACE,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_DEBUG_OUTPUT)
kDebugOutput = GL_DEBUG_OUTPUT,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_DEBUG_OUTPUT_SYNCHRONOUS)
kDebugOutputSynchronous = GL_DEBUG_OUTPUT_SYNCHRONOUS,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_DEPTH_CLAMP)
kDepthClamp = GL_DEPTH_CLAMP,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_DEPTH_TEST)
kDepthTest = GL_DEPTH_TEST,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_DITHER)
kDither = GL_DITHER,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_FRAMEBUFFER_SRGB)
kFramebufferSrgb = GL_FRAMEBUFFER_SRGB,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_LINE_SMOOTH)
kLineSmooth = GL_LINE_SMOOTH,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_MULTISAMPLE)
kMultisample = GL_MULTISAMPLE,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_POLYGON_OFFSET_FILL)
kPolygonOffsetFill = GL_POLYGON_OFFSET_FILL,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_POLYGON_OFFSET_LINE)
kPolygonOffsetLine = GL_POLYGON_OFFSET_LINE,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_POLYGON_OFFSET_POINT)
kPolygonOffsetPoint = GL_POLYGON_OFFSET_POINT,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_POLYGON_SMOOTH)
kPolygonSmooth = GL_POLYGON_SMOOTH,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_PRIMITIVE_RESTART)
kPrimitiveRestart = GL_PRIMITIVE_RESTART,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_PRIMITIVE_RESTART_FIXED_INDEX)
kPrimitiveRestartFixedIndex = GL_PRIMITIVE_RESTART_FIXED_INDEX,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_RASTERIZER_DISCARD)
kRasterizerDiscard = GL_RASTERIZER_DISCARD,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_SAMPLE_ALPHA_TO_COVERAGE)
kSampleAlphaToCoverage = GL_SAMPLE_ALPHA_TO_COVERAGE,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_SAMPLE_ALPHA_TO_ONE)
kSampleAlphaToOne = GL_SAMPLE_ALPHA_TO_ONE,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_SAMPLE_COVERAGE)
kSampleCoverage = GL_SAMPLE_COVERAGE,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_SAMPLE_SHADING)
kSampleShading = GL_SAMPLE_SHADING,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_SAMPLE_MASK)
kSampleMask = GL_SAMPLE_MASK,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_SCISSOR_TEST)
kScissorTest = GL_SCISSOR_TEST,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_STENCIL_TEST)
kStencilTest = GL_STENCIL_TEST,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_TEXTURE_CUBE_MAP_SEAMLESS)
kTextureCubeMapSeamless = GL_TEXTURE_CUBE_MAP_SEAMLESS,
#endif
#if OGLWRAP_DEFINE_EVERYTHING || defined(GL_PROGRAM_POINT_SIZE)
kProgramPointSize = GL_PROGRAM_POINT_SIZE,
#endif
};
} // namespace enums
using namespace enums;
} // namespace oglwrap
#endif
| {'content_hash': 'cab76cd8d016fd4929d079ed9b334d38', 'timestamp': '', 'source': 'github', 'line_count': 95, 'max_line_length': 74, 'avg_line_length': 33.73684210526316, 'alnum_prop': 0.7691107644305772, 'repo_name': 'Tomius/oglwrap', 'id': '82a52399f6abee92eeb5fe20037acef7408ff36e', 'size': '3332', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'enums/capability.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '6232'}, {'name': 'C++', 'bytes': '620617'}, {'name': 'Java', 'bytes': '6149'}, {'name': 'Python', 'bytes': '6059'}]} |
var tableDataRekon = $('#table-data-rekon');
$(document).ready(function(){
tableDataRekon.DataTable({
processing: true,
serverSide: true,
ajax : {
url : site_url + 'api/rekon/datatables',
method: 'post'
},
columns : [
{data: 'id_table'},
{data: 'total_record_sms_match'},
{data: 'total_record_dana_match'},
{data: 'process_id'},
{
data: 'process_id',
sortable: false,
render: function(data, type, row, meta){
return "<a class='btn btn-sm btn-default'><i class='glyphicon glyphicon-eye-open'></i></a>";
}
}
]
});
}); | {'content_hash': '8c5975964549578e596e2c1a509f69c5', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 112, 'avg_line_length': 30.08, 'alnum_prop': 0.45345744680851063, 'repo_name': 'arizkyana/work-ci', 'id': 'c2e314685841f284a60cd33a3bd35f2c3a165ba4', 'size': '752', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'assets/js/rekon/index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '240'}, {'name': 'HTML', 'bytes': '5633'}, {'name': 'JavaScript', 'bytes': '752'}, {'name': 'PHP', 'bytes': '1835300'}]} |
// Copyright © 2010-2016 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using CefSharp.Internals;
using System;
using System.Windows.Forms;
namespace CefSharp.WinForms.Internals
{
public class DefaultFocusHandler : IFocusHandler
{
private readonly ChromiumWebBrowser browser;
public DefaultFocusHandler(ChromiumWebBrowser browser)
{
this.browser = browser;
}
/// <remarks>
/// Try to avoid needing to override this logic in a subclass. The implementation in
/// DefaultFocusHandler relies on very detailed behavior of how WinForms and
/// Windows interact during window activation.
/// </remarks>
public virtual void OnGotFocus()
{
// During application activation, CEF receives a WM_SETFOCUS
// message from Windows because it is the top window
// on the CEF UI thread.
//
// If the WinForm ChromiumWebBrowser control is the
// current .ActiveControl before app activation
// then we MUST NOT try to reactivate the WinForm
// control during activation because that will
// start a race condition between reactivating
// the CEF control AND having another control
// that should be the new .ActiveControl.
//
// For example:
// * CEF control has focus, and thus ChromiumWebBrowser
// is the current .ActiveControl
// * Alt-Tab to another application
// * Click a non CEF control in the WinForms application.
// * This begins the Windows activation process.
// * The WM_ACTIVATE process on the WinForm UI thread
// will update .ActiveControl to the clicked control.
// The clicked control will receive WM_SETFOCUS as well.
// (i.e. OnGotFocus)
// If the ChromiumWebBrowser was the previous .ActiveControl,
// then we set .Activating = true.
// * The WM_ACTIVATE process on the CEF thread will
// send WM_SETFOCUS to CEF thus staring the race of
// which will end first, the WndProc WM_ACTIVATE process
// on the WinForm UI thread or the WM_ACTIVATE process
// on the CEF UI thread.
// * CEF will then call this method on the CEF UI thread
// due to WM_SETFOCUS.
// * This method will clear the activation state (if any)
// on the ChromiumWebBrowser control, due to the race
// condition the WinForm UI thread cannot.
if (browser.IsActivating)
{
browser.IsActivating = false;
}
else
{
// Otherwise, we're not being activated
// so we must activate the ChromiumWebBrowser control
// for WinForms focus tracking.
browser.InvokeOnUiThreadIfRequired(() =>
{
browser.Activate();
});
}
}
public virtual bool OnSetFocus(CefFocusSource source)
{
// Do not let the browser take focus when a Load method has been called
return source == CefFocusSource.FocusSourceNavigation;
}
public virtual void OnTakeFocus(bool next)
{
// NOTE: OnTakeFocus means leaving focus / not taking focus
browser.InvokeOnUiThreadIfRequired(() => browser.SelectNextControl(next));
}
}
}
| {'content_hash': '1d1d81d00ff2f25cae55ad1764653dbb', 'timestamp': '', 'source': 'github', 'line_count': 88, 'max_line_length': 100, 'avg_line_length': 42.26136363636363, 'alnum_prop': 0.5859101909115354, 'repo_name': 'VioletLife/CefSharp', 'id': '3c5b70a706e5407d841fc9a2729aae4d65a84b2e', 'size': '3722', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'CefSharp.WinForms/Internals/DefaultFocusHandler.cs', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '335'}, {'name': 'C#', 'bytes': '690988'}, {'name': 'C++', 'bytes': '417771'}, {'name': 'CSS', 'bytes': '92244'}, {'name': 'HTML', 'bytes': '44839'}, {'name': 'JavaScript', 'bytes': '2653'}, {'name': 'PowerShell', 'bytes': '9300'}]} |
class ArraySysAllocator : public SysAllocator {
public:
// Was this allocator invoked at least once?
bool invoked_;
ArraySysAllocator() : SysAllocator() {
ptr_ = 0;
invoked_ = false;
}
void* Alloc(size_t size, size_t *actual_size, size_t alignment) {
invoked_ = true;
if (size > kArraySize) {
return NULL;
}
void *result = &array_[ptr_];
uintptr_t ptr = reinterpret_cast<uintptr_t>(result);
if (actual_size) {
*actual_size = size;
}
// Try to get more memory for alignment
size_t extra = alignment - (ptr & (alignment-1));
size += extra;
CHECK_LT(ptr_ + size, kArraySize);
if ((ptr & (alignment-1)) != 0) {
ptr += alignment - (ptr & (alignment-1));
}
ptr_ += size;
return reinterpret_cast<void *>(ptr);
}
void DumpStats() {
}
private:
static const int kArraySize = 8 * 1024 * 1024;
char array_[kArraySize];
// We allocate the next chunk from here
int ptr_;
};
const int ArraySysAllocator::kArraySize;
ArraySysAllocator a;
static void TestBasicInvoked() {
MallocExtension::instance()->SetSystemAllocator(&a);
// An allocation size that is likely to trigger the system allocator.
// XXX: this is implementation specific.
char *p = noopt(new char[1024 * 1024]);
delete [] p;
// Make sure that our allocator was invoked.
CHECK(a.invoked_);
}
#if 0 // could port this to various OSs, but won't bother for now
TEST(AddressBits, CpuVirtualBits) {
// Check that kAddressBits is as least as large as either the number of bits
// in a pointer or as the number of virtual bits handled by the processor.
// To be effective this test must be run on each processor model.
const int kPointerBits = 8 * sizeof(void*);
const int kImplementedVirtualBits = NumImplementedVirtualBits();
CHECK_GE(kAddressBits, std::min(kImplementedVirtualBits, kPointerBits));
}
#endif
static void TestBasicRetryFailTest() {
// Check with the allocator still works after a failed allocation.
//
// There is no way to call malloc and guarantee it will fail. malloc takes a
// size_t parameter and the C++ standard does not constrain the size of
// size_t. For example, consider an implementation where size_t is 32 bits
// and pointers are 64 bits.
//
// It is likely, though, that sizeof(size_t) == sizeof(void*). In that case,
// the first allocation here might succeed but the second allocation must
// fail.
//
// If the second allocation succeeds, you will have to rewrite or
// disable this test.
// The weird parens are to avoid macro-expansion of 'max' on windows.
const size_t kHugeSize = (std::numeric_limits<size_t>::max)() / 2;
void* p1 = noopt(malloc(kHugeSize));
void* p2 = noopt(malloc(kHugeSize));
CHECK(p2 == NULL);
if (p1 != NULL) free(p1);
char* q = noopt(new char[1024]);
CHECK(q != NULL);
delete [] q;
}
int main(int argc, char** argv) {
TestBasicInvoked();
TestBasicRetryFailTest();
printf("PASS\n");
return 0;
}
| {'content_hash': '18270aef1a5c64d83263d3ef08ea9194', 'timestamp': '', 'source': 'github', 'line_count': 107, 'max_line_length': 79, 'avg_line_length': 28.130841121495326, 'alnum_prop': 0.667109634551495, 'repo_name': 'gperftools/gperftools', 'id': 'fd199e2caa20ecccdb0494d562da03f85ad6c4e2', 'size': '5278', 'binary': False, 'copies': '7', 'ref': 'refs/heads/master', 'path': 'src/tests/system-alloc_unittest.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Assembly', 'bytes': '3686'}, {'name': 'C', 'bytes': '101122'}, {'name': 'C++', 'bytes': '2111932'}, {'name': 'CMake', 'bytes': '68863'}, {'name': 'M4', 'bytes': '74461'}, {'name': 'Makefile', 'bytes': '73028'}, {'name': 'Perl', 'bytes': '178256'}, {'name': 'Shell', 'bytes': '45103'}]} |
import * as commonmark from "../approved-imports/commonmark";
import { Mappings } from "../approved-imports/sourceMap";
import { DataHandleRead, DataStoreView } from "../data-store/dataStore";
export async function parse(hConfigFile: DataHandleRead, intermediateScope: DataStoreView): Promise<{ data: DataHandleRead, codeBlock: commonmark.Node }[]> {
const result: { data: DataHandleRead, codeBlock: commonmark.Node }[] = [];
const rawMarkdown = await hConfigFile.readData();
for (const codeBlock of parseCodeblocks(rawMarkdown)) {
const codeBlockKey = `${hConfigFile.key}_codeBlock_${codeBlock.sourcepos[0][0]}`;
const data = codeBlock.literal;
const mappings = getSourceMapForCodeBlock(hConfigFile.key, codeBlock);
const hwCodeBlock = await intermediateScope.write(codeBlockKey);
const hCodeBlock = await hwCodeBlock.writeData(data, mappings, [hConfigFile]);
result.push({
data: hCodeBlock,
codeBlock: codeBlock
});
}
return result;
}
function* getSourceMapForCodeBlock(sourceFileName: string, codeBlock: commonmark.Node): Mappings {
const numLines = codeBlock.sourcepos[1][0] - codeBlock.sourcepos[0][0] + (codeBlock.info === null ? 1 : -1);
for (var i = 0; i < numLines; ++i) {
yield {
generated: {
line: i + 1,
column: 0
},
original: {
line: i + codeBlock.sourcepos[0][0] + (codeBlock.info === null ? 0 : 1),
column: codeBlock.sourcepos[0][1] - 1
},
source: sourceFileName,
name: `Codeblock line '${i + 1}'`
};
}
}
function* parseCodeblocks(markdown: string): Iterable<commonmark.Node> {
const parser = new commonmark.Parser();
const parsed = parser.parse(markdown);
const walker = parsed.walker();
let event;
while ((event = walker.next())) {
var node = event.node;
if (event.entering && node.type === "code_block") {
yield node;
}
}
} | {'content_hash': 'f1d7d962d4682c4d08e5735ea1dee270', 'timestamp': '', 'source': 'github', 'line_count': 55, 'max_line_length': 157, 'avg_line_length': 34.72727272727273, 'alnum_prop': 0.6649214659685864, 'repo_name': 'annatisch/autorest', 'id': 'acad34e3f65b02df5fe8742e4bba085fe99cee69', 'size': '2261', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/autorest-core/lib/parsing/literate.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '14890514'}, {'name': 'CSS', 'bytes': '110'}, {'name': 'Go', 'bytes': '147203'}, {'name': 'HTML', 'bytes': '274'}, {'name': 'Java', 'bytes': '6723411'}, {'name': 'JavaScript', 'bytes': '4544571'}, {'name': 'PowerShell', 'bytes': '58927'}, {'name': 'Python', 'bytes': '2065397'}, {'name': 'Ruby', 'bytes': '182074'}, {'name': 'Shell', 'bytes': '142'}, {'name': 'Smalltalk', 'bytes': '3'}, {'name': 'TypeScript', 'bytes': '179609'}]} |
****************************
rmgpy.kinetics.PDepArrhenius
****************************
.. autoclass:: rmgpy.kinetics.PDepArrhenius
The pressure-dependent Arrhenius formulation is sometimes used to extend the
Arrhenius expression to handle pressure-dependent kinetics. The formulation
simply parameterizes :math:`A`, :math:`n`, and :math:`E_\mathrm{a}` to be
dependent on pressure:
.. math:: k(T,P) = A(P) \left( \frac{T}{T_0} \right)^{n(P)} \exp \left( -\frac{E_\mathrm{a}(P)}{RT} \right)
Although this suggests some physical insight, the :math:`k(T,P)` data is often
highly complex and non-Arrhenius, limiting the usefulness of this formulation
to simple systems.
| {'content_hash': '6c556014abfba3ab94cbf7d447b226ce', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 111, 'avg_line_length': 43.8125, 'alnum_prop': 0.6490727532097005, 'repo_name': 'nyee/RMG-Py', 'id': '18468e6c43357280704bebae27496b9e17c45c70', 'size': '701', 'binary': False, 'copies': '16', 'ref': 'refs/heads/master', 'path': 'documentation/source/reference/kinetics/pdeparrhenius.rst', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '461'}, {'name': 'Jupyter Notebook', 'bytes': '17473'}, {'name': 'Makefile', 'bytes': '5832'}, {'name': 'Python', 'bytes': '3406678'}, {'name': 'Shell', 'bytes': '2733'}]} |
from setuptools import setup, find_packages
setup(
name='pullstring-python',
version='1.0.1',
description='Python SDK to access the PullString Web API',
author='PullString',
author_email='[email protected]',
url='https://github.com/pullstring/pullstring-python',
packages=['pullstring'],
)
| {'content_hash': 'a8805be86d1fb9e14408de4b0f23ba52', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 62, 'avg_line_length': 29.454545454545453, 'alnum_prop': 0.7006172839506173, 'repo_name': 'chenjic215/nickvoice', 'id': 'a9483d72065f558a512c0167e0632144a6d6c0ed', 'size': '347', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'setup.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '3817'}, {'name': 'JavaScript', 'bytes': '116333'}, {'name': 'Makefile', 'bytes': '676'}, {'name': 'Python', 'bytes': '121762'}]} |
A Pygame test project
## Code Example
## Motivation
Created mainly for testing purposes.
## Installation
To run use:
``
$ python Main.py
``
## API Reference
## Tests
## Contributors
## License
| {'content_hash': '3c918342b428c21f51f1a75491b75f7e', 'timestamp': '', 'source': 'github', 'line_count': 28, 'max_line_length': 36, 'avg_line_length': 7.5, 'alnum_prop': 0.6571428571428571, 'repo_name': 'zygimantus/PygameTest', 'id': '1845a1c7b79ccbc6b0919510509d7d2aea7ffa82', 'size': '222', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '391'}]} |
var gulp = require("gulp");
var tsc = require("gulp-typescript");
var sourcemaps = require("gulp-sourcemaps");
var concat = require("gulp-concat");
var ngAnnotate = require("gulp-ng-annotate");
var uglify = require("gulp-uglify");
var del = require("del");
var merge = require("merge2");
var args = require('yargs').argv;
var gulpif = require('gulp-if');
var rename = require('gulp-rename');
var runseq = require("run-sequence");
// example only
var browserSync = require("browser-sync");
var isRelease = args.rel || false;
console.log(">>>>> Is Release: " + isRelease);
var tsProject = tsc.createProject('tsconfig.json', { sortOutput: true });
var paths = {
tscripts: {
src: ["tools/typings/tsd.d.ts", "src/command.module.ts", "src/**/*.ts"],
},
distFileName: "ng-command.js",
distTypeScriptDefName: "ng-command.d.ts",
dist: "./dist",
exampleRoot: "./example"
};
gulp.task("default", ["compile:typescript"], function () {
});
// ** Watching ** //
gulp.task("watch", [], function () {
gulp.watch(paths.tscripts.src, ["compile:typescript"]).on("change", reportChange);
});
// ** Compilation ** //
gulp.task("build:rel", ["clean"], function (cb) {
//runseq("compile:typescript", "minify", cb);
runseq("compile:typescript", "compile:typescript:rel", cb);
});
gulp.task("compile:typescript", function () {
var tsResult = gulp
.src(paths.tscripts.src)
.pipe(sourcemaps.init())
.pipe(tsc(tsProject));
return merge([
tsResult.js
.pipe(concat(paths.distFileName))
.pipe(ngAnnotate())
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(paths.dist))
]);
});
gulp.task("compile:typescript:rel", function () {
var tsResult = gulp
.src(paths.tscripts.src)
.pipe(tsc(tsProject));
return merge([
tsResult.dts
.pipe(concat(paths.distTypeScriptDefName))
.pipe(gulp.dest(paths.dist)),
tsResult.js
.pipe(concat(paths.distFileName))
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest(paths.dist))
]);
});
// ** Clean ** //
gulp.task("clean", function (cb) {
del([paths.dist], cb);
});
function reportChange(event) {
console.log("File " + event.path + " was " + event.type + ", running tasks...");
}
// ** Example ** //
gulp.task("serve-example", ["build:rel"], function (done) {
browserSync({
open: true,
port: 9000,
server: {
baseDir: ["."],
index: "example/command-lab.html",
middleware: function (req, res, next) {
res.setHeader("Access-Control-Allow-Origin", "*");
next();
}
},
files: ["example/*.*", "dist/*.*"]
}, done);
}); | {'content_hash': '27f622a1df25ca3b25f6067ad29c1b39', 'timestamp': '', 'source': 'github', 'line_count': 111, 'max_line_length': 83, 'avg_line_length': 23.117117117117118, 'alnum_prop': 0.6340607950116913, 'repo_name': 'stephenlautier/ng-command', 'id': '60d0062bf62e12f2c25cfc503aa1e591e594775d', 'size': '2566', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'gulpfile.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2116'}, {'name': 'HTML', 'bytes': '2427'}, {'name': 'JavaScript', 'bytes': '4513'}, {'name': 'TypeScript', 'bytes': '2467'}]} |
package ev3dev.sensors.slamtec;
import lombok.extern.slf4j.Slf4j;
import java.util.Objects;
@Slf4j class RPLidarA1Factory {
private static final String RPLIDARA1_ENV_KEY = "FAKE_RPLIDARA1";
public static RPLidarProvider getInstance(final String USBPort) {
if(Objects.nonNull(System.getProperty(RPLIDARA1_ENV_KEY))){
return new RPLidarA1Fake(USBPort);
}
return new RPLidarA1Driver(USBPort);
}
}
| {'content_hash': '0eea7c567f0f1c5c6f6df7357c4867d7', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 69, 'avg_line_length': 23.63157894736842, 'alnum_prop': 0.7082405345211581, 'repo_name': 'ev3dev-lang-java/RPLidar4J', 'id': '570677c83b64519be8b71c6451603f03c581d48b', 'size': '449', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/ev3dev/sensors/slamtec/RPLidarA1Factory.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '41763'}]} |
<!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>Creating Core System Classes : 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 2.1.4</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> ›
Creating Core System Classes
</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>Creating Core System Classes</h1>
<p>Every time CodeIgniter runs there are several base classes that are initialized automatically as part of the core framework.
It is possible, however, to swap any of the core system classes with your own versions or even extend the core versions.</p>
<p><strong>Most users will never have any need to do this,
but the option to replace or extend them does exist for those who would like to significantly alter the CodeIgniter core.</strong>
</p>
<p class="important"><strong>Note:</strong> Messing with a core system class has a lot of implications, so make sure you
know what you are doing before attempting it.</p>
<h2>System Class List</h2>
<p>The following is a list of the core system files that are invoked every time CodeIgniter runs:</p>
<ul>
<li>Benchmark</li>
<li>Config</li>
<li>Controller</li>
<li>Exceptions</li>
<li>Hooks</li>
<li>Input</li>
<li>Language</li>
<li>Loader</li>
<li>Log</li>
<li>Output</li>
<li>Router</li>
<li>URI</li>
<li>Utf8</li>
</ul>
<h2>Replacing Core Classes</h2>
<p>To use one of your own system classes instead of a default one simply place your version inside your local <dfn>application/core</dfn> directory:</p>
<code>application/core/<dfn>some-class.php</dfn></code>
<p>If this directory does not exist you can create it.</p>
<p>Any file named identically to one from the list above will be used instead of the one normally used.</p>
<p>Please note that your class must use <kbd>CI</kbd> as a prefix. For example, if your file is named <kbd>Input.php</kbd> the class will be named:</p>
<code>
class CI_Input {<br /><br />
}
</code>
<h2>Extending Core Class</h2>
<p>If all you need to do is add some functionality to an existing library - perhaps add a function or two - then
it's overkill to replace the entire library with your version. In this case it's better to simply extend the class.
Extending a class is nearly identical to replacing a class with a couple exceptions:</p>
<ul>
<li>The class declaration must extend the parent class.</li>
<li>Your new class name and filename must be prefixed with <kbd>MY_</kbd> (this item is configurable. See below.).</li>
</ul>
<p>For example, to extend the native <kbd>Input</kbd> class you'll create a file named <dfn>application/core/</dfn><kbd>MY_Input.php</kbd>, and declare your class with:</p>
<code>
class MY_Input extends CI_Input {<br /><br />
}</code>
<p>Note: If you need to use a constructor in your class make sure you extend the parent constructor:</p>
<code>
class MY_Input extends CI_Input {<br />
<br />
function __construct()<br />
{<br />
parent::__construct();<br />
}<br />
}</code>
<p class="important"><strong>Tip:</strong> Any functions in your class that are named identically to the functions in the parent class will be used instead of the native ones
(this is known as "method overriding").
This allows you to substantially alter the CodeIgniter core.</p>
<p>If you are extending the Controller core class, then be sure to extend your new class in your application controller's constructors.</p>
<code>class Welcome extends MY_Controller {<br />
<br />
function __construct()<br />
{<br />
parent::__construct();<br />
}<br />
<br />
function index()<br />
{<br />
$this->load->view('welcome_message');<br />
}<br />
}</code>
<h3>Setting Your Own Prefix</h3>
<p>To set your own sub-class prefix, open your <dfn>application/config/config.php</dfn> file and look for this item:</p>
<code>$config['subclass_prefix'] = 'MY_';</code>
<p>Please note that all native CodeIgniter libraries are prefixed with <kbd>CI_</kbd> so DO NOT use that as your prefix.</p>
</div>
<!-- END CONTENT -->
<div id="footer">
<p>
Previous Topic: <a href="creating_libraries.html">Creating Your Own Libraries</a>
·
<a href="#top">Top of Page</a> ·
<a href="../index.html">User Guide Home</a> ·
Next Topic: <a href="hooks.html">Hooks - Extending the Core</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> | {'content_hash': '068614767ac69e17c8a66d19594e65d7', 'timestamp': '', 'source': 'github', 'line_count': 186, 'max_line_length': 383, 'avg_line_length': 38.19892473118279, 'alnum_prop': 0.6935960591133005, 'repo_name': 'howtomakeaturn/design', 'id': '60b4407bf2bdbeaad7c2c8f7173aeb2332a9ab96', 'size': '7105', 'binary': False, 'copies': '20', 'ref': 'refs/heads/master', 'path': 'user_guide/CodeIgniter/general/core_classes.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '40733'}, {'name': 'JavaScript', 'bytes': '466528'}, {'name': 'PHP', 'bytes': '2835810'}]} |
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#fff6f6f6" />
<stroke android:width="0dp"
android:color="#ffe2e2e2" />
</shape> | {'content_hash': '4155efc60f6707866d2468f5a4f0ad74', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 66, 'avg_line_length': 37.166666666666664, 'alnum_prop': 0.6547085201793722, 'repo_name': 'tangjy/accounting', 'id': '5c0d99a5664bebd5ff71830ec191cbfdf04a9e2f', 'size': '223', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'res/drawable/shape_bg_pressed_sr.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '33424'}]} |
package uk.org.adamretter.restream;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.Stack;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Temporary File Manager
*
* Attempts to create and delete temporary files
* working around the issues of some JDK platforms
* (e.g. Windows). Where deleting files is impossible,
* used but finished with temporary files will be re-used
* where possible if they cannot be deleted.
*
* @version 1.0
*
* @author Adam Retter <[email protected]>
*/
public class TemporaryFileManager {
private final static Logger LOG = LoggerFactory.getLogger(TemporaryFileManager.class);
private final static String FOLDER_PREFIX = "_mmtfm_";
private final Stack<File> available = new Stack<File>();
private final File tmpFolder;
private final static TemporaryFileManager instance = new TemporaryFileManager();
public static TemporaryFileManager getInstance() {
return instance;
}
private TemporaryFileManager() {
final String tmpDir = System.getProperty("java.io.tmpdir");
final File t = new File(tmpDir);
cleanupOldTempFolders(t);
this.tmpFolder = new File(t, FOLDER_PREFIX + UUID.randomUUID().toString());
if(!tmpFolder.mkdir()) {
throw new RuntimeException("Unable to use temporary folder: " + tmpFolder.getAbsolutePath());
}
LOG.info("Temporary folder is: " + tmpFolder.getAbsolutePath());
}
public final File getTemporaryFile() throws IOException {
File tempFile = null;
synchronized(available) {
if(!available.empty()) {
tempFile = available.pop();
}
}
if(tempFile == null) {
tempFile = File.createTempFile("mmtf_" + System.currentTimeMillis(), ".tmp", tmpFolder);
//add hook to JVM to delete the file on exit
//unfortunately this does not always work on all (e.g. Windows) platforms
tempFile.deleteOnExit();
}
return tempFile;
}
public void returnTemporaryFile(final File tempFile) {
//attempt to delete the temporary file
final boolean deleted = tempFile.delete();
if(deleted) {
LOG.debug("Deleted temporary file: " + tempFile.getAbsolutePath());
} else {
LOG.debug("Could not delete temporary file: " + tempFile.getAbsolutePath() + ". Returning to stack for re-use.");
//if we couldnt delete it, add it to the stack of available files
//for reuse in the future.
//Typically there are problems deleting these files on Windows
//platforms which is why this facility was added
synchronized(available) {
available.push(tempFile);
}
}
}
private void cleanupOldTempFolders(final File t) {
final File oldFolders[] = t.listFiles(new FileFilter(){
@Override
public boolean accept(final File f) {
return f.isDirectory() && f.getName().startsWith(FOLDER_PREFIX);
}
});
for(final File oldFolder : oldFolders) {
deleteFolder(oldFolder);
}
}
private void deleteFolder(final File folder) {
try {
FileUtils.deleteDirectory(folder);
LOG.debug("Deleted temporary folder: " + folder.getAbsolutePath());
} catch(final IOException ioe) {
LOG.warn("Unable to delete temporary folder: " + folder.getAbsolutePath(), ioe);
}
}
@Override
protected void finalize() throws Throwable {
super.finalize();
//remove references to available files
available.clear();
//try and remove our temporary folder
deleteFolder(tmpFolder);
}
} | {'content_hash': '0d767659712c201c3efe4389be66211f', 'timestamp': '', 'source': 'github', 'line_count': 127, 'max_line_length': 125, 'avg_line_length': 33.196850393700785, 'alnum_prop': 0.5896584440227703, 'repo_name': 'adamretter/restream', 'id': 'bcced957398a1632ff8cd888ad99f2a6c380c3c8', 'size': '5815', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/uk/org/adamretter/restream/TemporaryFileManager.java', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Java', 'bytes': '49827'}]} |
package org.qi4j.tutorials.composites.tutorial5;
import org.qi4j.api.composite.TransientComposite;
/**
* This Composite interface declares transitively
* all the Fragments of the HelloWorld composite.
* <p>
* What Mixins to use and what Assertions should
* apply to the methods can be found by exploring
* the interfaces extended by this Composite interface,
* and by looking at the declared Mixins.
* </p>
*/
public interface HelloWorldComposite
extends HelloWorld, TransientComposite
{
}
| {'content_hash': '18e9df59c12d94c21dd917da28866499', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 55, 'avg_line_length': 28.055555555555557, 'alnum_prop': 0.7702970297029703, 'repo_name': 'joobn72/qi4j-sdk', 'id': '5d52df15cc212eef00d1ba802b42dc0fa8869bee', 'size': '505', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldComposite.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '44634'}, {'name': 'Groovy', 'bytes': '15077'}, {'name': 'HTML', 'bytes': '73513'}, {'name': 'Java', 'bytes': '6576434'}, {'name': 'JavaScript', 'bytes': '17052'}, {'name': 'Python', 'bytes': '4879'}, {'name': 'Ruby', 'bytes': '81'}, {'name': 'Scala', 'bytes': '2917'}, {'name': 'Shell', 'bytes': '1785'}, {'name': 'XSLT', 'bytes': '53394'}]} |
module Engine
( startServer
) where
import Control.Concurrent (forkIO)
import Control.Monad (forever)
import Data.List (elemIndex, findIndex, concat)
import Data.List.Split (splitOneOf)
import Data.Time.Clock (getCurrentTime, utctDay)
import Data.Time.Calendar (toGregorian)
import Data.Text.Unsafe (inlinePerformIO)
import Network.Socket
import Network.Socket.ByteString (sendAll)
import System.Directory (doesFileExist)
import System.IO (FilePath, appendFile)
import System.Time (getClockTime)
import qualified Data.ByteString as B
import qualified Data.ByteString.Internal as B (ByteString)
import Configuration
import Mime
data StatusCodes =
OK
| NotFound
| BadRequest
deriving (Show)
data Fields = Fields
{ hostField :: Maybe String
, acceptField :: Maybe String
, acceptCharsetField :: Maybe String
, acceptEncodingField :: Maybe String
, acceptLanguageField :: Maybe String
, acceptDatetimeField :: Maybe String
, userAgentField :: Maybe String
} deriving (Show)
lengthFileUnsafe :: FilePath -> Int
lengthFileUnsafe file = (B.length $ inlinePerformIO $ B.readFile file)
-- Sun, 06 Nov 1994 08:49:37 GMT
date :: String
date = undefined
where
dateLocal :: IO (Integer,Int,Int)
dateLocal = getCurrentTime >>= return . toGregorian . utctDay
defaultFields :: Fields
defaultFields = Fields
{ hostField = Nothing
, acceptField = Nothing
, acceptCharsetField = Nothing
, acceptEncodingField = Nothing
, acceptLanguageField = Nothing
, acceptDatetimeField = Nothing
, userAgentField = Nothing
}
split :: String -> [String]
split s = removeEmpytElement(splitOneOf " \n\r" s)
where
removeEmpytElement :: [String] -> [String]
removeEmpytElement [] = []
removeEmpytElement (x:xs) = if x == ""
then removeEmpytElement xs
else x : removeEmpytElement xs
ignoreLR :: String -> String
ignoreLR x = if last x == '\r'
then init x
else x
splitTwo :: Char -> String -> (String,String)
splitTwo _ [] = ("","")
splitTwo d (x:xs) = if d == x
then ("",xs)
else (x:fst (splitTwo d xs), snd (splitTwo d xs))
getStatus :: StatusCodes -> String
getStatus status = case status of
OK -> "HTTP/1.1 200 OK\r\n"
NotFound -> "HTTP/1.1 404 Not Found\r\n"
BadRequest -> "HTTP/1.1 400 Bad Request\r\n"
headers :: Header -> String
headers hederConf = concat
[ contentLanguageHeder
, serverHeder
, pragmaHeder
]
where
contentLanguageHeder :: String
contentLanguageHeder = case contentLanguage hederConf of
Just a -> "Content-Language: " ++ a ++ "\r\n"
Nothing -> ""
serverHeder :: String
serverHeder = case server hederConf of
Just a -> "Server: " ++ a ++ "\r\n"
Nothing -> ""
pragmaHeder :: String
pragmaHeder = case server hederConf of
Just a -> "Pragma: " ++ a ++ "\r\n"
Nothing -> ""
requestHeader :: Config -> StatusCodes -> FilePath -> String
requestHeader conf status path =
(getStatus status) ++ (localHeader)
where
localHeader :: String
localHeader = (headers $ header conf) ++
"Content-Length: " ++ (show $ lengthFileUnsafe path) ++ "\r\n"
++ "Content-Type: " ++ (getMimeType path) ++ "\r\n\r\n"
parsFields :: [String] -> Fields -> Fields
parsFields [] f = f
parsFields (x:xs) f = parsFields xs (foundField f x)
where
foundField :: Fields -> String -> Fields
foundField fields field = parsField fields (splitTwo ' ' field)
parsField :: Fields -> (String, String) -> Fields
parsField fields ("Host:", x) =
fields { hostField = Just x }
parsField fields ("Accept:", x) =
fields { acceptField = Just x }
parsField fields ("Accept-Charset:", x) =
fields { acceptCharsetField = Just x }
parsField fields ("Accept-Encoding:", x) =
fields { acceptEncodingField = Just x }
parsField fields ("Accept-Language:", x) =
fields { acceptLanguageField = Just x }
parsField fields ("Accept-Datetime:", x) =
fields { acceptDatetimeField = Just x }
parsField fields ("User-Agent:", x) =
fields { userAgentField = Just x }
parsField fields (_, _) = fields
requestGet :: Config -> String -> [String] -> (String, FilePath)
requestGet conf path field = case searchHost of
Just a -> requestMake conf a path
Nothing -> (requestHeader conf BadRequest (status400 conf), status404 conf)
where
searchHost :: Maybe Int
searchHost = case (hostField $ parsFields field defaultFields) of
Just a -> elemIndex True $ map ((a ==) . fst) (domain conf)
Nothing -> Nothing
status404File :: FilePath
status404File = unknownDomain conf ++ status404 conf
requestMake :: Config -> Int -> FilePath -> (String, FilePath)
requestMake conf hostNum path =
if (inlinePerformIO $ doesFileExist pathFile) && blackListVerification
then (requestHeader conf OK pathFile , pathFile)
else (requestHeader conf NotFound (status404 conf), status404 conf)
where
pathFile :: FilePath
pathFile = if head (splitOneOf "?" path) == "/"
then (snd domainConf) ++ (indexFile conf)
else (snd domainConf) ++ head (splitOneOf "?" path)
blackListVerification :: Bool
blackListVerification =
filter (getMimeType pathFile ==) (blackList conf) == []
domainConf :: (String,FilePath)
domainConf = (domain conf) !! hostNum
status404File :: FilePath
status404File = status404 conf
parsHTTP :: Config -> [String] -> [String] -> (String, FilePath)
parsHTTP conf (verb:filePath:_) fields = case verb of
"GET" -> requestGet conf filePath fields
"POST" -> requestGet conf filePath fields
--otherwise -> expression
checkHTTP :: Config -> [String] -> (String, FilePath)
checkHTTP conf (heading:fields) = case last $ headingSplit of
"HTTP/1.1" -> parsHTTP conf (init headingSplit) (map ignoreLR fields)
otherwise -> undefined
where
headingSplit :: [String]
headingSplit = split heading
processHTTP :: Config -> String -> (String, FilePath)
processHTTP conf query = checkHTTP conf $ lines query
loger :: Config -> SockAddr -> String -> IO ()
loger conf addr request = do
time <- getClockTime
case fileLog conf of
Just file -> appendFile file $
(show addr) ++ " = " ++ (show time) ++ "\n" ++ request
Nothing -> putStrLn $
(show addr) ++ " = " ++ (show time) ++ "\n" ++ request
requestSend :: Socket -> (String, FilePath) -> IO ()
requestSend sock (header, fileName) = do
print header
send sock header
asdf <- B.readFile fileName
sendAll sock asdf
close sock
conect :: Config -> Socket -> SockAddr -> IO ()
conect conf sock addr = do
request <- recv sock 100000
requestSend sock $ processHTTP conf request
loger conf addr request
startServer :: Config -> IO ()
startServer conf = do
sock <- socket AF_INET Stream 0
bind sock (SockAddrInet (fromIntegral (port conf)) iNADDR_ANY)
listen sock (maxListen conf)
forever $ do
(sock, addr) <- accept sock
forkIO $ conect conf sock addr
| {'content_hash': '2949fa718750c677b31961b1d065b5ed', 'timestamp': '', 'source': 'github', 'line_count': 221, 'max_line_length': 79, 'avg_line_length': 36.23981900452489, 'alnum_prop': 0.584842052690723, 'repo_name': 'ununsept/lambdaHTTP', 'id': '7d15e682ed28a7bd3b2629fa0732786ad2f00d2f', 'size': '8009', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Engine.hs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Haskell', 'bytes': '10339'}]} |
import os
import django
from django.test import TestCase
from django.test.utils import setup_test_environment, teardown_test_environment
from pytest_django.compat import setup_databases, teardown_databases
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
django.setup()
def before_all(context):
setup_test_environment()
context.db_cfg = setup_databases(
verbosity=False,
interactive=False,
keepdb=not context.config.userdata.getbool('RESETDB')
)
def before_scenario(context, scenario):
context.test_case = TestCase(methodName='__init__')
context.test_case._pre_setup()
def after_step(context, step):
if context.config.userdata.getbool('DEBUGGER') and step.status == 'failed':
# -- ENTER DEBUGGER: Zoom in on failure location.
import ipdb
ipdb.post_mortem(step.exc_traceback)
def after_scenario(context, scenario):
context.test_case._post_teardown()
def after_all(context):
if context.config.userdata.getbool('RESETDB'):
teardown_databases(context.db_cfg, verbosity=False)
teardown_test_environment()
| {'content_hash': '80a27ddec1a61e767a53f3d4c8b41dfb', 'timestamp': '', 'source': 'github', 'line_count': 42, 'max_line_length': 79, 'avg_line_length': 26.785714285714285, 'alnum_prop': 0.7164444444444444, 'repo_name': 'laurenbarker/SHARE', 'id': 'f8cc773ed6fc8e6ba362102e6316efd29cd1a5eb', 'size': '1125', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/features/environment.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '3786'}, {'name': 'Gherkin', 'bytes': '1773'}, {'name': 'HTML', 'bytes': '4849'}, {'name': 'Python', 'bytes': '1431647'}, {'name': 'Shell', 'bytes': '830'}]} |
RailsTest::Application.config.session_store :cookie_store, :key => '_muck_raker_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
# RailsTest::Application.config.session_store :active_record_store
| {'content_hash': 'fec402d607a2f440a1aaff43e98a79a3', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 88, 'avg_line_length': 58.833333333333336, 'alnum_prop': 0.7875354107648725, 'repo_name': 'tatemae/muck-raker', 'id': '6173ce0f1149c4b86db8497608785c72165678c3', 'size': '414', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/config/initializers/session_store.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '153203'}, {'name': 'Ruby', 'bytes': '111780'}]} |
<?php
namespace Armd\OAuthBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class ArmdOAuthExtension extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
}
}
| {'content_hash': 'f341d471e32ea0eb959781b0272688a9', 'timestamp': '', 'source': 'github', 'line_count': 28, 'max_line_length': 104, 'avg_line_length': 31.285714285714285, 'alnum_prop': 0.726027397260274, 'repo_name': 'damedia/culture.ru', 'id': '42fd5a72a49b30c401ffa7538ff0997267f488f5', 'size': '876', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Armd/OAuthBundle/DependencyInjection/ArmdOAuthExtension.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1823103'}, {'name': 'JavaScript', 'bytes': '4818245'}, {'name': 'PHP', 'bytes': '2439432'}, {'name': 'Perl', 'bytes': '60'}, {'name': 'Ruby', 'bytes': '2913'}, {'name': 'Shell', 'bytes': '800'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ails: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.6.1 / ails - 8.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
ails
<small>
8.7.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-04-26 16:21:57 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-04-26 16:21:57 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.6.1 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/ails"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/AILS"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
]
tags: [ "keyword: ails" "keyword: aircraft" "keyword: trajectory" "keyword: conflict" "keyword: collision" "category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms" "date: 2002" ]
authors: [ "Olivier Desmettre" ]
bug-reports: "https://github.com/coq-contribs/ails/issues"
dev-repo: "git+https://github.com/coq-contribs/ails.git"
synopsis: "Proof of AILS algorithm"
description: """
An aircraft trajectory modeling and analysis using the AILS
algorithm (Airborne Information for Lateral Spacing) to warn
against possible collisions."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/ails/archive/v8.7.0.tar.gz"
checksum: "md5=0692db935a495e0a6c4346ab7e89b94d"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-ails.8.7.0 coq.8.6.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.6.1).
The following dependencies couldn't be met:
- coq-ails -> coq >= 8.7
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-ails.8.7.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {'content_hash': 'ef550b259e48cf94ccc4d1570b798980', 'timestamp': '', 'source': 'github', 'line_count': 167, 'max_line_length': 298, 'avg_line_length': 42.137724550898206, 'alnum_prop': 0.5458291885746767, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': '1a1c051b5897a0120d70eb24a2063bb636dd480b', 'size': '7062', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.05.0-2.0.1/released/8.6.1/ails/8.7.0.html', 'mode': '33188', 'license': 'mit', 'language': []} |
set -eu -o pipefail
outdir=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM
mkdir -p $outdir
mkdir -p $PREFIX/bin
cp -R * $outdir/
cp $RECIPE_DIR/encyclopedia.py $outdir/EncyclopeDIA
ls -l $outdir
ln -s $outdir/EncyclopeDIA $PREFIX/bin
chmod 0755 "${PREFIX}/bin/EncyclopeDIA"
| {'content_hash': '286bb99813d572e44ed5b0cc6c0b83ad', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 57, 'avg_line_length': 27.9, 'alnum_prop': 0.7419354838709677, 'repo_name': 'Luobiny/bioconda-recipes', 'id': '91967ccfffac6673559ba329ba7f541dc57b15f8', 'size': '291', 'binary': False, 'copies': '9', 'ref': 'refs/heads/master', 'path': 'recipes/encyclopedia/build.sh', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '154'}, {'name': 'CMake', 'bytes': '13967'}, {'name': 'M4', 'bytes': '726'}, {'name': 'Perl', 'bytes': '99771'}, {'name': 'Prolog', 'bytes': '1067'}, {'name': 'Python', 'bytes': '393551'}, {'name': 'Raku', 'bytes': '23942'}, {'name': 'Roff', 'bytes': '996'}, {'name': 'Shell', 'bytes': '3972568'}]} |
package com.lcram.conversions;
import java.text.NumberFormat;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
import android.widget.Toast;
public class ConversionsActivity extends Activity
implements OnItemSelectedListener, OnEditorActionListener,
OnClickListener{
private TextView conversionLabel;
private Spinner conversionSpinner;
private TextView fromLabel;
private EditText fromEditText;
private TextView toLabel;
private TextView toTextView;
private String fromString;
private String toString;
private float ratio;
private float fromValue = 0;
private float toValue = 0;
private TextView EURLabel;
private EditText EUREditText;
private TextView GBPLabel;
private EditText GBPEditText;
private TextView JPYLabel;
private EditText JPYEditText;
private Button ApplyButton;
private float GBPRate = 1.75f;
private float EURRate = 1.35f;
private float JPYRate = .00105f;
private int convtype = 0;
private SharedPreferences prefs;
private int[] actPos = new int[] {};
NumberFormat f = NumberFormat.getNumberInstance();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_conversions);
conversionSpinner = (Spinner) findViewById(R.id.conversionSpinner);
fromLabel = (TextView) findViewById(R.id.fromLabel);
fromEditText = (EditText) findViewById(R.id.fromEditText);
toLabel = (TextView) findViewById(R.id.toLabel);
toTextView = (TextView) findViewById(R.id.toTextView);
GBPLabel = (TextView) findViewById(R.id.GBPTitleLabel);
GBPEditText = (EditText) findViewById(R.id.GBPRateEditText);
EURLabel = (TextView) findViewById(R.id.EURTitleLabel);
EUREditText = (EditText) findViewById(R.id.EURRateEditText);
JPYLabel = (TextView) findViewById(R.id.JPYTitleLabel);
JPYEditText = (EditText) findViewById(R.id.JPYRateEditText);
ApplyButton = (Button) findViewById(R.id.ApplyButton);
toTextView.setText("");
GBPLabel.setVisibility(View.GONE);
GBPEditText.setVisibility(View.GONE);
EURLabel.setVisibility(View.GONE);
EUREditText.setVisibility(View.GONE);
JPYLabel.setVisibility(View.GONE);
JPYEditText.setVisibility(View.GONE);
ApplyButton.setVisibility(View.GONE);
setSpinner();
conversionSpinner.setOnItemSelectedListener(this);
fromEditText.setOnEditorActionListener(this);
ApplyButton.setOnClickListener(this);
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
prefs = PreferenceManager.getDefaultSharedPreferences(this);
}
@Override
public void onPause() {
super.onPause();
Editor ed = prefs.edit();
ed.putInt("Last Position", conversionSpinner.getSelectedItemPosition());
ed.putFloat("GBPRate", GBPRate);
ed.putFloat("EURRate", EURRate);
ed.putFloat("EURRate", EURRate);
ed.putFloat("fromValue", fromValue);
ed.commit();
}
public void onResume() {
super.onResume();
convtype = Integer.parseInt(prefs.getString("pref_convtype", "0"));
setSpinner();
conversionSpinner.setSelection(prefs.getInt("Last Position", 0));
GBPRate = prefs.getFloat("GBPRate", GBPRate);
GBPEditText.setText(String.valueOf(GBPRate));
EURRate = prefs.getFloat("EURRate", EURRate);
EUREditText.setText(String.valueOf(EURRate));
JPYRate = prefs.getFloat("JPYRate", JPYRate);
JPYEditText.setText(String.valueOf(JPYRate));
fromValue = prefs.getFloat("fromValue", fromValue);
fromEditText.setText(String.valueOf(fromValue));
calcAndDisplay();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.conversions, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
startActivity(new Intent(getApplicationContext(),
SettingsActivity.class));
return true;
} else if(id == R.id.menu_exchangerates) {
GBPEditText.setText(String.valueOf(GBPRate));
EUREditText.setText(String.valueOf(EURRate));
JPYEditText.setText(String.valueOf(JPYRate));
GBPLabel.setVisibility(View.VISIBLE);
GBPEditText.setVisibility(View.VISIBLE);
EURLabel.setVisibility(View.VISIBLE);
EUREditText.setVisibility(View.VISIBLE);
JPYLabel.setVisibility(View.VISIBLE);
JPYEditText.setVisibility(View.VISIBLE);
ApplyButton.setVisibility(View.VISIBLE);
}
return super.onOptionsItemSelected(item);
}
@Override
public void onItemSelected(AdapterView<?> parent, View v, int position,
long id) {
switch (convtype) {
case 0:
actPos = new int[] { 0,1,2,3,4,5,6,7,8 };
break;
case 1:
actPos = new int[] { 0,2,4,6,7,8 };
break;
case 2:
actPos = new int[] { 1,3,5,6,7,8 };
break;
case 3:
actPos = new int[] { 6,7,8 };
break;
}
switch(actPos[position]){
case 0:
fromString = "Miles";
toString = "Kilometers";
ratio = 1.6093f;
break;
case 1:
fromString = "Kilometers";
toString = "Miles";
ratio = 0.6214f;
break;
case 2:
fromString = "Inches";
toString = "Centimeters";
ratio = 2.54f;
break;
case 3:
fromString = "Centimeters";
toString = "Inches";
ratio = 0.3937f;
break;
case 4:
fromString = "Farenheit";
toString = "Celsius";
break;
case 5:
fromString = "Celsius";
toString = "Farnheit";
break;
case 6:
fromString = "GBP";
toString = "USD";
ratio = GBPRate;
break;
case 7:
fromString = "Euros";
toString = "USD";
ratio = EURRate;
break;
case 8:
fromString = "Yen";
toString = "USD";
ratio = JPYRate;
break;
}
fromLabel.setText(fromString);
toLabel.setText(toString);
toTextView.setText(String.valueOf(f.format(0)));
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
}
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if(actionId == EditorInfo.IME_ACTION_DONE ||
actionId == EditorInfo.IME_ACTION_UNSPECIFIED) {
calcAndDisplay();
}
return false;
}
private void calcAndDisplay(){
f.setMaximumFractionDigits(2);
f.setMinimumFractionDigits(2);
try{
fromValue = Float.parseFloat(fromEditText.getText().toString());
} catch (Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
fromValue = 0f;
}
if(fromLabel.getText().toString().equalsIgnoreCase("Farenheit"))
{
toValue = (fromValue - 32.0f) * (5.0f / 9.0f);
} else if (fromLabel.getText().toString().equalsIgnoreCase("Celsius"))
{
toValue = (fromValue * 9.0f / 5.0f) + 32.0f;
}else {
if(fromValue < 0) {
Toast.makeText(this, "Value cannot be negative.", Toast.LENGTH_LONG).show();
} else {
toValue = fromValue * ratio;
}
}
toTextView.setText(String.valueOf(f.format(toValue)));
}
@Override
public void onClick(View v) {
if(v.getId() == R.id.ApplyButton){
GBPRate = Float.parseFloat(GBPEditText.getText().toString());
EURRate = Float.parseFloat(EUREditText.getText().toString());
JPYRate = Float.parseFloat(JPYEditText.getText().toString());
GBPLabel.setVisibility(View.GONE);
GBPEditText.setVisibility(View.GONE);
EURLabel.setVisibility(View.GONE);
EUREditText.setVisibility(View.GONE);
JPYLabel.setVisibility(View.GONE);
JPYEditText.setVisibility(View.GONE);
ApplyButton.setVisibility(View.GONE);
if (actPos[conversionSpinner.getSelectedItemPosition()] == 6) {
ratio = GBPRate;
}
if (actPos[conversionSpinner.getSelectedItemPosition()] == 7) {
ratio = EURRate;
}
if (actPos[conversionSpinner.getSelectedItemPosition()] == 8) {
ratio = JPYRate;
}
calcAndDisplay();
}
}
private void setSpinner() {
ArrayAdapter<CharSequence> adapter;
switch (convtype) {
case 1:
adapter = ArrayAdapter.createFromResource(this, R.array.convenglish,
android.R.layout.simple_spinner_item);
break;
case 2:
adapter = ArrayAdapter.createFromResource(this, R.array.convmetric,
android.R.layout.simple_spinner_item);
break;
case 3:
adapter = ArrayAdapter.createFromResource(this, R.array.convcurrency,
android.R.layout.simple_spinner_item);
break;
default:
adapter = ArrayAdapter.createFromResource(this, R.array.conversions,
android.R.layout.simple_spinner_item);
break;
}
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
conversionSpinner.setAdapter(adapter);
}
}
| {'content_hash': 'e80f9aac21e4d4d4e4ff89a37c777c0a', 'timestamp': '', 'source': 'github', 'line_count': 326, 'max_line_length': 81, 'avg_line_length': 29.012269938650306, 'alnum_prop': 0.7150560372171707, 'repo_name': 'javaprocrammer/Conversions', 'id': '8ea94761b7bbc9651665c317e89177b5357ed5de', 'size': '9458', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'ConversionsActivity.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '26560'}]} |
package sigar
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestGosigar(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Gosigar Suite")
}
| {'content_hash': '3ceddf47bc27000abd57f935a188335f', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 32, 'avg_line_length': 14.384615384615385, 'alnum_prop': 0.7005347593582888, 'repo_name': 'pandemicsyn/megacfs', 'id': 'd6add37336a5d6fa3308068b3ea6e2c9ddbb3bca', 'size': '187', 'binary': False, 'copies': '12', 'ref': 'refs/heads/master', 'path': 'vendor/github.com/cloudfoundry/gosigar/sigar_suite_test.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Go', 'bytes': '486905'}, {'name': 'Makefile', 'bytes': '8419'}, {'name': 'Protocol Buffer', 'bytes': '17596'}, {'name': 'Shell', 'bytes': '13092'}, {'name': 'VimL', 'bytes': '1044'}]} |
'use strict';
angular.module('myApp.entity', []).
factory('genders', function(){
var _gender = [{value:'Male', text:'male'},
{value:'Female', text:'female'}];
return{gender: _gender};
})
.factory('newUsers', function(){
var _newUser = function(users){
var user = {
"name": users.name || '',
"email": users.email || '',
"qualification": users.qualification || '',
"mobile": users.mobile || '',
"skills": users.skills || '',
"location": users.location.name || '',
"year_passing": users.year_passing || '',
"gender": users.gender || '',
"current_employer": ('work' in users) ? users.work[0].employer.name : ""
}
return user;
}
return{newUser:_newUser};
}); | {'content_hash': 'bd7f79efef05a0105b36ddf530c52eff', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 75, 'avg_line_length': 26.0, 'alnum_prop': 0.5883190883190883, 'repo_name': 'joshineeraj/resume-app', 'id': '087c7e5342bd67a9e485721214d1126f76101b93', 'size': '702', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/js/entity.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '81365'}, {'name': 'CoffeeScript', 'bytes': '1267'}, {'name': 'JavaScript', 'bytes': '61960'}, {'name': 'Ruby', 'bytes': '503'}, {'name': 'Shell', 'bytes': '2577'}]} |
<!DOCTYPE html>
<!--
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html>
<head>
<title>Using Stylesheet Parser Plugin — CKEditor Sample</title>
<meta charset="utf-8">
<script src="../../../ckeditor.js"></script>
<script src="../../../samples/sample.js"></script>
<link rel="stylesheet" href="../../../samples/sample.css">
<meta name="ckeditor-sample-required-plugins" content="stylescombo">
<meta name="ckeditor-sample-name" content="Stylesheet Parser plugin">
<meta name="ckeditor-sample-description" content="Using the Stylesheet Parser plugin to fill the Styles drop-down list based on the CSS classes available in the document stylesheet.">
<meta name="ckeditor-sample-group" content="Plugins">
</head>
<body>
<h1 class="samples">
<a href="../../../samples/index.html">CKEditor Samples</a> » Using the Stylesheet Parser Plugin
</h1>
<div class="description">
<p>
This sample shows how to configure CKEditor instances to use the
<strong>Stylesheet Parser</strong> (<code>stylesheetparser</code>) plugin that fills
the <strong>Styles</strong> drop-down list based on the CSS rules available in the document stylesheet.
</p>
<p>
To add a CKEditor instance using the <code>stylesheetparser</code> plugin, insert
the following JavaScript call into your code:
</p>
<pre class="samples">
CKEDITOR.replace( '<em>textarea_id</em>', {
<strong>extraPlugins: 'stylesheetparser'</strong>
});</pre>
<p>
Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
the <code><textarea></code> element to be replaced with CKEditor.
</p>
</div>
<form action="../../../samples/sample_posteddata.php" method="post">
<p>
<label for="editor1">
CKEditor using the <code>stylesheetparser</code> plugin with its default configuration:
</label>
<textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>
<script>
// This call can be placed at any point after the
// <textarea>, or inside a <head><script> in a
// window.onload event handler.
// Replace the <textarea id="editor"> with an CKEditor
// instance, using default configurations.
CKEDITOR.replace( 'editor1' , {
extraPlugins: 'stylesheetparser',
// Stylesheet for the contents.
contentsCss: 'assets/sample.css',
// Do not load the default Styles configuration.
stylesSet: []
});
</script>
</p>
<p>
<input type="submit" value="Submit">
</p>
</form>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>
| {'content_hash': '776d4da8bffe9eec3a8a8bce2be894d3', 'timestamp': '', 'source': 'github', 'line_count': 82, 'max_line_length': 216, 'avg_line_length': 37.51219512195122, 'alnum_prop': 0.6791287386215865, 'repo_name': 'sfarmar/Orchard', 'id': 'b61d68c3d047f2f27d27bb032b76e2b2524c8b6e', 'size': '3076', 'binary': False, 'copies': '10', 'ref': 'refs/heads/master', 'path': 'src/Orchard.Web/Modules/CKEditor/Scripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ASP', 'bytes': '1401'}, {'name': 'C', 'bytes': '4755'}, {'name': 'C#', 'bytes': '8037024'}, {'name': 'CSS', 'bytes': '580393'}, {'name': 'JavaScript', 'bytes': '3899205'}, {'name': 'PHP', 'bytes': '2203'}, {'name': 'Shell', 'bytes': '6837'}, {'name': 'TypeScript', 'bytes': '48134'}, {'name': 'XSLT', 'bytes': '119918'}]} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2011, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<module xmlns="urn:jboss:module:1.3" name="org.jboss.ws.tools.wsprovide">
<properties>
<property name="jboss.api" value="private"/>
<property name="jboss.require-java-version" value="1.7"/>
</properties>
<main-class name="org.jboss.ws.tools.cmd.WSProvide"/>
<dependencies>
<module name="org.jboss.logmanager" services="import"/>
<module name="org.jboss.ws.tools.common"/>
</dependencies>
</module>
| {'content_hash': 'ec8d34b9524bd27869fdbd81f4ae1b37', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 73, 'avg_line_length': 39.51282051282051, 'alnum_prop': 0.7014925373134329, 'repo_name': 'NemesisShooter/CI346', 'id': '2b55a5f914c7b694611a5681c7d289601b045da7', 'size': '1541', 'binary': False, 'copies': '19', 'ref': 'refs/heads/master', 'path': 'target/wildfly-run/wildfly-10.1.0.Final/modules/system/layers/base/org/jboss/ws/tools/wsprovide/main/module.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '60635'}, {'name': 'CSS', 'bytes': '1678'}, {'name': 'HTML', 'bytes': '26204'}, {'name': 'Java', 'bytes': '5105'}, {'name': 'JavaScript', 'bytes': '746679'}, {'name': 'PowerShell', 'bytes': '28008'}, {'name': 'Shell', 'bytes': '68732'}]} |
package com.hubspot.singularity;
import io.dropwizard.lifecycle.ServerLifecycleListener;
import java.util.concurrent.atomic.AtomicReference;
import javax.inject.Inject;
import org.eclipse.jetty.server.Server;
import com.google.common.base.Optional;
import com.google.inject.Provider;
public class ServerProvider implements Provider<Optional<Server>>, ServerLifecycleListener
{
private final AtomicReference<Server> serverHolder = new AtomicReference<>();
@Inject
public ServerProvider() {
}
@Override
public Optional<Server> get() {
return Optional.fromNullable(serverHolder.get());
}
@Override
public void serverStarted(Server server) {
serverHolder.set(server);
}
}
| {'content_hash': '76eabf31d4ea743f763752569fd9f3be', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 90, 'avg_line_length': 22.741935483870968, 'alnum_prop': 0.774468085106383, 'repo_name': 'nvoron23/Singularity', 'id': '7bc4344372af7a1600af9c71de3c2f482a3ee248', 'size': '705', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'SingularityService/src/main/java/com/hubspot/singularity/ServerProvider.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '18637'}, {'name': 'CoffeeScript', 'bytes': '135910'}, {'name': 'HTML', 'bytes': '19364'}, {'name': 'Handlebars', 'bytes': '121574'}, {'name': 'Java', 'bytes': '1277536'}, {'name': 'JavaScript', 'bytes': '44273'}, {'name': 'Python', 'bytes': '27068'}, {'name': 'Ruby', 'bytes': '8543'}, {'name': 'Shell', 'bytes': '11512'}]} |
import React from 'react'
import { Image, Grid, Rail, Segment } from 'stardust'
const RailExample = () => (
<Grid columns={3}>
<Grid.Column>
<Segment>
<Image src='http://semantic-ui.com/images/wireframe/paragraph.png' />
<Rail position='left'>
<Segment>Left Rail Content</Segment>
</Rail>
<Rail position='right'>
<Segment>Right Rail Content</Segment>
</Rail>
</Segment>
</Grid.Column>
</Grid>
)
export default RailExample
| {'content_hash': '8b755aab0bbc3c2af98192357f923751', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 77, 'avg_line_length': 23.181818181818183, 'alnum_prop': 0.5882352941176471, 'repo_name': 'jamiehill/stardust', 'id': 'ab3385d2dfd835138139637e99e172dbc8f4873d', 'size': '510', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'docs/app/Examples/elements/Rail/Types/RailExample.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '460612'}]} |
'use strict';
var dynamoose = require('../');
dynamoose.AWS.config.update({
accessKeyId: 'AKID',
secretAccessKey: 'SECRET',
region: 'us-east-1'
});
dynamoose.local();
var Schema = dynamoose.Schema;
var should = require('should');
describe('Scan', function (){
this.timeout(5000);
before(function (done) {
dynamoose.setDefaults({ prefix: '' });
var dogSchema = new Schema({
ownerId: {
type: Number,
validate: function(v) { return v > 0; },
hashKey: true
},
breed: {
type: String,
trim: true,
required: true,
index: {
global: true,
rangeKey: 'ownerId',
name: 'BreedIndex',
project: true, // ProjectionType: ALL
throughput: 5 // read and write are both 5
}
},
name: {
type: String,
rangeKey: true,
index: true // name: nameLocalIndex, ProjectionType: ALL
},
color: {
lowercase: true,
type: [String],
default: ['Brown']
},
cartoon: {
type: Boolean
}
});
function addDogs (dogs) {
if(dogs.length <= 0) {
return done();
}
var dog = new Dog(dogs.pop());
dog.save(function (err) {
if (err) {
return done(err);
}
addDogs(dogs);
});
}
var Dog = dynamoose.model('Dog', dogSchema);
addDogs([
{ownerId:1, name: 'Foxy Lady', breed: 'Jack Russell Terrier ', color: ['White', 'Brown', 'Black']},
{ownerId:2, name: 'Quincy', breed: 'Jack Russell Terrier', color: ['White', 'Brown']},
{ownerId:2, name: 'Princes', breed: 'Jack Russell Terrier', color: ['White', 'Brown']},
{ownerId:3, name: 'Toto', breed: 'Terrier', color: ['Brown']},
{ownerId:4, name: 'Odie', breed: 'Beagle', color: ['Tan'], cartoon: true},
{ownerId:5, name: 'Pluto', breed: 'unknown', color: ['Mustard'], cartoon: true},
{ownerId:6, name: 'Brian Griffin', breed: 'unknown', color: ['White']},
{ownerId:7, name: 'Scooby Doo', breed: 'Great Dane', cartoon: true},
{ownerId:8, name: 'Blue', breed: 'unknown', color: ['Blue'], cartoon: true},
{ownerId:9, name: 'Lady', breed: ' Cocker Spaniel', cartoon: true},
{ownerId:10, name: 'Copper', breed: 'Hound', cartoon: true},
{ownerId:11, name: 'Old Yeller', breed: 'unknown', color: ['Tan']},
{ownerId:12, name: 'Hooch', breed: 'Dogue de Bordeaux', color: ['Brown']},
{ownerId:13, name: 'Rin Tin Tin', breed: 'German Shepherd'},
{ownerId:14, name: 'Benji', breed: 'unknown'},
{ownerId:15, name: 'Wishbone', breed: 'Jack Russell Terrier', color: ['White']},
{ownerId:16, name: 'Marley', breed: 'Labrador Retriever', color: ['Yellow']},
{ownerId:17, name: 'Beethoven', breed: 'St. Bernard'},
{ownerId:18, name: 'Lassie', breed: 'Collie', color: ['tan', 'white']},
{ownerId:19, name: 'Snoopy', breed: 'Beagle', color: ['black', 'white'], cartoon: true}]);
});
after(function (done) {
var Dog = dynamoose.model('Dog');
Dog.$__.table.delete(function (err) {
if(err) {
done(err);
}
delete dynamoose.models.Dog;
done();
});
});
it('Scan for all items', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan().exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(20);
done();
});
});
it('Scan on one attribute', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('breed').eq('Jack Russell Terrier').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(4);
done();
});
});
it('Scan on two attribute', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('breed').eq(' Jack Russell Terrier').and().where('color').contains('black').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(1);
done();
});
});
it('Scan on two attribute and a not', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('breed').eq('Jack Russell Terrier').and().where('color').not().contains('black').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(3);
done();
});
});
it('Scan with eq', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('breed').eq('Jack Russell Terrier').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(4);
done();
});
});
it('Scan with not eq', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('breed').not().eq('Jack Russell Terrier').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(16);
done();
});
});
it('Scan with null', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('cartoon').null().exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(13);
done();
});
});
it('Scan with not null', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('cartoon').not().null().exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(7);
done();
});
});
it('Scan with lt', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('ownerId').lt(2).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(1);
done();
});
});
it('Scan with not lt', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('ownerId').not().lt(2).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(19);
done();
});
});
it('Scan with gt', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('ownerId').gt(2).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(17);
done();
});
});
it('Scan with not gt', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('ownerId').not().gt(2).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(3);
done();
});
});
it('Scan with le', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('ownerId').le(2).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(3);
done();
});
});
it('Scan with not le', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('ownerId').not().le(2).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(17);
done();
});
});
it('Scan with ge', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('ownerId').ge(2).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(19);
done();
});
});
it('Scan with not ge', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('ownerId').not().ge(2).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(1);
done();
});
});
it('Scan with contains', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('breed').contains('Terrier').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(5);
done();
});
});
it('Scan with not contains', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('breed').not().contains('Terrier').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(15);
done();
});
});
it('Scan with beginsWith', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('name').beginsWith('B').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(4);
done();
});
});
it('Scan with not beginsWith (error)', function (done) {
var Dog = dynamoose.model('Dog');
(function() {
Dog.scan('name').not().beginsWith('B').exec(function () {
should.not.exist(true);
});
}).should.throw('Invalid scan state: beginsWith() cannot follow not()');
done();
});
it('Scan with in', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('breed').in(['Beagle', 'Hound']).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(3);
done();
});
});
it('Scan with not in (error)', function (done) {
var Dog = dynamoose.model('Dog');
(function() {
Dog.scan('name').not().in(['Beagle', 'Hound']).exec(function () {
should.not.exist(true);
});
}).should.throw('Invalid scan state: in() cannot follow not()');
done();
});
it('Scan with between', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan('ownerId').between(5, 8).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(4);
done();
});
});
it('Scan with not between (error)', function (done) {
var Dog = dynamoose.model('Dog');
(function() {
Dog.scan('ownerId').not().between(5, 8).exec(function () {
should.not.exist(true);
});
}).should.throw('Invalid scan state: between() cannot follow not()');
done();
});
it('Scan with limit', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan().limit(5).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(5);
done();
});
});
it('Scan with startAt key', function (done) {
var Dog = dynamoose.model('Dog');
var key = { ownerId: { N: '15' }, name: { S: 'Wishbone' } };
Dog.scan().startAt(key).exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(15);
done();
});
});
it('Scan with limit', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan().attributes(['name', 'breed']).exec(function (err, dogs) {
should.not.exist(err);
dogs[0].should.not.have.property('ownerId');
dogs[0].should.not.have.property('color');
dogs[0].should.have.property('name');
dogs[0].should.have.property('breed');
done();
});
});
it('Scan with ANDed filters (default)', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan().filter('breed').eq('unknown').filter('name').eq('Benji').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(1);
done();
});
});
it('Scan with ANDed filter', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan().and().filter('breed').eq('unknown').filter('name').eq('Benji').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(1);
done();
});
});
it('Scan with ORed filters', function (done) {
var Dog = dynamoose.model('Dog');
Dog.scan().or().filter('breed').eq('unknown').filter('name').eq('Odie').exec(function (err, dogs) {
should.not.exist(err);
dogs.length.should.eql(6);
done();
});
});
});
| {'content_hash': 'a8788bd5864a1468b1f8f2fcba28e0da', 'timestamp': '', 'source': 'github', 'line_count': 436, 'max_line_length': 121, 'avg_line_length': 25.53211009174312, 'alnum_prop': 0.5560546173194395, 'repo_name': 'sessionliang/dynamodel', 'id': 'd867b8c92b1e7f42514c38dd75b84b0f9976bf03', 'size': '11133', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/Scan.spec.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '100060'}]} |
class CreateTerms < ActiveRecord::Migration
def up
create_table :terms, id: false do |t|
t.integer :id
t.string :title, null: false
t.string :year, null: false
t.timestamps
end
execute "ALTER TABLE terms ADD PRIMARY KEY(id);"
end
def down
drop_table :terms
end
end
| {'content_hash': 'ded354cf851213352a6626f86c9c5dc5', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 52, 'avg_line_length': 18.529411764705884, 'alnum_prop': 0.6349206349206349, 'repo_name': 'AlJohri/coursescope', 'id': '3df5d6f4f1e385c26be5f0fc5b2deb93e271f192', 'size': '315', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'db/migrate/20131113035034_create_terms.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2911'}, {'name': 'CoffeeScript', 'bytes': '7642'}, {'name': 'JavaScript', 'bytes': '3890'}, {'name': 'Ruby', 'bytes': '93416'}]} |
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:paddingTop="20dp" >
<ImageView
android:id="@+id/empty_page_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="@drawable/selector_empty_page_image" />
<TextView
android:id="@+id/empty_page_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/empty_page_image"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:text="点击重新加载"
android:textColor="@color/empty_page_text"
android:textSize="16dp" />
</RelativeLayout> | {'content_hash': '4529283b97167138101384e3e88e2cd2', 'timestamp': '', 'source': 'github', 'line_count': 26, 'max_line_length': 74, 'avg_line_length': 36.19230769230769, 'alnum_prop': 0.667375132837407, 'repo_name': 'ice-coffee/WormBook', 'id': '0ed8d49fb29d5237951a3f127fafcf33d21f48a5', 'size': '953', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/res/layout/view_empty_page.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Webbprojekt</title>
<link rel="stylesheet" type="text/css" href="CSS-AdminSida/användareCSS.css">
<link rel="stylesheet" type="text/css" href="CSS-AdminSida/Font.css">
<link rel="stylesheet" type="text/css" href="CSS-AdminSida/scrollbar.css">
<link rel="stylesheet" type="text/css" href="CSS-AdminSida/unsemantic-grid-responsive-tablet.css">
<script type="text/javascript" src="Javascript-AdminSida/jquery-1.12.3.min.js"></script>
<script src="Javascript-AdminSida/editUser.js"></script>
<script src="Javascript-AdminSida/createUser.js"></script>
<script src="Javascript-AdminSida/drawList.js"></script>
<script src="Javascript-AdminSida/createClass.js"></script>
</head>
<body>
<div>
<div class="grid-90 prefix-20 grid-parent">
<ul class="tab-list">
<li class="grid-20 prefix-5 userButton reload-list"><a href="#skapaAnvandare" class="userA tab-control">Skapa Användare</a></li>
<li class="grid-20 prefix-5 userButton reload-list"><a href="#hanteraAnvandare" class="userA tab-control">Hantera Användare</a></li>
</ul>
</div>
<section class="grid-100 tab-panel grid-parent" id="skapaAnvandare">
<form class="grid-30" name="myForm" id="myForm">
<section class="formSection">
<label for="firstname">Förnamn</label>
<input type="text" id="firstname" name="myName">
<label class="grid-100 validationLabel" data-ng-show="myForm.myName.$touched && myForm.myName.$invalid">Du måste skriva in ett namn.</label>
</section>
<section class="formSection">
<label for="lastname">Efternamn</label>
<input type="text" id="lastname" name="myLastname">
<label class="grid-100 validationLabel" data-ng-show="myForm.myLastname.$touched && myForm.myLastname.$invalid">Du måste skriva in ett efternamn.</label>
</section>
<section class="formSection">
<label for="email">Email</label>
<input type="text" id="email" name="myEmail">
<label class="grid-100 validationLabel" data-ng-show="myForm.myEmail.$touched && myForm.myEmail.$invalid">Du måste skriva in en email.</label>
</section>
<section class="formSection">
<label for="password">Lösenord</label>
<input type="text" id="password" name="myPassword">
<label class="grid-100 validationLabel" data-ng-show="myForm.myPassword.$touched && myForm.myPassword.$invalid">Du måste skriva in ett lösenord.</label>
</section>
<section class="formSection">
<label for="klass">Klasser</label>
<select name="Klasser" id="klass" class="classList">
</select>
</section>
<button id="createUser" class="reload-list">Skapa användare</button>
</form>
<form class="grid-30 prefix-30" id="skapaKlassForm">
<label for="inputClass">Skapa klass</label>
<input type="text" id="inputClass">
<button id="createClass" class="reload-list">Skapa klass</button>
</form>
</section>
<section class="grid-100 tab-panel grid-parent" id="hanteraAnvandare">
<section id="centerAlign">
<section class="grid-75 prefix-10" id="ulSection">
<label>Studenter</label>
<div id="handleUl" class="grid-100">
</div>
</section>
<form class="grid-100" name="Form" id="form">
<section class="grid-90 prefix-5 handleForm">
<section class="formSection">
<label for="handleFirstname">Förnamn:</label>
<input type="text" id="handleFirstname" class="handleInput" name="myName">
</section>
<section class="formSection">
<label for="handleLastname">Efternamn:</label>
<input type="text" id="handleLastname" class="handleInput" name="myLastname">
</section>
</section>
<section class="grid-90 prefix-5 handleForm">
<section class="formSection">
<label for="handleEmail">Email:</label>
<input type="text" id="handleEmail" class="handleInput" name="myEmail">
</section>
<section class="formSection" id="labelPw">
<label for="handlePassword">Lösenord:</label>
<input type="text" id="handlePassword" class="handleInput" name="myPassword">
</section>
</section>
<section class="grid-90 prefix-5 handleForm">
<section class="formSection">
<label for="handleKlass">Klasser:</label>
<select name="Klasser" id="handleKlass" class="classList">
</select>
</section>
<button id="handleButton" class="reload-list">Uppdatera uppgifter</button>
</section>
</form>
</section>
</section>
<script type="text/javascript" src="Javascript-AdminSida/användareTabs.js"></script>
</div>
</body>
</html>
| {'content_hash': '9e3649471cbe98487589e266edc74614', 'timestamp': '', 'source': 'github', 'line_count': 127, 'max_line_length': 165, 'avg_line_length': 42.07874015748032, 'alnum_prop': 0.5827095808383234, 'repo_name': 'JoakimRW/WebbProjektDreamTeam', 'id': '397da985d0f48e819a84096a8a159165a0464f7a', 'size': '5358', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'AdminSida/anvandare.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '219937'}, {'name': 'HTML', 'bytes': '46105'}, {'name': 'JavaScript', 'bytes': '80158'}]} |
"""This is an integration test for the Dataproc-luigi binding.
This test requires credentials that can access GCS & access to a bucket below.
Follow the directions in the gcloud tools to set up local credentials.
"""
import unittest
try:
import oauth2client
import httplib2
from luigi.contrib import dataproc
from googleapiclient import discovery
default_credentials = oauth2client.client.GoogleCredentials.get_application_default()
default_client = discovery.build('dataproc', 'v1', credentials=default_credentials, http=httplib2.Http())
dataproc.set_dataproc_client(default_client)
except ImportError:
raise unittest.SkipTest('Unable to load google cloud dependencies')
import luigi
import os
import time
from nose.plugins.attrib import attr
# In order to run this test, you should set these to your GCS project.
# Unfortunately there's no mock
PROJECT_ID = os.environ.get('DATAPROC_TEST_PROJECT_ID', 'your_project_id_here')
CLUSTER_NAME = os.environ.get('DATAPROC_TEST_CLUSTER', 'unit-test-cluster')
REGION = os.environ.get('DATAPROC_REGION', 'global')
IMAGE_VERSION = '1-0'
class _DataprocBaseTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
@attr('gcloud')
class DataprocTaskTest(_DataprocBaseTestCase):
def test_1_create_cluster(self):
success = luigi.run(['--local-scheduler',
'--no-lock',
'CreateDataprocClusterTask',
'--gcloud-project-id=' + PROJECT_ID,
'--dataproc-cluster-name=' + CLUSTER_NAME])
self.assertTrue(success)
def test_2_create_cluster_should_notice_existing_cluster_and_return_immediately(self):
job_start = time.time()
success = luigi.run(['--local-scheduler',
'--no-lock',
'CreateDataprocClusterTask',
'--gcloud-project-id=' + PROJECT_ID,
'--dataproc-cluster-name=' + CLUSTER_NAME])
self.assertTrue(success)
self.assertLess(time.time() - job_start, 3)
def test_3_submit_minimal_job(self):
# The job itself will fail because the job files don't exist
# We don't care, because then we would be testing spark
# We care the job was submitted correctly, so that's what we test
luigi.run(['--local-scheduler',
'--no-lock',
'DataprocSparkTask',
'--gcloud-project-id=' + PROJECT_ID,
'--dataproc-cluster-name=' + CLUSTER_NAME,
'--main-class=my.MinimalMainClass'])
response = dataproc.get_dataproc_client().projects().regions().jobs() \
.list(projectId=PROJECT_ID, region=REGION, clusterName=CLUSTER_NAME).execute()
lastJob = response['jobs'][0]['sparkJob']
self.assertEquals(lastJob['mainClass'], "my.MinimalMainClass")
def test_4_submit_spark_job(self):
# The job itself will fail because the job files don't exist
# We don't care, because then we would be testing spark
# We care the job was submitted correctly, so that's what we test
luigi.run(['--local-scheduler',
'--no-lock',
'DataprocSparkTask',
'--gcloud-project-id=' + PROJECT_ID,
'--dataproc-cluster-name=' + CLUSTER_NAME,
'--main-class=my.MainClass',
'--jars=one.jar,two.jar',
'--job-args=foo,bar'])
response = dataproc.get_dataproc_client().projects().regions().jobs() \
.list(projectId=PROJECT_ID, region=REGION, clusterName=CLUSTER_NAME).execute()
lastJob = response['jobs'][0]['sparkJob']
self.assertEquals(lastJob['mainClass'], "my.MainClass")
self.assertEquals(lastJob['jarFileUris'], ["one.jar", "two.jar"])
self.assertEquals(lastJob['args'], ["foo", "bar"])
def test_5_submit_pyspark_job(self):
# The job itself will fail because the job files don't exist
# We don't care, because then we would be testing pyspark
# We care the job was submitted correctly, so that's what we test
luigi.run(['--local-scheduler',
'--no-lock',
'DataprocPysparkTask',
'--gcloud-project-id=' + PROJECT_ID,
'--dataproc-cluster-name=' + CLUSTER_NAME,
'--job-file=main_job.py',
'--extra-files=extra1.py,extra2.py',
'--job-args=foo,bar'])
response = dataproc.get_dataproc_client().projects().regions().jobs()\
.list(projectId=PROJECT_ID, region=REGION, clusterName=CLUSTER_NAME).execute()
lastJob = response['jobs'][0]['pysparkJob']
self.assertEquals(lastJob['mainPythonFileUri'], "main_job.py")
self.assertEquals(lastJob['pythonFileUris'], ["extra1.py", "extra2.py"])
self.assertEquals(lastJob['args'], ["foo", "bar"])
def test_6_delete_cluster(self):
success = luigi.run(['--local-scheduler',
'--no-lock',
'DeleteDataprocClusterTask',
'--gcloud-project-id=' + PROJECT_ID,
'--dataproc-cluster-name=' + CLUSTER_NAME])
self.assertTrue(success)
def test_7_delete_cluster_should_return_immediately_if_no_cluster(self):
job_start = time.time()
success = luigi.run(['--local-scheduler',
'--no-lock',
'DeleteDataprocClusterTask',
'--gcloud-project-id=' + PROJECT_ID,
'--dataproc-cluster-name=' + CLUSTER_NAME])
self.assertTrue(success)
self.assertLess(time.time() - job_start, 3)
def test_8_create_cluster_image_version(self):
success = luigi.run(['--local-scheduler',
'--no-lock',
'CreateDataprocClusterTask',
'--gcloud-project-id=' + PROJECT_ID,
'--dataproc-cluster-name=' + CLUSTER_NAME + '-' + IMAGE_VERSION,
'--image-version=1.0'])
self.assertTrue(success)
def test_9_delete_cluster_image_version(self):
success = luigi.run(['--local-scheduler',
'--no-lock',
'DeleteDataprocClusterTask',
'--gcloud-project-id=' + PROJECT_ID,
'--dataproc-cluster-name=' + CLUSTER_NAME + '-' + IMAGE_VERSION])
self.assertTrue(success)
| {'content_hash': 'da873398261909d065c5f7622ef86b3e', 'timestamp': '', 'source': 'github', 'line_count': 158, 'max_line_length': 109, 'avg_line_length': 42.87341772151899, 'alnum_prop': 0.5682019486271036, 'repo_name': 'ehdr/luigi', 'id': '3bc6f4756fa1a9e5129b7d446e3ebb71316a0921', 'size': '6774', 'binary': False, 'copies': '7', 'ref': 'refs/heads/master', 'path': 'test/contrib/dataproc_test.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '2162'}, {'name': 'HTML', 'bytes': '39979'}, {'name': 'JavaScript', 'bytes': '155711'}, {'name': 'Python', 'bytes': '1693115'}, {'name': 'Shell', 'bytes': '2627'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>vst: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.1+1 / vst - 2.8</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
vst
<small>
2.8
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-05-15 03:35:13 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-15 03:35:13 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.7.1+1 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
synopsis: "Verified Software Toolchain"
description: "The software toolchain includes static analyzers to check assertions about your program; optimizing compilers to translate your program to machine language; operating systems and libraries to supply context for your program. The Verified Software Toolchain project assures with machine-checked proofs that the assertions claimed at the top of the toolchain really hold in the machine-language program, running in the operating-system context."
authors: [
"Andrew W. Appel"
"Lennart Beringer"
"Sandrine Blazy"
"Qinxiang Cao"
"Santiago Cuellar"
"Robert Dockins"
"Josiah Dodds"
"Nick Giannarakis"
"Samuel Gruetter"
"Aquinas Hobor"
"Jean-Marie Madiot"
"William Mansky"
]
maintainer: "VST team"
homepage: "http://vst.cs.princeton.edu/"
dev-repo: "git+https://github.com/PrincetonUniversity/VST.git"
bug-reports: "https://github.com/PrincetonUniversity/VST/issues"
license: "https://raw.githubusercontent.com/PrincetonUniversity/VST/master/LICENSE"
patches: [ "0001-Fix-issue-485-make-install-with-IGNORECOQVERSION.patch" ]
build: [
[make "-j%{jobs}%" "IGNORECOQVERSION=true" "BITSIZE=64"]
]
install: [
[make "install" "IGNORECOQVERSION=true" "BITSIZE=64"]
]
depends: [
"ocaml"
"coq" {>= "8.12" & < "8.15~"}
"coq-compcert" {= "3.9"}
"coq-flocq" {>= "3.2.1"}
]
tags: [
"category:Computer Science/Semantics and Compilation/Semantics"
"keyword:C"
"logpath:VST"
"date:2021-06-01"
]
url {
src: "https://github.com/PrincetonUniversity/VST/archive/v2.8.tar.gz"
checksum: "sha512=80fae7277baf77319c9789fe4d170857862798988980f14c6ca4e11e5e027aff5dbf908848a193f90b0fb2a0dd7d12cf5f4446e2e5c13682e636d89838a08cae"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-vst.2.8 coq.8.7.1+1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+1).
The following dependencies couldn't be met:
- coq-vst -> coq >= 8.12
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-vst.2.8</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {'content_hash': 'ffde7664b9dbc10d7268d1216c9a886a', 'timestamp': '', 'source': 'github', 'line_count': 187, 'max_line_length': 467, 'avg_line_length': 42.00534759358289, 'alnum_prop': 0.5714831317632082, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': 'e92ff91c1b5e8121d1fcb6c920fad0891fd3fb9c', 'size': '7880', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.05.0-2.0.1/released/8.7.1+1/vst/2.8.html', 'mode': '33188', 'license': 'mit', 'language': []} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Boost.Polygon's rectangle_data</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Geometry">
<link rel="up" href="../boost_polygon.html" title="Boost.Polygon">
<link rel="prev" href="point_data.html" title="Boost.Polygon's point_data">
<link rel="next" href="polygon_data.html" title="Boost.Polygon's polygon_data">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="point_data.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_polygon.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="polygon_data.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="geometry.reference.adapted.boost_polygon.rectangle_data"></a><a class="link" href="rectangle_data.html" title="Boost.Polygon's rectangle_data">Boost.Polygon's
rectangle_data</a>
</h5></div></div></div>
<p>
Boost.Polygon's rectangle type (boost::polygon::rectangle_data) is adapted
to the Boost.Geometry Point Concept.
</p>
<h6>
<a name="geometry.reference.adapted.boost_polygon.rectangle_data.h0"></a>
<span class="phrase"><a name="geometry.reference.adapted.boost_polygon.rectangle_data.description"></a></span><a class="link" href="rectangle_data.html#geometry.reference.adapted.boost_polygon.rectangle_data.description">Description</a>
</h6>
<p>
Boost.Polygon's points (as well as polygons) can be used by Boost.Geometry.
The two libraries can therefore be used together. Using a boost::polygon::rectangle_data<...>,
algorithms from both Boost.Polygon and Boost.Geometry can be called.
</p>
<h6>
<a name="geometry.reference.adapted.boost_polygon.rectangle_data.h1"></a>
<span class="phrase"><a name="geometry.reference.adapted.boost_polygon.rectangle_data.model_of"></a></span><a class="link" href="rectangle_data.html#geometry.reference.adapted.boost_polygon.rectangle_data.model_of">Model
of</a>
</h6>
<p>
<a class="link" href="../../concepts/concept_box.html" title="Box Concept">Box Concept</a>
</p>
<h6>
<a name="geometry.reference.adapted.boost_polygon.rectangle_data.h2"></a>
<span class="phrase"><a name="geometry.reference.adapted.boost_polygon.rectangle_data.header"></a></span><a class="link" href="rectangle_data.html#geometry.reference.adapted.boost_polygon.rectangle_data.header">Header</a>
</h6>
<p>
<code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="identifier">boost_polygon</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
The standard header <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span></code>
does not include this header.
</p>
<h6>
<a name="geometry.reference.adapted.boost_polygon.rectangle_data.h3"></a>
<span class="phrase"><a name="geometry.reference.adapted.boost_polygon.rectangle_data.example"></a></span><a class="link" href="rectangle_data.html#geometry.reference.adapted.boost_polygon.rectangle_data.example">Example</a>
</h6>
<p>
Shows how to use Boost.Polygon rectangle_data within Boost.Geometry
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="identifier">boost_polygon</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">polygon</span><span class="special">::</span><span class="identifier">rectangle_data</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="identifier">rect</span><span class="special">;</span>
<span class="identifier">rect</span> <span class="identifier">b</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">polygon</span><span class="special">::</span><span class="identifier">construct</span><span class="special"><</span><span class="identifier">rect</span><span class="special">>(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">,</span> <span class="number">4</span><span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Area (using Boost.Geometry): "</span>
<span class="special"><<</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">area</span><span class="special">(</span><span class="identifier">b</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Area (using Boost.Polygon): "</span>
<span class="special"><<</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">polygon</span><span class="special">::</span><span class="identifier">area</span><span class="special">(</span><span class="identifier">b</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
</p>
<p>
Output:
</p>
<pre class="programlisting">Area (using Boost.Geometry): 4
Area (using Boost.Polygon): 4
</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2009-2021 Barend Gehrels,
Bruno Lalande, Mateusz Loskot, Adam Wulkiewicz, Oracle and/or its affiliates<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="point_data.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_polygon.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="polygon_data.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {'content_hash': 'e51e2e985d984857e7ea2f222ba7ad82', 'timestamp': '', 'source': 'github', 'line_count': 112, 'max_line_length': 628, 'avg_line_length': 87.80357142857143, 'alnum_prop': 0.6548708562131381, 'repo_name': 'arangodb/arangodb', 'id': 'b35282493dbfd42a328b8f9c7a430f45d9e94c76', 'size': '9837', 'binary': False, 'copies': '4', 'ref': 'refs/heads/devel', 'path': '3rdParty/boost/1.78.0/libs/geometry/doc/html/geometry/reference/adapted/boost_polygon/rectangle_data.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '61827'}, {'name': 'C', 'bytes': '311036'}, {'name': 'C++', 'bytes': '35149373'}, {'name': 'CMake', 'bytes': '387268'}, {'name': 'CSS', 'bytes': '210549'}, {'name': 'EJS', 'bytes': '232160'}, {'name': 'HTML', 'bytes': '23114'}, {'name': 'JavaScript', 'bytes': '33841256'}, {'name': 'LLVM', 'bytes': '15003'}, {'name': 'NASL', 'bytes': '381737'}, {'name': 'NSIS', 'bytes': '47138'}, {'name': 'Pascal', 'bytes': '75391'}, {'name': 'Perl', 'bytes': '9811'}, {'name': 'PowerShell', 'bytes': '6806'}, {'name': 'Python', 'bytes': '190515'}, {'name': 'SCSS', 'bytes': '255542'}, {'name': 'Shell', 'bytes': '133576'}, {'name': 'TypeScript', 'bytes': '179074'}, {'name': 'Yacc', 'bytes': '79620'}]} |
Spree::User.class_eval do
has_many :tasks, through: :efforts
has_many :time_sheets
has_many :efforts
end | {'content_hash': 'fb65de6504ad2937d73e7ecd29faccd4', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 36, 'avg_line_length': 22.0, 'alnum_prop': 0.7272727272727273, 'repo_name': 'DekaFugihara/spree_timesheet', 'id': '78440ffa56102c02eaeff9496cbf887009bb868b', 'size': '110', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'app/models/spree/user_decorator.rb', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '111'}, {'name': 'HTML', 'bytes': '15906'}, {'name': 'JavaScript', 'bytes': '598'}, {'name': 'Ruby', 'bytes': '60397'}]} |
import initialState from 'store/initialState';
import { TOGGLE_MENU_VISIBILITY } from 'atomic/toggleMenu';
export default function menuShowing(
state = initialState.app.menuShowing,
action
) {
switch (action.type) {
case TOGGLE_MENU_VISIBILITY: {
const { menuShowing } = action.payload;
return menuShowing;
}
default: {
return state;
}
}
}
| {'content_hash': 'ea111b389ab0cfc1d52ea43146ee9cb0', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 59, 'avg_line_length': 22.529411764705884, 'alnum_prop': 0.6736292428198434, 'repo_name': 'jebeck/nefelion', 'id': '8c49b1685fb474ae825a876cccf5366610f5543a', 'size': '383', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'redux/reducers/menuShowing.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '71819'}]} |
Template['cubEditForm'].helpers({
});
Template['cubEditForm'].events({
'submit form': function(){
console.log("Submit");
}
});
| {'content_hash': 'ae17144e97ba4f1b2cec6d64d9c110d4', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 33, 'avg_line_length': 16.25, 'alnum_prop': 0.6538461538461539, 'repo_name': 'ankaimer/meteor', 'id': '15242a0d4b401c3763a55945cfdce6d684d06ba2', 'size': '130', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'badges/client/modules/cubEditForm/cubEditForm.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '27895'}, {'name': 'CoffeeScript', 'bytes': '2386'}, {'name': 'HTML', 'bytes': '36084'}, {'name': 'JavaScript', 'bytes': '791065'}]} |
'use strict'
// @ts-expect-error no types
const Reader = require('it-reader')
const debug = require('debug')
const multistream = require('./multistream')
// @ts-expect-error no types
const handshake = require('it-handshake')
const lp = require('it-length-prefixed')
const { pipe } = require('it-pipe')
const log = Object.assign(debug('mss:ls'), {
error: debug('mss:ls:error')
})
/**
* @typedef {import('bl/BufferList')} BufferList
* @typedef {import('./types').DuplexStream<Uint8Array | BufferList>} DuplexStream
* @typedef {import('./types').AbortOptions} AbortOptions
*/
/**
* @param {DuplexStream} stream
* @param {AbortOptions} [options]
*/
module.exports = async function ls (stream, options) {
const { reader, writer, rest, stream: shakeStream } = handshake(stream)
log('write "ls"')
multistream.write(writer, 'ls')
rest()
// Next message from remote will be (e.g. for 2 protocols):
// <varint-msg-len><varint-proto-name-len><proto-name>\n<varint-proto-name-len><proto-name>\n
const res = await multistream.read(reader, options)
// After reading response we have:
// <varint-proto-name-len><proto-name>\n<varint-proto-name-len><proto-name>\n
const protocolsReader = Reader([res])
/**
* @type {string[]}
*/
const protocols = []
// Decode each of the protocols from the reader
await pipe(
protocolsReader,
lp.decode(),
async (/** @type {AsyncIterable<BufferList>} */ source) => {
for await (const protocol of source) {
// Remove the newline
protocols.push(protocol.shallowSlice(0, -1).toString())
}
}
)
/** @type {{ stream: DuplexStream, protocols: string[] }} */
const output = { stream: shakeStream, protocols }
return output
}
| {'content_hash': '36f1d61c53aa4d5e29cda821505ab0d1', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 95, 'avg_line_length': 28.06451612903226, 'alnum_prop': 0.6609195402298851, 'repo_name': 'multiformats/js-multistream', 'id': '53511b8c4fbb40c5dd41680f4ad0251ad8f57bde', 'size': '1740', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/ls.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '15180'}]} |
require 'spec_helper'
RSpec.configure do |c|
c.os = 'RedHat'
end
describe lxc('ct01') do
it { should exist }
its(:command) { should eq "lxc-ls -1 | grep -w ct01" }
end
describe lxc('invalid-ct') do
it { should_not exist }
end
describe lxc('ct01') do
it { should be_running }
its(:command) { should eq "lxc-info -n ct01 -t RUNNING"}
end
describe lxc('invalid-ct') do
it { should_not be_running }
end
| {'content_hash': '8b43a34dc035be70fc0c9365ee3c5778', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 58, 'avg_line_length': 17.458333333333332, 'alnum_prop': 0.6515513126491647, 'repo_name': 'jgmchan/serverspec', 'id': 'a5ed51ada05ebeaa83be6fea2055189ef144848e', 'size': '419', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'spec/redhat/lxc_spec.rb', 'mode': '33188', 'license': 'mit', 'language': []} |
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var _a, _b, _c, _d, _e;
import { Padding } from "../util/padding";
import { CartesianChart } from "./cartesianChart";
import { GroupedCategoryChart } from "./groupedCategoryChart";
import { NumberAxis } from "./axis/numberAxis";
import { CategoryAxis } from "./axis/categoryAxis";
import { GroupedCategoryAxis } from "./axis/groupedCategoryAxis";
import { LineSeries } from "./series/cartesian/lineSeries";
import { BarSeries } from "./series/cartesian/barSeries";
import { HistogramSeries } from "./series/cartesian/histogramSeries";
import { ScatterSeries } from "./series/cartesian/scatterSeries";
import { AreaSeries } from "./series/cartesian/areaSeries";
import { PolarChart } from "./polarChart";
import { PieSeries } from "./series/polar/pieSeries";
import { AxisLabel, AxisTick } from "../axis";
import { TimeAxis } from "./axis/timeAxis";
import { Caption } from "../caption";
import { DropShadow } from "../scene/dropShadow";
import { Legend, LegendPosition, LegendItem, LegendMarker, LegendLabel } from "./legend";
import { Navigator } from "./navigator/navigator";
import { NavigatorMask } from "./navigator/navigatorMask";
import { NavigatorHandle } from "./navigator/navigatorHandle";
import { CartesianSeriesMarker } from "./series/cartesian/cartesianSeries";
import { Chart } from "./chart";
import { HierarchyChart } from "./hierarchyChart";
import { TreemapSeries } from "./series/hierarchy/treemapSeries";
/*
This file defines the specs for creating different kinds of charts, but
contains no code that uses the specs to actually create charts
*/
var chartPadding = 20;
var commonChartMappings = {
background: {
meta: {
defaults: {
visible: true,
fill: 'white'
}
}
},
padding: {
meta: {
constructor: Padding,
defaults: {
top: chartPadding,
right: chartPadding,
bottom: chartPadding,
left: chartPadding
}
}
},
tooltip: {
meta: {
defaults: {
enabled: true,
tracking: true,
delay: 0,
class: Chart.defaultTooltipClass
}
}
},
title: {
meta: {
constructor: Caption,
defaults: {
enabled: false,
padding: {
meta: {
constructor: Padding,
defaults: {
top: 10,
right: 10,
bottom: 10,
left: 10
}
}
},
text: 'Title',
fontStyle: undefined,
fontWeight: 'bold',
fontSize: 14,
fontFamily: 'Verdana, sans-serif',
color: 'rgb(70, 70, 70)'
}
}
},
subtitle: {
meta: {
constructor: Caption,
defaults: {
enabled: false,
padding: {
meta: {
constructor: Padding,
defaults: {
top: 10,
right: 10,
bottom: 10,
left: 10
}
}
},
text: 'Subtitle',
fontStyle: undefined,
fontWeight: undefined,
fontSize: 12,
fontFamily: 'Verdana, sans-serif',
color: 'rgb(140, 140, 140)'
}
}
},
legend: {
meta: {
constructor: Legend,
defaults: {
enabled: true,
position: LegendPosition.Right,
spacing: 20
}
},
item: {
meta: {
constructor: LegendItem,
defaults: {
paddingX: 16,
paddingY: 8
}
},
marker: {
meta: {
constructor: LegendMarker,
defaults: {
shape: undefined,
size: 15,
strokeWidth: 1,
padding: 8
}
}
},
label: {
meta: {
constructor: LegendLabel,
defaults: {
color: 'black',
fontStyle: undefined,
fontWeight: undefined,
fontSize: 12,
fontFamily: 'Verdana, sans-serif'
}
}
}
}
}
};
var chartDefaults = {
container: undefined,
autoSize: true,
width: 600,
height: 300,
data: [],
title: undefined,
subtitle: undefined,
padding: {},
background: {},
legend: {
item: {
marker: {},
label: {}
}
},
navigator: {
mask: {},
minHandle: {},
maxHandle: {}
},
listeners: undefined
};
var chartMeta = {
// Charts components' constructors normally don't take any parameters (which makes things consistent -- everything
// is configured the same way, via the properties, and makes the factory pattern work well) but the charts
// themselves are the exceptions.
// If a chart config has the (optional) `document` property, it will be passed to the constructor.
// There is no actual `document` property on the chart, it can only be supplied during instantiation.
constructorParams: ['document'],
setAsIs: ['container', 'data', 'tooltipOffset'],
nonSerializable: ['container', 'data']
};
var axisDefaults = {
defaults: {
visibleRange: [0, 1],
label: {},
tick: {},
title: {},
line: {},
gridStyle: [{
stroke: 'rgb(219, 219, 219)',
lineDash: [4, 2]
}]
}
};
var seriesDefaults = {
visible: true,
showInLegend: true,
listeners: undefined
};
var columnSeriesDefaults = {
fillOpacity: 1,
strokeOpacity: 1,
xKey: '',
xName: '',
yKeys: [],
yNames: [],
grouped: false,
normalizedTo: undefined,
strokeWidth: 1,
lineDash: undefined,
lineDashOffset: 0,
shadow: undefined,
highlightStyle: {
fill: 'yellow'
}
};
var shadowMapping = {
shadow: {
meta: {
constructor: DropShadow,
defaults: {
enabled: true,
color: 'rgba(0, 0, 0, 0.5)',
xOffset: 0,
yOffset: 0,
blur: 5
}
}
}
};
var labelDefaults = {
enabled: true,
fontStyle: undefined,
fontWeight: undefined,
fontSize: 12,
fontFamily: 'Verdana, sans-serif',
color: 'rgb(70, 70, 70)'
};
var barLabelMapping = {
label: {
meta: {
defaults: __assign(__assign({}, labelDefaults), { formatter: undefined })
}
}
};
var tooltipMapping = {
tooltip: {
meta: {
defaults: {
enabled: true,
renderer: undefined,
format: undefined
}
}
}
};
var axisMappings = {
line: {
meta: {
defaults: {
width: 1,
color: 'rgb(195, 195, 195)'
}
}
},
title: {
meta: {
constructor: Caption,
defaults: {
padding: {
meta: {
constructor: Padding,
defaults: {
top: 10,
right: 10,
bottom: 10,
left: 10
}
}
},
text: 'Axis Title',
fontStyle: undefined,
fontWeight: 'bold',
fontSize: 12,
fontFamily: 'Verdana, sans-serif',
color: 'rgb(70, 70, 70)'
}
}
},
label: {
meta: {
constructor: AxisLabel,
defaults: {
fontStyle: undefined,
fontWeight: undefined,
fontSize: 12,
fontFamily: 'Verdana, sans-serif',
padding: 5,
rotation: 0,
color: 'rgb(87, 87, 87)',
formatter: undefined
}
}
},
tick: {
meta: {
constructor: AxisTick,
defaults: {
width: 1,
size: 6,
color: 'rgb(195, 195, 195)',
count: 10
}
}
}
};
var mappings = (_a = {},
_a[CartesianChart.type] = __assign(__assign({ meta: __assign(__assign({ constructor: CartesianChart }, chartMeta), { defaults: __assign(__assign({}, chartDefaults), { axes: [{
type: NumberAxis.type,
position: 'left'
}, {
type: CategoryAxis.type,
position: 'bottom'
}] }) }) }, commonChartMappings), { axes: (_b = {},
_b[NumberAxis.type] = __assign({ meta: __assign({ constructor: NumberAxis, setAsIs: ['gridStyle', 'visibleRange'] }, axisDefaults) }, axisMappings),
_b[CategoryAxis.type] = __assign({ meta: __assign({ constructor: CategoryAxis, setAsIs: ['gridStyle', 'visibleRange'] }, axisDefaults) }, axisMappings),
_b[GroupedCategoryAxis.type] = __assign({ meta: __assign({ constructor: GroupedCategoryAxis, setAsIs: ['gridStyle', 'visibleRange'] }, axisDefaults) }, axisMappings),
_b[TimeAxis.type] = __assign({ meta: __assign({ constructor: TimeAxis, setAsIs: ['gridStyle', 'visibleRange'] }, axisDefaults) }, axisMappings),
_b), series: (_c = {
column: __assign(__assign(__assign({ meta: {
constructor: BarSeries,
setAsIs: ['lineDash'],
defaults: __assign(__assign({ flipXY: false }, seriesDefaults), columnSeriesDefaults)
}, highlightStyle: {} }, tooltipMapping), barLabelMapping), shadowMapping)
},
_c[BarSeries.type] = __assign(__assign(__assign({ meta: {
constructor: BarSeries,
setAsIs: ['lineDash'],
defaults: __assign(__assign({ flipXY: true }, seriesDefaults), columnSeriesDefaults)
}, highlightStyle: {} }, tooltipMapping), barLabelMapping), shadowMapping),
_c[LineSeries.type] = __assign(__assign({ meta: {
constructor: LineSeries,
setAsIs: ['lineDash'],
defaults: __assign(__assign({}, seriesDefaults), { title: undefined, xKey: '', xName: '', yKey: '', yName: '', strokeWidth: 2, strokeOpacity: 1, lineDash: undefined, lineDashOffset: 0, highlightStyle: {
fill: 'yellow'
} })
} }, tooltipMapping), { highlightStyle: {}, marker: {
meta: {
constructor: CartesianSeriesMarker,
defaults: {
enabled: true,
shape: 'circle',
size: 6,
maxSize: 30,
strokeWidth: 1,
formatter: undefined
}
}
} }),
_c[ScatterSeries.type] = __assign(__assign({ meta: {
constructor: ScatterSeries,
defaults: __assign(__assign({}, seriesDefaults), { title: undefined, xKey: '', yKey: '', sizeKey: undefined, labelKey: undefined, xName: '', yName: '', sizeName: 'Size', labelName: 'Label', strokeWidth: 2, fillOpacity: 1, strokeOpacity: 1, highlightStyle: {
fill: 'yellow'
} })
} }, tooltipMapping), { highlightStyle: {}, marker: {
meta: {
constructor: CartesianSeriesMarker,
defaults: {
enabled: true,
shape: 'circle',
size: 6,
maxSize: 30,
strokeWidth: 1,
formatter: undefined
}
}
} }),
_c[AreaSeries.type] = __assign(__assign(__assign({ meta: {
constructor: AreaSeries,
setAsIs: ['lineDash'],
defaults: __assign(__assign({}, seriesDefaults), { xKey: '', xName: '', yKeys: [], yNames: [], normalizedTo: undefined, fillOpacity: 1, strokeOpacity: 1, strokeWidth: 2, lineDash: undefined, lineDashOffset: 0, shadow: undefined, highlightStyle: {
fill: 'yellow'
} })
} }, tooltipMapping), { highlightStyle: {}, marker: {
meta: {
constructor: CartesianSeriesMarker,
defaults: {
enabled: true,
shape: 'circle',
size: 6,
maxSize: 30,
strokeWidth: 1,
formatter: undefined
}
}
} }), shadowMapping),
_c[HistogramSeries.type] = __assign(__assign(__assign({ meta: {
constructor: HistogramSeries,
setAsIs: ['lineDash'],
defaults: __assign(__assign({}, seriesDefaults), { title: undefined, xKey: '', yKey: '', xName: '', yName: '', strokeWidth: 1, fillOpacity: 1, strokeOpacity: 1, lineDash: undefined, lineDashOffset: 0, areaPlot: false, binCount: undefined, bins: undefined, aggregation: 'sum', highlightStyle: {
fill: 'yellow'
} })
} }, tooltipMapping), { highlightStyle: {}, label: {
meta: {
defaults: __assign(__assign({}, labelDefaults), { formatter: undefined })
}
} }), shadowMapping),
_c), navigator: {
meta: {
constructor: Navigator,
defaults: {
enabled: false,
height: 30,
min: 0,
max: 1
}
},
mask: {
meta: {
constructor: NavigatorMask,
defaults: {
fill: '#999999',
stroke: '#999999',
strokeWidth: 1,
fillOpacity: 0.2
}
}
},
minHandle: {
meta: {
constructor: NavigatorHandle,
defaults: {
fill: '#f2f2f2',
stroke: '#999999',
strokeWidth: 1,
width: 8,
height: 16,
gripLineGap: 2,
gripLineLength: 8
}
}
},
maxHandle: {
meta: {
constructor: NavigatorHandle,
defaults: {
fill: '#f2f2f2',
stroke: '#999999',
strokeWidth: 1,
width: 8,
height: 16,
gripLineGap: 2,
gripLineLength: 8
}
}
}
} }),
_a[PolarChart.type] = __assign(__assign({ meta: __assign(__assign({ constructor: PolarChart }, chartMeta), { defaults: __assign(__assign({}, chartDefaults), { padding: {
meta: {
constructor: Padding,
defaults: {
top: 40,
right: 40,
bottom: 40,
left: 40
}
}
} }) }) }, commonChartMappings), { series: (_d = {},
_d[PieSeries.type] = __assign(__assign(__assign({ meta: {
constructor: PieSeries,
setAsIs: ['lineDash'],
defaults: __assign(__assign({}, seriesDefaults), { title: undefined, angleKey: '', angleName: '', radiusKey: undefined, radiusName: undefined, labelKey: undefined, labelName: undefined, callout: {}, fillOpacity: 1, strokeOpacity: 1, rotation: 0, outerRadiusOffset: 0, innerRadiusOffset: 0, strokeWidth: 1, lineDash: undefined, lineDashOffset: 0, shadow: undefined })
} }, tooltipMapping), { highlightStyle: {}, title: {
meta: {
constructor: Caption,
defaults: {
enabled: true,
padding: {
meta: {
constructor: Padding,
defaults: {
top: 10,
right: 10,
bottom: 10,
left: 10
}
}
},
text: 'Series Title',
fontStyle: undefined,
fontWeight: 'bold',
fontSize: 14,
fontFamily: 'Verdana, sans-serif',
color: 'black'
}
}
}, label: {
meta: {
defaults: __assign(__assign({}, labelDefaults), { offset: 3, minAngle: 20 })
}
}, callout: {
meta: {
defaults: {
length: 10,
strokeWidth: 1
}
}
} }), shadowMapping),
_d) }),
_a[HierarchyChart.type] = __assign(__assign({ meta: __assign(__assign({ constructor: HierarchyChart }, chartMeta), { defaults: __assign({}, chartDefaults) }) }, commonChartMappings), { series: (_e = {},
_e[TreemapSeries.type] = __assign({ meta: {
constructor: TreemapSeries,
defaults: __assign(__assign({}, seriesDefaults), { showInLegend: false })
} }, tooltipMapping),
_e) }),
_a);
// Amend the `mappings` object with aliases for different chart types.
{
var typeToAliases = {
cartesian: ['line', 'area', 'bar', 'column'],
polar: ['pie'],
hierarchy: ['treemap']
};
var _loop_1 = function (type) {
typeToAliases[type].forEach(function (alias) {
mappings[alias] = mappings[type];
});
};
for (var type in typeToAliases) {
_loop_1(type);
}
}
// Special handling for scatter and histogram charts, for which both axes should default to type `number`.
mappings['scatter'] =
mappings['histogram'] = __assign(__assign({}, mappings.cartesian), { meta: __assign(__assign({}, mappings.cartesian.meta), { defaults: __assign(__assign({}, chartDefaults), { axes: [{
type: 'number',
position: 'bottom'
}, {
type: 'number',
position: 'left'
}] }) }) });
var groupedCategoryChartMapping = Object.create(mappings[CartesianChart.type]);
var groupedCategoryChartMeta = Object.create(groupedCategoryChartMapping.meta);
groupedCategoryChartMeta.constructor = GroupedCategoryChart;
groupedCategoryChartMapping.meta = groupedCategoryChartMeta;
mappings[GroupedCategoryChart.type] = groupedCategoryChartMapping;
export default mappings;
| {'content_hash': '9673d465d291c415b408a5a35ba58b6f', 'timestamp': '', 'source': 'github', 'line_count': 564, 'max_line_length': 386, 'avg_line_length': 37.45744680851064, 'alnum_prop': 0.4330682571239231, 'repo_name': 'ceolter/ag-grid', 'id': '0190dcc801f0e6b94acbb1125b90cf70ec6e22f2', 'size': '21126', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'charts-packages/ag-charts-community/dist/es6/chart/agChartMappings.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '37765'}, {'name': 'JavaScript', 'bytes': '22118'}, {'name': 'TypeScript', 'bytes': '1267988'}]} |
%GETBRANCHPIXEL Get branch-pixels from skeleton
%
% SYNOPSIS:
% image_out = getbranchpixel(image_in, connectivity, edgeCondition)
%
% PARAMETERS:
% connectivity: defines the neighborhood:
% * 1 indicates 4-connected neighbors in 2D or 6-connected in 3D.
% * 2 indicates 8-connected neighbors in 2D
% * 3 indicates 28-connected neighbors in 3D
% edgeCondition: defines the value of the pixels outside the image. It can
% be 0/'background' or 1/'foreground'.
%
% DEFAULTS:
% connectivity = 0 (equal to ndims(image_in))
% edgeCondition = 'background'
% (c)2017, Cris Luengo.
% Based on original DIPlib code: (c)1995-2014, Delft University of Technology.
% Based on original DIPimage code: (c)1999-2014, Delft University of Technology.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
% See the License for the specific language governing permissions and
% limitations under the License.
function image_out = getbranchpixel(image_in, connectivity, edgeCondition)
if nargin < 3
edgeCondition = 'background';
if nargin < 2
connectivity = 0;
end
end
image_out = countneighbors(image_in,'foreground',connectivity,edgeCondition) > 3;
| {'content_hash': 'c89446da9f9fc7bdea3582264d325fed', 'timestamp': '', 'source': 'github', 'line_count': 41, 'max_line_length': 81, 'avg_line_length': 38.0, 'alnum_prop': 0.7400513478818999, 'repo_name': 'DIPlib/diplib', 'id': 'edb564c2d561e63f20c6e90aa3f80d93ee3c627a', 'size': '1558', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'dipimage/getbranchpixel.m', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '4572'}, {'name': 'C', 'bytes': '3829'}, {'name': 'C++', 'bytes': '6124225'}, {'name': 'CMake', 'bytes': '133083'}, {'name': 'Java', 'bytes': '22792'}, {'name': 'M', 'bytes': '906'}, {'name': 'MATLAB', 'bytes': '1322116'}, {'name': 'NSIS', 'bytes': '5595'}, {'name': 'Python', 'bytes': '16657'}, {'name': 'Shell', 'bytes': '10142'}]} |
package com.amazonaws.services.resiliencehub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/resiliencehub-2020-04-30/DeleteRecommendationTemplate"
* target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeleteRecommendationTemplateRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters.
* You should not reuse the same client token for other API requests.
* </p>
*/
private String clientToken;
/**
* <p>
* The Amazon Resource Name (ARN) for a recommendation template.
* </p>
*/
private String recommendationTemplateArn;
/**
* <p>
* Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters.
* You should not reuse the same client token for other API requests.
* </p>
*
* @param clientToken
* Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII
* characters. You should not reuse the same client token for other API requests.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
* <p>
* Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters.
* You should not reuse the same client token for other API requests.
* </p>
*
* @return Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII
* characters. You should not reuse the same client token for other API requests.
*/
public String getClientToken() {
return this.clientToken;
}
/**
* <p>
* Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters.
* You should not reuse the same client token for other API requests.
* </p>
*
* @param clientToken
* Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII
* characters. You should not reuse the same client token for other API requests.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteRecommendationTemplateRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
* <p>
* The Amazon Resource Name (ARN) for a recommendation template.
* </p>
*
* @param recommendationTemplateArn
* The Amazon Resource Name (ARN) for a recommendation template.
*/
public void setRecommendationTemplateArn(String recommendationTemplateArn) {
this.recommendationTemplateArn = recommendationTemplateArn;
}
/**
* <p>
* The Amazon Resource Name (ARN) for a recommendation template.
* </p>
*
* @return The Amazon Resource Name (ARN) for a recommendation template.
*/
public String getRecommendationTemplateArn() {
return this.recommendationTemplateArn;
}
/**
* <p>
* The Amazon Resource Name (ARN) for a recommendation template.
* </p>
*
* @param recommendationTemplateArn
* The Amazon Resource Name (ARN) for a recommendation template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteRecommendationTemplateRequest withRecommendationTemplateArn(String recommendationTemplateArn) {
setRecommendationTemplateArn(recommendationTemplateArn);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).append(",");
if (getRecommendationTemplateArn() != null)
sb.append("RecommendationTemplateArn: ").append(getRecommendationTemplateArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DeleteRecommendationTemplateRequest == false)
return false;
DeleteRecommendationTemplateRequest other = (DeleteRecommendationTemplateRequest) obj;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
if (other.getRecommendationTemplateArn() == null ^ this.getRecommendationTemplateArn() == null)
return false;
if (other.getRecommendationTemplateArn() != null && other.getRecommendationTemplateArn().equals(this.getRecommendationTemplateArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getRecommendationTemplateArn() == null) ? 0 : getRecommendationTemplateArn().hashCode());
return hashCode;
}
@Override
public DeleteRecommendationTemplateRequest clone() {
return (DeleteRecommendationTemplateRequest) super.clone();
}
}
| {'content_hash': 'b3b08d1d3f1c7a18d91994ee28497e61', 'timestamp': '', 'source': 'github', 'line_count': 173, 'max_line_length': 150, 'avg_line_length': 35.59537572254335, 'alnum_prop': 0.6555699902565768, 'repo_name': 'aws/aws-sdk-java', 'id': 'af5396d786bd0c13fa0afbe903c0090757d9e8df', 'size': '6738', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'aws-java-sdk-resiliencehub/src/main/java/com/amazonaws/services/resiliencehub/model/DeleteRecommendationTemplateRequest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Chat\V1\Service\User;
use Twilio\ListResource;
use Twilio\Values;
use Twilio\Version;
class UserChannelList extends ListResource {
/**
* Construct the UserChannelList
*
* @param Version $version Version that contains the resource
* @param string $serviceSid The service_sid
* @param string $userSid The sid
* @return \Twilio\Rest\Chat\V1\Service\User\UserChannelList
*/
public function __construct(Version $version, $serviceSid, $userSid) {
parent::__construct($version);
// Path Solution
$this->solution = array(
'serviceSid' => $serviceSid,
'userSid' => $userSid,
);
$this->uri = '/Services/' . rawurlencode($serviceSid) . '/Users/' . rawurlencode($userSid) . '/Channels';
}
/**
* Streams UserChannelInstance records from the API as a generator stream.
* This operation lazily loads records as efficiently as possible until the
* limit
* is reached.
* The results are returned as a generator, so this operation is memory
* efficient.
*
* @param int $limit Upper limit for the number of records to return. stream()
* guarantees to never return more than limit. Default is no
* limit
* @param mixed $pageSize Number of records to fetch per request, when not set
* will use the default value of 50 records. If no
* page_size is defined but a limit is defined, stream()
* will attempt to read the limit with the most
* efficient page size, i.e. min(limit, 1000)
* @return \Twilio\Stream stream of results
*/
public function stream($limit = null, $pageSize = null) {
$limits = $this->version->readLimits($limit, $pageSize);
$page = $this->page($limits['pageSize']);
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
}
/**
* Reads UserChannelInstance records from the API as a list.
* Unlike stream(), this operation is eager and will load `limit` records into
* memory before returning.
*
* @param int $limit Upper limit for the number of records to return. read()
* guarantees to never return more than limit. Default is no
* limit
* @param mixed $pageSize Number of records to fetch per request, when not set
* will use the default value of 50 records. If no
* page_size is defined but a limit is defined, read()
* will attempt to read the limit with the most
* efficient page size, i.e. min(limit, 1000)
* @return UserChannelInstance[] Array of results
*/
public function read($limit = null, $pageSize = null) {
return iterator_to_array($this->stream($limit, $pageSize), false);
}
/**
* Retrieve a single page of UserChannelInstance records from the API.
* Request is executed immediately
*
* @param mixed $pageSize Number of records to return, defaults to 50
* @param string $pageToken PageToken provided by the API
* @param mixed $pageNumber Page Number, this value is simply for client state
* @return \Twilio\Page Page of UserChannelInstance
*/
public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) {
$params = Values::of(array(
'PageToken' => $pageToken,
'Page' => $pageNumber,
'PageSize' => $pageSize,
));
$response = $this->version->page(
'GET',
$this->uri,
$params
);
return new UserChannelPage($this->version, $response, $this->solution);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString() {
return '[Twilio.Chat.V1.UserChannelList]';
}
} | {'content_hash': '63b6942ba4e525f84c9b1fdfef94bf58', 'timestamp': '', 'source': 'github', 'line_count': 115, 'max_line_length': 113, 'avg_line_length': 37.28695652173913, 'alnum_prop': 0.5757929104477612, 'repo_name': 'xinyuanmmx/xazhgba', 'id': '10c34bee36a74933611190ea707357630ef21507', 'size': '4288', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'application/libraries/twilio-php-master/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '240'}, {'name': 'CSS', 'bytes': '312373'}, {'name': 'HTML', 'bytes': '5092'}, {'name': 'JavaScript', 'bytes': '1421468'}, {'name': 'Makefile', 'bytes': '9667'}, {'name': 'PHP', 'bytes': '5334771'}, {'name': 'Python', 'bytes': '9796'}, {'name': 'Shell', 'bytes': '333'}]} |
import PctTorrentProvider from './PctTorrentProvider'
export default PctTorrentProvider
| {'content_hash': 'bb2ef82c2ae712a0a867a9330ad0df51', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 53, 'avg_line_length': 29.666666666666668, 'alnum_prop': 0.8651685393258427, 'repo_name': 'TriPSs/popcorn-time-desktop', 'id': 'e1c66f8db407518df9277180d2fa48b02de4c982', 'size': '89', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'app/api/Torrents/PctTorrentProvider/index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '23407'}, {'name': 'HTML', 'bytes': '1243'}, {'name': 'JavaScript', 'bytes': '214602'}]} |
package com.google.samples.apps.iosched.server.schedule.input.fetcher;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonReader;
import com.google.samples.apps.iosched.server.schedule.Config;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* EntityFetcher that fetches entities from the schedule CMS's HTTP server.
*
* This will need to be modified to use a custom backend for your event.
*/
@SuppressWarnings("unused")
public class VendorAPIEntityFetcher implements EntityFetcher {
static Logger LOG = Logger.getLogger(VendorAPIEntityFetcher.class.getName());
// TODO: Hook up to your backend data source
public static final String BASE_URL = "UNDEFINED";
@Override
public JsonElement fetch(Enum<?> entityType, Map<String, String> params)
throws IOException {
StringBuilder urlStr = new StringBuilder(BASE_URL);
urlStr.append(entityType.name());
if (params != null && !params.isEmpty()) {
urlStr.append("?");
for (Map.Entry<String, String> param: params.entrySet()) {
urlStr.append(param.getKey()).append("=").append(param.getValue())
.append("&");
}
urlStr.deleteCharAt(urlStr.length()-1);
}
URL url = new URL(urlStr.toString());
if (LOG.isLoggable(Level.INFO)) {
LOG.info("URL requested: "+url);
}
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setReadTimeout(1000 * 30); // 30 seconds
connection.setRequestProperty("code", Config.CMS_API_CODE);
connection.setRequestProperty("apikey", Config.CMS_API_KEY);
InputStream stream = connection.getInputStream();
JsonReader reader = new JsonReader(new InputStreamReader(stream, Charset.forName("UTF-8")));
return new JsonParser().parse(reader);
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "HttpEntityFetcher(baseURL="+BASE_URL+")";
}
}
| {'content_hash': 'cb1b514716fccf057df2799ce347b2f9', 'timestamp': '', 'source': 'github', 'line_count': 68, 'max_line_length': 96, 'avg_line_length': 32.51470588235294, 'alnum_prop': 0.715513342379014, 'repo_name': 'amardeshbd/iosched', 'id': '2601d95726bc2b0ffd739b07befd9c7ae619730a', 'size': '2827', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'server/src/main/java/com/google/samples/apps/iosched/server/schedule/input/fetcher/VendorAPIEntityFetcher.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '6214'}, {'name': 'HTML', 'bytes': '44208'}, {'name': 'Java', 'bytes': '2205978'}, {'name': 'JavaScript', 'bytes': '19470'}, {'name': 'Shell', 'bytes': '5083'}]} |
path=/home/ubuntu/InstaCluster
#get the namenode host
namenode_ip=$(sh $path/script/get_configuration_parameter.sh hdfs-site dfs.namenode.http-address | cut -d ":" -f 1);
sudo -u ubuntu ssh $namenode_ip "sudo -u hdfs hdfs dfs -mkdir /spark-app-logs"
sudo -u ubuntu ssh $namenode_ip "sudo -u hdfs hdfs dfs -chmod 777 /spark-app-logs"
#start the master and the slaves
sudo $SPARK_HOME/sbin/start-master.sh
#start the jobserver (assumes that the spark job server is already in the image)
sudo $path/resources/job-server/server_start.sh
| {'content_hash': '5fe54cac0154b90d55682e761a46d83d', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 116, 'avg_line_length': 44.666666666666664, 'alnum_prop': 0.7555970149253731, 'repo_name': 'deib-polimi/InstaCluster', 'id': '9e11982415a5d9187bc9a29437e7c24c09c6499c', 'size': '549', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'script/spark/spark_start.sh', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Python', 'bytes': '2072'}, {'name': 'Shell', 'bytes': '39272'}]} |
/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */
#ifndef NATIVE_EXTENSION_VTK_VTKTEMPORALARRAYOPERATORFILTERWRAP_H
#define NATIVE_EXTENSION_VTK_VTKTEMPORALARRAYOPERATORFILTERWRAP_H
#include <nan.h>
#include <vtkSmartPointer.h>
#include <vtkTemporalArrayOperatorFilter.h>
#include "vtkMultiTimeStepAlgorithmWrap.h"
#include "../../plus/plus.h"
class VtkTemporalArrayOperatorFilterWrap : public VtkMultiTimeStepAlgorithmWrap
{
public:
using Nan::ObjectWrap::Wrap;
static void Init(v8::Local<v8::Object> exports);
static void InitPtpl();
static void ConstructorGetter(
v8::Local<v8::String> property,
const Nan::PropertyCallbackInfo<v8::Value>& info);
VtkTemporalArrayOperatorFilterWrap(vtkSmartPointer<vtkTemporalArrayOperatorFilter>);
VtkTemporalArrayOperatorFilterWrap();
~VtkTemporalArrayOperatorFilterWrap( );
static Nan::Persistent<v8::FunctionTemplate> ptpl;
private:
static void New(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetFirstTimeStepIndex(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetOperator(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetOutputArrayNameSuffix(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetSecondTimeStepIndex(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetFirstTimeStepIndex(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetOperator(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetOutputArrayNameSuffix(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetSecondTimeStepIndex(const Nan::FunctionCallbackInfo<v8::Value>& info);
#ifdef VTK_NODE_PLUS_VTKTEMPORALARRAYOPERATORFILTERWRAP_CLASSDEF
VTK_NODE_PLUS_VTKTEMPORALARRAYOPERATORFILTERWRAP_CLASSDEF
#endif
};
#endif
| {'content_hash': 'a13fddc8f86aa09b533327c9cd35e7f3', 'timestamp': '', 'source': 'github', 'line_count': 49, 'max_line_length': 89, 'avg_line_length': 40.83673469387755, 'alnum_prop': 0.7971014492753623, 'repo_name': 'axkibe/node-vtk', 'id': '85362e9581f88e56b0309b5088c7f05c14122755', 'size': '2001', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'wrappers/8.1.1/vtkTemporalArrayOperatorFilterWrap.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C++', 'bytes': '75388342'}, {'name': 'CMake', 'bytes': '915'}, {'name': 'JavaScript', 'bytes': '70'}, {'name': 'Roff', 'bytes': '145455'}]} |
import {join} from 'path'
import http from 'http'
import express from 'express'
import Rex from 'rexpress'
import mongoose from 'mongoose'
import middlewares from './middlewares'
import controllers from './controllers'
import fallback from 'express-history-api-fallback'
import config from './config'
const root = join(__dirname, 'public')
const router = express()
const app = new Rex(router)
const server = http.createServer(router)
const port = process.env.PORT || config.port
app.setMiddlewares(middlewares)
app.setControllers(controllers)
router.use(fallback('index.html', {root}))
mongoose.Promise = global.Promise
config.db(process.env.NODE_ENV)
.then((db) => {
return mongoose.connect(db, {useMongoClient: true})
})
.then(() => console.log('Conexion a BD con exito'))
.catch((err) => console.log(`ERROR: ${err}`))
server.listen(port, () => console.log(`Magic on ${port}`))
| {'content_hash': 'a4f429b989628dddbef7f9bd8509ab9b', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 58, 'avg_line_length': 28.870967741935484, 'alnum_prop': 0.7240223463687151, 'repo_name': 'Pablo-Rodriguez/alotroladodelapagina', 'id': '17f2ddbae03530ad2b01f13191097459f1f4099a', 'size': '896', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/backend/server.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '3722'}, {'name': 'HTML', 'bytes': '934'}, {'name': 'JavaScript', 'bytes': '668226'}, {'name': 'Shell', 'bytes': '318'}]} |
{% load i18n %}
<noscript><h3>{{ step }}</h3></noscript>
<div class="project_membership" data-show-roles="{{ step.show_roles|yesno }}">
<div class="header">
<div class="help_text">{{ step.help_text }}</div>
<div class="left">
<div class="fake_table fake_table_header">
<span class="users_title">{{ step.available_list_title }}</span>
<input type="text" name="available_users_filter" id="available_users" class="filter" placeholder="Filter">
</div>
</div>
<div class="right">
<div class="fake_table fake_table_header">
<span class="users_title">{{ step.members_list_title }}</span>
<input type="text" name="project_members_filter" id="project_members" class="filter" placeholder="Filter">
</div>
</div>
</div>
<div class="left filterable">
<div class="fake_table" id="available_users">
<ul class="available_users"></ul>
<ul class="no_results" id="no_available_users"><li>{{ step.no_available_text }}</li></ul>
</div>
</div>
<div class="right filterable">
<div class="fake_table" id="project_members">
<ul class="project_members"></ul>
<ul class="no_results" id="no_project_members"><li>{{ step.no_members_text }}</li></ul>
</div>
</div>
</div>
<div class="hide">
{% include "horizon/common/_form_fields.html" %}
</div>
| {'content_hash': '2f2c9af855ebb1a7001404eae2ebe6c3', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 114, 'avg_line_length': 34.69230769230769, 'alnum_prop': 0.6090169992609017, 'repo_name': 'fmyzjs/horizon-hacker', 'id': 'f8c909d8ce4f98ddfab8a892ecd62ca036788c2f', 'size': '1353', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'horizon/templates/horizon/common/_workflow_step_update_members.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'JavaScript', 'bytes': '267602'}, {'name': 'Python', 'bytes': '1562814'}, {'name': 'Shell', 'bytes': '12823'}]} |
#include "Utils.h"
#include "TestUtils.h"
#include "CardFolder.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace Test
{
TEST_CLASS(CardFolderTest)
{
public:
TEST_METHOD(Draw0Test)
{
CardFolder folder;
for (auto i = 0u; i < Card::NUM_CARDS; ++i) {
auto card = folder.draw();
Assert::IsTrue(card != card_p(),
wstrf("deck[%d] is null.", i).c_str());
Assert::IsFalse(card->to_string() == "Invalid card.",
wstrf("Card is broken.").c_str());
}
Assert::IsTrue(folder.draw() == card_p());
}
TEST_METHOD(Draw1Test)
{
CardFolder folder;
auto cs0 = folder.draw(0);
Assert::IsTrue(cs0.size() == 0,
wstrf("cs0 is not empty.").c_str());
auto cs5 = folder.draw(5);
for (auto i = 0u; i < 5; ++i) {
Assert::IsFalse(cs5[i]->to_string() == "Invalid card.",
wstrf("Card is broken.").c_str());
}
folder.draw(Card::NUM_CARDS - 5);
auto csFail = folder.draw(1);
Assert::IsTrue(csFail.size() == 0,
wstrf("csFail is not empty.").c_str());
}
TEST_METHOD(replaceTest)
{
CardFolder folder;
auto fullDeck = folder.draw(Card::NUM_CARDS);
auto first = fullDeck[0];
auto second = fullDeck[1];
folder.replace(second);
folder.replace(first);
auto pt2 = folder.draw();
Assert::IsTrue(*pt2 == *second,
wstrf("a: %s, b: %s", pt2->c_str(), second->c_str()).c_str());
auto pt1 = folder.draw();
Assert::IsTrue(*pt1 == *first), wstrf("a: %s, b: %s", pt1->c_str(), first->c_str()).c_str();
}
TEST_METHOD(shuffleTest)
{
auto cards = hand_t{
make_cp(Card::Suit::Spades, CR_A),
make_cp(Card::Suit::Spades, CR_2),
make_cp(Card::Suit::Spades, CR_3) };
CardFolder folder;
folder.shuffle();
auto cs = folder.draw(3);
Assert::IsTrue(
*(cs[0]) != *(cards[0]) || *(cs[1]) != *(cards[1]) || *(cs[2]) != *(cards[2]),
wstrf("shuffle() failed.").c_str());
}
TEST_METHOD(makeHandTest)
{
CardFolder folder;
Assert::IsTrue(folder.getHand() == PokerHand::NoHand,
wstrf("New folder hand is not empty.").c_str());
auto straightFlush = folder.draw(5);
for (auto& c : straightFlush) {
folder.addToHand(c);
}
auto hand = folder.getHand();
Assert::IsTrue(hand == PokerHand::StraightFlush,
wstrf("Actual hand: %s.", to_string(hand).c_str()).c_str());
folder.addToHand(folder.draw());
Assert::IsTrue(folder.getHand() == PokerHand::NoHand,
wstrf("Bad return with Over 5 hand.").c_str());
}
TEST_METHOD(focusTest)
{
try {
CardFolder folder;
auto first = folder.draw();
auto second = folder.draw();
auto third = folder.draw();
Assert::IsTrue(first == folder.getFocusedCard(),
wstrf("Initialize of Focus failed.").c_str());
folder.focusNext();
Assert::IsTrue(second == folder.getFocusedCard(),
wstrf("focusNext() failed.").c_str());
folder.focusNext();
folder.focusNext();
Assert::IsTrue(first == folder.getFocusedCard(),
wstrf("Cycle of focusNext() failed.").c_str());
folder.focusNext();
folder.focusPrevious();
Assert::IsTrue(first == folder.getFocusedCard(),
wstrf("focusPrevious() failed.").c_str());
folder.focusPrevious();
Assert::IsTrue(third == folder.getFocusedCard(),
wstrf("Cycle of focusPrevious() failed.").c_str());
folder.shuffle();
Assert::IsTrue(folder.getFocusedCard() == nullptr,
wstrf("Reset Focus failed.").c_str());
}
catch (const std::exception& ex) {
Logger::WriteMessage(wstrf("%s", ex.what()).c_str());
Assert::Fail();
}
}
};
} | {'content_hash': 'd0137fa66388c00bba1ea9949ac97517', 'timestamp': '', 'source': 'github', 'line_count': 122, 'max_line_length': 95, 'avg_line_length': 30.204918032786885, 'alnum_prop': 0.5845318860244233, 'repo_name': 'eka-tel72/tumbler_maze', 'id': 'accf92c362199b69cd4ca5e0d2f5da44daa360b8', 'size': '3764', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Test/CardFolderTest.cpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '43'}, {'name': 'C++', 'bytes': '172086'}, {'name': 'CSS', 'bytes': '307'}, {'name': 'HTML', 'bytes': '4425'}, {'name': 'Ruby', 'bytes': '1343'}, {'name': 'Shell', 'bytes': '41'}]} |
/**
* View: corpus statistic view
*
* @author Helge Stallkamp
*/
"use strict";
define(['view', 'vc/statistic', 'buttongroup'],
function (viewClass, statClass, buttonGroup) {
// Localization values
const loc = KorAP.Locale;
loc.REFRESH = loc.REFRESH || 'Refresh';
return {
create : function(vc, panel) {
return Object.create(viewClass).
_init([ 'vcstatistic' ]).
upgradeTo(this).
_init(vc, panel);
},
_init : function(vc, panel) {
this.vc = vc;
this.panel = panel;
return this;
},
/*
* Returns corpus of the view,
* vc is used to create the corpus query string
* which is needed to receive the corpus statistic from the server
* (see also getStatistic : function(cb) {...))
*/
getvc : function() {
return this.vc;
},
/**
* Receive Corpus statistic from the server
*/
getStatistic : function (cb) {
const vc = this.vc;
try {
KorAP.API.getCorpStat(vc.toQuery(), function(statResponse) {
if (statResponse === null) {
cb(null);
return;
}
if (statResponse === undefined) {
cb(null);
return;
}
// catches notifications
if (statResponse["notifications"] !== null
&& statResponse["notifications"] !== undefined) {
const notif = statResponse["notifications"];
KorAP.log(0, notif[0][1]);
cb(null);
return;
}
cb(statResponse);
});
}
catch (e) {
KorAP.log(0, e);
cb(null);
}
},
/**
* Show corpus statistic view
*/
show : function() {
if (this._show)
return this._show;
const statTable = document.createElement('div');
statTable.classList.add('stattable', 'loading');
/*
* Get corpus statistic, remove "loading"-image and
* append result to statTable
*/
this.getStatistic(function(statistic) {
statTable.classList.remove('loading');
if (statistic === null)
return;
statTable.appendChild(
statClass.create(statistic).element()
);
});
return this._show = statTable;
},
/**
* Checks if statistic has to be disabled
*/
checkStatActive : function () {
let newString = KorAP.vc.toQuery();
const oldString = this.vc.oldvcQuery;
/*
* Do ignore surrounding round brackets
* Definining an incomplete docGroup in the vc builder:
* (foo = bar and author = Goethe) and ...
* leads to
* vc.toQuery() -> (foo = bar and author=Goethe)
*/
if (newString || newString === '') {
if (newString.startsWith('(')) {
newString = newString.slice(1, newString.length-1);
};
if (newString != oldString) {
this.disableStat();
}
}
},
/**
* Disabling corpus statistic if in vc builder a different vc is choosen.
* After clicking at the reload-button the up-to-date corpus statistic is displayed.
*/
disableStat : function(){
const statt = this._show;
if (statt.getElementsByClassName('reloadStatB').length == 0) {
const btg = buttonGroup.create(['reloadStatB', 'button-panel']);
btg.add(loc.REFRESH, {'cls':['refresh', 'button-icon']}, function (e) {
statt.classList.remove('stdisabled');
this.panel.reloadCorpStat();
}.bind(this));
statt.appendChild(btg.element());
statt.classList.add('stdisabled');
};
},
/**
* Close the view.
*/
onClose : function() {
this.vc = undefined;
}
}
});
| {'content_hash': '2e51f98d1fe08c2dfc797050e8755774', 'timestamp': '', 'source': 'github', 'line_count': 161, 'max_line_length': 88, 'avg_line_length': 23.937888198757765, 'alnum_prop': 0.5293201868188895, 'repo_name': 'KorAP/Kalamar', 'id': 'bb7ca2c5fc9d58b73d6e659816931d3e64a67381', 'size': '3854', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'dev/js/src/view/vc/corpstatv.js', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'CSS', 'bytes': '94955'}, {'name': 'Dockerfile', 'bytes': '3368'}, {'name': 'HTML', 'bytes': '82202'}, {'name': 'JavaScript', 'bytes': '2713121'}, {'name': 'Perl', 'bytes': '184239'}, {'name': 'Raku', 'bytes': '53992'}, {'name': 'SCSS', 'bytes': '101938'}]} |
package com.github.gquintana.metrics.proxy;
import java.lang.reflect.Constructor;
import java.util.concurrent.ConcurrentHashMap;
/**
* {@link ProxyFactory} using reflection, but caching proxy constructors.
* Performance of proxy instantiation is improved (even faster than CGLib).
* But it may lead to classloader memory leaks.
*/
public class CachingProxyFactory implements ProxyFactory {
private final ConcurrentHashMap<ProxyClass, Constructor<?>> constructorCache = new ConcurrentHashMap<>();
@Override
public <T> T newProxy(ProxyHandler<T> proxyHandler, ProxyClass proxyClass) {
Constructor constructor = constructorCache.get(proxyClass);
if (constructor == null) {
constructor = proxyClass.createConstructor();
final Constructor oldConstructor = constructorCache.putIfAbsent(proxyClass, constructor);
constructor = oldConstructor == null ? constructor : oldConstructor;
}
try {
return (T) constructor.newInstance(proxyHandler);
} catch (ReflectiveOperationException reflectiveOperationException) {
throw new ProxyException(reflectiveOperationException);
}
}
/**
* Clears the constructor cache
*/
public void clearCache() {
constructorCache.clear();
}
}
| {'content_hash': '8e4dddb97ba170f7d22062fd7ffd0986', 'timestamp': '', 'source': 'github', 'line_count': 35, 'max_line_length': 109, 'avg_line_length': 37.714285714285715, 'alnum_prop': 0.7045454545454546, 'repo_name': 'gquintana/metrics-sql', 'id': '2a13f4d86bb991344e56a73e0ff2833ec1baca24', 'size': '1959', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/github/gquintana/metrics/proxy/CachingProxyFactory.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '164748'}]} |
using NServiceBus.Extensibility;
using NServiceBus.Routing;
using NServiceBus.Transport;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NServiceBus.Transport.Kafka.Tests
{
[TestFixture]
class When_consuming_messages:KafkaContext
{
int TIMEOUT = 20;
int MAXMESSAGES = 10;
/* [Test]
public async Task Should_block_until_a_message_is_available()
{
base.SetUp();
var message = new OutgoingMessage("fixed token", new Dictionary<string, string>(), new byte[0]);
var transportOperations = new TransportOperations(new TransportOperation(message, new UnicastAddressTag(endpointName)));
await messageDispatcher.Dispatch(transportOperations, new TransportTransaction(), new ContextBag());
var receivedMessages = ReceiveMessages(TIMEOUT, MAXMESSAGES);
Assert.AreEqual(message.MessageId, receivedMessages.ToList()[0].MessageId);
}*/
}
}
| {'content_hash': '0aceed12198662d28a0bde3d94e4b4e5', 'timestamp': '', 'source': 'github', 'line_count': 38, 'max_line_length': 132, 'avg_line_length': 28.973684210526315, 'alnum_prop': 0.6757493188010899, 'repo_name': 'pablocastilla/NServiceBus.Kafka', 'id': '5b7a328cdcb93f85d23f0a0d332feb0ff8e84d69', 'size': '1103', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/NServiceBus.Kafka.Tests/When_consuming_messages .cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '849879'}]} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>lombok-intellij-plugin</groupId>
<artifactId>lombok-intellij-plugin-parent</artifactId>
<packaging>pom</packaging>
<version>1.1.10</version>
<distributionManagement>
<repository>
<id>${hamster.repository.id}</id>
<url>${hamster.repository.url}</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>${hamster.repository.id}</id>
<url>${hamster.repository.url}</url>
</repository>
</repositories>
<modules>
<module>lombok-api</module>
<module>lombok-plugin</module>
</modules>
<properties>
<maven.min.version>3.2.5</maven.min.version>
<!-- Idea requires JDK 1.6 -->
<jdk.min.version>1.8</jdk.min.version>
<downloadSources>true</downloadSources>
<createChecksum>true</createChecksum>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
<lombok.version>2.16.8.14</lombok.version>
<hrisey.version>0.3.1</hrisey.version>
<hamster.repository.id>internal</hamster.repository.id>
<hamster.repository.url>http://repu.huyaru.com/</hamster.repository.url>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>pl.mg6.hrisey</groupId>
<artifactId>hrisey</artifactId>
<version>${hrisey.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<optimize>true</optimize>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project> | {'content_hash': 'ca4d512ee0c201cf0bdbc502bbccd0bc', 'timestamp': '', 'source': 'github', 'line_count': 93, 'max_line_length': 108, 'avg_line_length': 30.72043010752688, 'alnum_prop': 0.6429821491074553, 'repo_name': 'HamsterCoders/lombok-intellij-plugin', 'id': '88e2031780a402d06bc10506ace35446199018ba', 'size': '2857', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'pom.xml', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'HTML', 'bytes': '133'}, {'name': 'Java', 'bytes': '1164819'}, {'name': 'Lex', 'bytes': '1626'}, {'name': 'Shell', 'bytes': '495'}]} |
/**
* Created with JetBrains WebStorm.
* User: ryaneldridge
* Date: 1/24/13
* Time: 8:41 PM
* To change this template use File | Settings | File Templates.
*/
var Sequelize = require('sequelize')
, logger = require('../logger/Logger')
, error = require('../errors/ApiError')
, connection = require('./db_conn')
, textMappings = require('../mappings/TextMappings').message
, fs = require('fs')
, aws = require('aws-sdk')
, utils = require('./util/Utils')
, roles = require('./Roles')
, users = require('./Users')
, images = require('./Images')
;
exports.artisanProfile = connection.Connection.define('artisan_profile', {
id : { type : Sequelize.INTEGER, primaryKey:true, allowNull: false, autoIncrement: true}
, companyName : {type : Sequelize.STRING, allowNull : false }
, location : { type : Sequelize.STRING, allowNull : true }
, latitude : { type : Sequelize.FLOAT, defaultValue : 0 }
, longitude : { type :Sequelize.FLOAT, defaultValue : 0 }
, website : { type : Sequelize.STRING, allowNull : true }
, story : { type : Sequelize.TEXT, allowNull : false }
, classification : { type: Sequelize.STRING, allowNull : true }
, profileImageUrl : {type : Sequelize.STRING, allowNull : true }
, stripeCustomerId : { type : Sequelize.STRING, allowNull : true}
},
{
charset: 'latin1'
}
);
exports.createArtisanProfile = function(user, json, done) {
try {
var self = this;
self.artisanProfile.build({companyName : json.companyName, website : json.website, location : json.location, story : json.story, classification : json.classification})
.save()
.complete(function(err, profile) {
if (err) {
logger.error(err, null, "artisan_profile_db");
return done(err, null);
}
profile.setUser(user)
.success(function(p) {
if (json.filePath && checkExtension(json.filePath)) {
images.uploadImage(json.filePath, "artisan_profile", function(err, url) {
if (err) {
logger.error(err, null, "artisan_profile_db");
return done(null, profile);
}
profile.profileImageUrl = url;
profile.save()
.complete(function(err, prof) {
if (err) {
logger.error("error updating profile with image url", null, "artisan_profile_db");
return done(null, profile);
}
addArtisanRoleToUser(profile, user.id, done);
geoCodeAddress(profile);
});
});
} else {
addArtisanRoleToUser(profile, user.id, done);
geoCodeAddress(profile);
}
})
.error(function(err) {
logger.error(err, null, "artisan_profile_db");
return done(err, null);
})
});
} catch (err) {
logger.error(err, json, "artisan_profile_db");
return done(new error.ApiError(textMappings.GENERAL_ARTISAN_PROFILE_CREATION_ERROR, "artisan_profile_db"), null);
}
};
function addArtisanRoleToUser(profile, id, done) {
users.addRoleToUser(id, roles.roleTypes.ARTISAN, function(err, user) {
if (err) {
logger.error(err, null, "adding_role_to_user");
return done(err, null);
}
done(null, profile);
});
}
function geoCodeAddress(profile) {
if (profile.location) {
utils.geoCodeArtisanProfile(profile.location, profile);
}
}
exports.updateArtisanProfile = function(user, data, done) {
try {
user.getArtisanProfile()
.complete(function(err, profile) {
if (err) {
logger.error(err, data, "artisan_profile_update_db");
return done(err, null);
} else {
if (data.filePath && checkExtension(data.filePath)) {
images.uploadImage(data.filePath, "artisan_profile", function(err, url) {
if (err) {
logger.error(err, data, "artisan_update_image_upload");
return done(err, null);
}
profile.updateAttributes({
companyName : data.companyName
, website : data.website
, location : data.location
, story : data.story
, classification : data.classification
, profileImageUrl : url
}).complete(function(err, profile) {
if (err) {
logger.error(err, data, "artisan_update_image_upload");
return done(err, null);
}
geoCodeAddress(profile);
return done(null, profile);
});
});
} else {
profile.updateAttributes({
companyName : data.companyName
, website : data.website
, location : data.location
, story : data.story
, classification : data.classification
}).complete(function(err, profile) {
if (err) {
logger.error(err, data, "artisan_update_image_upload");
return done(err, null);
}
geoCodeAddress(profile);
return done(null, profile);
});
}
}
});
} catch (err) {
logger.error(err, data, "artisan_profile_update_db");
return done(err, null);
}
};
exports.findArtisanProfileByUserId = function(user, done) {
try {
user.getArtisanProfile({include : ['Products']})
.complete(function(err, profile) {
if (err) {
logger.error(err, {userId : id}, "artisan_profile_db");
return done(err, null);
}
if (profile) {
var d = {
id : profile.id
, companyName : profile.companyName
, website : profile.website
, location : profile.location
, story : profile.story
, classification : profile.classification
, profileImageUrl : profile.profileImageUrl
, stripeCustomerId : profile.stripeCustomerId
, userId : profile.userId
, products : profile.products
};
return done(null, d);
} else {
return done(null, null);
}
});
} catch (err) {
logger.error(err, id, "artisan_profile_db");
return done(new error.ApiError(textMappings.FIND_ARTISAN_PROFILE_ERROR, "artisan_profile_db"), null);
}
};
exports.findArtisanProfileById = function(id, done) {
try {
this.artisanProfile.find(id)
.complete(function(err, profile) {
if (err) {
logger.error(err, {id : id}, "artisan_profile_id");
return done(err, null);
}
done(null, profile);
});
} catch (err) {
logger.error(err, {id : id}, "artisan_db");
return done(new error.ApiError(textMappings.FIND_ARTISAN_PROFILE_ERROR, "artisan_profile_db"), null);
}
};
exports.saveArtisanStripToken = function(user, id, done) {
user.getArtisanProfile()
.complete(function(err, profile) {
if (err) {
logger.error(err, null, "save_stripe_token");
return done(err, null);
}
profile.stripeCustomerId = id;
profile
.save()
.complete(function(err, profile) {
if (err) {
logger.error(err, null, "updateProfileWithStripe");
return done(err, null);
}
return done(null, profile);
});
});
};
exports.removeArtisanProfile = function(user, done) {
try {
users.removeRollFromUser(user, roles.roleTypes.ARTISAN, function(err, result) {
if (err) {
logger.error(err, null ,"removeArtisanProfile");
return done(err, null);
}
user.getArtisanProfile()
.complete(function(err, profile) {
profile.destroy()
.complete(function(err, result) {
if (err) {
logger.error(err, null, "removeArtisanProfile");
return done(err, null);
}
return done(null, result);
});
});
});
} catch (err) {
logger.error(err, null, "removeArtisanProfile");
done(err, null);
}
};
function checkExtension(filePath) {
var extension = filePath.substr(filePath.indexOf("."), filePath.length);
if (extension.toLowerCase() == ".png" || extension.toLowerCase() == ".jpg") {
return true;
} else {
return false;
}
}
| {'content_hash': '6d70b39846daae82ba7c6698b157fe99', 'timestamp': '', 'source': 'github', 'line_count': 261, 'max_line_length': 175, 'avg_line_length': 40.13409961685824, 'alnum_prop': 0.45346062052505964, 'repo_name': 'rde8026/popupsite', 'id': 'f4859210c6f9c82f3fa7600182eaf7a0fb4a5187', 'size': '10475', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'database/ArtisanProfile.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '5974'}, {'name': 'JavaScript', 'bytes': '334475'}, {'name': 'Shell', 'bytes': '258'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=constant.ECONNABORTED.html">
</head>
<body>
<p>Redirecting to <a href="constant.ECONNABORTED.html">constant.ECONNABORTED.html</a>...</p>
<script>location.replace("constant.ECONNABORTED.html" + location.search + location.hash);</script>
</body>
</html> | {'content_hash': '2009896bdfda0e7c1218165bebcc82b4', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 102, 'avg_line_length': 34.5, 'alnum_prop': 0.7014492753623188, 'repo_name': 'nitro-devs/nitro-game-engine', 'id': '045a360f33f099e93e2f086a9d538b8b1f19c37b', 'size': '345', 'binary': False, 'copies': '24', 'ref': 'refs/heads/master', 'path': 'docs/libc/ECONNABORTED.v.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CMake', 'bytes': '1032'}, {'name': 'Rust', 'bytes': '59380'}]} |
package com.vladsch.flexmark.parser.block;
import com.vladsch.flexmark.ast.util.Parsing;
import com.vladsch.flexmark.parser.InlineParser;
import com.vladsch.flexmark.util.ast.Block;
import com.vladsch.flexmark.util.ast.BlockTracker;
import com.vladsch.flexmark.util.ast.Node;
import com.vladsch.flexmark.util.data.MutableDataHolder;
import com.vladsch.flexmark.util.sequence.BasedSequence;
import java.util.List;
/**
* State of the parser that is used in block parsers.
* <p><em>This interface is not intended to be implemented by clients.</em></p>
*/
public interface ParserState extends BlockTracker, BlockParserTracker {
/**
* @return the current line
*/
BasedSequence getLine();
/**
* @return the current line with EOL
*/
BasedSequence getLineWithEOL();
/**
* @return the current index within the line (0-based)
*/
int getIndex();
/**
* @return the index of the next non-space character starting from {@link #getIndex()} (may be the same) (0-based)
*/
int getNextNonSpaceIndex();
/**
* The column is the position within the line after tab characters have been processed as 4-space tab stops.
* If the line doesn't contain any tabs, it's the same as the {@link #getIndex()}. If the line starts with a tab,
* followed by text, then the column for the first character of the text is 4 (the index is 1).
*
* @return the current column within the line (0-based)
*/
int getColumn();
/**
* @return the indentation in columns (either by spaces or tab stop of 4), starting from {@link #getColumn()}
*/
int getIndent();
/**
* @return true if the current line is blank starting from the index
*/
boolean isBlank();
/**
* @return true if the current line is blank starting from the index
*/
boolean isBlankLine();
/**
* @return the deepest open block parser
*/
BlockParser getActiveBlockParser();
/**
* @return the current list of active block parsers, deepest is last
*/
List<BlockParser> getActiveBlockParsers();
/**
* @param node block node for which to get the active block parser
* @return an active block parser for the node or null if not found or the block is already closed.
*/
BlockParser getActiveBlockParser(Block node);
/**
* @return inline parser instance for the parser state
*/
InlineParser getInlineParser();
/**
* @return The 0 based current line number within the input
*/
int getLineNumber();
/**
* @return the start of line offset into the input stream corresponding to current index into the line
*/
int getLineStart();
/**
* @return the EOL offset into the input stream corresponding to current index into the line
*/
int getLineEolLength();
/**
* @return the end of line offset into the input stream corresponding to current index into the line, including the EOL
*/
int getLineEndIndex();
/**
* Test the block to see if it ends in a blank line. The blank line can be in the block or its last child.
*
* @param block block to be tested
* @return true if the block ends in a blank line
*/
boolean endsWithBlankLine(Node block);
/**
* Test a block to see if the last line of the block is blank. Children not tested.
*
* @param node block instance to test
* @return true if the block's last line is blank
*/
boolean isLastLineBlank(Node node);
/**
* @return document properties of the document being parsed
*/
MutableDataHolder getProperties();
/**
* Get the current parser phase
*
* @return the current parser phase {@link ParserPhase}
*/
ParserPhase getParserPhase();
/**
* @return strings and patterns class adjusted for options {@link Parsing}
*/
Parsing getParsing();
/**
* Returns a list of document lines encountered this far in the parsing process
*
* @return list of line sequences (including EOLs)
*/
List<BasedSequence> getLineSegments();
}
| {'content_hash': '808d3aed17aa9807450b6220444ca00f', 'timestamp': '', 'source': 'github', 'line_count': 143, 'max_line_length': 123, 'avg_line_length': 29.11888111888112, 'alnum_prop': 0.6560999039385207, 'repo_name': 'vsch/flexmark-java', 'id': '5529ea16bb6188c0f9066c6a0c9b2dec8a48e366', 'size': '4164', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'flexmark/src/main/java/com/vladsch/flexmark/parser/block/ParserState.java', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'CSS', 'bytes': '6676'}, {'name': 'HTML', 'bytes': '171001'}, {'name': 'Java', 'bytes': '6405392'}, {'name': 'JavaScript', 'bytes': '1649'}, {'name': 'Shell', 'bytes': '3088'}]} |
package net.dv8tion.jda.internal.handle;
import net.dv8tion.jda.api.entities.ScheduledEvent;
import net.dv8tion.jda.api.events.guild.scheduledevent.ScheduledEventUserAddEvent;
import net.dv8tion.jda.api.events.guild.scheduledevent.ScheduledEventUserRemoveEvent;
import net.dv8tion.jda.api.utils.cache.CacheFlag;
import net.dv8tion.jda.api.utils.data.DataObject;
import net.dv8tion.jda.internal.JDAImpl;
import net.dv8tion.jda.internal.entities.GuildImpl;
public class ScheduledEventUserHandler extends SocketHandler
{
private final boolean add;
public ScheduledEventUserHandler(JDAImpl api, boolean add)
{
super(api);
this.add = add;
}
@Override
protected Long handleInternally(DataObject content)
{
if (!getJDA().isCacheFlagSet(CacheFlag.SCHEDULED_EVENTS))
return null;
long guildId = content.getUnsignedLong("guild_id", 0L);
if (getJDA().getGuildSetupController().isLocked(guildId))
return guildId;
GuildImpl guild = (GuildImpl) getJDA().getGuildById(guildId);
if (guild == null)
{
EventCache.LOG.debug("Caching SCHEDULED_EVENT_USER_ADD for uncached guild with id {}", guildId);
getJDA().getEventCache().cache(EventCache.Type.GUILD, guildId, responseNumber, allContent, this::handle);
return null;
}
ScheduledEvent event = guild.getScheduledEventById(content.getUnsignedLong("guild_scheduled_event_id"));
long userId = content.getUnsignedLong("user_id");
if (event == null)
return null;
if (add)
getJDA().handleEvent(new ScheduledEventUserAddEvent(getJDA(), responseNumber, event, userId));
else
getJDA().handleEvent(new ScheduledEventUserRemoveEvent(getJDA(), responseNumber, event, userId));
return null;
}
}
| {'content_hash': 'dfbed4dec7fe515bb9632409ce1b5dd2', 'timestamp': '', 'source': 'github', 'line_count': 52, 'max_line_length': 117, 'avg_line_length': 35.98076923076923, 'alnum_prop': 0.6926777124532336, 'repo_name': 'DV8FromTheWorld/JDA', 'id': '91e9184617e18c6bd97f2f045b56c393d130f5f0', 'size': '2524', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/net/dv8tion/jda/internal/handle/ScheduledEventUserHandler.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '5990127'}, {'name': 'Kotlin', 'bytes': '15383'}]} |
// # pretty-select-input component
/*
Render an input to be used as the element for typing a custom value into a pretty select.
*/
'use strict';
import createReactClass from 'create-react-class';
import { ref } from '@/src/utils';
import HelperMixin from '@/src/mixins/helper';
export default createReactClass({
displayName: 'PrettySelectInput',
mixins: [HelperMixin],
render: function() {
return this.renderWithConfig();
},
focus: function() {
if (this.textBoxRef && this.textBoxRef.focus) {
this.textBoxRef.focus();
}
},
setChoicesOpen: function(isOpenChoices) {
this.textBoxRef.setChoicesOpen(isOpenChoices);
},
renderDefault: function() {
return this.props.config.createElement('pretty-text-input', {
typeName: this.props.typeName,
ref: ref(this, 'textBox'),
classes: this.props.classes,
onChange: this.props.onChange,
onFocus: this.props.onFocus,
onBlur: this.props.onBlur,
onAction: this.onBubbleAction,
field: this.props.field,
value: this.props.isEnteringCustomValue
? this.props.field.value
: this.props.getDisplayValue(),
selectedChoices: this.props.config.fieldSelectedReplaceChoices(
this.props.field
),
replaceChoices: this.props.config.fieldReplaceChoices(this.props.field),
onTagClick: this.onTagClick,
readOnly: !this.props.isEnteringCustomValue,
disabled: this.isReadOnly(),
id: this.props.id,
});
},
});
| {'content_hash': '331c351ada5a00260dff1d2553c3d334', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 92, 'avg_line_length': 26.892857142857142, 'alnum_prop': 0.6766268260292164, 'repo_name': 'zapier/formatic', 'id': '72f33f34d79b492f9dad4bb34159fc2f9dad75dc', 'size': '1506', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/components/helpers/pretty-select-input.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '5435'}, {'name': 'JavaScript', 'bytes': '257804'}]} |
using System.IO;
using MsgPack.Serialization;
namespace TIKSN.Serialization.MessagePack
{
public class MessagePackSerializer : SerializerBase<byte[]>
{
private readonly SerializationContext _serializationContext;
public MessagePackSerializer(SerializationContext serializationContext) =>
this._serializationContext = serializationContext;
protected override byte[] SerializeInternal<T>(T obj)
{
var serializer = this._serializationContext.GetSerializer<T>();
using var stream = new MemoryStream();
serializer.Pack(stream, obj);
return stream.ToArray();
}
}
}
| {'content_hash': '6282c61e4635bbe5ec1844af25a7c458', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 82, 'avg_line_length': 30.681818181818183, 'alnum_prop': 0.677037037037037, 'repo_name': 'tiksn/TIKSN-Framework', 'id': '7b007ebb1e3dffb72f49414e888e114c866cf85b', 'size': '675', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'TIKSN.Core/Serialization/MessagePack/MessagePackSerializer.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '899203'}, {'name': 'PowerShell', 'bytes': '10679'}]} |
module Fog
module AWS
class CloudFormation
class Real
require 'fog/aws/parsers/cloud_formation/describe_stack_events'
# Describe stack events.
#
# @param stack_name [String] stack name to return events for.
# @param options [Hash]
# @option options NextToken [String] Identifies the start of the next list of events, if there is one.
#
# @return [Excon::Response]
# * body [Hash]:
# * StackEvents [Array] - Matching resources
# * event [Hash]:
# * EventId [String] -
# * StackId [String] -
# * StackName [String] -
# * LogicalResourceId [String] -
# * PhysicalResourceId [String] -
# * ResourceType [String] -
# * Timestamp [Time] -
# * ResourceStatus [String] -
# * ResourceStatusReason [String] -
#
# @see http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_DescribeStackEvents.html
def describe_stack_events(stack_name, options = {})
request({
'Action' => 'DescribeStackEvents',
'StackName' => stack_name,
:parser => Fog::Parsers::AWS::CloudFormation::DescribeStackEvents.new
}.merge!(options))
end
end
end
end
end
| {'content_hash': 'b30de1633afffa7e7c415f6d53cf2cf2', 'timestamp': '', 'source': 'github', 'line_count': 41, 'max_line_length': 115, 'avg_line_length': 34.5609756097561, 'alnum_prop': 0.5328158080451658, 'repo_name': 'bdunne/fog', 'id': '9331a133069270f4c07d35cc6d2902126989ca95', 'size': '1417', 'binary': False, 'copies': '13', 'ref': 'refs/heads/master', 'path': 'lib/fog/aws/requests/cloud_formation/describe_stack_events.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '8033839'}]} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': '8bee189bb500433c7ae5d2e83b73564e', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': 'd7872d235af6c76e845922696d0215c34a84606d', 'size': '193', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Desmodium/Desmodium miniaturum/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
package com.iggroup.webapi.samples.client.rest.dto.history.getActivityHistoryByTimeRangeV1;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/*
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class GetActivityHistoryByTimeRangeV1Response {
/*
List of activities
*/
private java.util.List<ActivitiesItem> activities;
public java.util.List<ActivitiesItem> getActivities() { return activities; }
public void setActivities(java.util.List<ActivitiesItem> activities) { this.activities=activities; }
}
| {'content_hash': 'a9b3ce1347c30d935eb3192d55d06048', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 100, 'avg_line_length': 28.88888888888889, 'alnum_prop': 0.8192307692307692, 'repo_name': 'IG-Group/ig-webapi-java-sample', 'id': '6d359b827fcd9ccfb1b8628beb4b74fba317ab66', 'size': '520', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ig-webapi-java-client/src/main/java/com/iggroup/webapi/samples/client/rest/dto/history/getActivityHistoryByTimeRangeV1/GetActivityHistoryByTimeRangeV1Response.java', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Java', 'bytes': '490855'}]} |
#ifndef _SUNDIALSTYPES_H
#define _SUNDIALSTYPES_H
#ifdef __cplusplus /* wrapper to enable C++ usage */
extern "C" {
#endif
#ifndef _SUNDIALS_CONFIG_H
#define _SUNDIALS_CONFIG_H
#include <sundials/sundials_config.h>
#endif
#include <float.h>
/*
*------------------------------------------------------------------
* Type realtype
* Macro RCONST
* Constants BIG_REAL, SMALL_REAL, and UNIT_ROUNDOFF
*------------------------------------------------------------------
*/
#if defined(SUNDIALS_SINGLE_PRECISION)
typedef float realtype;
# define RCONST(x) x##F
# define BIG_REAL FLT_MAX
# define SMALL_REAL FLT_MIN
# define UNIT_ROUNDOFF FLT_EPSILON
#elif defined(SUNDIALS_DOUBLE_PRECISION)
typedef double realtype;
# define RCONST(x) x
# define BIG_REAL DBL_MAX
# define SMALL_REAL DBL_MIN
# define UNIT_ROUNDOFF DBL_EPSILON
#elif defined(SUNDIALS_EXTENDED_PRECISION)
typedef long double realtype;
# define RCONST(x) x##L
# define BIG_REAL LDBL_MAX
# define SMALL_REAL LDBL_MIN
# define UNIT_ROUNDOFF LDBL_EPSILON
#endif
/*
*------------------------------------------------------------------
* Type : booleantype
*------------------------------------------------------------------
* Constants : FALSE and TRUE
*------------------------------------------------------------------
* ANSI C does not have a built-in boolean data type. Below is the
* definition for a new type called booleantype. The advantage of
* using the name booleantype (instead of int) is an increase in
* code readability. It also allows the programmer to make a
* distinction between int and boolean data. Variables of type
* booleantype are intended to have only the two values FALSE and
* TRUE which are defined below to be equal to 0 and 1,
* respectively.
*------------------------------------------------------------------
*/
#ifndef booleantype
#define booleantype int
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifdef __cplusplus
}
#endif
#endif
| {'content_hash': '72da51ac81a3f0ad63be0aab511674a2', 'timestamp': '', 'source': 'github', 'line_count': 84, 'max_line_length': 68, 'avg_line_length': 23.761904761904763, 'alnum_prop': 0.5866733466933868, 'repo_name': 'vladimir-ch/odeity', 'id': '953f6e09dfc21c628ca1ec476dc487a220c5d812', 'size': '3726', 'binary': False, 'copies': '8', 'ref': 'refs/heads/master', 'path': 'vendor/sundials-2.4.0/include/sundials/sundials_types.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C++', 'bytes': '201327'}, {'name': 'CMake', 'bytes': '4453'}]} |
import webapp2
import uuid
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.headers.add_header("Access-Control-Allow-Origin", "*")
self.response.write(str(uuid.uuid4()))
app = webapp2.WSGIApplication([
('/', MainHandler)
])
| {'content_hash': '03d8b371bcb9e4b40edada6bbb1b0e2a', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 76, 'avg_line_length': 24.818181818181817, 'alnum_prop': 0.684981684981685, 'repo_name': 'lukechurch/guid-generator-service', 'id': 'daa35301cd63dda0ec3c2a70f5649392c337697d', 'size': '273', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'guid-gen-service/main.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '273'}]} |
using System;
using System.Runtime.InteropServices;
namespace VulkanCore
{
/// <summary>
/// Opaque handle to a render pass object.
/// <para>
/// A render pass represents a collection of attachments, subpasses, and dependencies between the
/// subpasses, and describes how the attachments are used over the course of the subpasses. The
/// use of a render pass in a command buffer is a render pass instance.
/// </para>
/// </summary>
public unsafe class RenderPass : DisposableHandle<long>
{
internal RenderPass(Device parent, ref RenderPassCreateInfo createInfo, ref AllocationCallbacks? allocator)
{
Parent = parent;
Allocator = allocator;
fixed (AttachmentDescription* attachmentsPtr = createInfo.Attachments)
fixed (SubpassDependency* dependenciesPtr = createInfo.Dependencies)
{
createInfo.ToNative(out RenderPassCreateInfo.Native nativeCreateInfo, attachmentsPtr, dependenciesPtr);
long handle;
Result result = vkCreateRenderPass(Parent, &nativeCreateInfo, NativeAllocator, &handle);
nativeCreateInfo.Free();
VulkanException.ThrowForInvalidResult(result);
Handle = handle;
}
}
/// <summary>
/// Gets the parent of the resource.
/// </summary>
public Device Parent { get; }
/// <summary>
/// Returns the granularity for optimal render area.
/// </summary>
/// <returns>The structure in which the granularity is returned.</returns>
public Extent2D GetRenderAreaGranularity()
{
Extent2D granularity;
vkGetRenderAreaGranularity(Parent, this, &granularity);
return granularity;
}
/// <summary>
/// Create a new framebuffer object.
/// </summary>
/// <param name="createInfo">
/// The structure which describes additional information about framebuffer creation.
/// </param>
/// <param name="allocator">Controls host memory allocation.</param>
/// <returns>The resulting framebuffer object.</returns>
/// <exception cref="VulkanException">Vulkan returns an error code.</exception>
public Framebuffer CreateFramebuffer(FramebufferCreateInfo createInfo, AllocationCallbacks? allocator = null)
{
return new Framebuffer(Parent, this, ref createInfo, ref allocator);
}
/// <summary>
/// Destroy a render pass object.
/// </summary>
public override void Dispose()
{
if (!Disposed) vkDestroyRenderPass(Parent, this, NativeAllocator);
base.Dispose();
}
private delegate Result vkCreateRenderPassDelegate(IntPtr device, RenderPassCreateInfo.Native* createInfo, AllocationCallbacks.Native* allocator, long* renderPass);
private static readonly vkCreateRenderPassDelegate vkCreateRenderPass = VulkanLibrary.GetStaticProc<vkCreateRenderPassDelegate>(nameof(vkCreateRenderPass));
private delegate void vkDestroyRenderPassDelegate(IntPtr device, long renderPass, AllocationCallbacks.Native* allocator);
private static readonly vkDestroyRenderPassDelegate vkDestroyRenderPass = VulkanLibrary.GetStaticProc<vkDestroyRenderPassDelegate>(nameof(vkDestroyRenderPass));
private delegate void vkGetRenderAreaGranularityDelegate(IntPtr device, long renderPass, Extent2D* granularity);
private static readonly vkGetRenderAreaGranularityDelegate vkGetRenderAreaGranularity = VulkanLibrary.GetStaticProc<vkGetRenderAreaGranularityDelegate>(nameof(vkGetRenderAreaGranularity));
}
/// <summary>
/// Structure specifying parameters of a newly created render pass.
/// </summary>
public unsafe struct RenderPassCreateInfo
{
/// <summary>
/// Structures describing properties of the attachments, or <c>null</c>.
/// </summary>
public AttachmentDescription[] Attachments;
/// <summary>
/// Structures describing properties of the subpasses.
/// </summary>
public SubpassDescription[] Subpasses;
/// <summary>
/// Structures describing dependencies between pairs of subpasses, or <c>null</c>.
/// </summary>
public SubpassDependency[] Dependencies;
/// <summary>
/// Initializes a new instnace of the <see cref="RenderPassCreateInfo"/> structure.
/// </summary>
/// <param name="subpasses">Structures describing properties of the subpasses.</param>
/// <param name="attachments">Structures describing properties of the attachments, or <c>null</c>.</param>
/// <param name="dependencies">
/// Structures describing dependencies between pairs of subpasses, or <c>null</c>.
/// </param>
public RenderPassCreateInfo(
SubpassDescription[] subpasses,
AttachmentDescription[] attachments = null,
SubpassDependency[] dependencies = null)
{
Attachments = attachments;
Subpasses = subpasses;
Dependencies = dependencies;
}
[StructLayout(LayoutKind.Sequential)]
internal struct Native
{
public StructureType Type;
public IntPtr Next;
public RenderPassCreateFlags Flags;
public int AttachmentCount;
public AttachmentDescription* Attachments;
public int SubpassCount;
public SubpassDescription.Native* Subpasses;
public int DependencyCount;
public SubpassDependency* Dependencies;
public void Free()
{
for (int i = 0; i < SubpassCount; i++)
Subpasses[i].Free();
Interop.Free(Subpasses);
}
}
internal void ToNative(out Native native, AttachmentDescription* attachments, SubpassDependency* dependencies)
{
int subpassCount = Subpasses?.Length ?? 0;
var subpasses = (SubpassDescription.Native*)Interop.Alloc<SubpassDescription.Native>(subpassCount);
for (int i = 0; i < subpassCount; i++)
Subpasses[i].ToNative(out subpasses[i]);
native.Type = StructureType.RenderPassCreateInfo;
native.Next = IntPtr.Zero;
native.Flags = 0;
native.AttachmentCount = Attachments?.Length ?? 0;
native.Attachments = attachments;
native.SubpassCount = subpassCount;
native.Subpasses = subpasses;
native.DependencyCount = Dependencies?.Length ?? 0;
native.Dependencies = dependencies;
}
}
[Flags]
// Is reserved for future use.
internal enum RenderPassCreateFlags
{
None = 0
}
/// <summary>
/// Structure specifying a subpass description.
/// </summary>
public struct SubpassDescription
{
/// <summary>
/// A bitmask specifying usage of the subpass.
/// </summary>
public SubpassDescriptionFlags Flags;
/// <summary>
/// Structures that lists which of the render pass's attachments will be used as color
/// attachments in the subpass, and what layout each attachment will be in during the subpass.
/// <para>
/// Each element of the array corresponds to a fragment shader output location, i.e. if the
/// shader declared an output variable <c>layout(location=X)</c> then it uses the attachment
/// provided in <c>ColorAttachments[X]</c>.
/// </para>
/// </summary>
public AttachmentReference[] ColorAttachments;
/// <summary>
/// Structures that lists which of the render pass's attachments can be read in the fragment
/// shader stage during the subpass, and what layout each attachment will be in during the
/// subpass. Each element of the array corresponds to an input attachment unit number in the
/// shader, i.e. if the shader declares an input variable <c>layout(inputAttachmentIndex=X,
/// set=Y, binding=Z</c> then it uses the attachment provided in <c>InputAttachments[X]</c>.
/// Input attachments must also be bound to the pipeline with a descriptor set, with the
/// input attachment descriptor written in the location (set=Y, binding=Z). Fragment shaders
/// can use subpass input variables to access the contents of an input attachment at the
/// fragment's (x, y, layer) framebuffer coordinates.
/// </summary>
public AttachmentReference[] InputAttachments;
/// <summary>
/// Is <c>null</c> or an array of structures that lists which of the render pass's
/// attachments are resolved to at the end of the subpass, and what layout each attachment
/// will be in during the multisample resolve operation. If <see cref="ResolveAttachments"/>
/// is not <c>null</c>, each of its elements corresponds to a color attachment (the element
/// in <see cref="ColorAttachments"/> at the same index), and a multisample resolve operation
/// is defined for each attachment. At the end of each subpass, multisample resolve
/// operations read the subpass's color attachments, and resolve the samples for each pixel
/// to the same pixel location in the corresponding resolve attachments, unless the resolve
/// attachment index is <see cref="Constant.AttachmentUnused"/>. If the first use of an
/// attachment in a render pass is as a resolve attachment, then the <see
/// cref="AttachmentLoadOp"/> is effectively ignored as the resolve is guaranteed to
/// overwrite all pixels in the render area.
/// </summary>
public AttachmentReference[] ResolveAttachments;
/// <summary>
/// Specifies which attachment will be used for depth/stencil data and the layout it will be
/// in during the subpass. Setting the attachment index to <see
/// cref="Constant.AttachmentUnused"/> or leaving this as <c>null</c> indicates that no
/// depth/stencil attachment will be used in the subpass.
/// </summary>
public AttachmentReference? DepthStencilAttachment;
/// <summary>
/// Render pass attachment indices describing the attachments that are not used by a subpass,
/// but whose contents must be preserved throughout the subpass.
/// </summary>
public int[] PreserveAttachments;
/// <summary>
/// Initializes a new instance of the <see cref="SubpassDescription"/> structure.
/// </summary>
/// <param name="flags">A bitmask indicating usage of the subpass.</param>
/// <param name="colorAttachments">
/// Structures that lists which of the render pass’s attachments will be used as color
/// attachments in the subpass, and what layout each attachment will be in during the
/// subpass. Each element of the array corresponds to a fragment shader output location, i.e.
/// if the shader declared an output variable <c>layout(location=X)</c> then it uses the
/// attachment provided in <c>ColorAttachments[X]</c>.
/// </param>
/// <param name="inputAttachments">
/// Structures that lists which of the render pass's attachments can be read in the shader
/// during the subpass, and what layout each attachment will be in during the subpass. Each
/// element of the array corresponds to an input attachment unit number in the shader, i.e.
/// if the shader declares an input variable <c>layout(inputAttachmentIndex=X, set=Y,
/// binding=Z)</c> then it uses the attachment provided in <c>InputAttachments[X]</c>. Input
/// attachments must also be bound to the pipeline with a descriptor set, with the input
/// attachment descriptor written in the location (set=Y, binding=Z).
/// </param>
/// <param name="resolveAttachments">
/// Is <c>null</c> or an array of structures that lists which of the render pass's
/// attachments are resolved to at the end of the subpass, and what layout each attachment
/// will be in during the multisample resolve operation. If <see cref="ResolveAttachments"/>
/// is not <c>null</c>, each of its elements corresponds to a color attachment (the element
/// in <see cref="ColorAttachments"/> at the same index), and a multisample resolve operation
/// is defined for each attachment. At the end of each subpass, multisample resolve
/// operations read the subpass's color attachments, and resolve the samples for each pixel
/// to the same pixel location in the corresponding resolve attachments, unless the resolve
/// attachment index is <see cref="Constant.AttachmentUnused"/>. If the first use of an
/// attachment in a render pass is as a resolve attachment, then the <see
/// cref="AttachmentLoadOp"/> is effectively ignored as the resolve is guaranteed to
/// overwrite all pixels in the render area.
/// </param>
/// <param name="depthStencilAttachment">
/// Specifies which attachment will be used for depth/stencil data and the layout it will be
/// in during the subpass. Setting the attachment index to <see
/// cref="Constant.AttachmentUnused"/> or leaving this as <c>null</c> indicates that no
/// depth/stencil attachment will be used in the subpass.
/// </param>
/// <param name="preserveAttachments">
/// Render pass attachment indices describing the attachments that are not used by a subpass,
/// but whose contents must be preserved throughout the subpass.
/// </param>
public SubpassDescription(
SubpassDescriptionFlags flags = 0,
AttachmentReference[] colorAttachments = null,
AttachmentReference[] inputAttachments = null,
AttachmentReference[] resolveAttachments = null,
AttachmentReference? depthStencilAttachment = null,
int[] preserveAttachments = null)
{
Flags = flags;
ColorAttachments = colorAttachments;
InputAttachments = inputAttachments;
ResolveAttachments = resolveAttachments;
DepthStencilAttachment = depthStencilAttachment;
PreserveAttachments = preserveAttachments;
}
/// <summary>
/// Initializes a new instance of the <see cref="SubpassDescription"/> structure.
/// </summary>
/// <param name="colorAttachments">
/// Structures that lists which of the render pass’s attachments will be used as color
/// attachments in the subpass, and what layout each attachment will be in during the
/// subpass. Each element of the array corresponds to a fragment shader output location, i.e.
/// if the shader declared an output variable layout(location=X) then it uses the attachment
/// provided in <see cref="ColorAttachments"/>[X].
/// </param>
/// <param name="depthStencilAttachment">
/// Specifies which attachment will be used for depth/stencil data and the layout it will be
/// in during the subpass. Setting the attachment index to <see
/// cref="Constant.AttachmentUnused"/> or leaving this as <c>null</c> indicates that no
/// depth/stencil attachment will be used in the subpass.
/// </param>
public SubpassDescription(
AttachmentReference[] colorAttachments,
AttachmentReference? depthStencilAttachment = null)
{
Flags = 0;
ColorAttachments = colorAttachments;
InputAttachments = null;
ResolveAttachments = null;
DepthStencilAttachment = depthStencilAttachment;
PreserveAttachments = null;
}
[StructLayout(LayoutKind.Sequential)]
internal struct Native
{
public SubpassDescriptionFlags Flags;
public PipelineBindPoint PipelineBindPoint;
public int InputAttachmentCount;
public IntPtr InputAttachments;
public int ColorAttachmentCount;
public IntPtr ColorAttachments;
public IntPtr ResolveAttachments;
public IntPtr DepthStencilAttachment;
public int PreserveAttachmentCount;
public IntPtr PreserveAttachments;
public void Free()
{
Interop.Free(InputAttachments);
Interop.Free(ColorAttachments);
Interop.Free(ResolveAttachments);
Interop.Free(DepthStencilAttachment);
Interop.Free(PreserveAttachments);
}
}
internal void ToNative(out Native native)
{
// Only graphics subpasses are supported.
native.Flags = Flags;
native.PipelineBindPoint = PipelineBindPoint.Graphics;
native.InputAttachmentCount = InputAttachments?.Length ?? 0;
native.InputAttachments = Interop.Struct.AllocToPointer(InputAttachments);
native.ColorAttachmentCount = ColorAttachments?.Length ?? 0;
native.ColorAttachments = Interop.Struct.AllocToPointer(ColorAttachments);
native.ResolveAttachments = Interop.Struct.AllocToPointer(ResolveAttachments);
native.DepthStencilAttachment = Interop.Struct.AllocToPointer(ref DepthStencilAttachment);
native.PreserveAttachmentCount = PreserveAttachments?.Length ?? 0;
native.PreserveAttachments = Interop.Struct.AllocToPointer(PreserveAttachments);
}
}
/// <summary>
/// Bitmask specifying usage of a subpass.
/// </summary>
[Flags]
public enum SubpassDescriptionFlags
{
/// <summary>
/// No flags.
/// </summary>
None = 0,
/// <summary>
/// Specifies that shaders compiled for this subpass write the attributes for all views in a
/// single invocation of each vertex processing stage. All pipelines compiled against a
/// subpass that includes this bit must write per-view attributes to the <c>*PerViewNV[]</c>
/// shader outputs, in addition to the non-per-view (e.g. <c>Position</c>) outputs.
/// </summary>
PerViewAttributesNvx = 1 << 0,
/// <summary>
/// Specifies that shaders compiled for this subpass use per-view positions which only differ
/// in value in the x component. Per-view viewport mask can also be used.
/// </summary>
PerViewPositionXOnlyNvx = 1 << 1
}
/// <summary>
/// Specify the bind point of a pipeline object to a command buffer.
/// <para>
/// There are separate bind points for each of graphics and compute, so binding one does not
/// disturb the other.
/// </para>
/// </summary>
public enum PipelineBindPoint
{
/// <summary>
/// Specifies binding as a graphics pipeline.
/// </summary>
Graphics = 0,
/// <summary>
/// Specifies binding as a compute pipeline.
/// </summary>
Compute = 1
}
/// <summary>
/// Structure specifying an attachment reference.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct AttachmentReference
{
/// <summary>
/// The index of the attachment of the render pass, and corresponds to the index of the
/// corresponding element in the <see cref="RenderPassCreateInfo.Attachments"/> array. If any
/// color or depth/stencil attachments are <see cref="Constant.AttachmentUnused"/>, then no
/// writes occur for those attachments.
/// </summary>
public int Attachment;
/// <summary>
/// Specifies the layout the attachment uses during the subpass.
/// <para>Must not be <see cref="ImageLayout.Undefined"/> or <see cref="ImageLayout.Preinitialized"/>.</para>
/// </summary>
public ImageLayout Layout;
/// <summary>
/// Initializes a new instance of the <see cref="AttachmentReference"/> structure.
/// </summary>
/// <param name="attachment">
/// The index of the attachment of the render pass, and corresponds to the index of the
/// corresponding element in the <see cref="RenderPassCreateInfo.Attachments"/> array. If any
/// color or depth/stencil attachments are <see cref="Constant.AttachmentUnused"/>, then no
/// writes occur for those attachments.
/// </param>
/// <param name="layout">Specifies the layout the attachment uses during the subpass.</param>
public AttachmentReference(int attachment, ImageLayout layout)
{
Attachment = attachment;
Layout = layout;
}
}
/// <summary>
/// Structure specifying a subpass dependency.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct SubpassDependency
{
/// <summary>
/// The subpass index of the first subpass in the dependency, or <see cref="Constant.SubpassExternal"/>.
/// </summary>
public int SrcSubpass;
/// <summary>
/// The subpass index of the second subpass in the dependency, or <see cref="Constant.SubpassExternal"/>.
/// </summary>
public int DstSubpass;
/// <summary>
/// Specifies a source stage mask.
/// </summary>
public PipelineStages SrcStageMask;
/// <summary>
/// Specifies a destination stage mask.
/// </summary>
public PipelineStages DstStageMask;
/// <summary>
/// Specifies a source access mask.
/// </summary>
public Accesses SrcAccessMask;
/// <summary>
/// Specifies a destination access mask.
/// </summary>
public Accesses DstAccessMask;
/// <summary>
/// A bitmask of <see cref="Dependencies"/>.
/// </summary>
public Dependencies DependencyFlags;
/// <summary>
/// Initializes a new instance of the <see cref="SubpassDependency"/> structure.
/// </summary>
/// <param name="srcSubpass">
/// The subpass index of the first subpass in the dependency, or <see cref="Constant.SubpassExternal"/>.
/// </param>
/// <param name="dstSubpass">
/// The subpass index of the second subpass in the dependency, or <see cref="Constant.SubpassExternal"/>.
/// </param>
/// <param name="srcStageMask">Specifies a source stage mask.</param>
/// <param name="dstStageMask">Specifies a destination stage mask.</param>
/// <param name="srcAccessMask">Specifies a source access mask.</param>
/// <param name="dstAccessMask">Specifies a destination access mask.</param>
/// <param name="dependencyFlags">A bitmask of <see cref="Dependencies"/>.</param>
public SubpassDependency(
int srcSubpass,
int dstSubpass,
PipelineStages srcStageMask,
PipelineStages dstStageMask,
Accesses srcAccessMask,
Accesses dstAccessMask,
Dependencies dependencyFlags = Dependencies.None)
{
SrcSubpass = srcSubpass;
DstSubpass = dstSubpass;
SrcStageMask = srcStageMask;
DstStageMask = dstStageMask;
SrcAccessMask = srcAccessMask;
DstAccessMask = dstAccessMask;
DependencyFlags = dependencyFlags;
}
}
/// <summary>
/// Bitmask specifying how execution and memory dependencies are formed.
/// </summary>
[Flags]
public enum Dependencies
{
/// <summary>
/// No flags.
/// </summary>
None = 0,
/// <summary>
/// Specifies that dependencies will be framebuffer-local.
/// </summary>
ByRegion = 1 << 0,
/// <summary>
/// Specifies that a subpass has more than one view.
/// </summary>
ViewLocalKhx = 1 << 1,
/// <summary>
/// Specifies that dependencies are non-device-local.
/// </summary>
DeviceGroupKhx = 1 << 2
}
}
| {'content_hash': 'd11614dc0b77be6eba5848eef4cc2d19', 'timestamp': '', 'source': 'github', 'line_count': 522, 'max_line_length': 196, 'avg_line_length': 47.03831417624521, 'alnum_prop': 0.631709701067036, 'repo_name': 'discosultan/VulkanCore', 'id': '48d6221d31ed3343e14a44ac9c5a52f85bc0308a', 'size': '24558', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Src/RenderPass.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '1479134'}, {'name': 'GLSL', 'bytes': '322'}]} |
#ifndef SharedWorkerGlobalScope_h
#define SharedWorkerGlobalScope_h
#include "core/CoreExport.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerThreadStartupData.h"
#include "platform/heap/Handle.h"
namespace blink {
class MessageEvent;
class SharedWorkerThread;
class SharedWorkerGlobalScope final : public WorkerGlobalScope {
DEFINE_WRAPPERTYPEINFO();
public:
typedef WorkerGlobalScope Base;
static PassRefPtrWillBeRawPtr<SharedWorkerGlobalScope> create(const String& name, SharedWorkerThread*, PassOwnPtr<WorkerThreadStartupData>);
virtual ~SharedWorkerGlobalScope();
virtual bool isSharedWorkerGlobalScope() const override { return true; }
// EventTarget
virtual const AtomicString& interfaceName() const override;
// Setters/Getters for attributes in SharedWorkerGlobalScope.idl
DEFINE_ATTRIBUTE_EVENT_LISTENER(connect);
String name() const { return m_name; }
SharedWorkerThread* thread();
DECLARE_VIRTUAL_TRACE();
private:
SharedWorkerGlobalScope(const String& name, const KURL&, const String& userAgent, SharedWorkerThread*, const SecurityOrigin*, PassOwnPtrWillBeRawPtr<WorkerClients>);
virtual void logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallStack>) override;
String m_name;
};
CORE_EXPORT PassRefPtrWillBeRawPtr<MessageEvent> createConnectEvent(MessagePort*);
} // namespace blink
#endif // SharedWorkerGlobalScope_h
| {'content_hash': 'a1c821371a66a7b95b207541f2de9a74', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 190, 'avg_line_length': 33.166666666666664, 'alnum_prop': 0.7889447236180904, 'repo_name': 'zero-rp/miniblink49', 'id': '93620ea19f541faaab140439dca6f2ce2cadfba9', 'size': '3154', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '11324414'}, {'name': 'Batchfile', 'bytes': '52488'}, {'name': 'C', 'bytes': '31014938'}, {'name': 'C++', 'bytes': '281193388'}, {'name': 'CMake', 'bytes': '88548'}, {'name': 'CSS', 'bytes': '20839'}, {'name': 'DIGITAL Command Language', 'bytes': '226954'}, {'name': 'HTML', 'bytes': '202637'}, {'name': 'JavaScript', 'bytes': '32544926'}, {'name': 'Lua', 'bytes': '32432'}, {'name': 'M4', 'bytes': '125191'}, {'name': 'Makefile', 'bytes': '1517330'}, {'name': 'Objective-C', 'bytes': '87691'}, {'name': 'Objective-C++', 'bytes': '35037'}, {'name': 'PHP', 'bytes': '307541'}, {'name': 'Perl', 'bytes': '3283676'}, {'name': 'Prolog', 'bytes': '29177'}, {'name': 'Python', 'bytes': '4308928'}, {'name': 'R', 'bytes': '10248'}, {'name': 'Scheme', 'bytes': '25457'}, {'name': 'Shell', 'bytes': '264021'}, {'name': 'TypeScript', 'bytes': '162421'}, {'name': 'Vim script', 'bytes': '11362'}, {'name': 'XS', 'bytes': '4319'}, {'name': 'eC', 'bytes': '4383'}]} |
namespace Microsoft.Azure.Management.ContainerService.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The list credential result response.
/// </summary>
public partial class CredentialResults
{
/// <summary>
/// Initializes a new instance of the CredentialResults class.
/// </summary>
public CredentialResults()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the CredentialResults class.
/// </summary>
/// <param name="kubeconfigs">Base64-encoded Kubernetes configuration
/// file.</param>
public CredentialResults(IList<CredentialResult> kubeconfigs = default(IList<CredentialResult>))
{
Kubeconfigs = kubeconfigs;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets base64-encoded Kubernetes configuration file.
/// </summary>
[JsonProperty(PropertyName = "kubeconfigs")]
public IList<CredentialResult> Kubeconfigs { get; private set; }
}
}
| {'content_hash': '655dbc41ad3d0e52111bd2914961c672', 'timestamp': '', 'source': 'github', 'line_count': 44, 'max_line_length': 104, 'avg_line_length': 30.386363636363637, 'alnum_prop': 0.6050860134629769, 'repo_name': 'Azure/azure-sdk-for-net', 'id': '509c9e2961683d6f019939d58cb8b7ed4a22c5d4', 'size': '1690', 'binary': False, 'copies': '3', 'ref': 'refs/heads/main', 'path': 'sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/CredentialResults.cs', 'mode': '33188', 'license': 'mit', 'language': []} |
VLAN in VM with LinuxBridge and VXLan with Jumbo MTU
====================================================
Configure puppet\_openstack\_builder project to use VLANs, LinuxBridge,
and VXLan
The script in this project will update Cisco's version of
puppet_openstack_builder (aka COI), and update it to use by default:
- ML2 neutron core_plugin
- Linux Bridge L2 plugin/agent
- VXLan tenant netorks
It can also assist in configuring a VLAN as a management interface for
systems with only a single physical network interface.
It also includes an option to define the "default" or management/tunnel
interface, and the "external" or provider/neutron managed interface. It
only supports the configuration of a single neutron managed interface
at the moment.
For a standard 2 physical interface setup, where the interfaces are
already configured in the OS (e.g. dhcp or static configurations) with:
- eth0 for default
- eth1 for external
- ntp.esl.cisco.com for ntp
- Jumbo MTU (ends up at 8950 or less bytes at the VM with VXLan configured)
git clone https://github.com/onecloud/lb\_vxlan
cd lb\_vxlan
./setup -m -t ntp.esl.cisco.com -D eth0 -E eth1 -r
If you want to move a single interface to a VLAN for management (likely so that
you can use the un-tagged interface to pass tagged packets from your VMs), you
might use:
./setup -m -v 100 -i 10.0.100.10 -n 255.255.255.0 -g 10.0.100.1 -d 10.0.100.5
Note that the sytem will assume eth0, and add an eth0.XXX interface, and make
eth0 the default.
There is a test script that will try to create a flat network, and a set of VMs
along with a vxlan based tenant network:
./test.sh
And there is a reset script to clean up most of the system (doesn't delete the
ssh key)
./reset_test.sh
| {'content_hash': '89be9ebeb100cf468b5f774931aa7a6e', 'timestamp': '', 'source': 'github', 'line_count': 51, 'max_line_length': 79, 'avg_line_length': 34.431372549019606, 'alnum_prop': 0.7351936218678815, 'repo_name': 'onecloud/lb_vxlan', 'id': '8cd2b06b06335d986a5d45ab37b43fe1d66b4419', 'size': '1756', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Shell', 'bytes': '42167'}]} |
// The MIT License
//
// Copyright (C) 2013-2014 by Joseph Wayne Norton <[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 SCMI_ENV_NIF_LIB_H
#define SCMI_ENV_NIF_LIB_H
#include "erl_nif.h"
#ifdef __cplusplus
extern "C" {
#endif
extern ERL_NIF_TERM scmi_env_atom_;
extern ERL_NIF_TERM scmi_env_atom_true;
extern ERL_NIF_TERM scmi_env_atom_false;
extern ERL_NIF_TERM scmi_env_atom_mid;
// prototypes
extern bool scmi_env_lib_init(ErlNifEnv* env);
#ifdef __cplusplus
}
#endif
#endif /* SCMI_ENV_NIF_LIB_H */
| {'content_hash': 'bf36bd369f8e74590246df924e7cd8ea', 'timestamp': '', 'source': 'github', 'line_count': 44, 'max_line_length': 80, 'avg_line_length': 36.15909090909091, 'alnum_prop': 0.7391577624135763, 'repo_name': 'the-concurrent-schemer/scm', 'id': '21b55e9afbba91f52d9dab5a51342d7746bb07a0', 'size': '1591', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'c_src/scmi_env_lib.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '3909'}, {'name': 'C++', 'bytes': '24343'}, {'name': 'Erlang', 'bytes': '408489'}]} |
Appel WS Monext :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://DefaultNamespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:SetNiveauService>
<systemIdentifier xsi:type="xsd:string">WIZ_BOURSORAMA</systemIdentifier>
<password xsi:type="xsd:string">WsBoursorama!r20</password>
<CodeBanque xsi:type="xsd:string">40618</CodeBanque>
<NumCarte xsi:type="xsd:string">2000000000031883</NumCarte>
<NiveauService xsi:type="xsd:string">54AN</NiveauService>
<Column xsi:type="xsd:string">CRD_NUMBER_PK</Column>
</ns1:SetNiveauService>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Réponse :
<?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:SetNiveauServiceResponse xmlns:ns1="http://DefaultNamespace"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SetNiveauServiceReturn xsi:type="xsd:string"><MSG_RESPONSE><SIGNONPS_RETURN_CODE>0</SIGNONPS_RETURN_CODE><SERVICE_RETURN_CODE>2530</SERVICE_RETURN_CODE><SIGNOFF_RETURN_CODE>0</SIGNOFF_RETURN_CODE><RETURN_CODE>10</RETURN_CODE>
</MSG_RESPONSE></SetNiveauServiceReturn>
</ns1:SetNiveauServiceResponse>
</soapenv:Body>
</soapenv:Envelope>
| {'content_hash': 'f342a7f9f71f350aa4a728ad55f3c3ba', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 288, 'avg_line_length': 59.6, 'alnum_prop': 0.6711409395973155, 'repo_name': 'fpeyron/sampleBus', 'id': 'd995d1704be15b959e4f092e8534700ee3e13b9f', 'size': '1789', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'temp.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '1058'}, {'name': 'Java', 'bytes': '223145'}, {'name': 'XSLT', 'bytes': '6870'}]} |
require 'test_helper'
class ParseOrganizationDataWorkerTest < ActiveSupport::TestCase
test "smoke test parses data" do
Sidekiq::Testing.inline!
filepath = 'test/files/exempt_organizations_test.txt'
ParseOrganizationDataWorker.perform_async(filepath)
end
end
| {'content_hash': 'e88557c3092e906ed169a1a39dee54ab', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 63, 'avg_line_length': 25.181818181818183, 'alnum_prop': 0.776173285198556, 'repo_name': 'grantmnelson/charityapi', 'id': '2eb51994ce7a6a13e3fce385b87099772b81a48b', 'size': '277', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/workers/parse_organization_data_worker_test.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1022055'}, {'name': 'CoffeeScript', 'bytes': '211'}, {'name': 'HTML', 'bytes': '12871'}, {'name': 'JavaScript', 'bytes': '409569'}, {'name': 'Ruby', 'bytes': '79657'}]} |
package com.spring.core.domain;
import java.sql.Date;
/**
* @author vahid hosseinzadeh
* @version 1.0
* @since 1.0
*/
public class ProductReview {
private long id;
private long product;
private String review;
private String name;
private String email;
private Date date;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getProduct() {
return product;
}
public void setProduct(long product) {
this.product = product;
}
public String getReview() {
return review;
}
public void setReview(String review) {
this.review = review;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
}
| {'content_hash': '47349a3f4fb0b3419ff9172e20cff6a1', 'timestamp': '', 'source': 'github', 'line_count': 67, 'max_line_length': 42, 'avg_line_length': 16.37313432835821, 'alnum_prop': 0.5706472196900638, 'repo_name': 'garlos/ORFO', 'id': '964024e0be4c50502071dda48782a6029752d670', 'size': '1097', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/spring/core/domain/ProductReview.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '366848'}, {'name': 'Java', 'bytes': '410594'}]} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>basic_socket_acceptor::get_implementation (2 of 2 overloads)</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../../../boost_asio.html" title="Boost.Asio">
<link rel="up" href="../get_implementation.html" title="basic_socket_acceptor::get_implementation">
<link rel="prev" href="overload1.html" title="basic_socket_acceptor::get_implementation (1 of 2 overloads)">
<link rel="next" href="../get_io_service.html" title="basic_socket_acceptor::get_io_service">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="overload1.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../get_implementation.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../get_io_service.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_asio.reference.basic_socket_acceptor.get_implementation.overload2"></a><a class="link" href="overload2.html" title="basic_socket_acceptor::get_implementation (2 of 2 overloads)">basic_socket_acceptor::get_implementation
(2 of 2 overloads)</a>
</h5></div></div></div>
<p>
<span class="emphasis"><em>Inherited from basic_io_object.</em></span>
</p>
<p>
Get the underlying implementation of the I/O object.
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">implementation_type</span> <span class="special">&</span> <span class="identifier">get_implementation</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2003-2014 Christopher M. Kohlhoff<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="overload1.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../get_implementation.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../get_io_service.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {'content_hash': '86dee99da4b67ef0ab6af0154e174764', 'timestamp': '', 'source': 'github', 'line_count': 52, 'max_line_length': 457, 'avg_line_length': 71.01923076923077, 'alnum_prop': 0.6295694557270511, 'repo_name': 'rkq/cxxexp', 'id': 'ab77bee79928915a994ba04ffecdee06cbca32b2', 'size': '3693', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'third-party/src/boost_1_56_0/doc/html/boost_asio/reference/basic_socket_acceptor/get_implementation/overload2.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ActionScript', 'bytes': '65460'}, {'name': 'Assembly', 'bytes': '281439'}, {'name': 'Awk', 'bytes': '4270'}, {'name': 'C', 'bytes': '12760841'}, {'name': 'C#', 'bytes': '284333'}, {'name': 'C++', 'bytes': '168165192'}, {'name': 'CSS', 'bytes': '291858'}, {'name': 'Cuda', 'bytes': '26521'}, {'name': 'D', 'bytes': '644044'}, {'name': 'Emacs Lisp', 'bytes': '12952'}, {'name': 'Erlang', 'bytes': '137548'}, {'name': 'FORTRAN', 'bytes': '1387'}, {'name': 'Gnuplot', 'bytes': '2361'}, {'name': 'Go', 'bytes': '225070'}, {'name': 'Haskell', 'bytes': '55210'}, {'name': 'IDL', 'bytes': '14'}, {'name': 'Java', 'bytes': '2162335'}, {'name': 'JavaScript', 'bytes': '430303'}, {'name': 'Max', 'bytes': '36857'}, {'name': 'OCaml', 'bytes': '39133'}, {'name': 'Objective-C', 'bytes': '85640'}, {'name': 'Objective-C++', 'bytes': '207'}, {'name': 'PHP', 'bytes': '300052'}, {'name': 'Pascal', 'bytes': '311336'}, {'name': 'Perl', 'bytes': '549125'}, {'name': 'Python', 'bytes': '3145121'}, {'name': 'Rebol', 'bytes': '354'}, {'name': 'Ruby', 'bytes': '371639'}, {'name': 'Shell', 'bytes': '2701201'}, {'name': 'Smalltalk', 'bytes': '22944'}, {'name': 'Tcl', 'bytes': '1172'}, {'name': 'TeX', 'bytes': '181417'}, {'name': 'VimL', 'bytes': '6568'}, {'name': 'Visual Basic', 'bytes': '11578'}, {'name': 'XSLT', 'bytes': '751290'}]} |
from __future__ import print_function
import argparse
import sys
import xml.sax
class PathsExtractor(xml.sax.ContentHandler):
def __init__(self, polymer_version):
self.paths = []
self.polymer_version = polymer_version
def startElement(self, name, attrs):
if name != 'structure':
return
path = attrs['file']
if path.startswith('../../../third_party/web-animations-js'):
return
prefix = ('../../../third_party/polymer/v%s_0/components-chromium/' %
self.polymer_version)
if path.startswith(prefix):
self.paths.append(path[len(prefix):])
else:
raise Exception("Unexpected path %s." % path)
def main(argv):
parser = argparse.ArgumentParser()
parser.add_argument('input')
parser.add_argument('--polymer_version', required=True)
args = parser.parse_args(argv)
xml_handler = PathsExtractor(args.polymer_version)
xml.sax.parse(args.input, xml_handler)
print('\n'.join(sorted(xml_handler.paths)))
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
| {'content_hash': '59c3de090a8dcb9901a163aba8a15362', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 73, 'avg_line_length': 26.564102564102566, 'alnum_prop': 0.6621621621621622, 'repo_name': 'endlessm/chromium-browser', 'id': '0080261ef330789779518edbe19050403684b014', 'size': '1221', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tools/polymer/polymer_grdp_to_txt.py', 'mode': '33261', 'license': 'bsd-3-clause', 'language': []} |
layout: archive
title: "Latest Posts in *programmebook*"
excerpt: "儿童编程出版"
---
<div class="tiles">
{% for post in site.categories.programmebook %}
{% include post-grid.html %}
{% endfor %}
</div><!-- /.tiles -->
| {'content_hash': '6f2db47a1af55cc76839b7f8c5118aa2', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 47, 'avg_line_length': 19.545454545454547, 'alnum_prop': 0.6465116279069767, 'repo_name': 'myhome2016/myhome2016.github.io', 'id': 'f3e1de65dbb3c8316c7964b8c9c7a2700caca9a2', 'size': '231', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'programmebook/index.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '45844'}, {'name': 'HTML', 'bytes': '24387'}, {'name': 'JavaScript', 'bytes': '11566'}, {'name': 'Shell', 'bytes': '1441'}]} |
from utils import define_qfunc
import mxnet as mx
class QFunc(object):
"""
Base class for Q-Value Function.
"""
def __init__(self, env_spec):
self.env_spec = env_spec
def get_qvals(self, obs, act):
raise NotImplementedError
class ContinuousMLPQ(QFunc):
"""
Continuous Multi-Layer Perceptron Q-Value Network
for determnistic policy training.
"""
def __init__(
self,
env_spec):
super(ContinuousMLPQ, self).__init__(env_spec)
self.obs = mx.symbol.Variable("obs")
self.act = mx.symbol.Variable("act")
self.qval = define_qfunc(self.obs, self.act)
self.yval = mx.symbol.Variable("yval")
def get_output_symbol(self):
return self.qval
def get_loss_symbols(self):
return {"qval": self.qval,
"yval": self.yval}
def define_loss(self, loss_exp):
self.loss = mx.symbol.MakeLoss(loss_exp, name="qfunc_loss")
self.loss = mx.symbol.Group([self.loss, mx.symbol.BlockGrad(self.qval)])
def define_exe(self, ctx, init, updater, input_shapes=None, args=None,
grad_req=None):
# define an executor, initializer and updater for batch version loss
self.exe = self.loss.simple_bind(ctx=ctx, **input_shapes)
self.arg_arrays = self.exe.arg_arrays
self.grad_arrays = self.exe.grad_arrays
self.arg_dict = self.exe.arg_dict
for name, arr in self.arg_dict.items():
if name not in input_shapes:
init(name, arr)
self.updater = updater
def update_params(self, obs, act, yval):
self.arg_dict["obs"][:] = obs
self.arg_dict["act"][:] = act
self.arg_dict["yval"][:] = yval
self.exe.forward(is_train=True)
self.exe.backward()
for i, pair in enumerate(zip(self.arg_arrays, self.grad_arrays)):
weight, grad = pair
self.updater(i, grad, weight)
def get_qvals(self, obs, act):
self.exe.arg_dict["obs"][:] = obs
self.exe.arg_dict["act"][:] = act
self.exe.forward(is_train=False)
return self.exe.outputs[1].asnumpy()
| {'content_hash': 'a85f72ae5ac890b5ffe55ef1607fbbe6', 'timestamp': '', 'source': 'github', 'line_count': 86, 'max_line_length': 80, 'avg_line_length': 25.790697674418606, 'alnum_prop': 0.5779981965734896, 'repo_name': 'Ldpe2G/mxnet', 'id': '21957c47e3515f1dd50e22831edd1be975bba50e', 'size': '2218', 'binary': False, 'copies': '13', 'ref': 'refs/heads/develop', 'path': 'example/reinforcement-learning/ddpg/qfuncs.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '10676'}, {'name': 'C', 'bytes': '89222'}, {'name': 'C++', 'bytes': '3185225'}, {'name': 'CMake', 'bytes': '47349'}, {'name': 'Cuda', 'bytes': '566663'}, {'name': 'Dockerfile', 'bytes': '2645'}, {'name': 'Java', 'bytes': '2868'}, {'name': 'Jupyter Notebook', 'bytes': '1229390'}, {'name': 'MATLAB', 'bytes': '30187'}, {'name': 'Makefile', 'bytes': '39818'}, {'name': 'Perl', 'bytes': '610406'}, {'name': 'Perl 6', 'bytes': '938'}, {'name': 'Python', 'bytes': '2758731'}, {'name': 'R', 'bytes': '256596'}, {'name': 'Rebol', 'bytes': '353'}, {'name': 'Scala', 'bytes': '859860'}, {'name': 'Shell', 'bytes': '115261'}]} |
namespace chromecast {
namespace media {
MediaResourceTracker::MediaResourceTracker(
const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner)
: media_use_count_(0),
media_lib_initialized_(false),
delete_on_finalize_(false),
ui_task_runner_(ui_task_runner),
media_task_runner_(media_task_runner) {
DCHECK(ui_task_runner);
DCHECK(media_task_runner);
DCHECK(ui_task_runner_->BelongsToCurrentThread());
}
MediaResourceTracker::~MediaResourceTracker() {}
void MediaResourceTracker::InitializeMediaLib() {
DCHECK(ui_task_runner_->BelongsToCurrentThread());
media_task_runner_->PostTask(
FROM_HERE, base::Bind(&MediaResourceTracker::CallInitializeOnMediaThread,
base::Unretained(this)));
}
void MediaResourceTracker::FinalizeMediaLib(
const base::Closure& completion_cb) {
DCHECK(ui_task_runner_->BelongsToCurrentThread());
DCHECK(!completion_cb.is_null());
media_task_runner_->PostTask(
FROM_HERE,
base::Bind(&MediaResourceTracker::MaybeCallFinalizeOnMediaThread,
base::Unretained(this), completion_cb));
}
void MediaResourceTracker::FinalizeAndDestroy() {
DCHECK(ui_task_runner_->BelongsToCurrentThread());
media_task_runner_->PostTask(
FROM_HERE,
base::Bind(
&MediaResourceTracker::MaybeCallFinalizeOnMediaThreadAndDeleteSelf,
base::Unretained(this)));
}
void MediaResourceTracker::IncrementUsageCount() {
DCHECK(media_task_runner_->BelongsToCurrentThread());
DCHECK(media_lib_initialized_);
DCHECK(finalize_completion_cb_.is_null());
media_use_count_++;
}
void MediaResourceTracker::DecrementUsageCount() {
DCHECK(media_task_runner_->BelongsToCurrentThread());
media_use_count_--;
if (media_use_count_ == 0 &&
(delete_on_finalize_ || !finalize_completion_cb_.is_null())) {
CallFinalizeOnMediaThread();
}
}
void MediaResourceTracker::CallInitializeOnMediaThread() {
DCHECK(media_task_runner_->BelongsToCurrentThread());
if (media_lib_initialized_)
return;
DoInitializeMediaLib();
media_lib_initialized_ = true;
}
void MediaResourceTracker::MaybeCallFinalizeOnMediaThread(
const base::Closure& completion_cb) {
DCHECK(media_task_runner_->BelongsToCurrentThread());
DCHECK(finalize_completion_cb_.is_null());
finalize_completion_cb_ = BindToTaskRunner(ui_task_runner_, completion_cb);
if (!media_lib_initialized_) {
if (!finalize_completion_cb_.is_null())
base::ResetAndReturn(&finalize_completion_cb_).Run();
return;
}
// If there are things using media, we must wait for them to stop.
// CallFinalize will get called later from DecrementUsageCount when
// usage count drops to 0.
if (media_use_count_ == 0)
CallFinalizeOnMediaThread();
}
void MediaResourceTracker::MaybeCallFinalizeOnMediaThreadAndDeleteSelf() {
DCHECK(media_task_runner_->BelongsToCurrentThread());
if (!media_lib_initialized_) {
ui_task_runner_->DeleteSoon(FROM_HERE, this);
return;
}
delete_on_finalize_ = true;
// If there are things using media, we must wait for them to stop.
// CallFinalize will get called later from DecrementUsageCount when
// usage count drops to 0.
if (media_use_count_ == 0)
CallFinalizeOnMediaThread();
}
void MediaResourceTracker::CallFinalizeOnMediaThread() {
DCHECK(media_task_runner_->BelongsToCurrentThread());
DCHECK_EQ(media_use_count_, 0ul);
DCHECK(media_lib_initialized_);
DoFinalizeMediaLib();
media_lib_initialized_ = false;
if (!finalize_completion_cb_.is_null())
base::ResetAndReturn(&finalize_completion_cb_).Run();
if (delete_on_finalize_)
ui_task_runner_->DeleteSoon(FROM_HERE, this);
}
void MediaResourceTracker::DoInitializeMediaLib() {
base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
media::CastMediaShlib::Initialize(cmd_line->argv());
}
void MediaResourceTracker::DoFinalizeMediaLib() {
CastMediaShlib::Finalize();
}
} // namespace media
} // namespace chromecast
| {'content_hash': 'fd2355abaa1c626ac4adf9f61e4dcccf', 'timestamp': '', 'source': 'github', 'line_count': 134, 'max_line_length': 79, 'avg_line_length': 30.58955223880597, 'alnum_prop': 0.7152964137594535, 'repo_name': 'danakj/chromium', 'id': '79b4c12f5d04577cc314e3dbaa3a64bd39e298f0', 'size': '4488', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'chromecast/media/base/media_resource_tracker.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
import sys
import os
import argparse
import logging
from matplotlib import pyplot as plt
from scipy import ndimage
import numpy as np
from astropy.io import fits
from astropy import units as u
from astropy.modeling import models, fitting, Fittable2DModel, Parameter
from astropy.table import Table
from ccdproc import CCDData, combine, Combiner, flat_correct, trim_image, median_filter
##-------------------------------------------------------------------------
## Create logger object
##-------------------------------------------------------------------------
log = logging.getLogger('MyLogger')
log.setLevel(logging.DEBUG)
## Set up console output
LogConsoleHandler = logging.StreamHandler()
LogConsoleHandler.setLevel(logging.DEBUG)
LogFormat = logging.Formatter('%(asctime)s %(levelname)8s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
LogConsoleHandler.setFormatter(LogFormat)
log.addHandler(LogConsoleHandler)
## Set up file output
# LogFileName = None
# LogFileHandler = logging.FileHandler(LogFileName)
# LogFileHandler.setLevel(logging.DEBUG)
# LogFileHandler.setFormatter(LogFormat)
# log.addHandler(LogFileHandler)
##-------------------------------------------------------------------------
## mosfireAlignmentBox
##-------------------------------------------------------------------------
class mosfireAlignmentBox(Fittable2DModel):
amplitude = Parameter(default=1)
x_0 = Parameter(default=0)
y_0 = Parameter(default=0)
x_width = Parameter(default=1)
y_width = Parameter(default=1)
@staticmethod
def evaluate(x, y, amplitude, x_0, y_0, x_width, y_width):
'''MOSFIRE Alignment Box.
Typical widths are 22.5 pix horizontally and 36.0 pix vertically.
Angle of slit relative to pixels is 3.78 degrees.
'''
slit_angle = -3.7 # in degrees
x0_of_y = x_0 + (y-y_0)*np.sin(slit_angle*np.pi/180)
x_range = np.logical_and(x >= x0_of_y - x_width / 2.,
x <= x0_of_y + x_width / 2.)
y_range = np.logical_and(y >= y_0 - y_width / 2.,
y <= y_0 + y_width / 2.)
result = np.select([np.logical_and(x_range, y_range)], [amplitude], 0)
if isinstance(amplitude, u.Quantity):
return Quantity(result, unit=amplitude.unit, copy=False)
else:
return result
@property
def input_units(self):
if self.x_0.unit is None:
return None
else:
return {'x': self.x_0.unit,
'y': self.y_0.unit}
def _parameter_units_for_data_units(self, inputs_unit, outputs_unit):
return OrderedDict([('x_0', inputs_unit['x']),
('y_0', inputs_unit['y']),
('x_width', inputs_unit['x']),
('y_width', inputs_unit['y']),
('amplitude', outputs_unit['z'])])
##-------------------------------------------------------------------------
## Transformations (copied from CSU initializer code)
##-------------------------------------------------------------------------
def pad(x):
'''Pad array for affine transformation.
'''
return np.hstack([x, np.ones((x.shape[0], 1))])
def unpad(x):
'''Unpad array for affine transformation.
'''
return x[:,:-1]
def slit_to_bars(slit):
'''Given a slit number (1-46), return the two bar numbers associated
with that slit.
'''
return (slit*2-1, slit*2)
def bar_to_slit(bar):
'''Given a bar number, retun the slit associated with that bar.
'''
return int((bar+1)/2)
def pixel_to_physical(x):
'''Using the affine transformation determined by `fit_transforms`,
convert a set of pixel coordinates (X, Y) to physical coordinates (mm,
slit).
'''
Apixel_to_physical = [[ -1.30490576e-01, 8.06611058e-05, 0.00000000e+00],
[ -4.19125389e-04, -2.25757176e-02, 0.00000000e+00],
[ 2.73934450e+02, 4.66399772e+01, 1.00000000e+00]]
x = np.array(x)
result = unpad(np.dot(pad(x), Apixel_to_physical))
return result
def physical_to_pixel(x):
'''Using the affine transformation determined by `fit_transforms`,
convert a set of physical coordinates (mm, slit) to pixel coordinates
(X, Y).
'''
Aphysical_to_pixel = [[ -7.66328913e+00, -2.73804045e-02, 0.00000000e+00],
[ 1.42268848e-01, -4.42948641e+01, 0.00000000e+00],
[ 2.09260502e+03, 2.07341206e+03, 1.00000000e+00]]
x = np.array(x)
result = unpad(np.dot(pad(x), Aphysical_to_pixel))
return result
def fit_transforms(pixels, targets):
'''Given a set of pixel coordinates (X, Y) and a set of target
coordinates (X, Y), fit the affine transformations (forward and
backward) to convert between the two coordinate systems.
'''
if type(pixels) == list:
pixels = np.array(pixels)
if type(targets) == list:
targets = np.array(targets)
assert pixels.shape[1] == 2
assert targets.shape[1] == 2
assert pixels.shape[0] == targets.shape[0]
# Pad the data with ones, so that our transformation can do translations too
n = pixels.shape[0]
pad = lambda x: np.hstack([x, np.ones((x.shape[0], 1))])
unpad = lambda x: x[:,:-1]
X = pad(pixels)
Y = pad(targets)
# Solve the least squares problem X * A = Y
# to find our transformation matrix A
A, res, rank, s = np.linalg.lstsq(X, Y, rcond=None)
A[np.abs(A) < 1e-10] = 0
# Check Scale
thetas = np.array([np.arcsin(A[0,1])*180/np.pi, np.arcsin(A[1,0])*-180/np.pi])
thetadiff = np.abs(thetas[0] - thetas[1])
Sx = A[0,0]/np.cos(np.mean(thetas)*np.pi/180)
Sy = A[1,1]/np.cos(np.mean(thetas)*np.pi/180)
print(f"Scale Factor: {Sx:.4f}, {Sy:.4f}")
off_X = -A[2,0]
off_Y = -A[2,1]
off_R = -np.mean(thetas)
err_R = thetadiff/2
return (off_X, off_Y, off_R, err_R, A)
##-------------------------------------------------------------------------
## Fit CSU Edges (copied from CSU initializer code)
##-------------------------------------------------------------------------
def fit_CSU_edges(profile):
fitter = fitting.LevMarLSQFitter()
amp1_est = profile[profile == min(profile)][0]
mean1_est = np.argmin(profile)
amp2_est = profile[profile == max(profile)][0]
mean2_est = np.argmax(profile)
g_init1 = models.Gaussian1D(amplitude=amp1_est, mean=mean1_est, stddev=2.)
g_init1.amplitude.max = 0
g_init1.amplitude.min = amp1_est*0.9
g_init1.stddev.max = 3
g_init2 = models.Gaussian1D(amplitude=amp2_est, mean=mean2_est, stddev=2.)
g_init2.amplitude.min = 0
g_init2.amplitude.min = amp2_est*0.9
g_init2.stddev.max = 3
model = g_init1 + g_init2
fit = fitter(model, range(0,profile.shape[0]), profile)
# Check Validity of Fit
if abs(fit.stddev_0.value) <= 3 and abs(fit.stddev_1.value) <= 3\
and fit.amplitude_0.value < -1 and fit.amplitude_1.value > 1\
and fit.mean_0.value > fit.mean_1.value:
x = [fit.mean_0.value, fit.mean_1.value]
x1 = int(np.floor(min(x)-1))
x2 = int(np.ceil(max(x)+1))
else:
x1 = None
x2 = None
return x1, x2
##-------------------------------------------------------------------------
## Create Master Flat
##-------------------------------------------------------------------------
def create_master_flat(filepath='../../../KeckData/MOSFIRE_FCS/',
flatfiles = ['m180130_0320.fits',
'm180130_0321.fits',
'm180130_0322.fits',
'm180130_0323.fits',
'm180130_0324.fits',],
darkfile = 'm180130_0001.fits',
):
dark = CCDData.read(os.path.join(filepath, darkfile), unit='adu')
flats = []
for i,file in enumerate(flatfiles):
flat = CCDData.read(os.path.join(filepath, file), unit='adu')
flat = flat.subtract(dark)
flats.append(flat)
flat_combiner = Combiner(flats)
flat_combiner.sigma_clipping()
scaling_func = lambda arr: 1/np.ma.average(arr)
flat_combiner.scaling = scaling_func
masterflat = flat_combiner.median_combine()
masterflat.write('masterflat.fits', overwrite=True)
##-------------------------------------------------------------------------
## Reduce Image
##-------------------------------------------------------------------------
def reduce_image(imagefile, dark=None, flat=None):
im = CCDData.read(imagefile, unit='adu')
if dark is not None:
dark = CCDData.read(dark, unit='adu')
im = im.subtract(dark)
if flat is not None:
# masterflat = CCDData.read(flat, unit='adu')
hdul = fits.open(flat)
masterflat = CCDData(data=hdul[0].data, uncertainty=None, meta=hdul[0].header, unit='adu')
im = flat_correct(im, masterflat)
return im
# im = fits.open(imagefile)
# if dark is not None:
# masterdark = fits.open(dark)
# im[0].data -= masterdark[0].data
# if flat is not None:
# masterflat = fits.open(flat)
# norm = np.nanmedian(masterflat[0].data)
# im[0].data /= (masterflat[0].data / norm)
# return im
##-------------------------------------------------------------------------
## fit_alignment_box
##-------------------------------------------------------------------------
def fit_alignment_box(region, box_size=30, verbose=False, seeing=None,
medfilt=False):
pixelscale = u.pixel_scale(0.1798*u.arcsec/u.pixel)
if medfilt is True:
region = median_filter(region, size=(3,3))
# Estimate center of alignment box
threshold_pct = 80
window = region.data > np.percentile(region.data, threshold_pct)
alignment_box_position = ndimage.measurements.center_of_mass(window)
offset_val = np.median(region.data[~window])
offset = models.Const2D(offset_val)
# Determine fluctuations in sky
sky_amplitude = np.median(region.data[window])
sky_fluctuations = np.std(region.data[window])
# Detect box edges
gradx = np.gradient(region.data, axis=1)
horizontal_profile = np.sum(gradx, axis=0)
h_edges = fit_CSU_edges(horizontal_profile)
grady = np.gradient(region.data, axis=0)
vertical_profile = np.sum(grady, axis=1)
v_edges = fit_CSU_edges(vertical_profile)
# Estimate stellar position
maxr = np.max(region.data)
starloc = (np.where(region == maxr)[0][0],
np.where(region == maxr)[1][0])
# Build model of sky, star, & box
boxamplitude = 1
box = mosfireAlignmentBox(boxamplitude, alignment_box_position[1], alignment_box_position[0],\
abs(h_edges[0]-h_edges[1]), abs(v_edges[0]-v_edges[1]))
box.amplitude.fixed = True
box.x_width.min = 10
box.y_width.min = 10
sky = models.Const2D(sky_amplitude)
sky.amplitude.min = 0
star_amplitude = maxr - sky_amplitude
star_sigma = star_amplitude / sky_fluctuations
if star_sigma < 5:
if verbose: print(f'No star detected. sigma={star_sigma:.1f}')
return [None]*4
else:
if verbose: print(f'Detected peak pixel {star_sigma:.1f} sigma above sky.')
star = models.Gaussian2D(amplitude=star_amplitude,
x_mean=starloc[1], y_mean=starloc[0],
x_stddev=2, y_stddev=2)
# print(h_edges)
# print(v_edges)
# star.y_mean.min = v_edges[0]
# star.y_mean.max = v_edges[1]
# star.x_mean.min = h_edges[0]
# star.x_mean.max = h_edges[1]
star.amplitude.min = 5*sky_fluctuations
star.x_stddev.min = 1 # FWHM = 2.355*stddev = 0.42 arcsec FWHM
star.x_stddev.max = 4 # FWHM = 2.355*stddev = 1.47 arcsec FWHM
star.y_stddev.min = 1
star.y_stddev.max = 4
if seeing is not None and seeing > 0:
sigma = (seeing / 2.355 * u.arcsec).to(u.pixel, equivalencies=pixelscale)
star.x_stddev.min = max(2, sigma.value-1)
star.y_stddev.min = max(2, sigma.value-1)
star.x_stddev.max = min(sigma.value+1, 4)
star.y_stddev.max = min(sigma.value+1, 4)
# print(f"Using seeing value {seeing} arcsec. sigma limits {star.x_stddev.min}, {star.x_stddev.max} pix")
model = box*(sky + star) + offset
# modelim = np.zeros((61,61))
# fitim = np.zeros((61,61))
# for i in range(0,60):
# for j in range(0,60):
# modelim[j,i] = model(i,j)
# fitim[j,i] = model(i,j)
# residuals = region.data-fitim
# residualsum = np.sum(residuals)
# import pdb ; pdb.set_trace()
fitter = fitting.LevMarLSQFitter()
y, x = np.mgrid[:2*box_size+1, :2*box_size+1]
fit = fitter(model, x, y, region.data)
FWHMx = 2*(2*np.log(2))**0.5*fit.x_stddev_2.value * u.pix
FWHMy = 2*(2*np.log(2))**0.5*fit.y_stddev_2.value * u.pix
FWHM = (FWHMx**2 + FWHMy**2)**0.5/2**0.5
FWHMarcsec = FWHM.to(u.arcsec, equivalencies=pixelscale)
sky_amplitude = fit.amplitude_1.value
star_flux = 2*np.pi*fit.amplitude_2.value*fit.x_stddev_2.value*fit.y_stddev_2.value
star_amplitude = fit.amplitude_2.value
boxpos_x = fit.x_0_0.value
boxpos_y = fit.y_0_0.value
star_x = fit.x_mean_2.value
star_y = fit.y_mean_2.value
if verbose: print(f" Box X Center = {boxpos_x:.0f}")
if verbose: print(f" Box Y Center = {boxpos_y:.0f}")
if verbose: print(f" Sky Brightness = {fit.amplitude_1.value:.0f} ADU")
if verbose: print(f" Stellar FWHM = {FWHMarcsec:.2f}")
if verbose: print(f" Stellar Xpos = {star_x:.0f}")
if verbose: print(f" Stellar Xpos = {star_y:.0f}")
if verbose: print(f" Stellar Amplitude = {star_amplitude:.0f} ADU")
if verbose: print(f" Stellar Flux (fit) = {star_flux:.0f} ADU")
result = {'Star X': star_x,
'Star Y': star_y,
'Star Amplitude': star_amplitude,
'Sky Amplitude': sky_amplitude,
'FWHM pix': FWHM.value,
'FWHM arcsec': FWHMarcsec,
'Box X': boxpos_x,
'Box Y': boxpos_y,
# 'Residuals': residuals,
}
return result
def analyze_image(imagefile, dark=None, flat=None, box_size=30, medfilt=False,
plot=False, seeing=0, pixelscale=0.1798, verbose=False):
im = reduce_image(imagefile, dark=dark, flat=flat)
hdul = fits.open(imagefile)
# Get info about alignment box positions
alignment_box_table = Table(hdul[4].data)
if plot == True:
plt.figure(figsize=(16,6))
pixels = []
targets = []
for i,box in enumerate(alignment_box_table):
result = None
slitno = int(box['Slit_Number'])
bar_nos = slit_to_bars(slitno)
bar_pos = [hdul[0].header.get(f'B{b:02d}POS') for b in bar_nos]
box_pos = np.mean(bar_pos)
box_pix = physical_to_pixel([[box_pos, slitno]])[0]
boxat = [int(box_pix[0]), int(box_pix[1])]
fits_section = f'[{boxat[0]-box_size:d}:{boxat[0]+box_size:d}, '\
f'{boxat[1]-box_size:d}:{boxat[1]+box_size:d}]'
region = trim_image(im, fits_section=fits_section)
targ_pos = float(box['Target_to_center_of_slit_distance'])/pixelscale
if plot == True:
plt.subplot(1,len(alignment_box_table),i+1, aspect='equal')
plt.title(f"Alignment Box {i+1}\n{fits_section}")
plt.imshow(region.data, origin='lower',
vmin=np.percentile(region.data, 85)*0.95,
vmax=region.data.max()*1.02)
# try:
result = fit_alignment_box(region, box_size=box_size, verbose=False,
seeing=seeing, medfilt=medfilt)
star_pix = np.array([result['Star X']+boxat[0]-box_size,
result['Star Y']+boxat[1]-box_size])
fitted_box_pix = np.array([result['Box X']+boxat[0]-box_size,
result['Box Y']+boxat[1]-box_size])
slitang = 0.22*np.pi/180
targ_pix_im = (result['Box X']-np.sin(slitang)*targ_pos,
result['Box Y']+np.cos(slitang)*targ_pos)
targ_pix = np.array([targ_pix_im[0]+boxat[0]-box_size,
targ_pix_im[1]+boxat[1]-box_size])
pixels.append(list(star_pix))
targets.append(list(targ_pix))
pix_err = targ_pix - star_pix
pos_err = pix_err*pixelscale
if plot == True:
cxy = (result['Star X'], result['Star Y'])
c = plt.Circle(cxy, result['FWHM pix'], linewidth=2, ec='g', fc='none', alpha=0.3)
ax = plt.gca()
ax.add_artist(c)
plt.plot(result['Star X'], result['Star Y'], 'g.')
# plt.plot(result['Box X'], result['Box Y'], 'y+', alpha=0.5, ms=10)
plt.plot(targ_pix_im[0], targ_pix_im[1], 'rx', alpha=0.5)
if verbose:
print(f"Alignment Box {i+1} results:")
print(f" Sky Amplitude: {result['Sky Amplitude']:.0f} ADU")
print(f" Star Amplitude: {result['Star Amplitude']:.0f} ADU")
print(f" Star FWHM: {result['FWHM arcsec']:.2f}")
print(f" Star Position: {star_pix[0]:.1f}, {star_pix[1]:.1f}")
print(f" Target Position: {targ_pix[0]:.1f}, {targ_pix[1]:.1f}")
print(f" Position Error: {pos_err[0]:+.2f}, {pos_err[1]:+.2f} arcsec")
# except:
# print(f'Alignment Box {i+1} failed: {result}')
if plot == True:
plt.xticks([], [])
plt.yticks([], [])
# Calculate Transformation
off_Xpix, off_Ypix, off_R, err_R, A = fit_transforms(pixels, targets)
off_X = off_Xpix * pixelscale
off_Y = off_Ypix * pixelscale
th_XY = 0.10
th_R = 0.030
send_X = off_X if abs(off_X) > th_XY else 0
send_Y = off_Y if abs(off_Y) > th_XY else 0
send_R = off_R if abs(off_R) > th_R else 0
print()
print(f" Calculated Err Send (Threshold)")
print(f"Offset X = {off_X:+.2f} {send_X:+.2f} arcsec ({th_XY:.2f})")
print(f"Offset Y = {off_Y:+.2f} {send_Y:+.2f} arcsec ({th_XY:.2f})")
print(f"Rotation = {off_R:+.3f} {err_R:.3f} {send_R:+.3f} deg ({th_R:.3f})")
if plot == True:
plt.show()
if __name__ == '__main__':
##-------------------------------------------------------------------------
## Parse Command Line Arguments
##-------------------------------------------------------------------------
## create a parser object for understanding command-line arguments
p = argparse.ArgumentParser(description='''
''')
## add flags
p.add_argument("-v", "--verbose", dest="verbose",
default=False, action="store_true",
help="Be verbose! (default = False)")
p.add_argument("-m", "--medfilt", dest="medfilt",
default=False, action="store_true",
help="Median filter images?")
p.add_argument("-p", "--plot", dest="plot",
default=False, action="store_true",
help="Generate plots?")
## add options
p.add_argument("-d", "--dark", dest="dark", type=str,
help="Dark file to use.")
p.add_argument("-f", "--flat", dest="flat", type=str,
help="Master flat file to use.")
p.add_argument("-s", "--seeing", dest="seeing", type=float,
default=0,
help="Seeing in arcsec.")
## add arguments
p.add_argument('image', type=str,
help="Image file to analyze")
# p.add_argument('allothers', nargs='*',
# help="All other arguments")
args = p.parse_args()
if args.dark is not None:
args.dark = os.path.expanduser(args.dark)
if args.flat is not None:
args.flat = os.path.expanduser(args.flat)
args.image = os.path.expanduser(args.image)
analyze_image(args.image, dark=args.dark, flat=args.flat, box_size=30,
medfilt=args.medfilt, plot=args.plot, seeing=args.seeing)
| {'content_hash': '98dd57e610b8b42c332304bad8bc65c6', 'timestamp': '', 'source': 'github', 'line_count': 528, 'max_line_length': 113, 'avg_line_length': 38.240530303030305, 'alnum_prop': 0.5463820514090436, 'repo_name': 'joshwalawender/KeckUtilities', 'id': '773e821481688ae253db8fa55b704ceed237f651', 'size': '20234', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'SlitAlign/slitAlign.py', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Jupyter Notebook', 'bytes': '499302'}, {'name': 'Python', 'bytes': '134339'}]} |
export * from "./validator"
export * from "./baseclasses"
export * from "./required-validator"
export * from "./range-validator"
export * from "./email-validator"
export * from "./type-validator"
export * from "./validator-factory"
| {'content_hash': 'f36dfe5b7f759c8172a03b41f63e15d7', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 36, 'avg_line_length': 29.125, 'alnum_prop': 0.703862660944206, 'repo_name': 'kambojajs/kamboja', 'id': 'a79f0c6308f3f036687acca636c6ab186188829a', 'size': '233', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'packages/kamboja-foundation/src/validator/index.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '166'}, {'name': 'JavaScript', 'bytes': '5257'}, {'name': 'Makefile', 'bytes': '378'}, {'name': 'TypeScript', 'bytes': '673486'}]} |
package io.mycat.ep.v1.flashsale;
public abstract class Callback_FlashBuyHandler_flashBuy
extends IceInternal.TwowayCallback implements Ice.TwowayCallbackArg1<io.mycat.ep.v1.flashsale.FlashSaleResult>
{
public final void __completed(Ice.AsyncResult __result)
{
FlashBuyHandlerPrxHelper.__flashBuy_completed(this, __result);
}
}
| {'content_hash': 'ff8dd66f90ac101add04d56deab6fbd4', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 114, 'avg_line_length': 35.3, 'alnum_prop': 0.7648725212464589, 'repo_name': 'MyCATApache/Mycat-openEP', 'id': '2e797f4fcf218583c5d85ec447ba4f525443f0b6', 'size': '848', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'mycat-ep-server2/mycat-ep-flashsale/src/main/java/io/mycat/ep/v1/flashsale/Callback_FlashBuyHandler_flashBuy.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '26'}, {'name': 'Java', 'bytes': '1121591'}, {'name': 'Nginx', 'bytes': '1968'}, {'name': 'PHP', 'bytes': '12704'}, {'name': 'Shell', 'bytes': '21747'}]} |
package networkwebsockets
import (
"encoding/base64"
"errors"
"fmt"
"log"
"net"
"strings"
"time"
"github.com/richtr/bcrypt"
"github.com/richtr/mdns"
)
const (
ipv4mdns = "224.0.0.251"
ipv6mdns = "ff02::fb"
mdnsPort = 5406 // operate on our own multicast port (standard mDNS port is 5353)
)
var (
network_ipv4Addr = &net.UDPAddr{
IP: net.ParseIP(ipv4mdns),
Port: mdnsPort,
}
network_ipv6Addr = &net.UDPAddr{
IP: net.ParseIP(ipv6mdns),
Port: mdnsPort,
}
)
/** Network Web Socket DNS-SD Discovery Client interface **/
type DiscoveryService struct {
Name string
Hash string
Path string
Port int
server *mdns.Server
}
func NewDiscoveryService(name, hash, path string, port int) *DiscoveryService {
discoveryService := &DiscoveryService{
Name: name,
Hash: hash,
Path: path,
Port: port,
}
return discoveryService
}
func (dc *DiscoveryService) Register(domain string) {
dnssdServiceId := GenerateId()
s := &mdns.MDNSService{
Instance: dnssdServiceId,
Service: "_nws._tcp",
Domain: domain,
Port: dc.Port,
Info: fmt.Sprintf("hash=%s,path=%s", dc.Hash, dc.Path),
}
if err := s.Init(); err != nil {
log.Printf("Could not register service on network. %v", err)
return
}
var mdnsClientConfig *mdns.Config
// Advertise service to the correct endpoint (local or network)
mdnsClientConfig = &mdns.Config{
IPv4Addr: network_ipv4Addr,
IPv6Addr: network_ipv6Addr,
}
// Add the DNS zone record to advertise
mdnsClientConfig.Zone = s
serv, err := mdns.NewServer(mdnsClientConfig)
if err != nil {
log.Printf("Failed to create new mDNS server. %v", err)
return
}
dc.server = serv
log.Printf("New '%s' channel advertised as '%s' in %s network", dc.Name, fmt.Sprintf("%s._nws._tcp", dnssdServiceId), domain)
}
func (dc *DiscoveryService) Shutdown() {
if dc.server != nil {
dc.server.Shutdown()
}
}
/** Network Web Socket DNS-SD Discovery Server interface **/
type DiscoveryBrowser struct {
// Network Web Socket DNS-SD records currently unresolved by this proxy instance
cachedDNSRecords map[string]*DNSRecord
closed bool
}
func NewDiscoveryBrowser() *DiscoveryBrowser {
discoveryBrowser := &DiscoveryBrowser{
cachedDNSRecords: make(map[string]*DNSRecord, 255),
closed: false,
}
return discoveryBrowser
}
func (ds *DiscoveryBrowser) Browse(service *Service, timeoutSeconds int) {
entries := make(chan *mdns.ServiceEntry, 255)
recordsCache := make(map[string]*DNSRecord, 255)
timeout := time.Duration(timeoutSeconds) * time.Second
var targetIPv4 *net.UDPAddr
var targetIPv6 *net.UDPAddr
targetIPv4 = network_ipv4Addr
targetIPv6 = network_ipv6Addr
// Only look for Network Web Socket DNS-SD services
params := &mdns.QueryParam{
Service: "_nws._tcp",
Domain: "local",
Timeout: timeout,
Entries: entries,
IPv4mdns: targetIPv4,
IPv6mdns: targetIPv6,
}
go func() {
complete := false
timeoutFinish := time.After(timeout)
// Wait for responses until timeout
for !complete {
select {
case discoveredService, ok := <-entries:
if !ok {
continue
}
serviceRecord, err := NewServiceRecordFromDNSRecord(discoveredService)
if err != nil {
log.Printf("err: %v", err)
continue
}
// Ignore our own Channel services
if service.isOwnProxyService(serviceRecord) {
continue
}
// Ignore previously discovered Channel proxy services
if service.isActiveProxyService(serviceRecord) {
continue
}
// Resolve discovered service hash provided against available services
var channel *Channel
for _, knownService := range service.Channels {
if bcrypt.Match(knownService.serviceName, serviceRecord.Hash_BCrypt) {
channel = knownService
break
}
}
if channel != nil {
// Create new web socket connection toward discovered proxy
if dErr := dialProxyFromDNSRecord(serviceRecord, channel); dErr != nil {
log.Printf("err: %v", dErr)
continue
}
} else {
// Store as an unresolved DNS-SD record
recordsCache[serviceRecord.Hash_Base64] = serviceRecord
continue
}
case <-timeoutFinish:
// Replace unresolved DNS records cache
ds.cachedDNSRecords = recordsCache
complete = true
}
}
}()
// Run the mDNS/DNS-SD query
err := mdns.Query(params)
if err != nil {
log.Printf("Could not perform mDNS/DNS-SD query. %v", err)
return
}
}
func (ds *DiscoveryBrowser) Shutdown() {
ds.closed = true
}
/** Network Web Socket DNS Record interface **/
type DNSRecord struct {
*mdns.ServiceEntry
Path string
Hash_Base64 string
Hash_BCrypt string
}
func NewServiceRecordFromDNSRecord(serviceEntry *mdns.ServiceEntry) (*DNSRecord, error) {
servicePath := ""
serviceHash_Base64 := ""
serviceHash_BCrypt := ""
if serviceEntry.Info == "" {
return nil, errors.New("Could not find associated TXT record for advertised Network Web Socket service")
}
serviceParts := strings.FieldsFunc(serviceEntry.Info, func(r rune) bool {
return r == '=' || r == ',' || r == ';' || r == ' '
})
if len(serviceParts) > 1 {
for i := 0; i < len(serviceParts); i += 2 {
if strings.ToLower(serviceParts[i]) == "path" {
servicePath = serviceParts[i+1]
}
if strings.ToLower(serviceParts[i]) == "hash" {
serviceHash_Base64 = serviceParts[i+1]
if res, err := base64.StdEncoding.DecodeString(serviceHash_Base64); err == nil {
serviceHash_BCrypt = string(res)
}
}
}
}
if servicePath == "" || serviceHash_Base64 == "" || serviceHash_BCrypt == "" {
return nil, errors.New("Could not resolve the provided Network Web Socket DNS Record")
}
// Create and return a new Network Web Socket DNS Record with the parsed information
newServiceDNSRecord := &DNSRecord{serviceEntry, servicePath, serviceHash_Base64, serviceHash_BCrypt}
return newServiceDNSRecord, nil
}
| {'content_hash': '5b48356ed627e29e715dc8b7c0194040', 'timestamp': '', 'source': 'github', 'line_count': 258, 'max_line_length': 126, 'avg_line_length': 22.92248062015504, 'alnum_prop': 0.6817720662833954, 'repo_name': 'namedwebsockets/networkwebsockets', 'id': '55415bed2f5d10316f866d9e96099c977afb6f9a', 'size': '5914', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'discovery.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '79019'}, {'name': 'HTML', 'bytes': '16600'}, {'name': 'JavaScript', 'bytes': '10170'}]} |
function printAggregatedTable(params) {
let delimiter = '|';
let towns = [];
let sum = 0;
for (let i = 0; i < params.length; i++) {
let startIndex = params[i].indexOf(delimiter) + 1;
let endindex = params[i].lastIndexOf(delimiter);
let town = params[i].substring(startIndex, endindex).trim();
let income = Number(params[i].substring(endindex + 1).trim());
towns.push(town);
sum += income;
}
console.log(towns.join(', '));
console.log(sum);
}
printAggregatedTable(['| Sofia | 300',
'| Veliko Tarnovo | 500',
'| Yambol | 275']
); | {'content_hash': 'ec4feac49534543dfae541cf8b216694', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 70, 'avg_line_length': 26.5, 'alnum_prop': 0.5566037735849056, 'repo_name': 'RAstardzhiev/SoftUni-C-Scharp', 'id': '911a313b99c368d49cbe343ac0ec7c2d6c498a87', 'size': '636', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'JavaScript Fundamentals/Strings and Regular Expressions - Lab/05.AggregateTable.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '715188'}]} |
package tides
import (
"encoding/xml"
"fmt"
"io/ioutil"
"os"
"sort"
"golang.org/x/net/html/charset"
)
type tideLevel int
const (
low tideLevel = iota
high
)
// ObservationHolder maps a station id to the location
type ObservationHolder struct {
Locations map[string]*Location
}
// Location holds station information and the tide predictions
type Location struct {
XMLName xml.Name `xml:"datainfo"`
Items []*Prediction `xml:"data>item"`
State string `xml:"state"`
StationType string `xml:"stationtype"`
StationID string `xml:"stationid"`
}
func (loc Location) String() string {
return fmt.Sprintf("Location: id=%s, state=%s, type=%s", loc.StationID, loc.State, loc.StationType)
}
// Prediction is provided by the NOAA
type Prediction struct {
Level string
HighOrLow string `xml:"highlow"`
Date string `xml:"date"`
Feet float32 `xml:"predictions_in_ft"`
Time string `xml:"time"`
Direction string
}
func (p Prediction) String() string {
return fmt.Sprintf("date=%v, time=%v, tideHeightFt=%0.1f, highOrLow=%s, dir=%s", p.Date, p.Time, p.Feet, p.HighOrLow, p.Direction)
}
// LoadDataStore loads all prediction files in the given directory
func (holder *ObservationHolder) LoadDataStore(dir string) error {
files, err := ioutil.ReadDir(dir)
if err != nil {
return err
}
for _, file := range files {
loc, err := loadPredictionFile(dir + "/" + file.Name())
if err != nil {
return err
}
holder.Locations[loc.StationID] = loc
}
return nil
}
func loadPredictionFile(file string) (*Location, error) {
xmlFile, err := os.Open(file)
if err != nil {
return nil, err
}
defer xmlFile.Close()
// Since our XML is encoded in ISO-8859-1, we need to decode it
decoder := xml.NewDecoder(xmlFile)
decoder.CharsetReader = charset.NewReaderLabel
var loc Location
err = decoder.Decode(&loc)
if err != nil {
fmt.Printf("Unable to unmarshal correctly: %v\n", err)
return nil, err
}
// Now loop over to decide whether the tide will be rising or falling until the next observation
for i := range loc.Items {
if loc.Items[i].HighOrLow == "H" {
loc.Items[i].Direction = "FALLING"
} else {
loc.Items[i].Direction = "RISING"
}
}
return &loc, nil
}
// FindNearestPrediction finds the closest prediction to the provided date, using binary search until we move to a smarter data structure
func (loc *Location) FindNearestPrediction(date string) *Prediction {
i := sort.Search(len(loc.Items), func(i int) bool {
return loc.Items[i].Date >= date
})
if i < len(loc.Items) && loc.Items[i].Date == date {
return loc.Items[i]
}
return nil
}
| {'content_hash': 'af62c4680297af3008f9a9dd2456f39a', 'timestamp': '', 'source': 'github', 'line_count': 112, 'max_line_length': 137, 'avg_line_length': 23.8125, 'alnum_prop': 0.6801649793775778, 'repo_name': 'slowteetoe/tidechecker', 'id': 'c8d941266f2f3d701e159def5d1d4e53db498164', 'size': '2667', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tides/tides.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '7140'}, {'name': 'Protocol Buffer', 'bytes': '221'}]} |
<?php
use yii\bootstrap\Html;
use yii\widgets\Breadcrumbs;
use p2made\helpers\FA;
// load assets...
p2made\demo\assets\ThingsDemoAsset::register($this);
// DEMO ONLY _DON'T_ use this in your production copy.
/* @var $this yii\web\View */
$this->title = 'Scratchpad';
$this->params['breadcrumbs'][] = $this->title;
?>
<div id="content-wrapper">
<?= Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
<h1><?= Html::encode($this->title) ?></h1>
<div class="body-content">
<br><br><br>
</div><!-- /.body-content -->
</div><!-- /#content-wrapper -->
<?php
/*
*/
?>
| {'content_hash': '810de2841b176e108d4baacca393b4e4', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 85, 'avg_line_length': 16.512820512820515, 'alnum_prop': 0.6086956521739131, 'repo_name': 'jsondune/phonebook-yii2', 'id': '8abab0c5bd9abb237c2e9b185fed78e9f4043ef2', 'size': '832', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'vendor/p2made/yii2-p2y2-things-demo/views/site/pages/scratchpad.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ApacheConf', 'bytes': '242'}, {'name': 'Batchfile', 'bytes': '1030'}, {'name': 'CSS', 'bytes': '1513'}, {'name': 'PHP', 'bytes': '239971'}]} |
<html>
<head>
<title>User agent detail - Mozilla/5.0 (Linux; Android 4.3; D2104 Build/20.0.B.0.84) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Mobile Safari/537.36</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
Mozilla/5.0 (Linux; Android 4.3; D2104 Build/20.0.B.0.84) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Mobile Safari/537.36
</h5>
</div>
</div>
<div class="section">
<table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Source result (test suite)</th></tr><tr><td>whichbrowser/parser<br /><small>/tests/data/mobile/manufacturer-sony.yaml</small></td><td>Chrome 40</td><td>Android 4.3</td><td>Blink 537.36</td><td style="border-left: 1px solid #555">Sony</td><td>Xperia E1 dual</td><td>mobile:smart</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td></td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-test">Detail</a>
<!-- Modal Structure -->
<div id="modal-test" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Testsuite result detail</h4>
<p><pre><code class="php">Array
(
[headers] => User-Agent: Mozilla/5.0 (Linux; Android 4.3; D2104 Build/20.0.B.0.84) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Mobile Safari/537.36
[result] => Array
(
[browser] => Array
(
[name] => Chrome
[version] => 40
[type] => browser
)
[engine] => Array
(
[name] => Blink
[version] => 537.36
)
[os] => Array
(
[name] => Android
[version] => 4.3
)
[device] => Array
(
[type] => mobile
[subtype] => smart
[manufacturer] => Sony
[model] => Xperia E1 dual
)
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapPhp<br /><small>6012</small></td><td>Chrome 40.0</td><td>Blink </td><td>Android 4.3</td><td style="border-left: 1px solid #555"></td><td></td><td>Mobile Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.17798</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-215ac98d-ccf8-4615-916e-5a819d6a59c9">Detail</a>
<!-- Modal Structure -->
<div id="modal-215ac98d-ccf8-4615-916e-5a819d6a59c9" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapPhp result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/5\.0 \(.*linux.*android.4\.3.*\) applewebkit\/.* \(khtml, like gecko.*\) chrome\/40\..*safari\/.*$/
[browser_name_pattern] => mozilla/5.0 (*linux*android?4.3*) applewebkit/* (khtml, like gecko*) chrome/40.*safari/*
[parent] => Chrome 40.0 for Android
[comment] => Chrome 40.0
[browser] => Chrome
[browser_type] => Browser
[browser_bits] => 32
[browser_maker] => Google Inc
[browser_modus] => unknown
[version] => 40.0
[majorver] => 40
[minorver] => 0
[platform] => Android
[platform_version] => 4.3
[platform_description] => Android OS
[platform_bits] => 32
[platform_maker] => Google Inc
[alpha] =>
[beta] =>
[win16] =>
[win32] =>
[win64] =>
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[backgroundsounds] =>
[javascript] => 1
[vbscript] =>
[javaapplets] =>
[activexcontrols] =>
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] =>
[crawler] =>
[cssversion] => 3
[aolversion] => 0
[device_name] => general Mobile Phone
[device_maker] => unknown
[device_type] => Mobile Phone
[device_pointing_method] => touchscreen
[device_code_name] => general Mobile Phone
[device_brand_name] => unknown
[renderingengine_name] => Blink
[renderingengine_version] => unknown
[renderingengine_description] => a WebKit Fork by Google
[renderingengine_maker] => Google Inc
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>DonatjUAParser<br /><small>v0.5.0</small></td><td>Chrome 40.0.2214.89</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661">Detail</a>
<!-- Modal Structure -->
<div id="modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] => Android
[browser] => Chrome
[version] => 40.0.2214.89
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>NeutrinoApiCom<br /><small></small></td><td>Chrome Mobile 40.0.2214.89</td><td><i class="material-icons">close</i></td><td>Android 4.3</td><td style="border-left: 1px solid #555">Sony</td><td>D2104</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.32313</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc">Detail</a>
<!-- Modal Structure -->
<div id="modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 800
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] => Sony
[mobile_model] => D2104
[version] => 40.0.2214.89
[is_android] => 1
[browser_name] => Chrome Mobile
[operating_system_family] => Android
[operating_system_version] => 4.3
[is_ios] =>
[producer] => Google Inc.
[operating_system] => Android 4.3 Jelly Bean
[mobile_screen_width] => 480
[mobile_browser] => Chrome Mobile
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>PiwikDeviceDetector<br /><small>3.5.2</small></td><td>Chrome Mobile 40.0</td><td>Blink </td><td>Android 4.3</td><td style="border-left: 1px solid #555">Sony</td><td>Xperia E1 Dual</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.005</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-21638055-738d-46ba-a1b1-f5114bc26475">Detail</a>
<!-- Modal Structure -->
<div id="modal-21638055-738d-46ba-a1b1-f5114bc26475" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>PiwikDeviceDetector result detail</h4>
<p><pre><code class="php">Array
(
[client] => Array
(
[type] => browser
[name] => Chrome Mobile
[short_name] => CM
[version] => 40.0
[engine] => Blink
)
[operatingSystem] => Array
(
[name] => Android
[short_name] => AND
[version] => 4.3
[platform] =>
)
[device] => Array
(
[brand] => SO
[brandName] => Sony
[model] => Xperia E1 Dual
[device] => 1
[deviceName] => smartphone
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] => 1
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] => 1
[isTablet] =>
[isTV] =>
[isDesktop] =>
[isMobile] => 1
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.0</small></td><td>Chrome 40.0.2214.89</td><td><i class="material-icons">close</i></td><td>Android 4.3</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5415e7f2-ef7b-434c-abe0-b71ba9f6707c">Detail</a>
<!-- Modal Structure -->
<div id="modal-5415e7f2-ef7b-434c-abe0-b71ba9f6707c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>SinergiBrowserDetector result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Sinergi\BrowserDetector\Browser Object
(
[userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; Android 4.3; D2104 Build/20.0.B.0.84) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Mobile Safari/537.36
)
[name:Sinergi\BrowserDetector\Browser:private] => Chrome
[version:Sinergi\BrowserDetector\Browser:private] => 40.0.2214.89
[isRobot:Sinergi\BrowserDetector\Browser:private] =>
[isChromeFrame:Sinergi\BrowserDetector\Browser:private] =>
)
[operatingSystem] => Sinergi\BrowserDetector\Os Object
(
[name:Sinergi\BrowserDetector\Os:private] => Android
[version:Sinergi\BrowserDetector\Os:private] => 4.3
[isMobile:Sinergi\BrowserDetector\Os:private] => 1
[userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; Android 4.3; D2104 Build/20.0.B.0.84) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Mobile Safari/537.36
)
)
[device] => Sinergi\BrowserDetector\Device Object
(
[name:Sinergi\BrowserDetector\Device:private] => unknown
[userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; Android 4.3; D2104 Build/20.0.B.0.84) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Mobile Safari/537.36
)
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UAParser<br /><small>v3.4.5</small></td><td>Chrome Mobile 40.0.2214</td><td><i class="material-icons">close</i></td><td>Android 4.3</td><td style="border-left: 1px solid #555">Sony</td><td>D2104</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b">Detail</a>
<!-- Modal Structure -->
<div id="modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">UAParser\Result\Client Object
(
[ua] => UAParser\Result\UserAgent Object
(
[major] => 40
[minor] => 0
[patch] => 2214
[family] => Chrome Mobile
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] => 4
[minor] => 3
[patch] =>
[patchMinor] =>
[family] => Android
)
[device] => UAParser\Result\Device Object
(
[brand] => Sony
[model] => D2104
[family] => D2104
)
[originalUserAgent] => Mozilla/5.0 (Linux; Android 4.3; D2104 Build/20.0.B.0.84) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Mobile Safari/537.36
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentStringCom<br /><small></small></td><td>Android Webkit Browser </td><td><i class="material-icons">close</i></td><td>Android 4.3</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.16107</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4">Detail</a>
<!-- Modal Structure -->
<div id="modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentStringCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[agent_type] => Browser
[agent_name] => Android Webkit Browser
[agent_version] => --
[os_type] => Android
[os_name] => Android
[os_versionName] =>
[os_versionNumber] => 4.3
[os_producer] =>
[os_producerURL] =>
[linux_distibution] => Null
[agent_language] =>
[agent_languageTag] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhatIsMyBrowserCom<br /><small></small></td><td>Chrome 40.0.2214.89</td><td>WebKit 537.36</td><td>Android 4.3</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.45118</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9795f66f-7271-430e-973a-a5c0e14dc35a">Detail</a>
<!-- Modal Structure -->
<div id="modal-9795f66f-7271-430e-973a-a5c0e14dc35a" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhatIsMyBrowserCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[operating_system_name] => Android
[simple_sub_description_string] =>
[simple_browser_string] => Chrome 40 on Android (Jelly Bean)
[browser_version] => 40
[extra_info] => Array
(
)
[operating_platform] =>
[extra_info_table] => stdClass Object
(
[System Build] => 20
)
[layout_engine_name] => WebKit
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => chrome
[operating_system_version] => Jelly Bean
[simple_operating_platform_string] =>
[is_abusive] =>
[layout_engine_version] => 537.36
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] =>
[operating_system] => Android (Jelly Bean)
[operating_system_version_full] => 4.3
[operating_platform_code] =>
[browser_name] => Chrome
[operating_system_name_code] => android
[user_agent] => Mozilla/5.0 (Linux; Android 4.3; D2104 Build/20.0.B.0.84) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Mobile Safari/537.36
[browser_version_full] => 40.0.2214.89
[browser] => Chrome 40
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhichBrowser<br /><small>2.0.10</small></td><td>Chrome 40</td><td>Blink </td><td>Android 4.3</td><td style="border-left: 1px solid #555">Sony</td><td>Xperia E1 dual</td><td>mobile:smart</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.039</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4">Detail</a>
<!-- Modal Structure -->
<div id="modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[name] => Chrome
[version] => 40
[type] => browser
)
[engine] => Array
(
[name] => Blink
)
[os] => Array
(
[name] => Android
[version] => 4.3
)
[device] => Array
(
[type] => mobile
[subtype] => smart
[manufacturer] => Sony
[model] => Xperia E1 dual
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Woothee<br /><small>v1.2.0</small></td><td>Chrome 40.0.2214.89</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>smartphone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-3f285ff5-314b-4db4-9948-54572e92e7b6">Detail</a>
<!-- Modal Structure -->
<div id="modal-3f285ff5-314b-4db4-9948-54572e92e7b6" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Woothee result detail</h4>
<p><pre><code class="php">Array
(
[name] => Chrome
[vendor] => Google
[version] => 40.0.2214.89
[category] => smartphone
[os] => Android
[os_version] => 4.3
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Wurfl<br /><small>1.6.4</small></td><td>Chrome Mobile 40</td><td><i class="material-icons">close</i></td><td>Android 4.3</td><td style="border-left: 1px solid #555">Sony</td><td>D2104</td><td>Smartphone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.16298</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-1a1aee36-7ce7-4111-a391-8e2c501f1532">Detail</a>
<!-- Modal Structure -->
<div id="modal-1a1aee36-7ce7-4111-a391-8e2c501f1532" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => true
[is_ios] => false
[is_windows_phone] => false
[is_app] => false
[is_full_desktop] => false
[is_largescreen] => true
[is_mobile] => true
[is_robot] => false
[is_smartphone] => true
[is_touchscreen] => true
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => false
[is_html_preferred] => true
[advertised_device_os] => Android
[advertised_device_os_version] => 4.3
[advertised_browser] => Chrome Mobile
[advertised_browser_version] => 40
[complete_device_name] => Sony D2104 (Xperia E1 Dual)
[form_factor] => Smartphone
[is_phone] => true
[is_app_webview] => false
)
[all] => Array
(
[brand_name] => Sony
[model_name] => D2104
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => true
[has_qwerty_keyboard] => true
[can_skip_aligned_link_row] => true
[uaprof] => http://wap.sonymobile.com/UAprof/D2104R2001.xml
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] => Android
[mobile_browser] => Chrome Mobile
[mobile_browser_version] => 34
[device_os_version] => 4.3
[pointing_method] => touchscreen
[release_date] => 2014_february
[marketing_name] => Xperia E1 Dual
[model_extra_info] =>
[nokia_feature_pack] => 0
[can_assign_phone_number] => true
[is_tablet] => false
[manufacturer_name] =>
[is_bot] => false
[is_google_glass] => false
[proportional_font] => false
[built_in_back_button_support] => false
[card_title_support] => true
[softkey_support] => false
[table_support] => true
[numbered_menus] => false
[menu_with_select_element_recommended] => false
[menu_with_list_of_links_recommended] => true
[icons_on_menu_items_support] => false
[break_list_of_links_with_br_element_recommended] => true
[access_key_support] => false
[wrap_mode_support] => false
[times_square_mode_support] => false
[deck_prefetch_support] => false
[elective_forms_recommended] => true
[wizards_recommended] => false
[image_as_link_support] => false
[insert_br_element_after_widget_recommended] => false
[wml_can_display_images_and_text_on_same_line] => false
[wml_displays_image_in_center] => false
[opwv_wml_extensions_support] => false
[wml_make_phone_call_string] => wtai://wp/mc;
[chtml_display_accesskey] => false
[emoji] => false
[chtml_can_display_images_and_text_on_same_line] => false
[chtml_displays_image_in_center] => false
[imode_region] => none
[chtml_make_phone_call_string] => tel:
[chtml_table_support] => false
[xhtml_honors_bgcolor] => true
[xhtml_supports_forms_in_table] => true
[xhtml_support_wml2_namespace] => false
[xhtml_autoexpand_select] => false
[xhtml_select_as_dropdown] => false
[xhtml_select_as_radiobutton] => false
[xhtml_select_as_popup] => false
[xhtml_display_accesskey] => false
[xhtml_supports_invisible_text] => false
[xhtml_supports_inline_input] => false
[xhtml_supports_monospace_font] => false
[xhtml_supports_table_for_layout] => true
[xhtml_supports_css_cell_table_coloring] => true
[xhtml_format_as_css_property] => false
[xhtml_format_as_attribute] => false
[xhtml_nowrap_mode] => false
[xhtml_marquee_as_css_property] => false
[xhtml_readable_background_color1] => #FFFFFF
[xhtml_readable_background_color2] => #FFFFFF
[xhtml_allows_disabled_form_elements] => true
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => iso-8859-1
[opwv_xhtml_extensions_support] => false
[xhtml_make_phone_call_string] => tel:
[xhtmlmp_preferred_mime_type] => text/html
[xhtml_table_support] => true
[xhtml_send_sms_string] => sms:
[xhtml_send_mms_string] => mms:
[xhtml_file_upload] => supported
[cookie_support] => true
[accept_third_party_cookie] => true
[xhtml_supports_iframe] => full
[xhtml_avoid_accesskeys] => true
[xhtml_can_embed_video] => none
[ajax_support_javascript] => true
[ajax_manipulate_css] => true
[ajax_support_getelementbyid] => true
[ajax_support_inner_html] => true
[ajax_xhr_type] => standard
[ajax_manipulate_dom] => true
[ajax_support_events] => true
[ajax_support_event_listener] => true
[ajax_preferred_geoloc_api] => w3c_api
[xhtml_support_level] => 4
[preferred_markup] => html_web_4_0
[wml_1_1] => false
[wml_1_2] => false
[wml_1_3] => false
[html_wi_w3_xhtmlbasic] => true
[html_wi_oma_xhtmlmp_1_0] => true
[html_wi_imode_html_1] => false
[html_wi_imode_html_2] => false
[html_wi_imode_html_3] => false
[html_wi_imode_html_4] => false
[html_wi_imode_html_5] => false
[html_wi_imode_htmlx_1] => false
[html_wi_imode_htmlx_1_1] => false
[html_wi_imode_compact_generic] => false
[html_web_3_2] => true
[html_web_4_0] => true
[voicexml] => false
[multipart_support] => false
[total_cache_disable_support] => false
[time_to_live_support] => false
[resolution_width] => 480
[resolution_height] => 800
[columns] => 60
[max_image_width] => 320
[max_image_height] => 480
[rows] => 40
[physical_screen_width] => 53
[physical_screen_height] => 88
[dual_orientation] => true
[density_class] => 1.0
[wbmp] => true
[bmp] => false
[epoc_bmp] => false
[gif_animated] => false
[jpg] => true
[png] => true
[tiff] => false
[transparent_png_alpha] => true
[transparent_png_index] => true
[svgt_1_1] => true
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 65536
[webp_lossy_support] => true
[webp_lossless_support] => true
[post_method_support] => true
[basic_authentication_support] => true
[empty_option_value_support] => true
[emptyok] => false
[nokia_voice_call] => false
[wta_voice_call] => false
[wta_phonebook] => false
[wta_misc] => false
[wta_pdc] => false
[https_support] => true
[phone_id_provided] => false
[max_data_rate] => 3600
[wifi] => true
[sdio] => false
[vpn] => false
[has_cellular_radio] => true
[max_deck_size] => 2000000
[max_url_length_in_requests] => 256
[max_url_length_homepage] => 0
[max_url_length_bookmark] => 0
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 0
[max_length_of_password] => 0
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => true
[inline_support] => false
[oma_support] => true
[ringtone] => false
[ringtone_3gpp] => false
[ringtone_midi_monophonic] => false
[ringtone_midi_polyphonic] => false
[ringtone_imelody] => false
[ringtone_digiplug] => false
[ringtone_compactmidi] => false
[ringtone_mmf] => false
[ringtone_rmf] => false
[ringtone_xmf] => false
[ringtone_amr] => false
[ringtone_awb] => false
[ringtone_aac] => false
[ringtone_wav] => false
[ringtone_mp3] => false
[ringtone_spmidi] => false
[ringtone_qcelp] => false
[ringtone_voices] => 1
[ringtone_df_size_limit] => 0
[ringtone_directdownload_size_limit] => 0
[ringtone_inline_size_limit] => 0
[ringtone_oma_size_limit] => 0
[wallpaper] => false
[wallpaper_max_width] => 0
[wallpaper_max_height] => 0
[wallpaper_preferred_width] => 0
[wallpaper_preferred_height] => 0
[wallpaper_resize] => none
[wallpaper_wbmp] => false
[wallpaper_bmp] => false
[wallpaper_gif] => false
[wallpaper_jpg] => false
[wallpaper_png] => false
[wallpaper_tiff] => false
[wallpaper_greyscale] => false
[wallpaper_colors] => 2
[wallpaper_df_size_limit] => 0
[wallpaper_directdownload_size_limit] => 0
[wallpaper_inline_size_limit] => 0
[wallpaper_oma_size_limit] => 0
[screensaver] => false
[screensaver_max_width] => 0
[screensaver_max_height] => 0
[screensaver_preferred_width] => 0
[screensaver_preferred_height] => 0
[screensaver_resize] => none
[screensaver_wbmp] => false
[screensaver_bmp] => false
[screensaver_gif] => false
[screensaver_jpg] => false
[screensaver_png] => false
[screensaver_greyscale] => false
[screensaver_colors] => 2
[screensaver_df_size_limit] => 0
[screensaver_directdownload_size_limit] => 0
[screensaver_inline_size_limit] => 0
[screensaver_oma_size_limit] => 0
[picture] => false
[picture_max_width] => 0
[picture_max_height] => 0
[picture_preferred_width] => 0
[picture_preferred_height] => 0
[picture_resize] => none
[picture_wbmp] => false
[picture_bmp] => false
[picture_gif] => false
[picture_jpg] => false
[picture_png] => false
[picture_greyscale] => false
[picture_colors] => 2
[picture_df_size_limit] => 0
[picture_directdownload_size_limit] => 0
[picture_inline_size_limit] => 0
[picture_oma_size_limit] => 0
[video] => false
[oma_v_1_0_forwardlock] => false
[oma_v_1_0_combined_delivery] => false
[oma_v_1_0_separate_delivery] => false
[streaming_video] => true
[streaming_3gpp] => true
[streaming_mp4] => true
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => 10
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => 2
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => 3.0
[streaming_acodec_amr] => nb
[streaming_acodec_aac] => lc
[streaming_wmv] => none
[streaming_preferred_protocol] => rtsp
[streaming_preferred_http_protocol] => apple_live_streaming
[wap_push_support] => false
[connectionless_service_indication] => false
[connectionless_service_load] => false
[connectionless_cache_operation] => false
[connectionoriented_unconfirmed_service_indication] => false
[connectionoriented_unconfirmed_service_load] => false
[connectionoriented_unconfirmed_cache_operation] => false
[connectionoriented_confirmed_service_indication] => false
[connectionoriented_confirmed_service_load] => false
[connectionoriented_confirmed_cache_operation] => false
[utf8_support] => true
[ascii_support] => false
[iso8859_support] => false
[expiration_date] => false
[j2me_cldc_1_0] => false
[j2me_cldc_1_1] => false
[j2me_midp_1_0] => false
[j2me_midp_2_0] => false
[doja_1_0] => false
[doja_1_5] => false
[doja_2_0] => false
[doja_2_1] => false
[doja_2_2] => false
[doja_3_0] => false
[doja_3_5] => false
[doja_4_0] => false
[j2me_jtwi] => false
[j2me_mmapi_1_0] => false
[j2me_mmapi_1_1] => false
[j2me_wmapi_1_0] => false
[j2me_wmapi_1_1] => false
[j2me_wmapi_2_0] => false
[j2me_btapi] => false
[j2me_3dapi] => false
[j2me_locapi] => false
[j2me_nokia_ui] => false
[j2me_motorola_lwt] => false
[j2me_siemens_color_game] => false
[j2me_siemens_extension] => false
[j2me_heap_size] => 0
[j2me_max_jar_size] => 0
[j2me_storage_size] => 0
[j2me_max_record_store_size] => 0
[j2me_screen_width] => 0
[j2me_screen_height] => 0
[j2me_canvas_width] => 0
[j2me_canvas_height] => 0
[j2me_bits_per_pixel] => 0
[j2me_audio_capture_enabled] => false
[j2me_video_capture_enabled] => false
[j2me_photo_capture_enabled] => false
[j2me_capture_image_formats] => none
[j2me_http] => false
[j2me_https] => false
[j2me_socket] => false
[j2me_udp] => false
[j2me_serial] => false
[j2me_gif] => false
[j2me_gif89a] => false
[j2me_jpg] => false
[j2me_png] => false
[j2me_bmp] => false
[j2me_bmp3] => false
[j2me_wbmp] => false
[j2me_midi] => false
[j2me_wav] => false
[j2me_amr] => false
[j2me_mp3] => false
[j2me_mp4] => false
[j2me_imelody] => false
[j2me_rmf] => false
[j2me_au] => false
[j2me_aac] => false
[j2me_realaudio] => false
[j2me_xmf] => false
[j2me_wma] => false
[j2me_3gpp] => false
[j2me_h263] => false
[j2me_svgt] => false
[j2me_mpeg4] => false
[j2me_realvideo] => false
[j2me_real8] => false
[j2me_realmedia] => false
[j2me_left_softkey_code] => 0
[j2me_right_softkey_code] => 0
[j2me_middle_softkey_code] => 0
[j2me_select_key_code] => 0
[j2me_return_key_code] => 0
[j2me_clear_key_code] => 0
[j2me_datefield_no_accepts_null_date] => false
[j2me_datefield_broken] => false
[receiver] => false
[sender] => false
[mms_max_size] => 0
[mms_max_height] => 0
[mms_max_width] => 0
[built_in_recorder] => false
[built_in_camera] => true
[mms_jpeg_baseline] => false
[mms_jpeg_progressive] => false
[mms_gif_static] => false
[mms_gif_animated] => false
[mms_png] => false
[mms_bmp] => false
[mms_wbmp] => false
[mms_amr] => false
[mms_wav] => false
[mms_midi_monophonic] => false
[mms_midi_polyphonic] => false
[mms_midi_polyphonic_voices] => 0
[mms_spmidi] => false
[mms_mmf] => false
[mms_mp3] => false
[mms_evrc] => false
[mms_qcelp] => false
[mms_ota_bitmap] => false
[mms_nokia_wallpaper] => false
[mms_nokia_operatorlogo] => false
[mms_nokia_3dscreensaver] => false
[mms_nokia_ringingtone] => false
[mms_rmf] => false
[mms_xmf] => false
[mms_symbian_install] => false
[mms_jar] => false
[mms_jad] => false
[mms_vcard] => false
[mms_vcalendar] => false
[mms_wml] => false
[mms_wbxml] => false
[mms_wmlc] => false
[mms_video] => false
[mms_mp4] => false
[mms_3gpp] => false
[mms_3gpp2] => false
[mms_max_frame_rate] => 0
[nokiaring] => false
[picturemessage] => false
[operatorlogo] => false
[largeoperatorlogo] => false
[callericon] => false
[nokiavcard] => false
[nokiavcal] => false
[sckl_ringtone] => false
[sckl_operatorlogo] => false
[sckl_groupgraphic] => false
[sckl_vcard] => false
[sckl_vcalendar] => false
[text_imelody] => false
[ems] => false
[ems_variablesizedpictures] => false
[ems_imelody] => false
[ems_odi] => false
[ems_upi] => false
[ems_version] => 0
[siemens_ota] => false
[siemens_logo_width] => 101
[siemens_logo_height] => 29
[siemens_screensaver_width] => 101
[siemens_screensaver_height] => 50
[gprtf] => false
[sagem_v1] => false
[sagem_v2] => false
[panasonic] => false
[sms_enabled] => true
[wav] => false
[mmf] => false
[smf] => false
[mld] => false
[midi_monophonic] => false
[midi_polyphonic] => false
[sp_midi] => false
[rmf] => false
[xmf] => false
[compactmidi] => false
[digiplug] => false
[nokia_ringtone] => false
[imelody] => false
[au] => false
[amr] => false
[awb] => false
[aac] => true
[mp3] => true
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] =>
[fl_wallpaper] => false
[fl_screensaver] => false
[fl_standalone] => false
[fl_browser] => false
[fl_sub_lcd] => false
[full_flash_support] => false
[css_supports_width_as_percentage] => true
[css_border_image] => webkit
[css_rounded_corners] => webkit
[css_gradient] => none
[css_spriting] => true
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => true
[progressive_download] => true
[playback_vcodec_h263_0] => 10
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => 0
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => 3.0
[playback_real_media] => none
[playback_3gpp] => true
[playback_3g2] => false
[playback_mp4] => true
[playback_mov] => false
[playback_acodec_amr] => nb
[playback_acodec_aac] => none
[playback_df_size_limit] => 0
[playback_directdownload_size_limit] => 0
[playback_inline_size_limit] => 0
[playback_oma_size_limit] => 0
[playback_acodec_qcelp] => false
[playback_wmv] => none
[hinted_progressive_download] => true
[html_preferred_dtd] => html4
[viewport_supported] => true
[viewport_width] => device_width_token
[viewport_userscalable] => no
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => full
[image_inlining] => true
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => A
[is_sencha_touch_ok] => false
[controlcap_is_smartphone] => default
[controlcap_is_ios] => default
[controlcap_is_android] => default
[controlcap_is_robot] => default
[controlcap_is_app] => default
[controlcap_advertised_device_os] => default
[controlcap_advertised_device_os_version] => default
[controlcap_advertised_browser] => default
[controlcap_advertised_browser_version] => default
[controlcap_is_windows_phone] => default
[controlcap_is_full_desktop] => default
[controlcap_is_largescreen] => default
[controlcap_is_mobile] => default
[controlcap_is_touchscreen] => default
[controlcap_is_wml_preferred] => default
[controlcap_is_xhtmlmp_preferred] => default
[controlcap_is_html_preferred] => default
[controlcap_form_factor] => default
[controlcap_complete_device_name] => default
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr></table>
</div>
<div class="section">
<h1 class="header center orange-text">About this comparison</h1>
<div class="row center">
<h5 class="header light">
The primary goal of this project is simple<br />
I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br />
<br />
The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br />
<br />
You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br />
<br />
The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a>
</h5>
</div>
</div>
<div class="card">
<div class="card-content">
Comparison created <i>2016-02-13 13:35:37</i> | by
<a href="https://github.com/ThaDafinser">ThaDafinser</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script>
<script>
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
</script>
</body>
</html> | {'content_hash': '493e45eab35f3c7c45d8e64950401103', 'timestamp': '', 'source': 'github', 'line_count': 1151, 'max_line_length': 789, 'avg_line_length': 40.83927019982624, 'alnum_prop': 0.5331234310513552, 'repo_name': 'ThaDafinser/UserAgentParserComparison', 'id': '72c0a9dec80aae9998506e592ae710101fcd1361', 'size': '47007', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': 'v4/user-agent-detail/93/a9/93a9af6b-3b57-4818-83c7-7a9315936b11.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '2060859160'}]} |
package com.google.schemaorg.core;
import com.google.schemaorg.JsonLdContext;
import com.google.schemaorg.SchemaOrgType;
import com.google.schemaorg.core.datatype.DateTime;
import com.google.schemaorg.core.datatype.Text;
import com.google.schemaorg.core.datatype.URL;
import com.google.schemaorg.goog.PopularityScoreSpecification;
import javax.annotation.Nullable;
/** Interface of <a href="http://schema.org/ResumeAction}">http://schema.org/ResumeAction}</a>. */
public interface ResumeAction extends ControlAction {
/**
* Builder interface of <a
* href="http://schema.org/ResumeAction}">http://schema.org/ResumeAction}</a>.
*/
public interface Builder extends ControlAction.Builder {
@Override
Builder addJsonLdContext(@Nullable JsonLdContext context);
@Override
Builder addJsonLdContext(@Nullable JsonLdContext.Builder context);
@Override
Builder setJsonLdId(@Nullable String value);
@Override
Builder setJsonLdReverse(String property, Thing obj);
@Override
Builder setJsonLdReverse(String property, Thing.Builder builder);
/** Add a value to property actionStatus. */
Builder addActionStatus(ActionStatusType value);
/** Add a value to property actionStatus. */
Builder addActionStatus(String value);
/** Add a value to property additionalType. */
Builder addAdditionalType(URL value);
/** Add a value to property additionalType. */
Builder addAdditionalType(String value);
/** Add a value to property agent. */
Builder addAgent(Organization value);
/** Add a value to property agent. */
Builder addAgent(Organization.Builder value);
/** Add a value to property agent. */
Builder addAgent(Person value);
/** Add a value to property agent. */
Builder addAgent(Person.Builder value);
/** Add a value to property agent. */
Builder addAgent(String value);
/** Add a value to property alternateName. */
Builder addAlternateName(Text value);
/** Add a value to property alternateName. */
Builder addAlternateName(String value);
/** Add a value to property description. */
Builder addDescription(Text value);
/** Add a value to property description. */
Builder addDescription(String value);
/** Add a value to property endTime. */
Builder addEndTime(DateTime value);
/** Add a value to property endTime. */
Builder addEndTime(String value);
/** Add a value to property error. */
Builder addError(Thing value);
/** Add a value to property error. */
Builder addError(Thing.Builder value);
/** Add a value to property error. */
Builder addError(String value);
/** Add a value to property image. */
Builder addImage(ImageObject value);
/** Add a value to property image. */
Builder addImage(ImageObject.Builder value);
/** Add a value to property image. */
Builder addImage(URL value);
/** Add a value to property image. */
Builder addImage(String value);
/** Add a value to property instrument. */
Builder addInstrument(Thing value);
/** Add a value to property instrument. */
Builder addInstrument(Thing.Builder value);
/** Add a value to property instrument. */
Builder addInstrument(String value);
/** Add a value to property location. */
Builder addLocation(Place value);
/** Add a value to property location. */
Builder addLocation(Place.Builder value);
/** Add a value to property location. */
Builder addLocation(PostalAddress value);
/** Add a value to property location. */
Builder addLocation(PostalAddress.Builder value);
/** Add a value to property location. */
Builder addLocation(Text value);
/** Add a value to property location. */
Builder addLocation(String value);
/** Add a value to property mainEntityOfPage. */
Builder addMainEntityOfPage(CreativeWork value);
/** Add a value to property mainEntityOfPage. */
Builder addMainEntityOfPage(CreativeWork.Builder value);
/** Add a value to property mainEntityOfPage. */
Builder addMainEntityOfPage(URL value);
/** Add a value to property mainEntityOfPage. */
Builder addMainEntityOfPage(String value);
/** Add a value to property name. */
Builder addName(Text value);
/** Add a value to property name. */
Builder addName(String value);
/** Add a value to property object. */
Builder addObject(Thing value);
/** Add a value to property object. */
Builder addObject(Thing.Builder value);
/** Add a value to property object. */
Builder addObject(String value);
/** Add a value to property participant. */
Builder addParticipant(Organization value);
/** Add a value to property participant. */
Builder addParticipant(Organization.Builder value);
/** Add a value to property participant. */
Builder addParticipant(Person value);
/** Add a value to property participant. */
Builder addParticipant(Person.Builder value);
/** Add a value to property participant. */
Builder addParticipant(String value);
/** Add a value to property potentialAction. */
Builder addPotentialAction(Action value);
/** Add a value to property potentialAction. */
Builder addPotentialAction(Action.Builder value);
/** Add a value to property potentialAction. */
Builder addPotentialAction(String value);
/** Add a value to property result. */
Builder addResult(Thing value);
/** Add a value to property result. */
Builder addResult(Thing.Builder value);
/** Add a value to property result. */
Builder addResult(String value);
/** Add a value to property sameAs. */
Builder addSameAs(URL value);
/** Add a value to property sameAs. */
Builder addSameAs(String value);
/** Add a value to property startTime. */
Builder addStartTime(DateTime value);
/** Add a value to property startTime. */
Builder addStartTime(String value);
/** Add a value to property target. */
Builder addTarget(EntryPoint value);
/** Add a value to property target. */
Builder addTarget(EntryPoint.Builder value);
/** Add a value to property target. */
Builder addTarget(String value);
/** Add a value to property url. */
Builder addUrl(URL value);
/** Add a value to property url. */
Builder addUrl(String value);
/** Add a value to property detailedDescription. */
Builder addDetailedDescription(Article value);
/** Add a value to property detailedDescription. */
Builder addDetailedDescription(Article.Builder value);
/** Add a value to property detailedDescription. */
Builder addDetailedDescription(String value);
/** Add a value to property popularityScore. */
Builder addPopularityScore(PopularityScoreSpecification value);
/** Add a value to property popularityScore. */
Builder addPopularityScore(PopularityScoreSpecification.Builder value);
/** Add a value to property popularityScore. */
Builder addPopularityScore(String value);
/**
* Add a value to property.
*
* @param name The property name.
* @param value The value of the property.
*/
Builder addProperty(String name, SchemaOrgType value);
/**
* Add a value to property.
*
* @param name The property name.
* @param builder The schema.org object builder for the property value.
*/
Builder addProperty(String name, Thing.Builder builder);
/**
* Add a value to property.
*
* @param name The property name.
* @param value The string value of the property.
*/
Builder addProperty(String name, String value);
/** Build a {@link ResumeAction} object. */
ResumeAction build();
}
}
| {'content_hash': '32edb756846fe1201af3bfd9ab0d1026', 'timestamp': '', 'source': 'github', 'line_count': 262, 'max_line_length': 98, 'avg_line_length': 29.81297709923664, 'alnum_prop': 0.6841633593649981, 'repo_name': 'google/schemaorg-java', 'id': '40b0857ad96746e370ecde9a7fb04fd9bec938c3', 'size': '8422', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/google/schemaorg/core/ResumeAction.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '26308073'}]} |
import os
VERSION = '0.1'
# Keep a setting for the path to the templates in case a project subclasses the
# models and still needs to use the templates
TEMPLATE_DIR = os.path.join(
os.path.dirname(__file__),
'templates')
default_app_config = 'hooks.config.HooksConfig'
| {'content_hash': '9d850b8794c90198388983110e5982ea', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 79, 'avg_line_length': 25.454545454545453, 'alnum_prop': 0.7178571428571429, 'repo_name': 'cage1016/django-oscar-hooks', 'id': '52062225d2a03647a6ed09faabed7036e36ae5ad', 'size': '280', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'hooks/__init__.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'HTML', 'bytes': '24407'}, {'name': 'Makefile', 'bytes': '1058'}, {'name': 'Python', 'bytes': '62442'}, {'name': 'Shell', 'bytes': '251'}]} |
[#]: subject: "How To Perform Arithmetic Operations In Bash"
[#]: via: "https://ostechnix.com/bash-arithmetic-operations/"
[#]: author: "Karthick https://ostechnix.com/author/karthick/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How To Perform Arithmetic Operations In Bash
======
Different Ways To Do Mathematical Operations In Bash
In this article, we will focus on how to **do mathematical operations in bash scripts**. We can **perform arithmetic operations in Bash** using the built-in and external tools. First, we will learn about the built-in tools.
**Note:** Unlike other programming languages, bash arithmetic operations are not straight-forward(at least for me). There are multiple bash built-in and external programs to perform the same operations. If you want to perform any complex mathematical computation, then a shell is not a recommended way to do it.
#### Contents
1. Do Mathematical Operations In Bash Using The Built-in "let" Command
2. Do Arithmetic Operations In Bash Using The Built-in Double Brackets
3. Perform Arithmetic Operations In Bash Using Expr Utility
4. Perform Bash Arithmetic Operations Using bc Utility
5. Perform Mathematical Operations With AWK
6. Conclusion
### Do Mathematical Operations In Bash Using The Built-in "let" Command
Using the `let` command, you can perform arithmetic, incremental, bitwise, and conditional operations. The drawback with the let command is it cannot handle floating point values.
The `let` command in bash is a built-in command. You can verify that by running the following command in the terminal.
```
$ type -a letlet is a shell builtin
```
Run the following command to get the help section where you can find the list of operators supported by the ‘let’ command.
```
$ let -help
```
**Sample output:**
![Display let Command Help Section][1]
There are a few essential points to note when working with the let command.
* The output of any operation should be assigned to a variable and then printed. The ‘let’ command will not allow you to print the outputs straight away.
* No space is allowed between the operator and the operand.
Create a shell script, copy and paste the below example code and try running the script. In the code given below, I am performing arithmetic operations. As mentioned already, the output of the expression should be assigned to a variable before printing it out.
```
#!/usr/bin/env bash
let NUMBER1=10
let NUMBER2=3
# Addition => + operator
let ADD=$NUMBER1+$NUMBER2
echo "Addition of two numbers : ${ADD}"
# Subtraction => - operator
let SUB=$NUMBER1-$NUMBER2
echo "Subtraction of two numbers : ${SUB}"
# Multiply => * operator
let MUL=$NUMBER1*$NUMBER2
echo "Multiply two numbers : ${MUL}"
# Divide => / operator
let DIV=$NUMBER1/$NUMBER2
echo "Division of two numbers : ${DIV}"
# Remainder => % operator
let REM=$NUMBER1%$NUMBER2
echo "Remainder of two numbers : ${REM}"
# Exponent => ** operator
let EXPO=$NUMBER1**$NUMBER2
echo "Exponent of two numbers : ${EXPO}"
```
![Do Mathematical Operations In Bash Scripts][2]
You can also do post increment and post decrement operations too. This operation will be mostly used when we are running loops in the script.
* The post increment operation will increase the variable value to VARIABLE + 1.
* The pre-increment operation will increase the variable value to VARIABLE - 1.
```
let variable++let variable--
```
![Do Post Increment And Post Decrement Operations][3]
You can also do other comparison operations like checking for equality, inequality, greater than, less than, etc. I would strongly recommend not using the `let` command to do any comparison operations as there are better ways to handle it.
### Do Arithmetic Operations In Bash Using The Built-in Double Brackets
As an alternative to the `let` command, you can use the **double brackets** method where you have to place the operator and the operand within the double brackets.
The advantage of this method over the `let` command is that the result can be straightaway printed or stored in a variable and you can add spaces between the operator and the operand. Similar to the `let` command, you cannot do any floating point operations.
The example given below is pretty much the same as the examples shown in the `let` command. All you have to do is put your expression inside double brackets. There is no need to prepend the variables with the **$** symbol inside the double brackets. Just give the variable name and the value will be interpreted.
From the below image, if you can see lines 12 and 13 you will see a difference in how the expression is handled. Anything within the brackets will be first evaluated and the result of it will be computed against other operands. You can see this behavior in the output of **"Multiply"** and **"Multiply1"**.
![Perform Arithmetic Operations In Bash Scripts Using Double Brackets][4]
Similar to the `let` command, you can also do post increment and decrement operations.
```
((NUMBER2++)((NUMBER1--))
```
You can also perform shorthand operations.
```
(( NUMBER2 = NUMBER2 + 10 ))(( NUMBER2 += 10 )) # Shorthand
```
![Perform Post Increment And Decrement Operations][5]
### Perform Arithmetic Operations In Bash Using Expr Utility
In the previous sections, we have seen about built-in functionality and in this section, we will take a look at **"expr"**, which is an external program.
Not only the mathematical operations, the expr utility can also do operations on strings like finding the index of a character, length of a string, substring etc.
Before using the expr program, go through the man page which will give you a fair bit of understanding about this utility.
```
$ man expr$ expr -help
```
Following is the syntax for the `expr` command:
```
$ expr
```
The basic arithmetic operation is the same as what we have seen in the previous sections. The only difference here is when using ***** to do a multiplication operation you have to escape it with **"\"** otherwise it will throw an error.
```
expr 10 + 3 # Additionexpr 10 - 3 # Subtractionexpr 10 * 3 # Multiplyexpr 10 / 3 # Divideexpr 10 % 3 # Remainder
```
![Perform Arithmetic Operations In Bash Using Expr Utility][6]
Till now we have seen about three different ways to do basic arithmetic and incremental operation. Compared to the `let` and `expr`, the **recommended approach is to use double parentheses**.
A commonality with these three approaches is that they cannot handle floating point operations. You have to rely on external utilities like `awk` and `bc` to do floating point operations.
### Perform Bash Arithmetic Operations Using bc Utility
The **bc** utility is an external program that can be used to do basic as well as complex mathematical operations. **Floating point operation is also supported** by the bc utility.
You can view the type of the bc utility and its manual page using the following commands:
```
$ type -a bc$ man bc
```
Following examples show simple mathematical operations with Integer and floating values.
```
# Add
$ echo "10 + 100" | bc
=> 110
$ echo "10.15 + 11.20" | bc
21.35
# Subtract
$ echo "100 - 25" | bc
=> 75
$ echo "100 - 25.5" | bc
=> 74.5
# Multiply
$ echo "10 * 5" | bc
=> 50
$ echo "10.10 * 4" | bc
=> 40.40
```
When doing division operation you have to set the scale value for the result to be printed in floating point value otherwise the result will be an integer value. The value set in the scale decides how many digits to be printed after the decimal.
```
# without scale
echo "10.10 / 4" | bc
=> 2
```
```
# with scaleecho "scale=2;10.10 / 4" | bc=> 2.52
```
You can also do exponent operation.
```
$ echo "2.2^4" | bc=> 23.4
```
### Perform Mathematical Operations With AWK
**Awk** offers more functionality to do mathematical computation compared to other utilities. It has a couple of built-in functions which will make our life easy.
Below is the syntax to do mathematical computation.
```
$ awk "BEGIN {print expression }"
```
To perform a simple multiplication, run:
```
$ awk "BEGIN {print 23 * 4.5 }"=> 103.5
```
From a floating point value, you can get the integer value alone using the `int` function.
```
$ awk "BEGIN{print int(10.111) }"=> 10
```
You can also calculate the square root of a given number using the `sqrt` function.
```
$ awk "BEGIN{print sqrt(10) }"=> 3.16228
```
Particularly when working with CSV files I often end up in situations to compute the average of a column. You can simply calculate the average of a column with the following code.
Since this is a CSV file, I am setting the field separator to(-F “,”). Here the entire second column is first added and divided by the NR(number of records).
```
$ awk -F "," '{sum+=$2} END { print "average value from column 2 = ",sum/NR}' data.csv
```
We will post a detailed guide about **awk** in the days to come.
### Conclusion
In this article, I have shown you various methods to perform simple mathematical operations in Bash. If you are performing very simple arithmetic operations, stick with the double bracket approach and for more complex operations use awk.
--------------------------------------------------------------------------------
via: https://ostechnix.com/bash-arithmetic-operations/
作者:[Karthick][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://ostechnix.com/author/karthick/
[b]: https://github.com/lkxed
[1]: https://ostechnix.com/wp-content/uploads/2022/09/Display-let-Command-Help-Section.png
[2]: https://ostechnix.com/wp-content/uploads/2022/09/Do-Mathematical-Operations-In-Bash-Scripts.png
[3]: https://ostechnix.com/wp-content/uploads/2022/09/Do-Post-Increment-And-Post-Decrement-Operations.png
[4]: https://ostechnix.com/wp-content/uploads/2022/09/Perform-Arithmetic-Operations-In-Bash-Scripts-Using-Double-Brackets.png
[5]: https://ostechnix.com/wp-content/uploads/2022/09/Perform-Post-Increment-And-Decrement-Operations.png
[6]: https://ostechnix.com/wp-content/uploads/2022/09/Perform-Arithmetic-Operations-In-Bash-Using-Expr-Utility.png
| {'content_hash': '27ccec7c9fb0054fd24ac33ed07b2fc5', 'timestamp': '', 'source': 'github', 'line_count': 269, 'max_line_length': 312, 'avg_line_length': 38.02973977695167, 'alnum_prop': 0.7372434017595307, 'repo_name': 'LCTT/TranslateProject', 'id': 'bf81ae47088e07398108afd57a2a1e2eb9b9a7e2', 'size': '10314', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'sources/tech/20220905 How To Perform Arithmetic Operations In Bash.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Shell', 'bytes': '12332'}]} |
package com.sequenceiq.cloudbreak.audit.config;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.when;
import java.lang.reflect.Field;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.quality.Strictness;
import org.springframework.util.ReflectionUtils;
import com.sequenceiq.cloudbreak.structuredevent.conf.StructuredEventEnablementConfig;
@ExtendWith(MockitoExtension.class)
class AuditConfigTest {
@Mock
private StructuredEventEnablementConfig structuredEventEnablementConfig;
@InjectMocks
private AuditConfig underTest;
// @formatter:off
// CHECKSTYLE:OFF
static Object[][] scenarios() {
return new Object[][]{
// testCaseName endpoint valid enabled configured host port exception
{ "null endpoint, disabled", null, true, false, false, null, null, null },
{ "blank endpoint, disabled", " ", true, false, false, null, null, null },
{ "null endpoint, enabled", null, false, true, false, null, null, IllegalStateException.class },
{ "blank endpoint, enabled", " ", false, true, false, null, null, IllegalStateException.class },
{ "host only", "hostname", true, true, true, "hostname", 8982, null },
{ "host:port", "hostname:1234", true, true, true, "hostname", 1234, null },
{ "host:port:extra", "hostname:1234:whatelse", false, true, false, null, null, IllegalArgumentException.class },
};
}
// CHECKSTYLE:ON
// @formatter:on
@ParameterizedTest(name = "{0}")
@MethodSource("scenarios")
@MockitoSettings(strictness = Strictness.LENIENT)
void init(String testName, String endpoint, boolean valid, boolean enabled, boolean configured,
String host, Integer port, Class<? extends Exception> exceptionClass) {
Field endpointField = ReflectionUtils.findField(AuditConfig.class, "endpoint");
ReflectionUtils.makeAccessible(endpointField);
ReflectionUtils.setField(endpointField, underTest, endpoint);
when(structuredEventEnablementConfig.isAuditServiceEnabled()).thenReturn(enabled);
if (valid) {
underTest.init();
if (configured) {
assertThat(underTest.isConfigured()).isTrue();
assertThat(underTest.getHost()).isEqualTo(host);
assertThat(underTest.getPort()).isEqualTo(port);
} else {
assertThat(underTest.isConfigured()).isFalse();
}
} else {
assertThatThrownBy(underTest::init).isInstanceOf(exceptionClass);
}
}
}
| {'content_hash': '1ef602088bc5c20176e7483c55955481', 'timestamp': '', 'source': 'github', 'line_count': 71, 'max_line_length': 154, 'avg_line_length': 46.70422535211268, 'alnum_prop': 0.6182147165259348, 'repo_name': 'hortonworks/cloudbreak', 'id': '5e401d46fb31fe78977843a3f9f32ca068331d83', 'size': '3316', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'audit-connector/src/test/java/com/sequenceiq/cloudbreak/audit/config/AuditConfigTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '7535'}, {'name': 'Dockerfile', 'bytes': '9586'}, {'name': 'Fluent', 'bytes': '10'}, {'name': 'FreeMarker', 'bytes': '395982'}, {'name': 'Groovy', 'bytes': '523'}, {'name': 'HTML', 'bytes': '9917'}, {'name': 'Java', 'bytes': '55250904'}, {'name': 'JavaScript', 'bytes': '47923'}, {'name': 'Jinja', 'bytes': '190660'}, {'name': 'Makefile', 'bytes': '8537'}, {'name': 'PLpgSQL', 'bytes': '1830'}, {'name': 'Perl', 'bytes': '17726'}, {'name': 'Python', 'bytes': '29898'}, {'name': 'SaltStack', 'bytes': '222692'}, {'name': 'Scala', 'bytes': '11168'}, {'name': 'Shell', 'bytes': '416225'}]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.