code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.freteplanejado.entity;
/**
*
* @author 43596980895
*/
public class Frete {
private int id;
private String origem;
private String destino;
private float altura;
private float largura;
private float profundidade;
private float peso;
private String observacoes;
public Frete() {
}
public Frete(String origem, String destino, float altura, float largura, float profundidade, float peso, String observacoes) {
this.origem = origem;
this.destino = destino;
this.altura = altura;
this.largura = largura;
this.profundidade = profundidade;
this.peso = peso;
this.observacoes = observacoes;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getOrigem() {
return origem;
}
public void setOrigem(String origem) {
this.origem = origem;
}
public String getDestino() {
return destino;
}
public void setDestino(String destino) {
this.destino = destino;
}
public float getAltura() {
return altura;
}
public void setAltura(float altura) {
this.altura = altura;
}
public float getLargura() {
return largura;
}
public void setLargura(float largura) {
this.largura = largura;
}
public float getProfundidade() {
return profundidade;
}
public void setProfundidade(float profundidade) {
this.profundidade = profundidade;
}
public float getPeso() {
return peso;
}
public void setPeso(float peso) {
this.peso = peso;
}
public String getObservacoes() {
return observacoes;
}
public void setObservacoes(String observacoes) {
this.observacoes = observacoes;
}
}
| 5devs/web-project-m1 | FretePlanejado/src/java/com/freteplanejado/entity/Frete.java | Java | mit | 2,066 |
module.exports = require( "./src/LRUCache" ); | eventEmitter/ee-lru-cache | index.js | JavaScript | mit | 49 |
Kloj le Grand
=============
Clojure bot for [vindinium](http://vindinium.org)
## Usage
```
$ lein repl
```
```clojure
> ; (re)load the code
> (require 'vindinium.core :reload)
> ; run a training game with 80 turns
> (vindinium.core/-main "training" secretkey 80)
> ; run 50 arena games
> (vindinium.core/-main "arena" secretkey 50)
```
| chrisghost/kloj-le-grand | README.md | Markdown | mit | 343 |
<html>
<head>
<title>User agent detail - Mozilla/5.0 (Linux; U; Android 2.2.2; bg-bg; U8800 Pro Build/HuaweiU8800Pro) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1</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; U; Android 2.2.2; bg-bg; U8800 Pro Build/HuaweiU8800Pro) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
</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>ua-parser/uap-core<br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Huawei</td><td>U8800 Pro</td><td></td><td></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
(
[user_agent_string] => Mozilla/5.0 (Linux; U; Android 2.2.2; bg-bg; U8800 Pro Build/HuaweiU8800Pro) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
[family] => U8800 Pro
[brand] => Huawei
[model] => U8800 Pro
)
</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>Android 4.0</td><td>WebKit </td><td>Android 2.2</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.022</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.2\.2.* build\/.*\).*applewebkit\/.*\(.*khtml,.*like gecko.*\).*version\/4\.0.*safari.*$/
[browser_name_pattern] => mozilla/5.0 (*linux*android?2.2* build/*)*applewebkit/*(*khtml,*like gecko*)*version/4.0*safari*
[parent] => Android Browser 4.0
[comment] => Android Browser 4.0
[browser] => Android
[browser_type] => Browser
[browser_bits] => 32
[browser_maker] => Google Inc
[browser_modus] => unknown
[version] => 4.0
[majorver] => 4
[minorver] => 0
[platform] => Android
[platform_version] => 2.2
[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] => 1
[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] => WebKit
[renderingengine_version] => unknown
[renderingengine_description] => For Google Chrome, iOS (including both mobile Safari, WebViews within third-party apps, and web clips), Safari, Arora, Midori, OmniWeb, Shiira, iCab since version 4, Web, SRWare Iron, Rekonq, and in Maxthon 3.
[renderingengine_maker] => Apple 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>Android Browser 4.0</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</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] => Android Browser
[version] => 4.0
)
</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>Android Webkit 4.0</td><td><i class="material-icons">close</i></td><td>Android 2.2.2</td><td style="border-left: 1px solid #555">Huawei</td><td>U8800 Pro</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.26208</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] => Huawei
[mobile_model] => U8800 Pro
[version] => 4.0
[is_android] => 1
[browser_name] => Android Webkit
[operating_system_family] => Android
[operating_system_version] => 2.2.2
[is_ios] =>
[producer] => Google Inc.
[operating_system] => Android 2.2.x Froyo
[mobile_screen_width] => 480
[mobile_browser] => Android Webkit
)
</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>Android Browser </td><td>WebKit </td><td>Android 2.2</td><td style="border-left: 1px solid #555">Huawei</td><td>U8800Pro</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] => Android Browser
[short_name] => AN
[version] =>
[engine] => WebKit
)
[operatingSystem] => Array
(
[name] => Android
[short_name] => AND
[version] => 2.2
[platform] =>
)
[device] => Array
(
[brand] => HU
[brandName] => Huawei
[model] => U8800Pro
[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>Navigator 4.0</td><td><i class="material-icons">close</i></td><td>Android 2.2.2</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; U; Android 2.2.2; bg-bg; U8800 Pro Build/HuaweiU8800Pro) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
)
[name:Sinergi\BrowserDetector\Browser:private] => Navigator
[version:Sinergi\BrowserDetector\Browser:private] => 4.0
[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] => 2.2.2
[isMobile:Sinergi\BrowserDetector\Os:private] => 1
[userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; U; Android 2.2.2; bg-bg; U8800 Pro Build/HuaweiU8800Pro) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
)
)
[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; U; Android 2.2.2; bg-bg; U8800 Pro Build/HuaweiU8800Pro) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
)
)
)
</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>Android 2.2.2</td><td><i class="material-icons">close</i></td><td>Android 2.2.2</td><td style="border-left: 1px solid #555">Huawei</td><td>U8800 Pro</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.003</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] => 2
[minor] => 2
[patch] => 2
[family] => Android
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] => 2
[minor] => 2
[patch] => 2
[patchMinor] =>
[family] => Android
)
[device] => UAParser\Result\Device Object
(
[brand] => Huawei
[model] => U8800 Pro
[family] => U8800 Pro
)
[originalUserAgent] => Mozilla/5.0 (Linux; U; Android 2.2.2; bg-bg; U8800 Pro Build/HuaweiU8800Pro) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
)
</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 2.2.2</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.14904</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] => 2.2.2
[os_producer] =>
[os_producerURL] =>
[linux_distibution] => Null
[agent_language] => Bulgarian (Bulgaria)
[agent_languageTag] => bg-bg
)
</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>Android Browser 4.0</td><td>WebKit 533.1</td><td>Android 2.2.2</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.40612</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] => Android Browser 4 on Android (Froyo)
[browser_version] => 4
[extra_info] => Array
(
)
[operating_platform] =>
[extra_info_table] => stdClass Object
(
[System Build] => HuaweiU8800Pro
)
[layout_engine_name] => WebKit
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => android-browser
[operating_system_version] => Froyo
[simple_operating_platform_string] =>
[is_abusive] =>
[layout_engine_version] => 533.1
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] =>
[operating_system] => Android (Froyo)
[operating_system_version_full] => 2.2.2
[operating_platform_code] =>
[browser_name] => Android Browser
[operating_system_name_code] => android
[user_agent] => Mozilla/5.0 (Linux; U; Android 2.2.2; bg-bg; U8800 Pro Build/HuaweiU8800Pro) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
[browser_version_full] => 4.0
[browser] => Android Browser 4
)
</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>Android Browser </td><td>Webkit 533.1</td><td>Android 2.2.2</td><td style="border-left: 1px solid #555">Huawei</td><td>IDEOS X5 Pro</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.018</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] => Android Browser
)
[engine] => Array
(
[name] => Webkit
[version] => 533.1
)
[os] => Array
(
[name] => Android
[version] => 2.2.2
)
[device] => Array
(
[type] => mobile
[subtype] => smart
[manufacturer] => Huawei
[model] => IDEOS X5 Pro
)
)
</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>Safari 4.0</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</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] => Safari
[vendor] => Apple
[version] => 4.0
[category] => smartphone
[os] => Android
[os_version] => 2.2.2
)
</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>Android Webkit 2.2</td><td><i class="material-icons">close</i></td><td>Android 2.2</td><td style="border-left: 1px solid #555">Huawei</td><td>U8800 Pro</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.073</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] => 2.2
[advertised_browser] => Android Webkit
[advertised_browser_version] => 2.2
[complete_device_name] => Huawei U8800 Pro
[form_factor] => Smartphone
[is_phone] => true
[is_app_webview] => false
)
[all] => Array
(
[brand_name] => Huawei
[model_name] => U8800 Pro
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => true
[has_qwerty_keyboard] => true
[can_skip_aligned_link_row] => true
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] => Android
[mobile_browser] => Android Webkit
[mobile_browser_version] =>
[device_os_version] => 2.2
[pointing_method] => touchscreen
[release_date] => 2011_july
[marketing_name] =>
[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] => play_and_stop
[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] => 400
[rows] => 40
[physical_screen_width] => 50
[physical_screen_height] => 83
[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] => false
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 65536
[webp_lossy_support] => false
[webp_lossless_support] => false
[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] => 384
[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] => progressive_download
[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] => true
[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:37:33</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> | ThaDafinser/UserAgentParserComparison | v4/user-agent-detail/ad/03/ad03a2d6-a5c9-45b1-9a63-5381ec942da9.html | HTML | mit | 46,539 |
package com.martijndashorst.euler;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
/**
* The sequence of triangle numbers is generated by adding the natural numbers.
* So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first
* ten terms would be:
*
* 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
*
* Let us list the factors of the first seven triangle numbers:
*
* <pre>
1: 1
3: 1,3
6: 1,2,3,6
10: 1,2,5,10
15: 1,3,5,15
21: 1,3,7,21
28: 1,2,4,7,14,28
* </pre>
*
* We can see that 28 is the first triangle number to have over five divisors.
*
* What is the value of the first triangle number to have over five hundred
* divisors?
*/
public class Euler12 {
@Test
public void example() {
assertThat(firstTriangleNumberWithOverNDivisors(5), is(28L));
}
@Test
public void solution() {
assertThat(firstTriangleNumberWithOverNDivisors(500), is(76_576_500L));
}
private long firstTriangleNumberWithOverNDivisors(int n) {
int divisors = 0;
int counter = 1;
long triangle = 0;
do {
triangle = (counter * (counter + 1)) / 2;
divisors = numberOfDivisors(triangle);
counter++;
} while (divisors < n);
return triangle;
}
@Test
public void nrOfDivisors1() {
assertThat(numberOfDivisors(1), is(1));
assertThat(numberOfDivisors(2), is(2));
assertThat(numberOfDivisors(3), is(2));
assertThat(numberOfDivisors(4), is(3));
assertThat(numberOfDivisors(10), is(4));
assertThat(numberOfDivisors(28), is(6));
}
private int numberOfDivisors(long n) {
if (n == 1)
return 1;
if (n <= 3)
return 2;
long nr = (long) Math.sqrt(n);
int nrOfDivisors = 2;
for (int i = 2; i <= nr; i++) {
if (n % i == 0) {
nrOfDivisors += i == nr ? 1 : 2;
}
}
return nrOfDivisors;
}
}
| dashorst/project-euler | src/test/java/com/martijndashorst/euler/Euler12.java | Java | mit | 1,853 |
'use strict';
angular.module('sportzCast')
.controller('FooterCtrl', function ($scope) {
$('#footer').hide();
$(function () {
$(window).scroll(function () {
// set distance user needs to scroll before we start fadeIn
if ($(this).scrollTop() > 500) {
$('.navbar').fadeIn();
} else {
$('.navbar').fadeOut();
}
});
});
}); | AriGonzo/SportzCast | src/components/footer/footerController.js | JavaScript | mit | 439 |
# Changelog
## Unreleased
- Removed `kp get` and `kp set` commands, basically we removed the global config. Config can only be done via `kanpai.json` or the `kanpai` field in `package.json`.
## 0.10.1
- Support `HTTPS` git URL.
## 0.10.0
- Move `npm publish` and `kp gh-release` to a standalone command: `kp release`, now running `kp` will only update `package.json`, create git tag and push to GitHub. `kp release` is used to actually publish on npm and create release on GitHub, this step could be automated via CI instead, env variables `GITHUB_TOKEN` and `NPM_TOKEN` are required for this to work.
- Generate default changelog from commit messages.
## 0.9.9
- Missing changelog body on GitHub Releases.
## 0.9.8
- Add `kp gh-release` command to publish a new release on GitHub.
- Migrate this package to esm format.
## 0.9.7
- Fix first release again
## 0.9.6
- Fix changelog heading
## 0.9.5
- Fix first release
- Prepend `## Unreleased` to the top of the changelog
## 0.9.4
- Remove `v` prefix from default version number in CHANGELOG.md
## 0.9.3
- Make sure git push tags too
## 0.9.2
- Replace `%s` in commit message with actual version number.
## 0.9.1
- Require version to be specified to prevent accidentally running `kp`
- Automatically change title `## Unreleased` in `CHANGELOG.md` to actual version `## vx.y.z` when publishing
| egoist/kanpai | CHANGELOG.md | Markdown | mit | 1,366 |
/* crypto/bf/blowfish.h */
/* Copyright (C) 1995-1998 Eric Young ([email protected])
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young ([email protected]).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson ([email protected]).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young ([email protected])"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson ([email protected])"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef HEADER_BLOWFISH_H
# define HEADER_BLOWFISH_H
# include <VialerPJSIP/openssl/e_os2.h>
#ifdef __cplusplus
extern "C" {
#endif
# ifdef OPENSSL_NO_BF
# error BF is disabled.
# endif
# define BF_ENCRYPT 1
# define BF_DECRYPT 0
/*-
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* ! BF_LONG has to be at least 32 bits wide. If it's wider, then !
* ! BF_LONG_LOG2 has to be defined along. !
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
# if defined(__LP32__)
# define BF_LONG unsigned long
# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
# define BF_LONG unsigned long
# define BF_LONG_LOG2 3
/*
* _CRAY note. I could declare short, but I have no idea what impact
* does it have on performance on none-T3E machines. I could declare
* int, but at least on C90 sizeof(int) can be chosen at compile time.
* So I've chosen long...
* <[email protected]>
*/
# else
# define BF_LONG unsigned int
# endif
# define BF_ROUNDS 16
# define BF_BLOCK 8
typedef struct bf_key_st {
BF_LONG P[BF_ROUNDS + 2];
BF_LONG S[4 * 256];
} BF_KEY;
# ifdef OPENSSL_FIPS
void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data);
# endif
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
void BF_encrypt(BF_LONG *data, const BF_KEY *key);
void BF_decrypt(BF_LONG *data, const BF_KEY *key);
void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
const BF_KEY *key, int enc);
void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
const BF_KEY *schedule, unsigned char *ivec, int enc);
void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,
long length, const BF_KEY *schedule,
unsigned char *ivec, int *num, int enc);
void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,
long length, const BF_KEY *schedule,
unsigned char *ivec, int *num);
const char *BF_options(void);
#ifdef __cplusplus
}
#endif
#endif
| OnurVar/TestProject | Pods/Vialer-pjsip-iOS/VialerPJSIP.framework/Versions/A/Headers/openssl/blowfish.h | C | mit | 5,363 |
package ru.otus.l51.tests;
/**
* Created by tully.
*/
@SuppressWarnings("unused")
public class TestClass {
private int a = 0;
private String s = "";
public TestClass() {
}
public TestClass(Integer a) {
this.a = a;
}
public TestClass(Integer a, String s) {
this.a = a;
this.s = s;
}
int getA() {
return a;
}
String getS() {
return s;
}
private void setDefault(){
a = 0;
s = "";
}
}
| artem-gabbasov/otus_java_2017_04_L1 | L5.1/src/test/java/ru/otus/l51/tests/TestClass.java | Java | mit | 502 |
{% extends "adventure/views/templates/layout.html" %}
{% block content %}
<div class="post">
<div class="post_inner">
<div class="the_post format-text">
<ul>
{% for adventure in adventures %}
<li>
<a href="/adventure/{{ adventure.id }}">{{ adventure.title }}</a>
<div class="additional-meta-wrap">
<div class="additional-meta">
<div class="meta-date">
Created by {{ adventure.author }} on {{ adventure.created_on|date:"MM/dd/yyyy" }}
</div>
</div>
</div>
<br />
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endblock %}
{% block extra-js %}
{% if analytics-id %}
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create','{{ analytics-id }}','inchingforward.com');
ga('send', 'pageview');
{% endif %}
{% endblock %}
| inchingforward/adventure | src/adventure/views/templates/home.html | HTML | mit | 1,133 |
<?php
namespace Blogger\BlogBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
//\Blogger\BlogBundle\Entity\Client
class ClientController extends Controller{
/**
* Show one client.
*
* @Route("/client/{id}", name="client_show")
* @Method("GET")
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$client = $em->getRepository('BloggerBlogBundle:Client')->find($id);
if (!$client) {
throw $this->createNotFoundException('Unable to find Client post.');
}
return $this->render('BloggerBlogBundle:Client:show.html.twig', array(
'client' => $client,
));
}
}
| PavelKovalchuk/symblog | src/Blogger/BlogBundle/Controller/ClientController.php | PHP | mit | 901 |
<?php
namespace mle86\Value;
/**
* The interface of all value classes,
* i.e. AbstractValue and AbstractSerializableValue.
*
* It just specifies that Value classes should have a 'value' method
* and a one-argument constructor, although those classes have another
* important requirement: being immutable. But we cannot encode that
* in an interface.
*
* @author Maximilian Eul
* @link https://github.com/mle86/php-value
*/
interface Value
{
public function __construct($rawValue);
public function value();
}
| mle86/php-value | src/Value.php | PHP | mit | 536 |
package main
import (
"fmt"
"log"
"net"
"os"
"github.com/kennylevinsen/g9p"
"github.com/kennylevinsen/g9ptools/fileserver"
"github.com/kennylevinsen/g9ptools/ramfs/ramtree"
)
func main() {
if len(os.Args) < 5 {
fmt.Printf("Too few arguments\n")
fmt.Printf("%s service UID GID address\n", os.Args[0])
fmt.Printf("UID and GID are the user/group that owns /\n")
return
}
service := os.Args[1]
user := os.Args[2]
group := os.Args[3]
addr := os.Args[4]
root := ramtree.NewRAMTree("/", 0777, user, group)
l, err := net.Listen("tcp", addr)
if err != nil {
log.Fatalf("Unable to listen: %v", err)
}
h := func() g9p.Handler {
m := make(map[string]fileserver.Dir)
m[service] = root
return fileserver.NewFileServer(nil, m, 10*1024*1024, fileserver.Debug)
}
log.Printf("Starting ramfs at %s", addr)
g9p.ServeListener(l, h)
}
| joushou/g9ptools | ramfs/server.go | GO | mit | 857 |
/**
* Usuario Controller Test Suite
*
* @author Thiago Paes <[email protected]>
* @license MIT
*/
'use strict';
var connection = require('../test');
var Usuario = require('../../src/controllers/UsuarioController');
var sinon = require('sinon');
var assert = require('assert');
var request = require('request');
var response = {
content: null,
statusCode: 0,
json: function(content){
this.content = content;
return this;
},
status: function(status) {
this.statusCode = status;
return this;
}
};
describe('Usuario Controller', function () {
it('#lista() deve retornar um array', function (done) {
request.headers = {};
request.params = { };
request.query = {
page : 1,
limit: 1
};
Usuario.lista(request, response, function() {
assert.equal(response.content.object, 'list');
done();
});
});
it('#abre() deve retornar um objeto', function (done) {
request.headers = { };
request.params = {
id: 1
};
request.query = {
page : 1,
limit: 1
};
Usuario.abre(request, response, function() {
assert.equal(response.content.object, 'error');
assert.equal(response.statusCode, 404);
done();
});
});
it('#adiciona() deve retornar um objeto', function (done) {
request.headers = { };
request.body = {
nome : 'Foo Bar',
email : '[email protected]',
password: 'foo',
uf : 'AA',
estado : 'aaa aaa',
cidade : 'bbb bbb bb'
};
Usuario.adiciona(request, response, function() {
assert.equal(response.content.object, 'error');
done();
});
});
it('#atualiza() deve retornar um objeto', function (done) {
request.headers = { };
request.params = {
id: 1
};
request.query = {
page : 1,
limit: 1
};
Usuario.atualiza(request, response, function() {
assert.equal(response.content.object, 'error');
done();
});
});
it('#apaga() deve retornar um objeto', function (done) {
request.headers = { };
request.params = {
id: 1
};
request.query = {
page : 1,
limit: 1
};
Usuario.apaga(request, response, function() {
assert.equal(response.content.object, 'error');
done();
});
});
}); | mrprompt/expressjs-api-skel | test/controllers/UsuarioControllerTest.js | JavaScript | mit | 2,672 |
#!/usr/bin/env ts-node
import * as Path from 'path'
import * as Fs from 'fs'
import Ajv, { ErrorObject } from 'ajv'
function handleError(error: string) {
console.error(error)
process.exit(-1)
}
function formatErrors(errors: ErrorObject[]): string {
return errors
.map(error => {
const { dataPath, message } = error
const additionalProperties = error.params as any
const additionalProperty = additionalProperties.additionalProperty as string
let additionalPropertyText = ''
if (additionalProperty != null) {
additionalPropertyText = `, found: '${additionalProperties.additionalProperty}'`
}
// dataPath starts with a leading "."," which is a bit confusing
const element = dataPath.substring(1)
return ` - ${element} - ${message}${additionalPropertyText}`
})
.join('\n')
}
const repositoryRoot = Path.dirname(__dirname)
const changelogPath = Path.join(repositoryRoot, 'changelog.json')
// eslint-disable-next-line no-sync
const changelog = Fs.readFileSync(changelogPath, 'utf8')
let changelogObj = null
try {
changelogObj = JSON.parse(changelog)
} catch {
handleError(
'Unable to parse the contents of changelog.json into a JSON object. Please review the file contents.'
)
}
const schema = {
$schema: 'http://json-schema.org/draft-07/schema#',
type: 'object',
properties: {
releases: {
type: 'object',
patternProperties: {
'^([0-9]+.[0-9]+.[0-9]+)(-beta[0-9]+|-test[0-9]+)?$': {
type: 'array',
items: {
type: 'string',
},
uniqueItems: true,
},
},
additionalProperties: false,
},
},
}
const ajv = new Ajv({ allErrors: true, uniqueItems: true })
const validate = ajv.compile(schema)
const valid = validate(changelogObj)
if (!valid && validate.errors != null) {
handleError(`Errors: \n${formatErrors(validate.errors)}`)
}
console.log('The changelog is totally fine')
| desktop/desktop | script/validate-changelog.ts | TypeScript | mit | 1,979 |
<?php
namespace TheScienceTour\DocumentBundle\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
use Doctrine\Bundle\MongoDBBundle\Validator\Constraints\Unique as MongoDBUnique;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use TheScienceTour\MediaBundle\Validator\Constraints as TSTMediaAssert;
/** @MongoDB\MappedSuperclass */
abstract class Document {
/**
* @MongoDB\Boolean
*/
protected $isErasmus; // Le contenu est-il lié à un projet Erasmus ?
/**
* @MongoDB\String
*/
protected $language; // La langue du document
/**
* @MongoDB\ReferenceOne(targetDocument="TheScienceTour\DocumentBundle\Document\Document", inversedBy="translations")
*/
protected $principal; // Le document original
/**
* @MongoDB\ReferenceMany(targetDocument="TheScienceTour\DocumentBundle\Document\Document", mappedBy="principal")
*/
protected $translations; // Ensemble des traductions
public function getIsErasmus() {
return $this->isErasmus;
}
public function getLanguage() {
return $this->isErasmus;
}
public function getPrincipal() {
return $this->isErasmus;
}
public function setIsErasmus($isErasmus) {
$this->isErasmus = $isErasmus;
return $this;
}
public function setLanguage($language) {
$this->language = $language;
return $this;
}
public function setPrincipal(\TheScienceTour\DocumentBundle\Document\Document $principal) {
$this->principal = $principal;
return $this;
}
public function getTranslations() {
return $this->translations;
}
public function addTranslation(\TheScienceTour\DocumentBundle\Document\Document $translation) {
$this->translations[] = $translation;
}
public function removeTranslation(\TheScienceTour\DocumentBundle\Document\Document $translation) {
$this->translations->removeElement($translation);
}
}
| assemblee-virtuelle/science-tour | src/TheScienceTour/DocumentBundle/Document/Document.php | PHP | mit | 1,916 |
define([
], function () {
'use strict';
return function (req, res, next) {
function filterParams(req, action) {
var paramsWhitelist = action.params,
whitelistParam,
paramValue,
type,
filteredParams = {};
// check all actions params
for (whitelistParam in paramsWhitelist) {
if (paramsWhitelist.hasOwnProperty(whitelistParam)) {
type = '';
// get param from body or query
if (paramsWhitelist[whitelistParam].query === true) {
paramValue = req.query[whitelistParam];
} else {
paramValue = req.body[whitelistParam];
}
// if defined or not optional -> validate
if (paramValue !== undefined || !paramsWhitelist[whitelistParam].optional) {
// validate missing params
if (paramValue === undefined && !paramsWhitelist[whitelistParam].optional) { // necessary param missing
type = 'missing_parameter';
} else if (paramValue && paramValue.constructor !== paramsWhitelist[whitelistParam].type) { // validate param type
type = 'wrong_type';
} else if (paramsWhitelist[whitelistParam].hasOwnProperty('regex') && !paramsWhitelist[whitelistParam].regex.test(paramValue)) {
type = 'invalid_structure'; // validate param for custom regex
} else if (paramsWhitelist[whitelistParam].hasOwnProperty('validate') && !paramsWhitelist[whitelistParam].validate(paramValue)) {
type = 'custom_validation'; // validate param for custom validate function
}
// if error type is set -> throw error
if (type) {
throw {
error: type,
param: whitelistParam
};
}
// set validated param
filteredParams[whitelistParam] = paramValue;
}
}
}
return filteredParams;
}
if (req.customData && req.customData.action) {
try {
req.customData.params = filterParams(req, req.customData.action);
} catch (e) {
return res.status(400).send(e);
}
}
next();
};
});
| KillerCodeMonkey/handmade | middleware/validation.js | JavaScript | mit | 2,697 |
module Em
module Systemcommand
VERSION = "2.0.10"
end
end
| leoc/em-systemcommand | lib/em-systemcommand/version.rb | Ruby | mit | 66 |
use std::env;
use std::process;
use minigrep::Config;
fn main() {
let args: Vec<String> = env::args().collect();
let config = Config::new(&args).unwrap_or_else(|err| {
eprintln!("Problem parsing arguments: {}", err);
process::exit(1);
});
if let Err(e) = minigrep::run(config) {
eprintln!("Application error: {}", e);
process::exit(1);
}
}
| jekhokie/scriptbox | rust--learnings/12/minigrep/src/main.rs | Rust | mit | 396 |
// Copyright (c) 2018 Slack Technologies, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_COMMON_GIN_UTIL_H_
#define SHELL_COMMON_GIN_UTIL_H_
#include "gin/converter.h"
#include "gin/function_template.h"
namespace gin_util {
template <typename T>
bool SetMethod(v8::Local<v8::Object> recv,
const base::StringPiece& key,
const T& callback) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
auto context = isolate->GetCurrentContext();
return recv
->Set(context, gin::StringToV8(isolate, key),
gin::CreateFunctionTemplate(isolate, callback)
->GetFunction(context)
.ToLocalChecked())
.ToChecked();
}
} // namespace gin_util
#endif // SHELL_COMMON_GIN_UTIL_H_
| the-ress/electron | shell/common/gin_util.h | C | mit | 829 |
{% extends "images/base.html" %}
{% block content %}
<h2>{{ resource }}</h2>
<p><strong>Tags: </strong>
{% for tag in resource.tags.all %}
<a href={% url 'tag' tag %}>{{ tag }}</a>
{% endfor %}
<p><strong>Similar Images: </strong>
{% for resource in resource.tags.similar_objects %}
<a href="{% url 'resource' resource.id %}">{{ resource }}</a>
{% endfor %}</p>
<img src="{{ resource.file.url }}" class="thumbnail">
{% endblock %}
| bdunnette/pima | images/templates/images/resource.html | HTML | mit | 435 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User agent detail - DoCoMo/2.0 P90liS(c100;TB;W20H10)</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">
<link href="../circle.css" 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">
DoCoMo/2.0 P90liS(c100;TB;W20H10)
</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">Test suite</th></tr><tr><td>UAParser<br /><small>v0.5.0.2</small><br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">DoCoMo</td><td>P90liS</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><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59">Detail</a>
<!-- Modal Structure -->
<div id="modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">Array
(
[user_agent_string] => DoCoMo/2.0 P90liS(c100;TB;W20H10)
[family] => DoCoMo P90liS
[brand] => DoCoMo
[model] => P90liS
)
</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>BrowscapFull<br /><small>6014</small><br /></td><td>DoCoMo 2.0</td><td> </td><td>JAVA </td><td style="border-left: 1px solid #555"></td><td></td><td>Mobile Device</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.007</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-47a9cd06-e213-4882-bc34-db6aed664223">Detail</a>
<!-- Modal Structure -->
<div id="modal-47a9cd06-e213-4882-bc34-db6aed664223" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapFull result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^docomo\/2\.0.*$/
[browser_name_pattern] => docomo/2.0*
[parent] => DoCoMo
[comment] => DoCoMo
[browser] => DoCoMo
[browser_type] => Browser
[browser_bits] => 32
[browser_maker] => unknown
[browser_modus] => unknown
[version] => 2.0
[majorver] => 2
[minorver] => 0
[platform] => JAVA
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 32
[platform_maker] => Oracle
[alpha] =>
[beta] =>
[win16] =>
[win32] =>
[win64] =>
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[backgroundsounds] =>
[javascript] => 1
[vbscript] =>
[javaapplets] =>
[activexcontrols] =>
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] =>
[crawler] =>
[isfake] =>
[isanonymized] =>
[ismodified] =>
[cssversion] => 1
[aolversion] => 0
[device_name] => general Mobile Device
[device_maker] => unknown
[device_type] => Mobile Device
[device_pointing_method] => unknown
[device_code_name] => general Mobile Device
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</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>BrowscapLite<br /><small>6014</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td><td>DoCoMo 2.0</td><td><i class="material-icons">close</i></td><td>JAVA </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Device</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.01</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68">Detail</a>
<!-- Modal Structure -->
<div id="modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapPhp result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^docomo\/2\.0.*$/
[browser_name_pattern] => docomo/2.0*
[parent] => DoCoMo
[comment] => DoCoMo
[browser] => DoCoMo
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => unknown
[browser_modus] => unknown
[version] => 2.0
[majorver] => 2
[minorver] => 0
[platform] => JAVA
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] => false
[beta] => false
[win16] => false
[win32] => false
[win64] => false
[frames] => false
[iframes] => false
[tables] => false
[cookies] => false
[backgroundsounds] => false
[javascript] => false
[vbscript] => false
[javaapplets] => false
[activexcontrols] => false
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] => false
[crawler] =>
[isfake] => false
[isanonymized] => false
[ismodified] => false
[cssversion] => 0
[aolversion] => 0
[device_name] => unknown
[device_maker] => unknown
[device_type] => Mobile Device
[device_pointing_method] => unknown
[device_code_name] => unknown
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</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.1</small><br /></td><td>DoCoMo 2.0</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</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050">Detail</a>
<!-- Modal Structure -->
<div id="modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] =>
[browser] => DoCoMo
[version] => 2.0
)
</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>JenssegersAgent<br /><small>v2.3.3</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>NeutrinoApiCom<br /><small></small><br /></td><td>NetFront </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">DoCoMo</td><td></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.20801</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b">Detail</a>
<!-- Modal Structure -->
<div id="modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 320
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] => DoCoMo
[mobile_model] =>
[version] =>
[is_android] =>
[browser_name] => NetFront
[operating_system_family] => unknown
[operating_system_version] =>
[is_ios] =>
[producer] => ACCESS CO.,LTD
[operating_system] => unknown
[mobile_screen_width] => 240
[mobile_browser] =>
)
</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.6.1</small><br /></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">DoCoMo</td><td>P90liS</td><td>feature phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.007</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-4a941d34-a8d3-4914-9724-346f60ad7046">Detail</a>
<!-- Modal Structure -->
<div id="modal-4a941d34-a8d3-4914-9724-346f60ad7046" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>PiwikDeviceDetector result detail</h4>
<p><pre><code class="php">Array
(
[client] =>
[operatingSystem] => Array
(
)
[device] => Array
(
[brand] => DC
[brandName] => DoCoMo
[model] => P90liS
[device] => 3
[deviceName] => feature phone
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] =>
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] => 1
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] =>
[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.1</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">DoCoMo</td><td>P90liS</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.002</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-3160e405-8a8f-46dd-8f47-5115f06462d2">Detail</a>
<!-- Modal Structure -->
<div id="modal-3160e405-8a8f-46dd-8f47-5115f06462d2" 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] =>
[minor] =>
[patch] =>
[family] => Other
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] =>
[minor] =>
[patch] =>
[patchMinor] =>
[family] => Other
)
[device] => UAParser\Result\Device Object
(
[brand] => DoCoMo
[model] => P90liS
[family] => DoCoMo P90liS
)
[originalUserAgent] => DoCoMo/2.0 P90liS(c100;TB;W20H10)
)
</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>UserAgentApiCom<br /><small></small><br /></td><td> </td><td> </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>Mobile</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.15301</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6">Detail</a>
<!-- Modal Structure -->
<div id="modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[platform_name] => NTT DoCoMo
[platform_version] => 2.0
[platform_type] => 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>UserAgentStringCom<br /><small></small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555"></td><td>P90liS</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.23401</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c">Detail</a>
<!-- Modal Structure -->
<div id="modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhatIsMyBrowserCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[operating_system_name] =>
[simple_sub_description_string] =>
[simple_browser_string] =>
[browser_version] =>
[extra_info] => Array
(
)
[operating_platform] => P90liS
[extra_info_table] => Array
(
)
[layout_engine_name] =>
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] =>
[operating_system_version] =>
[simple_operating_platform_string] => P90liS
[is_abusive] =>
[layout_engine_version] =>
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] =>
[operating_system] =>
[operating_system_version_full] =>
[operating_platform_code] =>
[browser_name] =>
[operating_system_name_code] =>
[user_agent] => DoCoMo/2.0 P90liS(c100;TB;W20H10)
[browser_version_full] =>
[browser] =>
)
</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>v2.0.18</small><br /></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555"></td><td>P90liS</td><td>mobile:feature</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.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-083a336f-5d73-4505-84f3-c5fc9bb78652">Detail</a>
<!-- Modal Structure -->
<div id="modal-083a336f-5d73-4505-84f3-c5fc9bb78652" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[device] => Array
(
[type] => mobile
[subtype] => feature
[model] => P90liS
[carrier] => DoCoMo
)
)
</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><br /></td><td>docomo P90liS</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>mobilephone</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</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9">Detail</a>
<!-- Modal Structure -->
<div id="modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Woothee result detail</h4>
<p><pre><code class="php">Array
(
[name] => docomo
[os] => docomo
[category] => mobilephone
[vendor] => docomo
[version] => P90liS
[os_version] => UNKNOWN
)
</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.7.1.0</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">DoCoMo</td><td></td><td>Feature Phone</td><td>yes</td><td></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.016</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50">Detail</a>
<!-- Modal Structure -->
<div id="modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => false
[is_ios] => false
[is_windows_phone] => false
[is_app] => false
[is_full_desktop] => false
[is_largescreen] => false
[is_mobile] => true
[is_robot] => false
[is_smartphone] => false
[is_touchscreen] => false
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => true
[is_html_preferred] => false
[advertised_device_os] =>
[advertised_device_os_version] =>
[advertised_browser] =>
[advertised_browser_version] =>
[complete_device_name] => DoCoMo
[device_name] => DoCoMo
[form_factor] => Feature Phone
[is_phone] => true
[is_app_webview] => false
)
[all] => Array
(
[brand_name] => DoCoMo
[model_name] =>
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => false
[has_qwerty_keyboard] => false
[can_skip_aligned_link_row] => true
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] =>
[mobile_browser] =>
[mobile_browser_version] =>
[device_os_version] =>
[pointing_method] =>
[release_date] => 2002_january
[marketing_name] =>
[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] => true
[card_title_support] => false
[softkey_support] => false
[table_support] => false
[numbered_menus] => false
[menu_with_select_element_recommended] => false
[menu_with_list_of_links_recommended] => false
[icons_on_menu_items_support] => false
[break_list_of_links_with_br_element_recommended] => false
[access_key_support] => false
[wrap_mode_support] => false
[times_square_mode_support] => false
[deck_prefetch_support] => false
[elective_forms_recommended] => false
[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] => true
[emoji] => false
[chtml_can_display_images_and_text_on_same_line] => false
[chtml_displays_image_in_center] => false
[imode_region] => ja
[chtml_make_phone_call_string] => tel:
[chtml_table_support] => false
[xhtml_honors_bgcolor] => false
[xhtml_supports_forms_in_table] => false
[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] => false
[xhtml_supports_css_cell_table_coloring] => false
[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] => false
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => utf8
[opwv_xhtml_extensions_support] => false
[xhtml_make_phone_call_string] => tel:
[xhtmlmp_preferred_mime_type] => application/vnd.wap.xhtml+xml
[xhtml_table_support] => false
[xhtml_send_sms_string] => none
[xhtml_send_mms_string] => none
[xhtml_file_upload] => not_supported
[cookie_support] => true
[accept_third_party_cookie] => true
[xhtml_supports_iframe] => none
[xhtml_avoid_accesskeys] => false
[xhtml_can_embed_video] => none
[ajax_support_javascript] => false
[ajax_manipulate_css] => false
[ajax_support_getelementbyid] => false
[ajax_support_inner_html] => false
[ajax_xhr_type] => none
[ajax_manipulate_dom] => false
[ajax_support_events] => false
[ajax_support_event_listener] => false
[ajax_preferred_geoloc_api] => none
[xhtml_support_level] => 1
[preferred_markup] => docomo_imode_html_3
[wml_1_1] => true
[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] => true
[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] => true
[html_web_3_2] => false
[html_web_4_0] => false
[voicexml] => false
[multipart_support] => false
[total_cache_disable_support] => false
[time_to_live_support] => false
[resolution_width] => 240
[resolution_height] => 320
[columns] => 8
[max_image_width] => 240
[max_image_height] => 320
[rows] => 6
[physical_screen_width] => 27
[physical_screen_height] => 27
[dual_orientation] => false
[density_class] => 1.0
[wbmp] => false
[bmp] => false
[epoc_bmp] => false
[gif_animated] => false
[jpg] => false
[png] => false
[tiff] => false
[transparent_png_alpha] => false
[transparent_png_index] => false
[svgt_1_1] => false
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 262144
[webp_lossy_support] => false
[webp_lossless_support] => false
[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] => 9
[wifi] => false
[sdio] => false
[vpn] => false
[has_cellular_radio] => true
[max_deck_size] => 5000
[max_url_length_in_requests] => 512
[max_url_length_homepage] => 100
[max_url_length_bookmark] => 100
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 256
[max_length_of_password] => 20
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => false
[inline_support] => false
[oma_support] => false
[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] => false
[streaming_3gpp] => false
[streaming_mp4] => false
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => -1
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => -1
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => -1
[streaming_acodec_amr] => none
[streaming_acodec_aac] => none
[streaming_wmv] => none
[streaming_preferred_protocol] => rtsp
[streaming_preferred_http_protocol] => none
[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] => false
[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] => false
[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] => false
[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] => false
[mp3] => false
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] => 1_1
[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] => none
[css_rounded_corners] => none
[css_gradient] => none
[css_spriting] => false
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => false
[progressive_download] => true
[playback_vcodec_h263_0] => -1
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => -1
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => 1
[playback_real_media] => none
[playback_3gpp] => true
[playback_3g2] => false
[playback_mp4] => false
[playback_mov] => false
[playback_acodec_amr] => nb
[playback_acodec_aac] => lc
[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] => false
[html_preferred_dtd] => xhtml_mp1
[viewport_supported] => false
[viewport_width] =>
[viewport_userscalable] =>
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => none
[image_inlining] => false
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => none
[is_sencha_touch_ok] => false
)
)
</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>Zsxsoft<br /><small>1.3</small><br /></td><td>DoCoMo 2.0</td><td><i class="material-icons">close</i></td><td> </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</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5d43e024-b46c-44f6-8914-529b05569bc2">Detail</a>
<!-- Modal Structure -->
<div id="modal-5d43e024-b46c-44f6-8914-529b05569bc2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Zsxsoft result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[link] => http://www.nttdocomo.com/
[title] => DoCoMo 2.0
[code] => null
[version] => 2.0
[name] => DoCoMo
[image] => img/16/browser/null.png
)
[os] => Array
(
[link] =>
[name] =>
[version] =>
[code] => null
[x64] =>
[title] =>
[type] => os
[dir] => os
[image] => img/16/os/null.png
)
[device] => Array
(
[link] => #
[title] => Unknown
[code] => null
[dir] => browser
[type] => os
[image] => img/16/browser/null.png
)
[platform] => Array
(
[link] => #
[title] => Unknown
[code] => null
[dir] => browser
[type] => os
[image] => img/16/browser/null.png
)
)
</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-05-10 08:06:17</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.2.0/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> | ThaDafinser/UserAgentParserComparison | v5/user-agent-detail/ba/2e/ba2efb11-d9a9-4489-8474-c5e519c9d172.html | HTML | mit | 46,068 |
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SourceSchemaParser.DOTA2;
using System;
using System.Collections.Generic;
using System.Reflection;
namespace SourceSchemaParser.JsonConverters
{
internal class SchemaItemToDotaHeroJsonConverter : JsonConverter
{
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
throw new NotImplementedException();
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null)
{
return null;
}
List<DotaHeroSchemaItem> heroes = new List<DotaHeroSchemaItem>();
JToken t = JToken.Load(reader);
var properties = t.Children<JProperty>();
foreach (var item in properties)
{
if (item.Name == "Version")
{
continue;
}
JObject o = (JObject)item.Value;
DotaHeroSchemaItem heroSchemaItem = JsonConvert.DeserializeObject<DotaHeroSchemaItem>(item.Value.ToString());
if (!string.IsNullOrWhiteSpace(heroSchemaItem.Url)) { heroSchemaItem.Url = heroSchemaItem.Url.Replace(" ", "_"); }
heroSchemaItem.Name = item.Name;
if (heroSchemaItem.Team == "good") { heroSchemaItem.Team = "Good"; } // fix stupid caps
heroes.Add(heroSchemaItem);
}
return heroes;
}
public override bool CanWrite { get { return false; } }
public override bool CanConvert(Type objectType)
{
return typeof(IList<DotaHeroSchemaItem>).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo());
}
}
} | babelshift/SourceSchemaParser | src/SourceSchemaParser/JsonConverters/SchemaItemToDotaHeroJsonConverter.cs | C# | mit | 1,860 |
<!doctype html>
<html lang="en-gb">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noindex, nofollow">
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<title>Wing Jones by Katherine Webber – Suffolk Libraries</title>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@suffolklibrary">
<meta name="twitter:title" content="Wing Jones by Katherine Webber">
<meta name="twitter:description" content="Emma loved Wing Jones and is excited to read Katherine Webber's future work">
<meta name="twitter:image" content="/images/featured/featured-wing-jones.jpg">
<meta name="twitter:image:alt" content="Wing Jones">
<link rel="stylesheet" href="/css/style.css">
<link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-regular.woff2">
<link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-italic.woff2">
<link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-700.woff2">
</head>
<body class="custom-sans-serif lh-copy dark-gray bg-moon-gray">
<ul class="clip">
<li><a href="#content">Skip to content</a></li>
<li><a href="#footer-nav">Skip to navigation menu</a></li>
</ul>
<div class="bg-black white pa2 ph3-ns">
<div class="custom-max-width">
<p class="f6 ma0 custom-lh-title"><span role='image' aria-label='Debit card' class='pr1'>💳</span> You can now pay online. <a href="
https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/MSGTRN/OPAC/LOGINB?RDT=/SpydusCitizenPay/default.aspx
" class="underline lightest-blue">
Pay charges now →
</a></p>
</div>
</div>
<header id="site-header" class="custom-lh-title">
<div class="bg-white dark-gray ph2 ph3-ns pt2 pt3-ns">
<div class="custom-max-width flex">
<div class="w-30">
<a href="/"><img src="/images/logos/sl.svg" class="v-btm w3 w4-ns" alt="Suffolk Libraries"></a>
</div>
<div class="w-70 flex justify-end items-center">
<div><a href="/support-us/" class="dib blue pv1 pv2-ns f7 f6-ns pr2">Donate</a></div>
<div><a href="/help/joining-the-library/" class="dib custom-icon custom-icon-card blue pv1 pv2-ns f7 f6-ns">Join</a></div>
<div><a href="https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/MSGTRN/OPAC/LOGINB" class="dib custom-icon custom-icon-lock blue pv1 pv2-ns ml2 f7 f6-ns">Login</a></div>
<div><a href="/search-form/" class="dib custom-icon custom-icon-search blue ml2 pv1 pv2-ns f7 f6-ns">Search</a></div>
</div>
</div>
</div>
<div class="custom-bg-corporate white ph2 ph3-ns bb b--white">
<div class="custom-max-width">
<ul class="ma0 pa0 list f6">
<li class="dib mr2 mr3-l"><a href="/" class="white underline db pv2">Home</a></li>
<li class="dib mr2 mr3-l"><a href="/elibrary/" class="white underline db pv2">eLibrary</a></li>
<li class="dib mr2 mr3-l"><a href="/events-activities/online-and-streamed-events/" class="white underline db pv2">Online events</a></li>
<li class="dib mr2 mr3-l"><a href="/help/" class="white underline db pv2">Help</a></li>
<li class="dib mr2 mr3-l"><a href="/contact/" class="white underline db pv2">Contact</a></li>
<!-- <li class="dib mr2 mr3-l"><a href="/about/" class="white underline db pv2">About</a></li>
<li class="dib"><a class="white underline db pv2" href="/support-us/">Donate</a></li> -->
</ul>
</div>
</div>
</header>
<div class="pv2 pv3-ns cf custom-max-width
">
<main id="content" role="main">
<div class="custom-g-l4">
<article>
<div class="bg-white pa2 pa5-ns pv4-ns cf mb2 border-box b--light-gray
">
<div class="pa2 ph3-ns bg-white ba b--light-gray custom-underline f6">
<a class="blue underline" href="/">Home</a>
→ <a class="blue underline" href="/new-suggestions/">New suggestions</a>
→ <a class="blue underline" href="/new-suggestions/young-adult/">Young adult</a>
→ Wing Jones by Katherine Webber
</div>
<header class="mt3">
<h1 itemprop="name headline"class="custom-lh-title f2 pa0 ma0 mb3
}">Wing Jones by Katherine Webber</h1>
<p class="f6 mid-gray">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Emma Maguire</span></span> · Published Apr 27, 2017 · Filed under <a class="blue" href="/new-suggestions/reviews/genre/literary-fiction">Literary fiction</a>
</p>
</header>
<div itemprop="articleBody"class="lh-copy custom-hyphens custom-prose
custom-underline custom-visited">
<p><img src="/images/featured/featured-wing-jones.jpg" alt="Wing Jones" /></p>
<p><strong><a href="https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/ENQ/OPAC/BIBENQ?BRN=2078815">See <cite>Wing Jones</cite> in our catalogue</a>.</strong></p>
<p>Wing has always been in the shadow of her football-playing popular brother. She doesn’t look like anyone else, and the one friend she did have moved away. When tragedy strikes the family, Wing discovers she can run - fast!</p>
<p>Wing finds a place to fit in, makes new friends, and Aaron becomes more than just her brother’s best friend. Wing discovers against incredible pain you can find happiness - and her talent might just help her family too.</p>
<p>I loved <cite>Wing Jones</cite>, and I couldn’t put it down. I will be keeping an eye out for anything else Katherine Webber writes. Read this book, it’s one of my favourites so far this year!</p>
<footer>
<footer class="pb4 pb5-ns pt3 bt b--light-gray">
<h1 class="f4 ma0 pa0 pb1">Emma Maguire</a></h1>
<p class="ma0">I'm a library and information advisor.</p>
</footer>
</footer>
</div>
</div>
</article>
</div>
</main>
<div class="custom-g-l2 custom-g-nm custom-underline">
<aside id="sidebar" class="bg-white pa2 pa5-ns pv4-ns cf mb2 border-box b--light-gray
custom-constrain-img" role="complementary">
<section class="pb3 pb4-ns
">
<h1 class="ma0 pb2 f5 f4-ns fw6
">About our Young Adult section</h1>
<p class="ma0 mb2 f6 f5-ns">Book reviews, reading suggestions and blog posts from our staff and young adult readers. Want to write for our website? Email us at <strong>[email protected]</strong>.</p>
</section>
<section class="pb3 pb4-ns
">
<h1 class="ma0 pb2 f5 f4-ns fw6
">More Young adult</h1>
<ul class="pa0 ma0 list mb2 f6 f5-ns
">
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/new-young-adult-for-march-2020/">New Young Adult books for March 2020</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/wranglestone-by-darren-charlton/">Wranglestone by Darren Charlton</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/lgbt-history-month-2020/">Recommended Young Adult titles to mark LGBT History Month 2020</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/with-the-fire-on-high-by-elizabeth-acevedo/">With the Fire on High by Elizabeth Acevedo</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/new-young-adult-for-february-2020/">New Young Adult books for February 2020</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/the-poet-x-by-elizabeth-acevedo/">The Poet X by Elizabeth Acevedo</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/read-for-empathy-ya-2020/">Find your new favourite book with the 2020 Read for Empathy YA book collection</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/the-deathless-girls-by-kiran-millwood-hargrave/">The Deathless Girls by Kiran Millwood Hargrave</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/the-beautiful-by-renee-ahdieh/">The Beautiful by Renée Ahdieh</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/ya-comic-books/">Feast your eyes on our stunning Young Adult comic books</a></li>
</ul>
</section>
<section class="pb3 pb4-ns
">
<h1 class="ma0 pb2 f5 f4-ns fw6
">More suggestions</h1>
<ul class="pa0 ma0 list mb2 f6 f5-ns
">
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/fiction/">Fiction</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/audiobooks/">Audiobooks</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/films-dvds/">Films & DVDs</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/elibrary-picks/">eLibrary picks</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/childrens-ya-books/">Children's books</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/young-adult/">Young adult</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/non-fiction/">Non-fiction</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/music/">Music</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/meet-the-author/">Meet the Author interviews</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/articles/">Articles</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/health-lists/"> Health and wellbeing</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/reviews/">Reviews</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/new-suggestions/book-club/">Book club favourites</a></li>
</ul>
</section>
<section class="pb3 pb4-ns
">
<h1 class="ma0 pb2 f5 f4-ns fw6
">Keep updated</h1>
<p class="ma0 mb2 f6 f5-ns">Get the latest suggestions, releases and reviews delivered straight to you.</p>
<ul class="pa0 ma0 list mb2 f6 f5-ns
">
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="/newsletter/">Email newsletter</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="https://facebook.com/suffolklibraries">Facebook</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="https://twitter.com/suffolklibrary">Twitter</a></li>
<li class="pv2 bt b--light-gray
"><a class="blue link
" href="https://instagram.com/suffolklibraries">Instagram</a></li>
</ul>
</section>
</aside>
</div>
</div>
<footer id="footer" class="pa2 pt3 pa3-ns pt4-ns bg-near-black white custom-underline">
<div class="custom-max-width">
<div class="flex-l justify-between-l">
<div class="w-30-l mb4 f6">
<section class="pb4">
<h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal
">Do it online</h2>
<ul class="list pa0 ma0">
<li class="mb2 mb1-ns"><a href="https://suffolk.spydus.co.uk" class="link light-gray hover-white">Search & reserve</a></li>
<li class="mb2 mb1-ns"><a href="https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/MSGTRN/OPAC/LOGINB" class="link light-gray hover-white">Login & renew</a></li>
<li class="mb2 mb1-ns"><a class="link light-gray hover-white" href="/elibrary">eLibrary</a></li>
<li class="mb2 mb1-ns"><a href="/help/joining-the-library/" class="link light-gray hover-white">Get a library card</a></li>
</ul>
</section>
<section class="pb4">
<h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal
">Support your library</h2>
<p>We're a charity that makes life in Suffolk better for thousands of people.</p>
<p class="ma0"><a class="b pa1 br2 custom-bg-corporate-green hover-bg-green white custom-no-underline" href="/support-us">Donate</a></p>
</section>
</div>
<div class="w-30-l mb4 f6">
<section class="pb4">
<h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal
">Contact us</h2>
<ul class="list pa0 ma0">
<li class="mb2 mb1-ns"><a href="tel:01473351249" class="link light-gray hover-white">01473 351249</a></li>
<li class="mb2 mb1-ns"><a href="mailto:[email protected]" class="link light-gray hover-white">[email protected]</a></li>
</ul>
</section>
<section class="pb4">
<h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal
">Social media</h2>
<ul class="list pa0 ma0">
<li class="mb2 mb1-ns"><a href="http://facebook.com/suffolklibraries" class="link light-gray hover-white">Facebook</a></li>
<li class="mb2 mb1-ns"><a href="https://www.youtube.com/user/SuffolkLibraries/" class="link light-gray hover-white">YouTube</a></li>
<li class="mb2 mb1-ns"><a href="http://twitter.com/suffolklibrary" class="link light-gray hover-white">Twitter</a></li>
<li class="mb2 mb1-ns"><a href="https://instagram.com/suffolklibraries" class="link light-gray hover-white">Instagram</a></li>
<li class="mb2 mb1-ns"><a href="https://www.linkedin.com/company/suffolk-libraries/" class="link light-gray hover-white">LinkedIn</a></li>
<li class="mb2 mb1-ns"><a href="/newsletter" class="link light-gray hover-white">Email newsletter</a></li>
</ul>
</section>
</div>
<div class="w-30-l mb4 f6">
<nav class="pb4" id="footer-nav">
<h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal
">Sections</h2>
<ul class="list pa0 ma0">
<li class="mb2 mb1-ns"><a href="/elibrary/" class="link light-gray hover-white">eLibrary</a></li>
<li class="mb2 mb1-ns"><a href="/libraries/" class="link light-gray hover-white">Libraries</a></li>
<li class="mb2 mb1-ns"><a href="/mobiles-home/" class="link light-gray hover-white">Mobile & home service</a></li>
<li class="mb2 mb1-ns"><a href="/help/" class="link light-gray hover-white">Help using the service</a></li>
<li class="mb2 mb1-ns"><a href="/new-suggestions/" class="link light-gray hover-white">Recommendations & reviews</a></li>
<li class="mb2 mb1-ns"><a href="/events-activities/" class="link light-gray hover-white">Events & activities</a></li>
<li class="mb2 mb1-ns"><a href="/research-and-reference/" class="link light-gray hover-white">Research & reference</a></li>
<li class="mb2 mb1-ns"><a href="/parents-carers-and-children/" class="link light-gray hover-white">Parents, carers & children</a></li>
<li class="mb2 mb1-ns"><a href="/teachers-and-home-educators/" class="link light-gray hover-white">Teachers & home educators</a></li>
<li class="mb2 mb1-ns"><a href="/health/" class="link light-gray hover-white">Health & wellbeing</a></li>
<li class="mb2 mb1-ns"><a href="/help-with-reading-and-literacy/" class="link light-gray hover-white">Help with reading & literacy</a></li>
<li class="mb2 mb1-ns"><a href="/work-and-benefits/" class="link light-gray hover-white">Work & benefits</a></li>
<li class="mb2 mb1-ns"><a href="/business-and-room-hire/" class="link light-gray hover-white">Business & room hire</a></li>
<li class="mb2 mb1-ns"><a href="/bloc/" class="link light-gray hover-white">BLOC</a></li>
<li class="mb2 mb1-ns"><a href="/music-and-drama/" class="link light-gray hover-white">Music & Drama Library</a></li>
<li class="mb2 mb1-ns"><a href="/news/" class="link light-gray hover-white">News</a></li>
<li class="mb2 mb1-ns"><a href="/about/jobs/" class="link light-gray hover-white">Jobs</a></li>
<li class="mb2 mb1-ns"><a href="/volunteer/" class="link light-gray hover-white">Volunteering</a></li>
<li class="mb2 mb1-ns"><a href="/about/" class="link light-gray hover-white">About us</a></li>
</ul>
</nav>
</div>
</div>
<section class="pb4 f6">
<h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal
">Privacy & cookies</h2>
<ul class="list pa0 ma0">
<li class="mb2 mb1-ns">Find out what cookies we use and how we use your data: <a href="/help/privacy-and-cookies/" class="light-gray underline hover-white">our privacy policies</a>.</li>
<li class="mb2 mb1-ns"><a href="/about/jobs/privacy-notice-for-job-applicants/" class="light-gray underline hover-white">Privacy notice for job applicants</a></li>
</ul>
</section>
<div class="pb4 f6">
<p class="ma0 light-gray">Suffolk Libraries HMRC charity number XT34476. Registered company number IP031542.</p>
</div>
</div>
</footer>
</body>
</html>
| suffolklibraries/sljekyll | _site/new-suggestions/young-adult/wing-jones-by-katherine-webber/index.html | HTML | mit | 21,399 |
Express ES6 boilerplate
=======================
[](https://codeclimate.com/github/RomanovSci/express-es6-boilerplate) [](https://scrutinizer-ci.com/g/RomanovSci/express-es6-boilerplate/?branch=master) [](https://scrutinizer-ci.com/g/RomanovSci/express-es6-boilerplate/build-status/master) [](https://david-dm.org/romanovsci/express-es6-boilerplate.svg)
Just simple express server with ES6 syntax
| RomanovSci/express-es6-boilerplate | README.md | Markdown | mit | 803 |
---
layout: page
title: Sanchez Township Air Trade Fair
date: 2016-05-24
author: Pamela Simon
tags: weekly links, java
status: published
summary: Fusce sem justo, feugiat in commodo eu, vulputate at augue.
banner: images/banner/meeting-01.jpg
booking:
startDate: 10/02/2016
endDate: 10/07/2016
ctyhocn: ALOIAHX
groupCode: STATF
published: true
---
Donec eleifend viverra elit, iaculis sollicitudin risus tincidunt non. Etiam mattis augue et nulla lacinia, ut tincidunt metus semper. Nulla lacinia vulputate facilisis. Etiam tristique tincidunt arcu, ac iaculis neque laoreet eget. Aliquam feugiat neque nec ultrices aliquam. Pellentesque id nunc massa. Integer quis odio sed mauris cursus tincidunt eu at augue. Mauris sapien mi, scelerisque vitae leo nec, posuere porttitor libero. Donec luctus, risus a vehicula efficitur, ante ante volutpat nulla, eget accumsan eros sapien non sem. Vestibulum non semper diam. Sed ultricies lobortis dignissim. Nunc dictum lacus a lorem venenatis, at sollicitudin augue aliquam.
Sed dignissim est id volutpat gravida. Donec semper felis vitae purus pellentesque accumsan non at ipsum. In commodo quam id diam congue, nec sagittis leo dapibus. Suspendisse semper sem in ullamcorper sodales. Cras rutrum in nulla a viverra. Sed pharetra, tellus id fermentum ullamcorper, mi odio cursus turpis, eu pulvinar quam libero ac purus. Pellentesque congue maximus risus, eget gravida nibh commodo et. Cras condimentum eros condimentum, aliquam orci ac, rhoncus lacus. Sed egestas condimentum fermentum. Aenean convallis tortor purus, sit amet fermentum tellus tempus vitae. Maecenas tincidunt ut arcu eget pretium. Cras tincidunt tortor vitae iaculis porta. Mauris ut tellus eget massa placerat fermentum vel et nisl.
* Donec sed eros et massa rhoncus dapibus
* Fusce et ligula a metus bibendum convallis sed et tortor
* Phasellus sagittis lectus a pharetra aliquam
* Vivamus mattis turpis at felis hendrerit imperdiet
* Integer ac ligula a metus auctor faucibus at id libero.
Vestibulum at nisi risus. Praesent porta nisl et magna vehicula, vel pharetra metus lacinia. Morbi rhoncus cursus eros, nec porttitor arcu malesuada eu. Etiam condimentum lectus ante, id blandit massa euismod vel. Vestibulum consequat est quis massa condimentum bibendum. Morbi arcu ipsum, scelerisque eget arcu vitae, semper dictum turpis. Aenean pulvinar sit amet nulla nec faucibus. Praesent a semper lacus. Nullam leo sem, rutrum eu ante quis, ullamcorper posuere ligula. Praesent sit amet posuere lacus.
Phasellus efficitur enim sit amet sapien volutpat, et commodo neque malesuada. Mauris velit diam, semper et tortor varius, consequat molestie orci. Fusce eget sem nisi. Donec cursus mi et nunc feugiat, sed pharetra justo pharetra. Vestibulum arcu urna, porta nec tincidunt non, semper at arcu. Integer cursus, risus sit amet elementum semper, orci ante faucibus lorem, non dictum eros nunc ut dui. Maecenas mattis semper arcu.
| KlishGroup/prose-pogs | pogs/A/ALOIAHX/STATF/index.md | Markdown | mit | 2,950 |
<?php
/*
* This file is part of the Quantum Unit Solutions development package.
*
* (c) Quantum Unit Solutions <http://github.com/dmeikle/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Gossamer\Tehuti\Routing;
/**
* ServerContext
*
* @author Dave Meikle
*/
class ServerContext extends Context {
}
| dmeikle/tehuti | src/framework/Gossamer/Tehuti/Routing/ServerContext.php | PHP | mit | 417 |
<html>
<head>
<meta content="HTML Tidy for HTML5 for Linux version 5.2.0" name="generator"/>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="Describes the xSemaphoreCreateBinaryStatic() RTOS API function which is part of the RTOS semaphore API source code function set." name="description"/>
<meta content="vSemaphoreCreateBinaryStatic, semaphore, binary, binary semaphore, mutex, mailbox, RTOS mailbox, FreeRTOS API, RTOS API, RTOS" name="keywords"/>
<title>xSemaphoreCreateBinaryStatic() RTOS API documentation</title>
<link href="doxygen.css" rel="stylesheet"/>
<style type="text/css">
</style>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<script src="banners.js" type="text/javascript">
</script>
<script src="stlib.js" type="text/javascript">
</script>
<script src="left_menu.js" type="text/javascript">
</script>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript">
</script>
<script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js">
</script>
<link href="code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css" rel="stylesheet"/>
<script type="text/javascript">
window.onload = function()
{
var rect1 = document.getElementById( 'td_right_side_bar' ).getBoundingClientRect();
if( rect1.right >= window.innerWidth )
{
document.getElementById( 'td_right_side_bar' ).style.display = 'none';
document.getElementById( 'td_right_side_bar' ).style.width = '0';
}
};
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-6086815-2']);
_gaq.push(['_setDomainName', 'freertos.org']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript">
function check_left_image_clash()
{
var rect1 = document.getElementById( 'left_banner_image' ).getBoundingClientRect();
var rect2 = document.getElementById( 'id_tree_menu' ).getBoundingClientRect();
if ( rect1.right >= rect2.left ) {
document.getElementById( 'td_left_side_bar' ).style.display = 'none';
document.getElementById( 'td_left_side_bar' ).style.width = '0';
}
}
</script>
<script type="text/javascript">
function check_right_image_clash()
{
var rect1 = document.getElementById( 'td_right_side_bar' ).getBoundingClientRect();
if( rect1.right >= window.innerWidth )
{
document.getElementById( 'td_right_side_bar' ).style.display = 'none';
document.getElementById( 'td_right_side_bar' ).style.width = '0';
}
}
</script>
<script type="text/javascript">
$( document ).ready( function()
{
window.setTimeout("blindDownMenuHint();", 5000);
window.setTimeout("blindUpMenuHint();", 12000);
}
)
function blindDownMenuHint()
{
if( window.name != "done" )
{
$( "#menu_hint").show( "blind", "slow" );
window.name = "done";
}
}
function blindUpMenuHint()
{
$( "#menu_hint").hide( "blind", "slow" );
}
</script></head>
<body><font face="Arial"><a id="page_top" name="page_top"/></font>
<table>
<tbody>
<tr>
<td valign="top">
<!-- Content area - the other td is the side bar area. -->
<table align="center" cellpadding="5" cellspacing="0" style="height:100%;background:white; border-left:solid 1px #f0f0f0; border-right:solid 1px #f0f0f0;">
<tbody>
<tr valign="top">
<td colspan="3" style="height:100px;">
<!-- Spans the left menu, blank line, and main content columns of the next row. -->
<table border="0" cellpadding="0" cellspacing="2" style="width:100%;"><!-- Rows for logos and banners, blue lines with menu. -->
<tbody>
<tr style="padding: 0px 0px 0px 0px;"><!-- Top row, banner and logo. -->
<td>
<table cellpadding="0" cellspacing="5px" style="table-layout:fixed;" width="100%">
<tbody>
<tr>
<td id="logo_column" style="line-height:normal;" valign="middle" width="174px">
<div style="float:left;"><a href="index.html"><img alt="Free RTOS logo" border="0" src="logo.jpg" style="padding: 0 0 0 5px;" width="164px"/></a></div>
</td>
<td style="width:5px; border-top:solid 2px #e6e6e6; border-left:solid 2px #e6e6e6; border-bottom:solid 2px #e6e6e6;"> </td>
<td id="page_heading_largerx" style="line-height:normal; width:324px;" valign="middle">
<h3>Quality RTOS & Embedded
Software<br/>
</h3>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr bgcolor="#7095D3" style="height:5px;"><!-- Blank line. -->
<td/>
</tr>
<tr bgcolor="#B6CFFE" style="height:19px;"><!-- Horizontal menu. -->
<td bgcolor="#B6CFFE" valign="middle">
<!-- Top menu with social media icons. -->
<table cellpadding="0" cellspacing="0" style="padding-top:4px;"><!-- Top horizontal menu. -->
<tbody>
<tr>
<td width="4px">
<!-- Just brings the first white menu spacing bar in from the left of the blue bar. --></td>
<td align="center" style="border-right:solid 2px white; border-left:solid 2px white; width:100px; line-height:normal;"/>
<td align="center" style="border-right:solid 2px white; width:112px; line-height:normal;"/>
<td align="center" style="border-right:solid 2px white; width:104px; line-height:normal;"/>
<td align="center" style="border-right:solid 2px white; width:94px; line-height:normal;"/>
<td align="center" style="border-right:solid 2px white; width:94px; line-height:normal;"/>
<td align="center" style="border-right:solid 2px white; width:90px; line-height:normal;"/>
<td align="center" style="border-right:solid 2px white; width:90px; line-height:normal;"/>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr valign="top"><!-- Main content row with menu and content area columns. -->
<td style="width:2px; padding-right:0; padding-left:0;"> <!-- Blank column. -->
<!-- Just to move the main text away from the silver verticle line slightly. --></td>
<td id="td_main_content_column"><!-- Main content area. -->
<table border="0" cellpadding="0" cellspacing="0" id="menu_hint" style="height:30px; background:#ffff99; display:none;">
<tbody>
<tr valign="middle">
<td width="5px"/>
<td width="30px"><img border="0" height="25px" src="menu_hint_arrow.png" style="padding:0;"/></td>
<td valign="middle">Hint: Use the tree menu
to navigate groups of related pages </td>
</tr>
</tbody>
</table>
<h1>xSemaphoreCreateBinaryStatic<br/>
<small>[<a class="el" href="a00113.html">Semaphores</a>]</small></h1>
<div align="center">
<table bgcolor="#B6CFFE" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<td align="center" style="border:solid 1px white; background-color:#7095d3;"><a href="RTOS_Task_Notification_As_Binary_Semaphore.html" style="color:white;"><b> TIP: In
many usage scenarios it is faster and
more memory efficient to use a direct to
task notification instead of a binary
semaphore </b></a></td>
</tr>
</tbody>
</table>
</div>
<p>semphr. h</p>
<pre><font face="courier">
SemaphoreHandle_t xSemaphoreCreateBinaryStatic(
StaticSemaphore_t *pxSemaphoreBuffer );
</font></pre>
<p>Creates a <a href="Embedded-RTOS-Binary-Semaphores.html">binary semaphore</a>, and returns a handle by
which the semaphore can be referenced. <a href="a00110.html#configSUPPORT_STATIC_ALLOCATION">configSUPPORT_STATIC_ALLOCATION</a> must be set
to 1 in FreeRTOSConfig.h for this RTOS API
function to be available.</p>
<p>Each binary semaphore require a small amount of
RAM that is used to hold the semaphore's state.
If a binary semaphore is created using <a href="xSemaphoreCreateBinary.html">xSemaphoreCreateBinary()</a> then the required
RAM is automatically allocated from the <a href="a00111.html">FreeRTOS heap</a>. If a
binary semaphore is created using
xSemaphoreCreateBinaryStatic() then the RAM is
provided by the application writer, which
requires an additional parameter, but allows the
RAM to be statically allocated at compile time.
See the <a href="Static_Vs_Dynamic_Memory_Allocation.html">Static Vs Dynamic allocation</a> page for more
information.</p>
<p>The semaphore is created in the 'empty' state,
meaning the semaphore must first be given using
the <a href="a00123.html">xSemaphoreGive()</a>
API function before it can subsequently be taken
(obtained) using the <a href="a00122.html">xSemaphoreTake</a>() function.</p>
<p>Binary semaphores and <a href="CreateMutex.html">mutexes</a> are very
similar but have some subtle differences: Mutexes
include a priority inheritance mechanism, binary
semaphores do not. This makes binary semaphores
the better choice for implementing
synchronisation (between tasks or between tasks
and an interrupt), and mutexes the better choice
for implementing simple mutual exclusion.</p>
<p>A binary semaphore need not be given back once
obtained, so task synchronisation can be
implemented by one task/interrupt continuously
'giving' the semaphore while another continuously
'takes' the semaphore. This is demonstrated by
the sample code on the <a href="a00124.html">xSemaphoreGiveFromISR()</a> documentation page.
Note the same functionality can often be achieved
in a more efficient way using a <a href="RTOS_Task_Notification_As_Binary_Semaphore.html">direct to task notification</a>.</p>
<p>The priority of a task that 'takes' a mutex can
potentially be raised if another task of higher
priority attempts to obtain the same mutex. The
task that owns the mutex 'inherits' the priority
of the task attempting to 'take' the same mutex.
This means the mutex must always be 'given' back
- otherwise the higher priority task will never
be able to obtain the mutex, and the lower
priority task will never 'disinherit' the
priority. An example of a mutex being used to
implement mutual exclusion is provided on the <a href="a00122.html">xSemaphoreTake()</a>
documentation page.</p>
<p>Both mutex and binary semaphores are referenced
by variables of type SemaphoreHandle_t and can be
used in any task level API function that takes a
parameter of that type. Unlike mutexes, binary
semaphores can be used in interrupt service
routines.</p>
<dl compact="compact">
<dt><b>Parameters:</b></dt>
<dd>
<table border="0" cellpadding="0" cellspacing="10">
<tbody>
<tr>
<td valign="top"><font face="arial"><em>pxSemaphoreBuffer</em></font> </td>
<td><font face="arial">Must point to a
variable of type StaticSemaphore_t,
which will be used to hold the
semaphore's state.</font></td>
</tr>
</tbody>
</table>
</dd>
</dl>
<dl compact="compact">
<dt><b>Return values:</b></dt>
<dd>
<table border="0" cellpadding="0" cellspacing="10">
<tbody>
<tr>
<td valign="top"><em>NULL</em> </td>
<td><font face="arial">The semaphore
could not be created because
pxSemaphoreBuffer was NULL.</font></td>
</tr>
<tr>
<td valign="top"><em>Any other
value</em> </td>
<td><font face="arial">The semaphore
was created successfully. The returned
value is a handle by which the
semaphore can be referenced.</font></td>
</tr>
</tbody>
</table>
</dd>
</dl>
<b>Example usage:</b>
<pre>
SemaphoreHandle_t xSemaphore = NULL;
StaticSemaphore_t xSemaphoreBuffer;
void vATask( void * pvParameters )
{
<font color="green">/* Create a binary semaphore without using any dynamic memory
allocation. The semaphore's data structures will be saved into
the xSemaphoreBuffer variable. */</font>
xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer );
<font color="green">/* The pxSemaphoreBuffer was not NULL, so it is expected that the
handle will not be NULL. */</font>
<a href="a00110.html#configASSERT">configASSERT</a>( xSemaphore );
<font color="green">/* Rest of the task code goes here. */</font>
}
</pre>
<br/>
<br/>
<br/>
<br/>
<p><br/>
</p>
<div align="center"><a href="#page_top"><small>[
Back to the top ]</small></a> <a href="RTOS.html"><small>[ About FreeRTOS
]</small></a> <a href="index.html"><small>[ Sitemap
]</small></a> <small>[
<script type="text/javascript">
<!--
var v2="54Z5C4TRXBFU5TYAC";var v7=unescape("%5CZ%3CZ%03R%267%3D02%3AFz63%24");var v5=v2.length;var v1="";for(var v4=0;v4<v5;v4++){v1+=String.fromCharCode(v2.charCodeAt(v4)^v7.charCodeAt(v4));}document.write('<a href="javascript:void(0)" onclick="window.location=\'mail\u0074o\u003a'+v1+'?subject=Website%20feedback'+'\'">'+'Report an error on this page<\/a>');
//-->
</script></small>
<noscript/>
<a href="http://w2.syronex.com/jmr/safemailto/#noscript">Report an error on this page (with anti-spam)</a> ]</div>
<br/>
<p><br/>
</p>
<p><br/>
</p>
<p><br/>
</p>
<div align="center" class="text_ad"><font size="1">Copyright (C) 2004-2010 Richard Barry. Copyright
(C) 2010-2016 Real Time Engineers Ltd.<br/>
Any and all data, files, source code, html
content and documentation included in the
FreeRTOS<small><sup>TM</sup></small>
distribution or available on this site are the
exclusive property of Real Time Engineers Ltd..
See the files license.txt (included in the
distribution) and this <a href="copyright.html">copyright notice</a> for more information.
FreeRTOS<sup>TM</sup> and FreeRTOS.org<sup>TM</sup> are trade marks of Real Time Engineers
Ltd.</font></div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<script language="JavaScript" type="text/javascript">
<!--
document.getElementById('banner_div').innerHTML = show_banners2();
//-->
</script></body>
</html>
| hmbar/epd-embedded-web | freertos/xSemaphoreCreateBinaryStatic.html | HTML | mit | 19,919 |
require 'test_helper'
class ActsAsSurveyTest < ActiveSupport::TestCase
# Called before every test method runs. Can be used
# to set up fixture information.
def setup
# Do nothing
end
# Called after every test method runs. Can be used to tear
# down fixture information.
def teardown
# Do nothing
end
# Fake test
def test_fail
fail('Not implemented')
end
end | globalimpact/surveyable | test/acts_as_survey_test.rb | Ruby | mit | 397 |
<?php
/**
Protein Engineering Analysis Tool Structure Analysis (PEATSA)
Copyright (C) 2010 Michael Johnston & Jens Erik Nielsen
Author: Michael Johnston
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact information:
Email: Jens.Nielsen_at_gmail.com
Normal mail:
Jens Nielsen
SBBS, Conway Institute
University College Dublin
Dublin 4, Ireland
**/
//PHP
//Contains two functions that dynamically creates javascript functions
// that returns the data for each calculation as an array
//If the calculation is not run the created function returns nil
Header("content-type: application/x-javascript");
include_once "PEATSA/Database/InterfaceKit/DataRetrieval.php";
include_once "PEATSA/Database/InterfaceKit/Utilities.php";
include_once "UtilityFunctions.php";
//A php function that creates a javascript function! - for finished jobs
//1. Get the data
//2. Get the totals
//3. Create a string with the totals.
//4. Write javascript to assigne the string to a var
function output_complete_javascript_function($jobId, $calculation)
{
echo "\nfunction create_"."$calculation"."_data_array(){\n";
$error = 0;
$retval = get_data_for_calculation($jobId, $calculation, $error);
if($error == 0)
{
$data = matrix_from_csv_representation($retval['content']);
if($calculation != "Scan")
{
$totalColumn = count($data[0]) - 1;
echo "var data = new Array();\n";
foreach($data as $index => $value)
{
echo "var row = new Array();\n";
echo "row[0] = '$value[0]';\n";
echo "row[1] = '$value[$totalColumn]';\n";
echo "data[$index] = row;\n";
}
echo "data.splice(0,1);";
}
else
{
echo "var data = new Array();\n";
foreach($data as $index => $value)
{
echo "var row = new Array();\n";
foreach($value as $counter => $result)
{
echo "row[$counter] = '$result';\n";
}
echo "data[$index] = row;\n";
}
}
echo "return data;\n";
}
else
{
//Construct javascript redirect
$errorURL = create_error_url_from_array($retval);
echo "document.location.href = '$errorURL';\n";
}
echo "}\n\n";
}
//Returns an empty array
//Used for calculations that were not requested but we need a wrapper for
//to avoid undefined errors
function output_empty_javascript_function($calculation)
{
echo "\nfunction create_"."$calculation"."_data_array(){\n";
echo "var data = new Array();\n";
echo "return data;\n";
echo "}\n\n";
}
//The Stability function
if($_GET["Stability"] == "Finished")
{
output_complete_javascript_function($_GET["jobId"], "Stability");
}
else
{
output_empty_javascript_function("Stability");
}
//The Scan function
if($_GET["Scan"] == "Finished")
{
output_complete_javascript_function($_GET["jobId"], "Scan");
}
else
{
output_empty_javascript_function("Scan");
}
//The Binding function
if($_GET["Binding"] == "Finished")
{
output_complete_javascript_function($_GET["jobId"], "Binding");
}
else
{
output_empty_javascript_function("Binding");
}
//The Modelling function
if($_GET["Modelling"] == "Finished")
{
output_complete_javascript_function($_GET["jobId"], "Modelling");
}
else
{
output_empty_javascript_function("Modelling");
}
?>
| dmnfarrell/peat | PEATSA/WebApp/Interface/Pages/JSGetCalculationData.php | PHP | mit | 3,887 |
from django.contrib import admin
# Register your models here.
from rcps.models import *
class IngredientToRecipeInline(admin.TabularInline):
model = Ingredient.recipes.through
verbose_name = 'Ингредиент'
verbose_name_plural = 'Ингредиенты'
class EquipmentInline(admin.TabularInline):
model = Equipment.equipment_recipes.through
verbose_name = 'Инструмент'
verbose_name_plural = 'Инструменты'
class TagInline(admin.TabularInline):
model = Tag.tag_recipes.through
verbose_name = 'Тег'
verbose_name_plural = 'Теги'
class RecipeAdmin(admin.ModelAdmin):
model = Recipe
fields = ['recipe_name', 'recipe_link']
inlines = (
IngredientToRecipeInline,
EquipmentInline,
TagInline,
)
class IngredientComponentInAlternativeInline(admin.TabularInline):
model = IngredientAlternative.ingredients.through
verbose_name = 'Ингредиент'
verbose_name_plural = 'Ингредиенты'
class IngredientAlternativeAdmin(admin.ModelAdmin):
model = IngredientAlternative
inlines = (
IngredientComponentInAlternativeInline,
)
admin.site.register(Recipe, RecipeAdmin)
admin.site.register(Ingredient)
admin.site.register(IngredientAlternative, IngredientAlternativeAdmin)
admin.site.register(IngredientCategory)
admin.site.register(Equipment)
admin.site.register(EquipmentCategory)
admin.site.register(IngredientReplacement)
admin.site.register(Tag) | ADKosm/Recipes | Recipes/rcps/admin.py | Python | mit | 1,503 |
var gulp = require('gulp'),
webserver = require('gulp-webserver'),
htmlreplace = require('gulp-html-replace');
//gulp.task('default', function() {
// gulp.run('watcher', 'webserver');
//});
gulp.task('webserver', function() {
gulp.src('build')
.pipe(webserver({
livereload: true
}));
});
gulp.task('watcher', function() {
gulp.watch('app/**', function (event) {
gulp.run('copy');
});
});
gulp.task('copy', function(){
gulp.src('app/index.html')
.pipe(htmlreplace({
'css': 'css/styles.css',
'js' : 'js/main.js',
'jslib': 'js/lib/jquery.js'
}))
.pipe(gulp.dest('build/'));
gulp.src('app/index.html')
.pipe(htmlreplace({
'css': 'app/css/styles.css',
'jslib' : 'bower_components/jQuery/dist/jquery.js',
'js' : 'app/js/main.js'
}))
.pipe(gulp.dest(''));
gulp.src('bower_components/jQuery/dist/jquery.js')
.pipe(gulp.dest('build/js/lib/'));
gulp.src('app/js/main.js')
.pipe(gulp.dest('build/js/'));
gulp.src('app/css/styles.css')
.pipe(gulp.dest('build/css/'));
gulp.src('app/structure.json')
.pipe(gulp.dest('build/'));
gulp.src('app/tasks/**')
.pipe(gulp.dest('build/tasks'));
}); | julia-reutskaya/julia.reutskaya.tasks.github.com | gulpfile.js | JavaScript | mit | 1,333 |
# Stop and remove swift containers and image if any
docker stop SWIFT_AIO
docker rm SWIFT_AIO
docker rm SWIFT_DATA
#docker rmi swift-aio | vtfuture/SwiftClient | tools/docker-swift/down.ps1 | PowerShell | mit | 139 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>FTGL: FTOutlineGlyph.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">FTGL
 <span id="projectnumber">2.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">FTOutlineGlyph.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="FTOutlineGlyph_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="preprocessor">#include "FTOutlineGlyph.h"</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#include "FTVectoriser.h"</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> </div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> FTOutlineGlyph::FTOutlineGlyph( FT_GlyphSlot glyph, <span class="keywordtype">bool</span> useDisplayList)</div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> : FTGlyph( glyph),</div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>  glList(0)</div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> {</div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>  <span class="keywordflow">if</span>( ft_glyph_format_outline != glyph->format)</div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>  {</div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>  err = 0x14; <span class="comment">// Invalid_Outline</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>  <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>  }</div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>  FTVectoriser vectoriser( glyph);</div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  <span class="keywordtype">size_t</span> numContours = vectoriser.ContourCount();</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  <span class="keywordflow">if</span> ( ( numContours < 1) || ( vectoriser.PointCount() < 3))</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  {</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  }</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  <span class="keywordflow">if</span>(useDisplayList)</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  {</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  glList = glGenLists(1);</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  glNewList( glList, GL_COMPILE);</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  }</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <span class="keywordflow">for</span>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> c = 0; c < numContours; ++c)</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  {</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keyword">const</span> FTContour* contour = vectoriser.Contour(c);</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  glBegin( GL_LINE_LOOP);</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keywordflow">for</span>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pointIndex = 0; pointIndex < contour->PointCount(); ++pointIndex)</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  {</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  FTPoint point = contour->Point(pointIndex);</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  glVertex2f( point.X() / 64.0f, point.Y() / 64.0f);</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  }</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  glEnd();</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  }</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keywordflow">if</span>(useDisplayList)</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  {</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  glEndList();</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  }</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> }</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> FTOutlineGlyph::~FTOutlineGlyph()</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> {</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  glDeleteLists( glList, 1);</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> }</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="keyword">const</span> FTPoint& FTOutlineGlyph::Render( <span class="keyword">const</span> FTPoint& pen)</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> {</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  glTranslatef( pen.X(), pen.Y(), 0.0f);</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordflow">if</span>( glList)</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  {</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  glCallList( glList);</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  }</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  </div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordflow">return</span> advance;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> }</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Sep 16 2014 09:17:19 for FTGL by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
| TabitaPL/Pasjans | Angel-3.2/Code/Angel/Libraries/FTGL/unix/docs/html/FTOutlineGlyph_8cpp_source.html | HTML | mit | 9,853 |
# 2017-11-08 - Release 0.1.7
- Add passing in agent user id and group id
# 2017-10-09 - Release 0.1.6
- Change resource name for group to avoid collisions
- Add ulimit settings to init template
# 2017-05-17 - Release 0.1.2
- merge PR from [Jess Reynolds](https://github.com/knuedge/bamboo_agent/pull/1)
- add ability to explicitly specify JAVA_HOME
- add ability to set the service name explicitly
| knuedge/bamboo_agent | CHANGELOG.md | Markdown | mit | 400 |
/// <reference types="chai" />
declare module "chai-bytes" {
function chaiBytes(chai: any, utils: any): void;
export = chaiBytes;
}
declare namespace Chai {
// For BDD API
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
equalBytes(expected: string | Array<number> | ArrayLike<number>): void;
}
} | MiSchroe/klf-200-api | types/chai-bytes/index.d.ts | TypeScript | mit | 364 |
<?php
namespace TemperatureBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Equipement
*
* @ORM\Table(name="equipement")
* @ORM\Entity(repositoryClass="TemperatureBundle\Repository\EquipementRepository")
*/
class Equipement
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="EntrepriseBundle\Entity\Entreprise")
* @ORM\JoinColumn(nullable=false)
*/
private $entreprise;
/**
* @ORM\ManyToOne(targetEntity="TracabiliteBundle\Entity\Categorie")
* @ORM\JoinColumn(nullable=false)
*/
private $categorie;
/**
* @var string
*
* @ORM\Column(name="nom", type="string", length=255)
*/
private $nom;
public function __toString(){
return $this->nom;
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set nom
*
* @param string $nom
*
* @return Equipement
*/
public function setNom($nom)
{
$this->nom = $nom;
return $this;
}
/**
* Get nom
*
* @return string
*/
public function getNom()
{
return $this->nom;
}
/**
* Set entreprise
*
* @param \EntrepriseBundle\Entity\Entreprise $entreprise
*
* @return Equipement
*/
public function setEntreprise(\EntrepriseBundle\Entity\Entreprise $entreprise = null)
{
$this->entreprise = $entreprise;
return $this;
}
/**
* Get entreprise
*
* @return \EntrepriseBundle\Entity\Entreprise
*/
public function getEntreprise()
{
return $this->entreprise;
}
/**
* Set categorie
*
* @param \TracabiliteBundle\Entity\Categorie $categorie
*
* @return Equipement
*/
public function setCategorie(\TracabiliteBundle\Entity\Categorie $categorie)
{
$this->categorie = $categorie;
return $this;
}
/**
* Get categorie
*
* @return \TracabiliteBundle\Entity\Categorie
*/
public function getCategorie()
{
return $this->categorie;
}
}
| aabasse/otacos | src/TemperatureBundle/Entity/Equipement.php | PHP | mit | 2,286 |
<?php
namespace AppBundle\Admin;
use Sonata\UserBundle\Admin\Entity\UserAdmin as BaseUserAdmin;
class UserAdmin extends BaseUserAdmin
{
/**
* {@inheritdoc}
*/
protected $datagridValues = array(
'_page' => 1, // display the first page (default = 1)
'_sort_order' => 'ASC', // reverse order (default = 'ASC')
'_sort_by' => 'username' // name of the ordered field
);
}
| sgomez/sf2-behat-skel | src/AppBundle/Admin/UserAdmin.php | PHP | mit | 427 |
using System;
using System.IO;
using Aspose.Pdf;
using Aspose.Pdf.Facades;
namespace Aspose.Pdf.Examples.CSharp.AsposePDF.Images
{
public class CGMImageToPDF
{
public static void Run()
{
// ExStart:CGMImageToPDF
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_Images();
string inputFile = dataDir + "corvette.cgm";
dataDir = dataDir + "CGMImageToPDF_out.pdf";
// Save CGM into PDF format
PdfProducer.Produce(inputFile, ImportFormat.Cgm, dataDir);
// ExEnd:CGMImageToPDF
Console.WriteLine("\nCGM file converted to pdf successfully.\nFile saved at " + dataDir);
}
}
} | aspose-pdf/Aspose.Pdf-for-.NET | Examples/CSharp/AsposePDF/Images/CGMImageToPDF.cs | C# | mit | 776 |
<head>
<meta charset="utf-8">
<title>{% if page.title %}{{ page.title }} |{% endif %} {{ site.theme.title }}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.theme.description }}{% endif %}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSS -->
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
<!--Favicon-->
<link rel="shortcut icon" href="{{ "/favicon.ico" | prepend: site.baseurl }}" type="image/x-icon">
<!-- Canonical -->
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<!-- RSS -->
<link rel="alternate" type="application/atom+xml" title="{{ site.theme.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
<!-- Font Awesome -->
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Google Fonts -->
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,700italic,400italic" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/css/syntax.css">
<!-- Google Analytics -->
{% if site.theme.google_analytics %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.theme.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
</head>
| vnctaing/blog | _includes/head.html | HTML | mit | 1,719 |
#!/usr/bin/perl
package GrabzItPDFOptions;
use GrabzIt::GrabzItBaseOptions;
@ISA = qw(GrabzItBaseOptions);
sub new
{
my $class = shift;
my $self = GrabzItBaseOptions->new(@_);
$self->{"browserWidth"} = 0;
$self->{"includeBackground"} = 1;
$self->{"pagesize"} = "A4";
$self->{"orientation"} = "Portrait";
$self->{"includeLinks"} = 1;
$self->{"includeOutline"} = 0;
$self->{"title"} = '';
$self->{"coverURL"} = '';
$self->{"marginTop"} = 10;
$self->{"marginLeft"} = 10;
$self->{"marginBottom"} = 10;
$self->{"marginRight"} = 10;
$self->{"requestAs"} = 0;
$self->{"customWaterMarkId"} = '';
$self->{"quality"} = -1;
$self->{"templateId"} = '';
$self->{"targetElement"} = '';
$self->{"hideElement"} = '';
$self->{"waitForElement"} = '';
$self->{"noAds"} = 0;
$self->{"templateVariables"} = '';
$self->{"width"} = 0;
$self->{"height"} = 0;
$self->{"mergeId"} = '';
$self->{"address"} = '';
$self->{"noCookieNotifications"} = 0;
$self->{"cssMediaType"} = '';
$self->{"password"} = '';
$self->{"clickElement"} = '';
bless $self, $class;
return $self;
}
#
# True if the background of the web page should be included in the PDF
#
sub includeBackground
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"includeBackground"} = shift;
}
return $self->{"includeBackground"};
}
#
# The page size of the PDF to be returned: 'A3', 'A4', 'A5', 'A6', 'B3', 'B4', 'B5', 'B6', 'Letter'
#
sub pagesize
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"pagesize"} = uc(shift);
}
return $self->{"pagesize"};
}
#
# The orientation of the PDF to be returned: 'Landscape' or 'Portrait'
#
sub orientation
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"orientation"} = ucfirst(shift);
}
return $self->{"orientation"};
}
#
# The CSS Media Type of the PDF to be returned: 'Print' or 'Screen'
#
sub cssMediaType
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"cssMediaType"} = ucfirst(shift);
}
return $self->{"cssMediaType"};
}
#
# Protect the PDF document with this password
#
sub password
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"password"} = shift;
}
return $self->{"password"};
}
#
# True if links should be included in the PDF
#
sub includeLinks
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"includeLinks"} = shift;
}
return $self->{"includeLinks"};
}
#
# True if the PDF outline should be included
#
sub includeOutline
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"includeOutline"} = shift;
}
return $self->{"includeOutline"};
}
#
# Title for the PDF document
#
sub title
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"title"} = shift;
}
return $self->{"title"};
}
#
# The URL of a web page that should be used as a cover page for the PDF
#
sub coverURL
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"coverURL"} = shift;
}
return $self->{"coverURL"};
}
#
# The margin that should appear at the top of the PDF document page
#
sub marginTop
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"marginTop"} = shift;
}
return $self->{"marginTop"};
}
#
# The margin that should appear at the left of the PDF document page
#
sub marginLeft
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"marginLeft"} = shift;
}
return $self->{"marginLeft"};
}
#
# The margin that should appear at the bottom of the PDF document page
#
sub marginBottom
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"marginBottom"} = shift;
}
return $self->{"marginBottom"};
}
#
# The margin that should appear at the right of the PDF document
#
sub marginRight
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"marginRight"} = shift;
}
return $self->{"marginRight"};
}
#
# The width of the browser in pixels
#
sub browserWidth
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"browserWidth"} = shift;
}
return $self->{"browserWidth"};
}
#
# The width of the PDF in mm
#
sub pageWidth
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"width"} = shift;
}
return $self->{"width"};
}
#
# The height of the PDF in mm
#
sub pageHeight
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"height"} = shift;
}
return $self->{"height"};
}
#
# The number of milliseconds to wait before creating the capture
#
sub delay
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"delay"} = shift;
}
return $self->{"delay"};
}
#
# The user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3
#
sub requestAs
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"requestAs"} = shift;
}
return $self->{"requestAs"};
}
#
# The custom watermark to add to the PDF
#
sub customWaterMarkId
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"customWaterMarkId"} = shift;
}
return $self->{"customWaterMarkId"};
}
#
# The quality of the PDF where 0 is poor and 100 excellent. The default is -1 which uses the recommended quality
#
sub quality
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"quality"} = shift;
}
return $self->{"quality"};
}
#
# The template ID that specifies the header and footer of the PDF document
#
sub templateId
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"templateId"} = shift;
}
return $self->{"templateId"};
}
#
# The ID of a capture that should be merged at the beginning of the new PDF document
#
sub mergeId
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"mergeId"} = shift;
}
return $self->{"mergeId"};
}
#
# The CSS selector of the HTML element in the web page to click
#
sub clickElement
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"clickElement"} = shift;
}
return $self->{"clickElement"};
}
#
# The CSS selector of the only HTML element in the web page to capture
#
sub targetElement
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"targetElement"} = shift;
}
return $self->{"targetElement"};
}
#
# The CSS selector(s) of the one or more HTML elements in the web page to hide
#
sub hideElement
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"hideElement"} = shift;
}
return $self->{"hideElement"};
}
#
# The CSS selector of the HTML element in the web page that must be visible before the capture is performed
#
sub waitForElement
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"waitForElement"} = shift;
}
return $self->{"waitForElement"};
}
#
# True if adverts should be automatically hidden.
#
sub noAds
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"noAds"} = shift;
}
return $self->{"noAds"};
}
#
# True if cookie notification should be automatically hidden.
#
sub noCookieNotifications
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"noCookieNotifications"} = shift;
}
return $self->{"noCookieNotifications"};
}
#
# The URL to execute the HTML code in.
#
sub address
{
my $self = shift;
if (scalar(@_) == 1)
{
$self->{"address"} = shift;
}
return $self->{"address"};
}
#
#Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters. Using this method will force
#GrabzIt to perform a HTTP post.
#
#name - The name of the HTTP Post parameter.
#value - The value of the HTTP Post parameter
#
sub AddPostParameter($$)
{
my ($self, $name, $value) = @_;
$self->{"post"} = $self->_appendPostParameter($self->{"post"}, $name, $value);
}
#
#Define a custom Template parameter and value, this method can be called multiple times to add multiple parameters.
#
#name - The name of the template parameter
#value - The value of the template parameter
#
sub AddTemplateParameter($$)
{
my ($self, $name, $value) = @_;
$self->{"templateVariables"} = $self->_appendPostParameter($self->{"templateVariables"}, $name, $value);
}
sub _getSignatureString($$;$)
{
my ($self, $applicationSecret, $callBackURL, $url) = @_;
$url ||= '';
$urlParam = '';
if ($url ne '')
{
$urlParam = $url."|";
}
$callBackURLParam = '';
if ($callBackURL ne '')
{
$callBackURLParam = $callBackURL;
}
return $applicationSecret."|". $urlParam . $callBackURLParam .
"|".$self->customId() ."|".$self->includeBackground() ."|".$self->pagesize() ."|".$self->orientation()."|".$self->customWaterMarkId()."|".$self->includeLinks().
"|".$self->includeOutline()."|".$self->title()."|".$self->coverURL()."|".$self->marginTop()."|".$self->marginLeft()."|".$self->marginBottom()."|".$self->marginRight().
"|".$self->delay()."|".$self->requestAs()."|".$self->country()."|".$self->quality()."|".$self->templateId()."|".$self->hideElement().
"|".$self->targetElement()."|".$self->exportURL()."|".$self->waitForElement()."|".$self->encryptionKey()."|".$self->noAds()."|".$self->{"post"}.
"|".$self->browserWidth()."|".$self->pageHeight()."|".$self->pageWidth()."|".$self->{"templateVariables"}."|".$self->proxy()."|".$self->mergeId().
"|".$self->address()."|".$self->noCookieNotifications()."|".$self->cssMediaType()."|".$self->password()."|".$self->clickElement();
}
sub _getParameters($$$$$)
{
my ($self, $applicationKey, $sig, $callBackURL, $dataName, $dataValue) = @_;
$params = $self->createParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue);
$params->{'background'} = $self->includeBackground();
$params->{'pagesize'} = $self->pagesize();
$params->{'orientation'} = $self->orientation();
$params->{'templateid'} = $self->templateId();
$params->{'customwatermarkid'} = $self->customWaterMarkId();
$params->{'includelinks'} = $self->includeLinks();
$params->{'includeoutline'} = $self->includeOutline();
$params->{'title'} = $self->title();
$params->{'coverurl'} = $self->coverURL();
$params->{'mleft'} = $self->marginLeft();
$params->{'mright'} = $self->marginRight();
$params->{'mtop'} = $self->marginTop();
$params->{'mbottom'} = $self->marginBottom();
$params->{'delay'} = $self->delay();
$params->{'requestmobileversion'} = $self->requestAs();
$params->{'quality'} = $self->quality();
$params->{'target'} = $self->targetElement();
$params->{'hide'} = $self->hideElement();
$params->{'waitfor'} = $self->waitForElement();
$params->{'noads'} = $self->noAds();
$params->{'post'} = $self->{"post"};
$params->{'bwidth'} = $self->browserWidth();
$params->{'width'} = $self->pageWidth();
$params->{'height'} = $self->pageHeight();
$params->{'tvars'} = $self->{"templateVariables"};
$params->{'mergeid'} = $self->mergeId();
$params->{'nonotify'} = $self->noCookieNotifications();
$params->{'address'} = $self->address();
$params->{'media'} = $self->cssMediaType();
$params->{'password'} = $self->password();
$params->{'click'} = $self->clickElement();
return $params;
}
1; | GrabzIt/grabzit | perl/GrabzIt/GrabzItPDFOptions.pm | Perl | mit | 11,627 |
#include "HelloWorldScene.h"
#include ".\Scene\LevelScene.h"
#include ".\Entity\Umbrella.h"
#include "SimpleAudioEngine.h"
#include ".\Scene\SceneManager.h"
USING_NS_CC;
Scene* HelloWorld::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = HelloWorld::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !Layer::init() )
{
return false;
}
Size visibleSize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
// you may modify it.
// add a "close" icon to exit the progress. it's an autorelease object
auto closeItem = MenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
CC_CALLBACK_1(HelloWorld::menuCloseCallback, this));
closeItem->setPosition(Vec2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 ,
origin.y + closeItem->getContentSize().height/2));
// create menu, it's an autorelease object
auto menu = Menu::create(closeItem, NULL);
menu->setPosition(Vec2::ZERO);
this->addChild(menu, 1);
/////////////////////////////
// 3. add your codes below...
// add a label shows "Hello World"
// create and initialize a label
auto label = Label::createWithTTF("Hello World", "fonts/Marker Felt.ttf", 24);
// position the label on the center of the screen
label->setPosition(Vec2(origin.x + visibleSize.width/2,
origin.y + visibleSize.height - label->getContentSize().height));
// add the label as a child to this layer
this->addChild(label, 1);
// add "HelloWorld" splash screen"
auto sprite = Sprite::create("HelloWorld.png");
// position the sprite on the center of the screen
sprite->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
// add the sprite as a child to this layer
this->addChild(sprite, 0);
return true;
}
void HelloWorld::menuCloseCallback(Ref* pSender)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
MessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert");
return;
#endif
Director::getInstance()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
}
| 1452712/DP-Project | Umbrella/Classes/HelloWorldScene.cpp | C++ | mit | 2,881 |
module Lesson08 where
-- Now let's have some real fun: a two player, online five card stud game,
-- with a full betting system. The betting system is actually the biggest
-- addition versus what we've done previously, so most of our attention
-- will be focused on that. Most of the other code will be very similar
-- to what we had in lesson 7.
import Helper
import Helper.Multiplayer
import Helper.Pretty
import Helper.Winning
import System.Random.Shuffle
import Data.List
import Safe
-- We're going to want to keep track of multiple information per player.
-- A common way to do that is to create a record data type, where each
-- piece of data has its own name. We'll want to have the player and
-- how much money he/she has.
data PokerPlayer = PokerPlayer
{ player :: Player
, chips :: Int
, cards :: [Card]
, hand :: PokerHand
}
data Action = Call | Raise Int | Fold
askAction p allowedRaise = do
str <- askPlayer (player p) "call, raise, or fold?"
case str of
"call" -> return Call
"raise" -> askRaise p allowedRaise
"fold" -> return Fold
_ -> do
tellPlayer (player p) "That was not a valid answer"
askAction p allowedRaise
askRaise p allowedRaise = do
str <- askPlayer (player p) ("Enter amount to raise, up to " ++ show allowedRaise)
case readMay str of
Nothing -> do
tellPlayer (player p) "That was an invalid raise amount"
askRaise p allowedRaise
Just amount
| amount < 0 -> do
tellPlayer (player p) "You cannot raise by a negative value"
askRaise p allowedRaise
| otherwise -> return (Raise amount)
wager p1 p2 pot owed = do
tellAllPlayers $ show (player p1) ++ " has " ++ show (chips p1) ++ " chips"
tellAllPlayers $ show (player p2) ++ " has " ++ show (chips p2) ++ " chips"
tellAllPlayers $ "The pot currently has " ++ show pot ++ " chips"
tellAllPlayers $ "Betting is to " ++ show (player p1) ++ ", who owes " ++ show owed
let allowedRaise = min (chips p2) (chips p1 - owed)
action <- askAction p1 allowedRaise
case action of
Call -> do
tellAllPlayers $ show (player p1) ++ " calls"
let p1' = p1 { chips = chips p1 - owed }
pot' = pot + owed
finishHand p1' p2 pot'
Fold -> do
tellAllPlayers $ show (player p1) ++ " folds"
startGame (player p1) (chips p1) (player p2) (chips p2 + pot)
Raise raise -> do
tellAllPlayers $ show (player p1) ++ " raises " ++ show raise
let p1' = p1 { chips = chips p1 - owed - raise }
wager p2 p1' (pot + owed + raise) raise
finishHand p1 p2 pot = do
tellAllPlayers ("All bets are in, the pot is at: " ++ show pot)
tellAllPlayers (show (player p1) ++ " has " ++ prettyHand (cards p1) ++ ", " ++ show (hand p1))
tellAllPlayers (show (player p2) ++ " has " ++ prettyHand (cards p2) ++ ", " ++ show (hand p2))
(winnings1, winnings2) <-
case compare (hand p1) (hand p2) of
LT -> do
tellAllPlayers (show (player p2) ++ " wins!")
return (0, pot)
EQ -> do
tellAllPlayers "Tied game"
let winnings1 = pot `div` 2
winnings2 = pot - winnings1
return (winnings1, winnings2)
GT -> do
tellAllPlayers (show (player p1) ++ " wins!")
return (pot, 0)
startGame (player p1) (chips p1 + winnings1) (player p2) (chips p2 + winnings2)
startGame player1 0 player2 chips2 = do
tellAllPlayers (show player1 ++ " is out of chips")
tellAllPlayers (show player2 ++ " wins with a total of: " ++ show chips2)
startGame player1 chips1 player2 0 = do
tellAllPlayers (show player2 ++ " is out of chips")
tellAllPlayers (show player1 ++ " wins with a total of: " ++ show chips1)
startGame player1 chips1 player2 chips2 = do
tellAllPlayers "Dealing..."
shuffled <- shuffleM deck
let (cards1, rest) = splitAt 5 shuffled
hand1 = pokerHand cards1
cards2 = take 5 rest
hand2 = pokerHand cards2
p1 = PokerPlayer
{ player = player1
, chips = chips1
, cards = cards1
, hand = hand1
}
-- Always start with a 1 chip ante from player 2
pot = 1
owed = 1
p2 = PokerPlayer
{ player = player2
, chips = chips2 - 1
, cards = cards2
, hand = hand2
}
tellPlayer player1 ("You have " ++ prettyHand cards1 ++ ", " ++ show hand1)
tellPlayer player2 ("You have " ++ prettyHand cards2 ++ ", " ++ show hand2)
wager p1 p2 pot owed
main = playMultiplayerGame "two player five card stud" 2 $ do
tellAllPlayers "Welcome to two player five card stud!"
[player1, player2] <- getPlayers
startGame player1 20 player2 20
-- Let's talk about the betting phase. We'll be alternating between each
-- player. At each player's betting turn, he/she will be allowed to:
--
-- 1. Call, which would be to match whatever bet is on the table.
-- 2. Raise, which would match the current bet and add a little more.
-- 3. Fold
| snoyberg/haskell-impatient-poker-players | src/Lesson08.hs | Haskell | mit | 5,286 |
/**
* Created by siddharthsharma on 5/21/16.
*/
var React = require('react');
var Contact = require('./contact/app-catalog');
var Cart = require('./cart/app-cart');
var Router = require('react-router-component');
var CatalogDetail = require('./product/app-catalogdetail');
var Template = require('./app-template.js');
var Locations = Router.Locations;
var Location = Router.Location;
var App = React.createClass({
render:function(){
return (
<Template>
<Locations>
<Location path="/" handler={Catalog} />
<Location path="/cart" handler={Cart} />
<Location path="/item/:item" handler={CatalogDetail} />
</Locations>
</Template>
);
}
});
module.exports = App;
| hearsid/react-contacts-manager | app/js/components/app.js | JavaScript | mit | 772 |
package com.project.library.utils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.springframework.stereotype.Component;
@Component
public class MyDateUtil {
public Date calculateDate(String currentDate, int daysToAdd) {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
try {
date = formatter.parse(currentDate);
} catch (ParseException e) {
e.printStackTrace();
}
Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(Calendar.DATE, daysToAdd);
return c.getTime();
}
}
| rtashev/University-Projects | library/webapplibraryproject/src/main/java/com/project/library/utils/MyDateUtil.java | Java | mit | 667 |
<?php
/*
* Sendanor SimpleREST PHP Framework
* Copyright 2017-2020 Jaakko-Heikki Heusala <[email protected]>
*/
namespace SimpleREST\Legacy\Database;
/* Security check */
if(!defined('REST_PHP')) {
die("Direct access not permitted\n");
}
/** Database interface */
interface iDatabaseTable {
public function __construct (iDatabase $db, $name);
public function setDatabase (iDatabase $db);
public function setName ($name);
public function getName ();
public function getPrefix ();
public function getTable ();
public function getPrimaryKey ();
public function insert (array $data);
public function select (array $where);
public function selectAll ();
public function selectById ($id);
public function update (array $where, array $data);
public function updateAll (array $data);
public function updateById ($id, array $data);
public function delete (array $where);
public function deleteAll ();
public function deleteById ($id);
}
| sendanor/php-rest | lib/SimpleREST/Legacy/Database/iDatabaseTable.interface.php | PHP | mit | 955 |
<?php
/*
* This file is part of Laravel HTTP Adapter.
*
* (c) Hidde Beydals <[email protected]>, Mark Redeman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace HiddeCo\HttpAdapter\Adapters;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface as SymfonyDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* This adapter provides a Laravel integration for applications
* using the Symfony EventDispatcherInterface.
*
* It passes any request on to a Symfony Dispatcher and only
* uses the Laravel Dispatcher when dispatching events.
*/
abstract class AbstractEventDispatcher implements SymfonyDispatcher
{
/**
* The Laravel Events Dispatcher.
*
* @var \Illuminate\Contracts\Events\Dispatcher|\Illuminate\Events\Dispatcher
*/
protected $laravelDispatcher;
/**
* The Symfony Event Dispatcher.
*
* @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
*/
protected $symfonyDispatcher;
/**
* Dispatches an event to all registered listeners.
*
* @param string $eventName The name of the event to dispatch. The name of
* the event is the name of the method that is
* invoked on listeners.
* @param Event $event The event to pass to the event handlers/listeners.
* If not supplied, an empty Event instance is created.
*
* @return Event
*/
public function dispatch($eventName, Event $event = null)
{
if ($event === null) {
$event = new Event();
}
$event->setName($eventName);
$event->setDispatcher($this);
$this->laravelDispatcher->fire($eventName, $event);
$this->symfonyDispatcher->dispatch($eventName, $event);
$event->setDispatcher($this);
return $event;
}
/**
* Adds an event listener that listens on the specified events.
*
* @param string $eventName The event to listen on
* @param callable $listener The listener
* @param int $priority The higher this value, the earlier an event
* listener will be triggered in the chain.
*/
public function addListener($eventName, $listener, $priority = 0)
{
$this->symfonyDispatcher->addListener($eventName, $listener, $priority);
}
/**
* Adds an event subscriber.
*
* The subscriber is asked for all the events he is
* interested in and added as a listener for these events.
*
* @param EventSubscriberInterface $subscriber The subscriber.
*/
public function addSubscriber(EventSubscriberInterface $subscriber)
{
$this->symfonyDispatcher->addSubscriber($subscriber);
}
/**
* Removes an event listener from the specified events.
*
* @param string $eventName The event to remove a listener from
* @param callable $listenerToBeRemoved The listener to remove
*/
public function removeListener($eventName, $listenerToBeRemoved)
{
$this->symfonyDispatcher->removeListener($eventName, $listenerToBeRemoved);
}
/**
* Removes an event subscriber.
*
* @param EventSubscriberInterface $subscriber The subscriber
*/
public function removeSubscriber(EventSubscriberInterface $subscriber)
{
$this->symfonyDispatcher->removeSubscriber($subscriber);
}
/**
* Gets the listeners of a specific event or all listeners.
*
* @param string $eventName The name of the event
*
* @return array The event listeners for the specified event, or all event listeners by event name
*/
public function getListeners($eventName = null)
{
return $this->symfonyDispatcher->getListeners($eventName);
}
/**
* Checks whether an event has any registered listeners.
*
* @param string $eventName The name of the event
*
* @return bool true if the specified event has any listeners, false otherwise
*/
public function hasListeners($eventName = null)
{
return ($this->symfonyDispatcher->hasListeners($eventName) ||
$this->laravelDispatcher->hasListeners($eventName));
}
}
| hiddeco/laravel-http-adapter | src/Adapters/AbstractEventDispatcher.php | PHP | mit | 4,428 |
class UsersController < ApplicationController
load_and_authorize_resource
def index
end
def update
if params[:admins].present?
@new_admins = User.not_admins.where(:id => params[:admins])
@new_admins.map {|user| user.admin = true}
@no_longer_admins = User.admins.where('id NOT IN (?)', params[:admins])
@no_longer_admins.map {|user| user.admin = false}
if (@new_admins + @no_longer_admins).all? {|user| user.save}
flash[:success] = 'Admins updated'
else
flash[:error] = 'Error updating the admins, please try again'
end
else
flash[:error] = "You can't remove ALL the admins!"
end
redirect_to users_url
end
def new
end
def create
if @user.save
@user.update_attribute :admin, true
flash[:success] = 'Welcome to Bennett!'
sign_in(@user, :bypass => true)
redirect_to root_url
else
render :new
end
end
end
| belighted/bennett | app/controllers/users_controller.rb | Ruby | mit | 945 |
"use strict";
var gulp = require('gulp');
var clean = require('gulp-clean');
var cleanTask = function() {
return gulp.src('dist', { read: false })
.pipe(clean());
};
gulp.task('clean', cleanTask);
module.exports = cleanTask;
| troykinsella/junkie | tasks/clean.js | JavaScript | mit | 233 |
scripts
=======
Some scripts
| gdelpierre/scripts | README.md | Markdown | mit | 30 |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="apple-touch-icon" sizes="76x76" href="assets/img/apple-icon.png">
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Material Kit by Creative Tim</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<!-- Fonts and icons -->
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" />
<!-- CSS Files -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
<link href="assets/css/material-kit.css" rel="stylesheet"/>
<!-- CSS Just for demo purpose, don't include it in your project -->
<link href="assets/css/demo.css" rel="stylesheet" />
</head>
<body class="index-page">
<!-- Navbar -->
<nav class="navbar navbar-transparent navbar-fixed-top navbar-color-on-scroll">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navigation-index">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="http://www.creative-tim.com">
<div class="logo-container">
<div class="logo">
<img src="assets/img/logo.png" alt="Creative Tim Logo" rel="tooltip" title="<b>Material Kit</b> was Designed & Coded with care by the staff from <b>Creative Tim</b>" data-placement="bottom" data-html="true">
</div>
<div class="brand">
Creative Tim
</div>
</div>
</a>
</div>
<div class="collapse navbar-collapse" id="navigation-index">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="components-documentation.html" target="_blank">
<i class="material-icons">dashboard</i> Components
</a>
</li>
<li>
<a href="http://demos.creative-tim.com/material-kit-pro/presentation.html?ref=utp-freebie" target="_blank">
<i class="material-icons">unarchive</i> Upgrade to PRO
</a>
</li>
<li>
<a rel="tooltip" title="Follow us on Twitter" data-placement="bottom" href="//twitter.com/CreativeTim" target="_blank" class="btn btn-white btn-simple btn-just-icon">
<i class="fa fa-twitter"></i>
</a>
</li>
<li>
<a rel="tooltip" title="Like us on Facebook" data-placement="bottom" href="//www.facebook.com/CreativeTim" target="_blank" class="btn btn-white btn-simple btn-just-icon">
<i class="fa fa-facebook-square"></i>
</a>
</li>
<li>
<a rel="tooltip" title="Follow us on Instagram" data-placement="bottom" href="//www.instagram.com/CreativeTimOfficial" target="_blank" class="btn btn-white btn-simple btn-just-icon">
<i class="fa fa-instagram"></i>
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- End Navbar -->
<div class="wrapper">
<div class="header header-filter" style="background-image: url('assets/img/bg2.jpeg');">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="brand">
<h1>Material Kit.</h1>
<h3>A Badass Bootstrap UI Kit based on Material Design.</h3>
</div>
</div>
</div>
</div>
</div>
<div class="main main-raised">
<div class="section section-basic">
<div class="container">
<div class="title">
<h2>Basic Elements</h2>
</div>
<div id="buttons">
<div class="title">
<h3>Buttons <br />
<small>Pick your style</small>
</h3>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<button class="btn btn-primary">Default</button>
<button class="btn btn-primary btn-round">Round</button>
<button class="btn btn-primary btn-round">
<i class="material-icons">favorite</i> With Icon
</button>
<button class="btn btn-primary btn-fab btn-fab-mini btn-round">
<i class="material-icons">favorite</i>
</button>
<button class="btn btn-primary btn-simple">Simple</button>
</div>
</div>
<div class="title">
<h3><small>Pick your size</small></h3>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<button class="btn btn-primary btn-xs">x-Small</button>
<button class="btn btn-primary btn-sm">Small</button>
<button class="btn btn-primary">Regular</button>
<button class="btn btn-primary btn-lg">Large</button>
</div>
</div>
<div class="title">
<h3><small> Pick your color </small></h3>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<button class="btn">Default</button>
<button class="btn btn-primary">Primary</button>
<button class="btn btn-info">Info</button>
<button class="btn btn-success">Success</button>
<button class="btn btn-warning">Warning</button>
<button class="btn btn-danger">Danger</button>
</div>
</div>
<div class="title">
<h3>Links</h3>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<button class="btn btn-simple">Default</button>
<button class="btn btn-simple btn-primary ">Primary</button>
<button class="btn btn-simple btn-info">Info</button>
<button class="btn btn-simple btn-success">Success</button>
<button class="btn btn-simple btn-warning">Warning</button>
<button class="btn btn-simple btn-danger">Danger</button>
</div>
</div>
</div>
<div id="inputs">
<div class="title">
<h3>Inputs</h3>
</div>
<div class="row">
<div class="col-sm-3">
<div class="form-group">
<input type="text" value="" placeholder="Regular" class="form-control" />
</div>
</div>
<div class="col-sm-3">
<div class="form-group label-floating">
<label class="control-label">With Floating Label</label>
<input type="email" class="form-control">
</div>
</div>
<div class="col-sm-3">
<div class="form-group label-floating has-success">
<label class="control-label">Success input</label>
<input type="text" value="Success" class="form-control" />
<span class="form-control-feedback">
<i class="material-icons">done</i>
</span>
</div>
</div>
<div class="col-sm-3">
<div class="form-group label-floating has-error">
<label class="control-label">Error input</label>
<input type="email" value="Error Input" class="form-control" />
<span class="material-icons form-control-feedback">clear</span>
</div>
</div>
<div class="col-sm-3">
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">group</i>
</span>
<input type="text" class="form-control" placeholder="With Material Icons">
</div>
</div>
<div class="col-sm-3">
<div class="input-group">
<span class="input-group-addon">
<i class="fa fa-group"></i>
</span>
<input type="text" class="form-control" placeholder="With Font Awesome Icons">
</div>
</div>
</div>
</div>
<div class="space-70"></div>
<div id="checkRadios">
<div class="row">
<div class="col-sm-3">
<div class="title">
<h3>Checkboxes</h3>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="optionsCheckboxes">
Unchecked
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="optionsCheckboxes" checked>
Checked
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="optionsCheckboxes" disabled>
Disabled Unchecked
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="optionsCheckboxes" disabled checked>
Disabled Checked
</label>
</div>
</div>
<div class="col-sm-3">
<div class="title">
<h3>Radio Buttons</h3>
</div>
<div class="radio">
<label>
<input type="radio" name="optionsRadios">
Radio is off
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="optionsRadios" checked="true">
Radio is on
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="optionsRadiosDisabled" disabled>
Disabled Radio is off
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="optionsRadiosDisabled" checked="true" disabled>
Disabled Radio is on
</label>
</div>
</div>
<div class="col-sm-3">
<div class="title">
<h3>Toggle Buttons</h3>
</div>
<div class="togglebutton">
<label>
<input type="checkbox" checked="">
Toggle is on
</label>
</div>
<div class="togglebutton">
<label>
<input type="checkbox">
Toggle is off
</label>
</div>
</div>
<div class="col-sm-3">
<div class="title">
<h3>Sliders</h3>
</div>
<div id="sliderRegular" class="slider"></div>
<div id="sliderDouble" class="slider slider-info"></div>
</div>
</div>
</div>
</div>
</div>
<div class="section section-navbars">
<div class="container" id="menu-dropdown">
<div class="row">
<div class="col-md-6">
<div class="title">
<h3>Menu</h3>
</div>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Menu</a>
</div>
<div class="collapse navbar-collapse" id="example-navbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown
<b class="caret"></b>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li class="dropdown-header">Dropdown header</li>
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
<li class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
</div>
<div class="col-md-6">
<div class="title">
<h3>Menu with Icons</h3>
</div>
<nav class="navbar navbar-info">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-icons">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Icons</a>
</div>
<div class="collapse navbar-collapse" id="example-navbar-icons">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#pablo"><i class="material-icons">email</i></a>
</li>
<li>
<a href="#pablo"><i class="material-icons">face</i></a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="material-icons">settings</i>
<b class="caret"></b>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li class="dropdown-header">Dropdown header</li>
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
<li class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
</div>
</div>
<div class="title">
<h3>Navigation</h3>
</div>
</div>
<div id="navbar">
<div class="navigation-example">
<!-- Navbar Primary -->
<nav class="navbar navbar-primary">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-primary">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#pablo">Primary Color</a>
</div>
<div class="collapse navbar-collapse" id="example-navbar-primary">
<ul class="nav navbar-nav navbar-right">
<li class="active">
<a href="#pablo">
<i class="material-icons">explore</i>
Discover
</a>
</li>
<li>
<a href="#pablo">
<i class="material-icons">account_circle</i>
Profile
</a>
</li>
<li>
<a href="#pablo">
<i class="material-icons">settings</i>
Settings
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- End Navbar Primary -->
<!-- Navbar Info -->
<nav class="navbar navbar-info">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-info">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#pablo">Info Color</a>
</div>
<div class="collapse navbar-collapse" id="example-navbar-info">
<ul class="nav navbar-nav navbar-right">
<li class="active">
<a href="#pablo" >
Discover
</a>
</li>
<li>
<a href="#pablo">
Profile
</a>
</li>
<li>
<a href="#pablo">
Settings
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- End Navbar Info -->
<!-- Navbar Success -->
<nav class="navbar navbar-success">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-success">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Success Color</a>
</div>
<div class="collapse navbar-collapse" id="example-navbar-success">
<ul class="nav navbar-nav navbar-right">
<li class="active">
<a href="#pablo">
<i class="material-icons">explore</i>
</a>
</li>
<li>
<a href="#pablo">
<i class="material-icons">account_circle</i>
</a>
</li>
<li>
<a href="#pablo">
<i class="material-icons">settings</i>
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- End Navbar Success -->
<!-- Navbar Warning -->
<nav class="navbar navbar-warning">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-warning">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#pablo">Warning Color</a>
</div>
<div class="collapse navbar-collapse" id="example-navbar-warning">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#pablo">
<i class="fa fa-facebook-square"></i>
</a>
</li>
<li>
<a href="#pablo">
<i class="fa fa-twitter"></i>
</a>
</li>
<li>
<a href="#pablo">
<i class="fa fa-google-plus"></i>
</a>
</li>
<li>
<a href="#pablo">
<i class="fa fa-instagram"></i>
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- End Navbar Warning -->
<!-- Navbar Danger -->
<nav class="navbar navbar-danger">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-danger">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#pablo">Danger Color</a>
</div>
<div class="collapse navbar-collapse" id="example-navbar-danger">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#pablo">
<i class="fa fa-facebook-square"></i> Share
</a>
</li>
<li>
<a href="#pablo">
<i class="fa fa-twitter"></i> Tweet
</a>
</li>
<li>
<a href="#pablo">
<i class="fa fa-pinterest"></i> Pin
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- End Navbar Danger -->
<!-- Navbar Transparent -->
<nav class="navbar navbar-transparent">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-transparent">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#pablo">Transparent</a>
</div>
<div class="collapse navbar-collapse" id="example-navbar-transparent">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#pablo">
<i class="fa fa-facebook-square"></i>
Facebook
</a>
</li>
<li>
<a href="#pablo">
<i class="fa fa-twitter"></i>
Twitter
</a>
</li>
<li>
<a href="#pablo">
<i class="fa fa-instagram"></i> Instagram
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- End Navbar Transparent-->
</div>
</div>
</div>
<!-- End .section-navbars -->
<div class="section section-tabs">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="title">
<h3>Tabs with Icons on Card</h3>
</div>
<!-- Tabs with icons on Card -->
<div class="card card-nav-tabs">
<div class="header header-success">
<!-- colors: "header-primary", "header-info", "header-success", "header-warning", "header-danger" -->
<div class="nav-tabs-navigation">
<div class="nav-tabs-wrapper">
<ul class="nav nav-tabs" data-tabs="tabs">
<li class="active">
<a href="#profile" data-toggle="tab">
<i class="material-icons">face</i>
Profile
</a>
</li>
<li>
<a href="#messages" data-toggle="tab">
<i class="material-icons">chat</i>
Messages
</a>
</li>
<li>
<a href="#settings" data-toggle="tab">
<i class="material-icons">build</i>
Settings
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="content">
<div class="tab-content text-center">
<div class="tab-pane active" id="profile">
<p> I will be the leader of a company that ends up being worth billions of dollars, because I got the answers. I understand culture. I am the nucleus. I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at. I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at. </p>
</div>
<div class="tab-pane" id="messages">
<p> I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at. I will be the leader of a company that ends up being worth billions of dollars, because I got the answers. I understand culture. I am the nucleus. I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at.</p>
</div>
<div class="tab-pane" id="settings">
<p>I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at. So when you get something that has the name Kanye West on it, it’s supposed to be pushing the furthest possibilities. I will be the leader of a company that ends up being worth billions of dollars, because I got the answers. I understand culture. I am the nucleus.</p>
</div>
</div>
</div>
</div>
<!-- End Tabs with icons on Card -->
</div>
<div class="col-md-6">
<div class="title">
<h3>Tabs on Plain Card</h3>
</div>
<!-- Tabs on Plain Card -->
<div class="card card-nav-tabs card-plain">
<div class="header header-danger">
<!-- colors: "header-primary", "header-info", "header-success", "header-warning", "header-danger" -->
<div class="nav-tabs-navigation">
<div class="nav-tabs-wrapper">
<ul class="nav nav-tabs" data-tabs="tabs">
<li class="active"><a href="#home" data-toggle="tab">Home</a></li>
<li><a href="#updates" data-toggle="tab">Updates</a></li>
<li><a href="#history" data-toggle="tab">History</a></li>
</ul>
</div>
</div>
</div>
<div class="content">
<div class="tab-content text-center">
<div class="tab-pane active" id="home">
<p>I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at. So when you get something that has the name Kanye West on it, it’s supposed to be pushing the furthest possibilities. I will be the leader of a company that ends up being worth billions of dollars, because I got the answers. I understand culture. I am the nucleus.</p>
</div>
<div class="tab-pane" id="updates">
<p> I will be the leader of a company that ends up being worth billions of dollars, because I got the answers. I understand culture. I am the nucleus. I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at. I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at. </p>
</div>
<div class="tab-pane" id="history">
<p> I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at. I will be the leader of a company that ends up being worth billions of dollars, because I got the answers. I understand culture. I am the nucleus. I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at.</p>
</div>
</div>
</div>
</div>
<!-- End Tabs on plain Card -->
</div>
</div>
</div>
</div>
<!-- End Section Tabs -->
<div class="section section-pagination">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="title">
<h3>Progress Bars</h3>
</div>
<div class="progress progress-line-primary">
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 30%;">
<span class="sr-only">60% Complete</span>
</div>
</div>
<div class="progress progress-line-info">
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
<span class="sr-only">60% Complete</span>
</div>
</div>
<div class="progress progress-line-danger">
<div class="progress-bar progress-bar-success" style="width: 35%">
<span class="sr-only">35% Complete (success)</span>
</div>
<div class="progress-bar progress-bar-warning" style="width: 20%">
<span class="sr-only">20% Complete (warning)</span>
</div>
<div class="progress-bar progress-bar-danger" style="width: 10%">
<span class="sr-only">10% Complete (danger)</span>
</div>
</div>
<br />
<div class="title">
<h3>Navigation Pills</h3>
</div>
<ul class="nav nav-pills" role="tablist">
<!--
color-classes: "nav-pills-primary", "nav-pills-info", "nav-pills-success", "nav-pills-warning","nav-pills-danger"
-->
<li>
<a href="#dashboard" role="tab" data-toggle="tab">
<i class="material-icons">dashboard</i>
Dashboard
</a>
</li>
<li class="active">
<a href="#schedule" role="tab" data-toggle="tab">
<i class="material-icons">schedule</i>
Schedule
</a>
</li>
<li>
<a href="#tasks" role="tab" data-toggle="tab">
<i class="material-icons">list</i>
Tasks
</a>
</li>
<li>
<a href="#payments" role="tab" data-toggle="tab">
<i class="material-icons">attach_money</i>
Payments
</a>
</li>
</ul>
</div>
<div class="col-md-6">
<div class="title">
<h3>Pagination</h3>
</div>
<ul class="pagination pagination-primary">
<!--
color-classes: "pagination-primary", "pagination-info", "pagination-success", "pagination-warning", "pagination-danger"
-->
<li><a href="javascript:void(0);">1</a></li>
<li><a href="javascript:void(0);">...</a></li>
<li><a href="javascript:void(0);">5</a></li>
<li><a href="javascript:void(0);">6</a></li>
<li class="active"><a href="javascript:void(0);">7</a></li>
<li><a href="javascript:void(0);">8</a></li>
<li><a href="javascript:void(0);">9</a></li>
<li><a href="javascript:void(0);">...</a></li>
<li><a href="javascript:void(0);">12</a></li>
</ul>
<ul class="pagination pagination-info">
<li><a href="javascript:void(0);">< prev</a></li>
<li><a href="javascript:void(0);">1</a></li>
<li><a href="javascript:void(0);">2</a></li>
<li class="active"><a href="javascript:void(0);">3</a></li>
<li><a href="javascript:void(0);">4</a></li>
<li><a href="javascript:void(0);">5</a></li>
<li><a href="javascript:void(0);">next ></a></li>
</ul>
<div class="title">
<h3>Labels </h3>
</div>
<span class="label label-default">Default</span>
<span class="label label-primary">Primary</span>
<span class="label label-info">Info</span>
<span class="label label-success">Success</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
</div>
</div>
<div class="space"></div>
<div class="title">
<h3>Notifications</h3>
</div>
</div>
</div>
<div class="section section-notifications" id="notifications">
<div class="alert alert-info">
<div class="container-fluid">
<div class="alert-icon">
<i class="material-icons">info_outline</i>
</div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true"><i class="material-icons">clear</i></span>
</button>
<b>Info alert:</b> You've got some friends nearby, stop looking at your phone and find them...
</div>
</div>
<div class="alert alert-success">
<div class="container-fluid">
<div class="alert-icon">
<i class="material-icons">check</i>
</div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true"><i class="material-icons">clear</i></span>
</button>
<b>Success Alert:</b> Yuhuuu! You've got your $11.99 album from The Weeknd
</div>
</div>
<div class="alert alert-warning">
<div class="container-fluid">
<div class="alert-icon">
<i class="material-icons">warning</i>
</div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true"><i class="material-icons">clear</i></span>
</button>
<b>Warning Alert:</b> Hey, it looks like you still have the "copyright © 2015" in your footer. Please update it!
</div>
</div>
<div class="alert alert-danger">
<div class="container-fluid">
<div class="alert-icon">
<i class="material-icons">error_outline</i>
</div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true"><i class="material-icons">clear</i></span>
</button>
<b>Error Alert:</b> Damn man! You screwed up the server this time. You should find a good excuse for your Boss...
</div>
</div>
<div class="clearfix"></div>
</div><!-- end notifications -->
<div class="section">
<div class="container tim-container">
<div class="title">
<h2>Typography</h2>
</div>
<div id="typography">
<div class="row">
<div class="tim-typo">
<h1><span class="tim-note">Header 1</span>The Life of Material Kit </h1>
</div>
<div class="tim-typo">
<h2><span class="tim-note">Header 2</span>The Life of Material Kit</h2>
</div>
<div class="tim-typo">
<h3><span class="tim-note">Header 3</span>The Life of Material Kit</h3>
</div>
<div class="tim-typo">
<h4><span class="tim-note">Header 4</span>The Life of Material Kit</h4>
</div>
<div class="tim-typo">
<h5><span class="tim-note">Header 5</span>The Life of Material Kit</h5>
</div>
<div class="tim-typo">
<h6><span class="tim-note">Header 6</span>The Life of Material Kit</h6>
</div>
<div class="tim-typo">
<p><span class="tim-note">Paragraph</span>
I will be the leader of a company that ends up being worth billions of dollars, because I got the answers. I understand culture. I am the nucleus. I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at.</p>
</div>
<div class="tim-typo">
<span class="tim-note">Quote</span>
<blockquote>
<p>
I will be the leader of a company that ends up being worth billions of dollars, because I got the answers. I understand culture. I am the nucleus. I think that’s a responsibility that I have, to push possibilities, to show people, this is the level that things could be at.
</p>
<small>
Kanye West, Musician
</small>
</blockquote>
</div>
<div class="tim-typo">
<span class="tim-note">Muted Text</span>
<p class="text-muted">
I will be the leader of a company that ends up being worth billions of dollars, because I got the answers...
</p>
</div>
<div class="tim-typo">
<span class="tim-note">Primary Text</span>
<p class="text-primary">
I will be the leader of a company that ends up being worth billions of dollars, because I got the answers... </p>
</div>
<div class="tim-typo">
<span class="tim-note">Info Text</span>
<p class="text-info">
I will be the leader of a company that ends up being worth billions of dollars, because I got the answers... </p>
</div>
<div class="tim-typo">
<span class="tim-note">Success Text</span>
<p class="text-success">
I will be the leader of a company that ends up being worth billions of dollars, because I got the answers... </p>
</div>
<div class="tim-typo">
<span class="tim-note">Warning Text</span>
<p class="text-warning">
I will be the leader of a company that ends up being worth billions of dollars, because I got the answers...
</p>
</div>
<div class="tim-typo">
<span class="tim-note">Danger Text</span>
<p class="text-danger">
I will be the leader of a company that ends up being worth billions of dollars, because I got the answers... </p>
</div>
<div class="tim-typo">
<h2><span class="tim-note">Small Tag</span>
Header with small subtitle <br>
<small>Use "small" tag for the headers</small>
</h2>
</div>
</div>
</div>
<div class="space-50"></div>
<div id="images">
<div class="title">
<h2>Images</h2>
</div>
<br>
<div class="row">
<div class="col-sm-2">
<h4>Rounded Image</h4>
<img src="assets/img/avatar.jpg" alt="Rounded Image" class="img-rounded img-responsive">
</div>
<div class="col-sm-2 col-sm-offset-1">
<h4>Circle Image</h4>
<img src="assets/img/avatar.jpg" alt="Circle Image" class="img-circle img-responsive">
</div>
<div class="col-sm-2 col-sm-offset-1">
<h4>Rounded Raised</h4>
<img src="assets/img/avatar.jpg" alt="Raised Image" class="img-rounded img-responsive img-raised">
</div>
<div class="col-sm-2 col-sm-offset-1">
<h4>Circle Raised</h4>
<img src="assets/img/avatar.jpg" alt="Thumbnail Image" class="img-circle img-raised img-responsive">
</div>
</div>
<div class="row">
</div>
</div>
</div>
</div>
<div class="section" id="javascriptComponents">
<div class="container">
<div class="title">
<h2>Javascript components</h2>
</div>
<div class="row" id="modals">
<div class="col-md-6">
<div class="title">
<h3>Modal</h3>
</div>
<button class="btn btn-primary" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
</div>
<div class="col-md-6">
<div class="title">
<h3>Popovers</h3>
</div>
<button type="button" class="btn btn-default" data-toggle="popover" data-placement="left" title="Popover on left" data-content="Here will be some very useful information about his popover.<br> Here will be some very useful information about his popover." data-container="body">On left</button>
<button type="button" class="btn btn-default" data-toggle="popover" data-placement="top" title="Popover on top" data-content="Here will be some very useful information about his popover." data-container="body">On top</button>
<button type="button" class="btn btn-default" data-toggle="popover" data-placement="bottom" title="Popover on bottom" data-content="Here will be some very useful information about his popover." data-container="body">On bottom</button>
<button type="button" class="btn btn-default" data-toggle="popover" data-placement="right" title="Popover on right" data-content="Here will be some very useful information about his popover." data-container="body">On right</button>
</div>
<br /><br />
<div class="col-md-6">
<div class="title">
<h3>Datepicker</h3>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group label-static">
<label class="control-label">Datepicker</label>
<input type="text" class="datepicker form-control" value="03/12/2016" />
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="title">
<h3>Tooltips</h3>
</div>
<button type="button" class="btn btn-default btn-tooltip" data-toggle="tooltip" data-placement="left" title="Tooltip on left" data-container="body">On left</button>
<button type="button" class="btn btn-default btn-tooltip" data-toggle="tooltip" data-placement="top" title="Tooltip on top" data-container="body">On top</button>
<button type="button" class="btn btn-default btn-tooltip" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom" data-container="body">On bottom</button>
<button type="button" class="btn btn-default btn-tooltip" data-toggle="tooltip" data-placement="right" title="Tooltip on right" data-container="body">On right</button>
<div class="clearfix"></div><br><br>
</div>
<div class="title">
<h3>Carousel</h3>
</div>
</div>
</div>
</div>
<div class="section" id="carousel">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<!-- Carousel Card -->
<div class="card card-raised card-carousel">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<div class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="assets/img/bg2.jpeg" alt="Awesome Image">
<div class="carousel-caption">
<h4><i class="material-icons">location_on</i> Yellowstone National Park, United States</h4>
</div>
</div>
<div class="item">
<img src="assets/img/bg3.jpeg" alt="Awesome Image">
<div class="carousel-caption">
<h4><i class="material-icons">location_on</i> Somewhere Beyond, United States</h4>
</div>
</div>
<div class="item">
<img src="assets/img/bg4.jpeg" alt="Awesome Image">
<div class="carousel-caption">
<h4><i class="material-icons">location_on</i> Yellowstone National Park, United States</h4>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<i class="material-icons">keyboard_arrow_left</i>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<i class="material-icons">keyboard_arrow_right</i>
</a>
</div>
</div>
</div>
<!-- End Carousel Card -->
</div>
</div>
</div>
</div>
<div class="section">
<div class="container text-center">
<div class="row">
<div class="col-md-8 col-md-offset-2 text-center">
<h2>Completed with examples</h2>
<h4>The kit comes with three pre-built pages to help you get started faster. You can change the text and images and you're good to go. More importantly, looking at them will give you a picture of what you can built with this powerful kit.</h4>
</div>
</div>
</div>
</div>
<div class="section section-full-screen section-signup" style="background-image: url('assets/img/city.jpg'); background-size: cover; background-position: top center; min-height: 700px;">
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="card card-signup">
<form class="form" method="" action="">
<div class="header header-primary text-center">
<h4>Sign Up</h4>
<div class="social-line">
<a href="#pablo" class="btn btn-simple btn-just-icon">
<i class="fa fa-facebook-square"></i>
</a>
<a href="#pablo" class="btn btn-simple btn-just-icon">
<i class="fa fa-twitter"></i>
</a>
<a href="#pablo" class="btn btn-simple btn-just-icon">
<i class="fa fa-google-plus"></i>
</a>
</div>
</div>
<p class="text-divider">Or Be Classical</p>
<div class="content">
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">face</i>
</span>
<input type="text" class="form-control" placeholder="First Name...">
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">email</i>
</span>
<input type="text" class="form-control" placeholder="Email...">
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">lock_outline</i>
</span>
<input type="password" placeholder="Password..." class="form-control" />
</div>
<!-- If you want to add a checkbox to this form, uncomment this code
<div class="checkbox">
<label>
<input type="checkbox" name="optionsCheckboxes" checked>
Subscribe to newsletter
</label>
</div> -->
</div>
<div class="footer text-center">
<a href="#pablo" class="btn btn-simple btn-primary btn-lg">Get Started</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12 text-center">
<a href="examples/signup-page.html" class="btn btn-simple btn-primary btn-lg" target="_blank">View Signup Page</a>
</div>
<div class="space-50"></div>
<div class="section section-examples">
<div class="container-fluid text-center">
<div class="row">
<div class="col-md-6">
<a href="examples/landing-page.html" target="_blank">
<img src="assets/img/landing.jpg" alt="Rounded Image" class="img-rounded img-raised img-responsive">
<button class="btn btn-simple btn-primary btn-lg">View Landing Page</button>
</a>
</div>
<div class="col-md-6">
<a href="examples/profile-page.html" target="_blank">
<img src="assets/img/profile.jpg" alt="Rounded Image" class="img-rounded img-raised img-responsive">
<button class="btn btn-simple btn-primary btn-lg">View Profile Page</button>
</a>
</div>
</div>
</div>
</div>
<div class="section section-download">
<div class="container">
<div class="row text-center">
<div class="col-md-8 col-md-offset-2">
<h2>Do you love this UI Kit?</h2>
<h4>Cause if you do, it can be yours for FREE. Hit the button below to navigate to Creative Tim where you can find the kit. Start a new project or give an old Bootstrap project a new look!</h4>
</div>
<div class="col-xs-8 col-xs-offset-2 col-sm-4 col-sm-offset-4">
<a href="http://www.creative-tim.com/product/material-kit" class="btn btn-primary btn-lg">
<i class="material-icons">cloud_download</i> Free Download
</a>
</div>
</div>
<br><br>
<div class="row text-center">
<div class="col-md-8 col-md-offset-2">
<h2>Want more?</h2>
<h4>We've just launched <a href="http://demos.creative-tim.com/material-kit-pro/presentation.html?ref=utp-freebie" target="_blank">Material Kit PRO</a>. It has a huge number of components, sections and example pages. Start Your Development With A Badass Bootstrap UI Kit inspired by Material Design.</h4>
</div>
<div class="col-xs-8 col-xs-offset-2 col-sm-4 col-sm-offset-4">
<a href="http://demos.creative-tim.com/material-kit-pro/presentation.html?ref=utp-freebie" class="btn btn-upgrade btn-lg" target="_blank">
<i class="material-icons">unarchive</i> Upgrade to PRO
</a>
</div>
</div>
<div class="row sharing-area text-center">
<h3>Thank you for supporting us!</h3>
<a href="#" class="btn btn-twitter">
<i class="fa fa-twitter"></i>
Tweet
</a>
<a href="#" class="btn btn-facebook">
<i class="fa fa-facebook-square"></i>
Share
</a>
<a href="#" class="btn btn-google-plus">
<i class="fa fa-google-plus"></i>
Share
</a>
<a href="#" class="btn btn-github">
<i class="fa fa-github"></i>
Star
</a>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<nav class="pull-left">
<ul>
<li>
<a href="http://www.creative-tim.com">
Creative Tim
</a>
</li>
<li>
<a href="http://presentation.creative-tim.com">
About Us
</a>
</li>
<li>
<a href="http://blog.creative-tim.com">
Blog
</a>
</li>
<li>
<a href="http://www.creative-tim.com/license">
Licenses
</a>
</li>
</ul>
</nav>
<div class="copyright pull-right">
© 2016, made with <i class="material-icons">favorite</i> by Creative Tim for a better web.
</div>
</div>
</footer>
</div>
<!-- Sart Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
<i class="material-icons">clear</i>
</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-simple">Nice Button</button>
<button type="button" class="btn btn-danger btn-simple" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- End Modal -->
</body>
<!-- Core JS Files -->
<script src="assets/js/jquery.min.js" type="text/javascript"></script>
<script src="assets/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/js/material.min.js"></script>
<!-- Plugin for the Sliders, full documentation here: http://refreshless.com/nouislider/ -->
<script src="assets/js/nouislider.min.js" type="text/javascript"></script>
<!-- Plugin for the Datepicker, full documentation here: http://www.eyecon.ro/bootstrap-datepicker/ -->
<script src="assets/js/bootstrap-datepicker.js" type="text/javascript"></script>
<!-- Control Center for Material Kit: activating the ripples, parallax effects, scripts from the example pages etc -->
<script src="assets/js/material-kit.js" type="text/javascript"></script>
<script type="text/javascript">
$().ready(function(){
// the body of this function is in assets/material-kit.js
materialKit.initSliders();
window_width = $(window).width();
if (window_width >= 992){
big_image = $('.wrapper > .header');
$(window).on('scroll', materialKitDemo.checkScrollForParallax);
}
});
</script>
</html>
| zhouxinyong/code-demo | demoHouse/material_kit/index.html | HTML | mit | 58,219 |
import os
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = "super_secret_key"
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
class ProductionConfig(Config):
DEBUG = False
SECRET_KEY = os.environ['SECRET_KEY']
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
class TestingConfig(Config):
TESTING = True
| jiangtyd/crewviewer | project/config.py | Python | mit | 404 |
<div id="about">
<header class="twelve columns">
<h1>My background</h1>
<p class="opening">I'm a programmer, entrepreneur, speaker, designer, and trail runner among other things. As an engineer I've worked across the stack in backend, web, and mobile. I live and work in Los Angeles and studied at UCLA.</p>
</header>
<div id="page-content" class="twelve columns">
<section class="twelve columns">
<p>I'm currently an Engineering Manager working on feature development and engineering best practices alongside a great team at <a href="https://www.gotinder.com/" target="_blank">Tinder</a>. I'm also an organizer of monthly meetups at the <a href="http://lactoforum.org/" target="_blank">LA CTO Forum</a>.</p>
<p> In 2015 I was featured in Inc.'s <a href="https://enplug.com/blog/enplug-makes-inc-magazines-2015-30-under-30-list">30 under 30</a> for co-founding <a href="https://enplug.com">Enplug</a>, a display software for teams and businesses.</p>
<p>You can find my work history on <a href="https://www.linkedin.com/in/alexross8">LinkedIn</a>, or you can download my <a href="/src/pdf/AlexRoss-Resume.pdf">resume</a>. I have a few projects on <a href="https://github.com/aleross">Github</a>.</p>
</section>
<article id="photos" class="twelve columns">
<img src="/src/img/about/1.jpg">
<img src="/src/img/about/4.jpg">
<img src="/src/img/about/13.jpg">
<img src="/src/img/about/11.jpg">
<img src="/src/img/about/5.jpg">
<img src="/src/img/about/7.jpg">
</article>
<article class="twelve columns">
<h2>Programming</h2>
<p>I frequently work across the full stack, including mobile. Below are some technologies I've used in production projects:</p>
<ul>
<li><strong>Front-end:</strong> HTML5, CSS3, SASS, JavaScript</li>
<li><strong>Back-end & scripting:</strong> NodeJS, PHP, Ruby, Python</li>
<li><strong>Frameworks:</strong> AngularJS, Bootstrap, jQuery, Wordpress, ZendFramework</li>
<li><strong>Servers:</strong> Linux, Apache, RabbitMQ, Rackspace, AWS</li>
<li><strong>Databases:</strong> MySQL, MongoDB, Redis, DynamoDB, Firebase (DBaaS)</li>
<li><strong>Mobile:</strong> Objective-C & Interface Builder, Java (Android), PhoneGap/Cordova</li>
<li><strong>Dev tools:</strong> Git, Grunt, Bower, NPM, Composer, Jasmine+Karma</li>
<li><strong>The Internet:</strong> DNS, HTTP, sockets, CDNs, load-balancing, etc.</li>
<li><strong>Design:</strong> Adobe Photoshop & Illustrator, InvisionApp</li>
</ul>
<p></p>
</article>
</div>
</div>
| aleross/alexross.codes | src/html/pages/about.html | HTML | mit | 2,831 |
var scroller = angular.module("scroller", ["ngTouch", "angular-websql"]); | jouk0/Scroller | js/index.js | JavaScript | mit | 73 |
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV (from 2014)
This library 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 library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
#include "QtAV/LibAVFilter.h"
#include <QtCore/QSharedPointer>
#include "QtAV/private/Filter_p.h"
#include "QtAV/Statistics.h"
#include "QtAV/AudioFrame.h"
#include "QtAV/VideoFrame.h"
#include "QtAV/private/AVCompat.h"
#include "utils/internal.h"
#include "utils/Logger.h"
/*
* libav10.x, ffmpeg2.x: av_buffersink_read deprecated
* libav9.x: only av_buffersink_read can be used
* ffmpeg<2.0: av_buffersink_get_buffer_ref and av_buffersink_read
*/
// TODO: enabled = false if no libavfilter
// TODO: filter_complex
// NO COPY in push/pull
#define QTAV_HAVE_av_buffersink_get_frame (LIBAV_MODULE_CHECK(LIBAVFILTER, 4, 2, 0) || FFMPEG_MODULE_CHECK(LIBAVFILTER, 3, 79, 100)) //3.79.101: ff2.0.4
namespace QtAV {
#if QTAV_HAVE(AVFILTER)
// local types can not be used as template parameters
class AVFrameHolder {
public:
AVFrameHolder() {
m_frame = av_frame_alloc();
#if !QTAV_HAVE_av_buffersink_get_frame
picref = 0;
#endif
}
~AVFrameHolder() {
av_frame_free(&m_frame);
#if !QTAV_HAVE_av_buffersink_get_frame
avfilter_unref_bufferp(&picref);
#endif
}
AVFrame* frame() { return m_frame;}
#if !QTAV_HAVE_av_buffersink_get_frame
AVFilterBufferRef** bufferRef() { return &picref;}
// copy properties and data ptrs(no deep copy).
void copyBufferToFrame() { avfilter_copy_buf_props(m_frame, picref);}
#endif
private:
AVFrame *m_frame;
#if !QTAV_HAVE_av_buffersink_get_frame
AVFilterBufferRef *picref;
#endif
};
typedef QSharedPointer<AVFrameHolder> AVFrameHolderRef;
#endif //QTAV_HAVE(AVFILTER)
class LibAVFilter::Private
{
public:
Private()
: avframe(0)
, status(LibAVFilter::NotConfigured)
{
#if QTAV_HAVE(AVFILTER)
filter_graph = 0;
in_filter_ctx = 0;
out_filter_ctx = 0;
avfilter_register_all();
#endif //QTAV_HAVE(AVFILTER)
}
~Private() {
#if QTAV_HAVE(AVFILTER)
avfilter_graph_free(&filter_graph);
#endif //QTAV_HAVE(AVFILTER)
if (avframe) {
av_frame_free(&avframe);
avframe = 0;
}
}
bool setOptions(const QString& opt) {
if (options == opt)
return false;
options = opt;
status = LibAVFilter::NotConfigured;
return true;
}
bool pushAudioFrame(Frame *frame, bool changed, const QString& args);
bool pushVideoFrame(Frame *frame, bool changed, const QString& args);
bool setup(const QString& args, bool video) {
if (avframe) {
av_frame_free(&avframe);
avframe = 0;
}
status = LibAVFilter::ConfigureFailed;
#if QTAV_HAVE(AVFILTER)
avfilter_graph_free(&filter_graph);
filter_graph = avfilter_graph_alloc();
//QString sws_flags_str;
// pixel_aspect==sar, pixel_aspect is more compatible
QString buffersrc_args = args;
qDebug("buffersrc_args=%s", buffersrc_args.toUtf8().constData());
AVFilter *buffersrc = avfilter_get_by_name(video ? "buffer" : "abuffer");
Q_ASSERT(buffersrc);
AV_ENSURE_OK(avfilter_graph_create_filter(&in_filter_ctx,
buffersrc,
"in", buffersrc_args.toUtf8().constData(), NULL,
filter_graph)
, false);
/* buffer video sink: to terminate the filter chain. */
AVFilter *buffersink = avfilter_get_by_name(video ? "buffersink" : "abuffersink");
Q_ASSERT(buffersink);
AV_ENSURE_OK(avfilter_graph_create_filter(&out_filter_ctx, buffersink, "out",
NULL, NULL, filter_graph)
, false);
/* Endpoints for the filter graph. */
AVFilterInOut *outputs = avfilter_inout_alloc();
AVFilterInOut *inputs = avfilter_inout_alloc();
outputs->name = av_strdup("in");
outputs->filter_ctx = in_filter_ctx;
outputs->pad_idx = 0;
outputs->next = NULL;
inputs->name = av_strdup("out");
inputs->filter_ctx = out_filter_ctx;
inputs->pad_idx = 0;
inputs->next = NULL;
struct delete_helper {
AVFilterInOut **x;
delete_helper(AVFilterInOut **io) : x(io) {}
~delete_helper() {
// libav always free it in avfilter_graph_parse. so we does nothing
#if QTAV_USE_FFMPEG(LIBAVFILTER)
avfilter_inout_free(x);
#endif
}
} scoped_in(&inputs), scoped_out(&outputs);
//avfilter_graph_parse, avfilter_graph_parse2?
AV_ENSURE_OK(avfilter_graph_parse_ptr(filter_graph, options.toUtf8().constData(), &inputs, &outputs, NULL), false);
AV_ENSURE_OK(avfilter_graph_config(filter_graph, NULL), false);
avframe = av_frame_alloc();
status = LibAVFilter::ConfigureOk;
#if DBG_GRAPH
//not available in libav9
const char* g = avfilter_graph_dump(filter_graph, NULL);
if (g)
qDebug().nospace() << "filter graph:\n" << g; // use << to not print special chars in qt5.5
av_freep(&g);
#endif //DBG_GRAPH
return true;
#endif //QTAV_HAVE(AVFILTER)
return false;
}
#if QTAV_HAVE(AVFILTER)
AVFilterGraph *filter_graph;
AVFilterContext *in_filter_ctx;
AVFilterContext *out_filter_ctx;
#endif //QTAV_HAVE(AVFILTER)
AVFrame *avframe;
QString options;
LibAVFilter::Status status;
};
QStringList LibAVFilter::videoFilters()
{
static const QStringList list(LibAVFilter::registeredFilters(AVMEDIA_TYPE_VIDEO));
return list;
}
QStringList LibAVFilter::audioFilters()
{
static const QStringList list(LibAVFilter::registeredFilters(AVMEDIA_TYPE_AUDIO));
return list;
}
QString LibAVFilter::filterDescription(const QString &filterName)
{
QString s;
#if QTAV_HAVE(AVFILTER)
avfilter_register_all();
const AVFilter *f = avfilter_get_by_name(filterName.toUtf8().constData());
if (!f)
return s;
if (f->description)
s.append(QString::fromUtf8(f->description));
#if AV_MODULE_CHECK(LIBAVFILTER, 3, 7, 0, 8, 100)
return s.append(QLatin1String("\n")).append(QObject::tr("Options:"))
.append(Internal::optionsToString((void*)&f->priv_class));
#endif
#endif //QTAV_HAVE(AVFILTER)
Q_UNUSED(filterName);
return s;
}
LibAVFilter::LibAVFilter()
: priv(new Private())
{
}
LibAVFilter::~LibAVFilter()
{
delete priv;
}
void LibAVFilter::setOptions(const QString &options)
{
if (!priv->setOptions(options))
return;
Q_EMIT optionsChanged();
}
QString LibAVFilter::options() const
{
return priv->options;
}
LibAVFilter::Status LibAVFilter::status() const
{
return priv->status;
}
bool LibAVFilter::pushVideoFrame(Frame *frame, bool changed)
{
return priv->pushVideoFrame(frame, changed, sourceArguments());
}
bool LibAVFilter::pushAudioFrame(Frame *frame, bool changed)
{
return priv->pushAudioFrame(frame, changed, sourceArguments());
}
void* LibAVFilter::pullFrameHolder()
{
#if QTAV_HAVE(AVFILTER)
AVFrameHolder *holder = NULL;
holder = new AVFrameHolder();
#if QTAV_HAVE_av_buffersink_get_frame
int ret = av_buffersink_get_frame(priv->out_filter_ctx, holder->frame());
#else
int ret = av_buffersink_read(priv->out_filter_ctx, holder->bufferRef());
#endif //QTAV_HAVE_av_buffersink_get_frame
if (ret < 0) {
qWarning("av_buffersink_get_frame error: %s", av_err2str(ret));
delete holder;
return 0;
}
#if !QTAV_HAVE_av_buffersink_get_frame
holder->copyBufferToFrame();
#endif
return holder;
#endif //QTAV_HAVE(AVFILTER)
return 0;
}
QStringList LibAVFilter::registeredFilters(int type)
{
QStringList filters;
#if QTAV_HAVE(AVFILTER)
avfilter_register_all();
const AVFilter* f = NULL;
AVFilterPad* fp = NULL; // no const in avfilter_pad_get_name() for ffmpeg<=1.2 libav<=9
#if AV_MODULE_CHECK(LIBAVFILTER, 3, 8, 0, 53, 100)
while ((f = avfilter_next(f))) {
#else
AVFilter** ff = NULL;
while ((ff = av_filter_next(ff)) && *ff) {
f = (*ff);
#endif
fp = (AVFilterPad*)f->inputs;
// only check the 1st pad
if (!fp || !avfilter_pad_get_name(fp, 0) || avfilter_pad_get_type(fp, 0) != (AVMediaType)type)
continue;
fp = (AVFilterPad*)f->outputs;
// only check the 1st pad
if (!fp || !avfilter_pad_get_name(fp, 0) || avfilter_pad_get_type(fp, 0) != (AVMediaType)type)
continue;
filters.append(QLatin1String(f->name));
}
#endif //QTAV_HAVE(AVFILTER)
return filters;
}
class LibAVFilterVideoPrivate : public VideoFilterPrivate
{
public:
LibAVFilterVideoPrivate()
: VideoFilterPrivate()
, pixfmt(QTAV_PIX_FMT_C(NONE))
, width(0)
, height(0)
{}
AVPixelFormat pixfmt;
int width, height;
};
LibAVFilterVideo::LibAVFilterVideo(QObject *parent)
: VideoFilter(*new LibAVFilterVideoPrivate(), parent)
, LibAVFilter()
{
}
QStringList LibAVFilterVideo::filters() const
{
return LibAVFilter::videoFilters();
}
void LibAVFilterVideo::process(Statistics *statistics, VideoFrame *frame)
{
Q_UNUSED(statistics);
#if QTAV_HAVE(AVFILTER)
if (status() == ConfigureFailed)
return;
DPTR_D(LibAVFilterVideo);
//Status old = status();
bool changed = false;
if (d.width != frame->width() || d.height != frame->height() || d.pixfmt != frame->pixelFormatFFmpeg()) {
changed = true;
d.width = frame->width();
d.height = frame->height();
d.pixfmt = (AVPixelFormat)frame->pixelFormatFFmpeg();
}
bool ok = pushVideoFrame(frame, changed);
//if (old != status())
// emit statusChanged();
if (!ok)
return;
AVFrameHolderRef ref((AVFrameHolder*)pullFrameHolder());
if (!ref)
return;
const AVFrame *f = ref->frame();
VideoFrame vf(f->width, f->height, VideoFormat(f->format));
vf.setBits((quint8**)f->data);
vf.setBytesPerLine((int*)f->linesize);
vf.setMetaData(QStringLiteral("avframe_hoder_ref"), QVariant::fromValue(ref));
vf.setTimestamp(ref->frame()->pts/1000000.0); //pkt_pts?
//vf.setMetaData(frame->availableMetaData());
*frame = vf;
#else
Q_UNUSED(frame);
#endif //QTAV_HAVE(AVFILTER)
}
QString LibAVFilterVideo::sourceArguments() const
{
DPTR_D(const LibAVFilterVideo);
#if QTAV_USE_LIBAV(LIBAVFILTER)
return QStringLiteral("%1:%2:%3:%4:%5:%6:%7")
#else
return QStringLiteral("video_size=%1x%2:pix_fmt=%3:time_base=%4/%5:pixel_aspect=%6/%7")
#endif
.arg(d.width).arg(d.height).arg(d.pixfmt)
.arg(1).arg(AV_TIME_BASE) //time base 1/1?
.arg(1).arg(1) //sar
;
}
class LibAVFilterAudioPrivate : public AudioFilterPrivate
{
public:
LibAVFilterAudioPrivate()
: AudioFilterPrivate()
, sample_rate(0)
, sample_fmt(AV_SAMPLE_FMT_NONE)
, channel_layout(0)
{}
int sample_rate;
AVSampleFormat sample_fmt;
qint64 channel_layout;
};
LibAVFilterAudio::LibAVFilterAudio(QObject *parent)
: AudioFilter(*new LibAVFilterAudioPrivate(), parent)
, LibAVFilter()
{}
QStringList LibAVFilterAudio::filters() const
{
return LibAVFilter::audioFilters();
}
QString LibAVFilterAudio::sourceArguments() const
{
DPTR_D(const LibAVFilterAudio);
return QStringLiteral("time_base=%1/%2:sample_rate=%3:sample_fmt=%4:channel_layout=0x%5")
.arg(1)
.arg(AV_TIME_BASE)
.arg(d.sample_rate)
//ffmpeg new: AV_OPT_TYPE_SAMPLE_FMT
//libav, ffmpeg old: AV_OPT_TYPE_STRING
.arg(QLatin1String(av_get_sample_fmt_name(d.sample_fmt)))
.arg(d.channel_layout, 0, 16) //AV_OPT_TYPE_STRING
;
}
void LibAVFilterAudio::process(Statistics *statistics, AudioFrame *frame)
{
Q_UNUSED(statistics);
#if QTAV_HAVE(AVFILTER)
if (status() == ConfigureFailed)
return;
DPTR_D(LibAVFilterAudio);
//Status old = status();
bool changed = false;
const AudioFormat afmt(frame->format());
if (d.sample_rate != afmt.sampleRate() || d.sample_fmt != afmt.sampleFormatFFmpeg() || d.channel_layout != afmt.channelLayoutFFmpeg()) {
changed = true;
d.sample_rate = afmt.sampleRate();
d.sample_fmt = (AVSampleFormat)afmt.sampleFormatFFmpeg();
d.channel_layout = afmt.channelLayoutFFmpeg();
}
bool ok = pushAudioFrame(frame, changed);
//if (old != status())
// emit statusChanged();
if (!ok)
return;
AVFrameHolderRef ref((AVFrameHolder*)pullFrameHolder());
if (!ref)
return;
const AVFrame *f = ref->frame();
AudioFormat fmt;
fmt.setSampleFormatFFmpeg(f->format);
fmt.setChannelLayoutFFmpeg(f->channel_layout);
fmt.setSampleRate(f->sample_rate);
if (!fmt.isValid()) {// need more data to decode to get a frame
return;
}
AudioFrame af(fmt);
//af.setBits((quint8**)f->extended_data);
//af.setBytesPerLine((int*)f->linesize);
af.setBits(f->extended_data); // TODO: ref
af.setBytesPerLine(f->linesize[0], 0); // for correct alignment
af.setSamplesPerChannel(f->nb_samples);
af.setMetaData(QStringLiteral("avframe_hoder_ref"), QVariant::fromValue(ref));
af.setTimestamp(ref->frame()->pts/1000000.0); //pkt_pts?
//af.setMetaData(frame->availableMetaData());
*frame = af;
#else
Q_UNUSED(frame);
#endif //QTAV_HAVE(AVFILTER)
}
bool LibAVFilter::Private::pushVideoFrame(Frame *frame, bool changed, const QString &args)
{
#if QTAV_HAVE(AVFILTER)
VideoFrame *vf = static_cast<VideoFrame*>(frame);
if (status == LibAVFilter::NotConfigured || !avframe || changed) {
if (!setup(args, true)) {
qWarning("setup video filter graph error");
//enabled = false; // skip this filter and avoid crash
return false;
}
}
if (!vf->constBits(0)) {
*vf = vf->to(vf->format());
}
avframe->pts = frame->timestamp() * 1000000.0; // time_base is 1/1000000
avframe->width = vf->width();
avframe->height = vf->height();
avframe->format = (AVPixelFormat)vf->pixelFormatFFmpeg();
for (int i = 0; i < vf->planeCount(); ++i) {
avframe->data[i] = (uint8_t*)vf->constBits(i);
avframe->linesize[i] = vf->bytesPerLine(i);
}
//TODO: side data for vf_codecview etc
//int ret = av_buffersrc_add_frame_flags(in_filter_ctx, avframe, AV_BUFFERSRC_FLAG_KEEP_REF);
/*
* av_buffersrc_write_frame equals to av_buffersrc_add_frame_flags with AV_BUFFERSRC_FLAG_KEEP_REF.
* av_buffersrc_write_frame is more compatible, while av_buffersrc_add_frame_flags only exists in ffmpeg >=2.0
* add a ref if frame is ref counted
* TODO: libav < 10.0 will copy the frame, prefer to use av_buffersrc_buffer
*/
AV_ENSURE_OK(av_buffersrc_write_frame(in_filter_ctx, avframe), false);
return true;
#endif //QTAV_HAVE(AVFILTER)
Q_UNUSED(frame);
return false;
}
bool LibAVFilter::Private::pushAudioFrame(Frame *frame, bool changed, const QString &args)
{
#if QTAV_HAVE(AVFILTER)
if (status == LibAVFilter::NotConfigured || !avframe || changed) {
if (!setup(args, false)) {
qWarning("setup audio filter graph error");
//enabled = false; // skip this filter and avoid crash
return false;
}
}
AudioFrame *af = static_cast<AudioFrame*>(frame);
const AudioFormat afmt(af->format());
avframe->pts = frame->timestamp() * 1000000.0; // time_base is 1/1000000
avframe->sample_rate = afmt.sampleRate();
avframe->channel_layout = afmt.channelLayoutFFmpeg();
#if QTAV_USE_FFMPEG(LIBAVCODEC) || QTAV_USE_FFMPEG(LIBAVUTIL) //AVFrame was in avcodec
avframe->channels = afmt.channels(); //MUST set because av_buffersrc_write_frame will compare channels and layout
#endif
avframe->format = (AVSampleFormat)afmt.sampleFormatFFmpeg();
avframe->nb_samples = af->samplesPerChannel();
for (int i = 0; i < af->planeCount(); ++i) {
//avframe->data[i] = (uint8_t*)af->constBits(i);
avframe->extended_data[i] = (uint8_t*)af->constBits(i);
avframe->linesize[i] = af->bytesPerLine(i);
}
AV_ENSURE_OK(av_buffersrc_write_frame(in_filter_ctx, avframe), false);
return true;
#endif //QTAV_HAVE(AVFILTER)
Q_UNUSED(frame);
return false;
}
} //namespace QtAV
#if QTAV_HAVE(AVFILTER)
Q_DECLARE_METATYPE(QtAV::AVFrameHolderRef)
#endif
| fuyanzhi1234/DevelopQt | QtAV-master/src/filter/LibAVFilter.cpp | C++ | mit | 17,637 |
r"""
Create MapServer class diagrams
Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html
https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph
For DOT languge see http://www.graphviz.org/doc/info/attrs.html
cd C:\Program Files (x86)\Graphviz2.38\bin
dot -Tpng D:\GitHub\mappyfile\mapfile_classes.dot -o outfile.png
outfile.png
For Entity Relationship diagrams:
https://graphviz.readthedocs.io/en/stable/examples.html#er-py
"""
import os
import pydot
# import pprint
FONT = "Lucida Sans"
def graphviz_setup(gviz_path):
os.environ['PATH'] = gviz_path + ";" + os.environ['PATH']
def add_child(graph, child_id, child_label, parent_id, colour):
"""
http://www.graphviz.org/doc/info/shapes.html#polygon
"""
node = pydot.Node(child_id, style="filled", fillcolor=colour, label=child_label, shape="polygon", fontname=FONT)
graph.add_node(node)
graph.add_edge(pydot.Edge(parent_id, node))
def add_children(graph, parent_id, d, level=0):
blue = "#6b6bd1"
white = "#fdfefd"
green = "#33a333"
colours = [blue, white, green] * 3
for class_, children in d.items():
colour = colours[level]
child_label = class_
child_id = parent_id + "_" + class_
add_child(graph, child_id, child_label, parent_id, colour)
add_children(graph, child_id, children, level+1)
def save_file(graph, fn):
filename = "%s.png" % fn
graph.write_png(filename)
graph.write("%s.dot" % fn)
os.startfile(filename)
def main(gviz_path, layer_only=False):
graphviz_setup(gviz_path)
graph = pydot.Dot(graph_type='digraph', rankdir="TB")
layer_children = {
'CLASS': {
'LABEL': {'STYLE': {}},
'CONNECTIONOPTIONS': {},
'LEADER': {'STYLE': {}},
'STYLE': {},
'VALIDATION': {}
},
'CLUSTER': {},
'COMPOSITE': {},
'FEATURE': {'POINTS': {}},
'GRID': {},
'JOIN': {},
'METADATA': {},
'PROJECTION': {},
'SCALETOKEN': {'VALUES': {}},
'VALIDATION': {}
}
# pprint.pprint(layer_children)
classes = {
"MAP": {
"LAYER": layer_children,
'LEGEND': {'LABEL': {}},
'PROJECTION': {},
'QUERYMAP': {},
'REFERENCE': {},
'SCALEBAR': {'LABEL': {}},
'SYMBOL': {},
'WEB': {'METADATA': {}, 'VALIDATION': {}}
}
}
if layer_only:
root = "LAYER"
classes = classes["MAP"]
fn = "layer_classes"
else:
fn = "map_classes"
root, = classes.keys()
node = pydot.Node(root, style="filled", fillcolor="#33a333", label=root, fontname=FONT, shape="polygon")
graph.add_node(node)
add_children(graph, root, classes[root])
save_file(graph, fn)
if __name__ == "__main__":
gviz_path = r"C:\Program Files (x86)\Graphviz2.38\bin"
main(gviz_path, True)
main(gviz_path, False)
print("Done!")
| geographika/mappyfile | docs/scripts/class_diagrams.py | Python | mit | 3,102 |
import { get_definition } from './../base';
export const push_link = (
oid, linkurl, linkname, onmenu='true', instance_name,
when, additional_args, description
) => get_definition({
oid,
linkurl,
linkname,
onmenu,
instance_name
},
{
label: 'VersionOne - Push Link',
method: 'push_link',
module: 'main',
name: 'v1plugin'
},
when, additional_args, description
); | walkerrandolphsmith/VersionOne.JavaScript.PipelineBuilder | src/plugins/v1/push_link.js | JavaScript | mit | 457 |
#region License
/* The MIT License
*
* Copyright (c) 2011 Red Badger Consulting
*
* 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.
*/
#endregion
namespace RedBadger.Xpf.Graphics
{
/// <summary>
/// Represents a Texture.
/// </summary>
public interface ITexture
{
/// <summary>
/// Gets the height of this texture in pixels.
/// </summary>
int Height { get; }
/// <summary>
/// Gets the width of this texture in pixels.
/// </summary>
int Width { get; }
}
}
| redbadger/XPF | XPF/RedBadger.Xpf/Graphics/ITexture.cs | C# | mit | 1,630 |
<?php
namespace fufudao\base;
use yii\behaviors\TimestampBehavior;
//use yii\behaviors\AttributeBehavior;
use yii\db\ActiveRecord as ar;
use yii\db\Expression;
class ActiveRecord extends ar
{
public function behaviors()
{
return [
'timestamp' => [
'class' => TimestampBehavior::className(),
'attributes' => [
ActiveRecord::EVENT_BEFORE_INSERT => ['created','modified'],
ActiveRecord::EVENT_BEFORE_UPDATE => ['modified']
],
'value' => new Expression(date('\'Y-m-d H:i:s\'')),
],
];
}
public function newID(){
$schema = $this->getTableSchema();
$primaryKey = $schema->primaryKey[0];
$col = $schema->columns[$primaryKey];
$ret = $this->getAttribute($primaryKey);
if( empty($ret) ){
if( $col->phpType === \yii\db\Schema::TYPE_STRING ){
switch ($col->size){
case 13:
$ret = uniqid();
break;
case 32:
$ret = md5(uniqid(mt_rand(), true));
break;
}
}
}
return $ret;
}
} | fufudao/yii2-base | base/ActiveRecord.php | PHP | mit | 1,074 |
SET DEFINE OFF;
CREATE SEQUENCE AFW_07_AUDIT_STRUC_APLIC_SEQ
START WITH 1
MAXVALUE 9999999999999999999999999999
MINVALUE 1
NOCYCLE
CACHE 20
NOORDER
/
| lgcarrier/APEXFramework | 5.2.3/Database/Sequences/AFW_07_AUDIT_STRUC_APLIC_SEQ.sql | SQL | mit | 162 |
#
# Cookbook Name:: dokku
# Spec:: plugins
#
# Copyright (c) 2015 Nick Charlton, MIT licensed.
require "spec_helper"
describe "dokku::plugins" do
context "when all attributes are default" do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new
runner.converge(described_recipe)
end
before do
stub_command("which nginx").and_return("/usr/bin/nginx")
end
it "does nothing" do
expect { chef_run }.to_not raise_error
end
end
context "when plugins exist in attributes and no actions are listed" do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new do |node|
node.override["dokku"]["plugins"] = [{
name: "redis",
url: "https://github.com/dokku/dokku-redis.git"
}]
end
runner.converge(described_recipe)
end
before do
stub_command("which nginx").and_return("/usr/bin/nginx")
end
it "installs plugins" do
expect(chef_run).to install_dokku_plugin(
"redis").with(url: "https://github.com/dokku/dokku-redis.git")
end
end
context "when plugins exist in attributes" do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new do |node|
node.override["dokku"]["plugins"] = [
{ name: "redis", url: "https://github.com/dokku/dokku-redis.git",
action: "install" },
{ name: "mongo", url: "https://github.com/dokku/dokku-mongo.git",
action: "uninstall" },
]
end
runner.converge(described_recipe)
end
before do
stub_command("which nginx").and_return("/usr/bin/nginx")
end
it "manages plugins" do
expect(chef_run).to install_dokku_plugin(
"redis").with(url: "https://github.com/dokku/dokku-redis.git")
expect(chef_run).to uninstall_dokku_plugin(
"mongo").with(url: "https://github.com/dokku/dokku-mongo.git")
end
end
context "when plugins to be installed provide a commit to fetch" do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new do |node|
node.override["dokku"]["plugins"] = [
{ name: "redis", url: "https://github.com/dokku/dokku-redis.git",
action: "install", committish: "0.4.4" },
]
end
runner.converge(described_recipe)
end
before do
stub_command("which nginx").and_return("/usr/bin/nginx")
end
it "installs the plugins specifying that committish" do
expect(chef_run).to install_dokku_plugin("redis").with(
url: "https://github.com/dokku/dokku-redis.git", committish: "0.4.4",
)
end
end
end
| nickcharlton/dokku-cookbook | spec/unit/recipes/plugins_spec.rb | Ruby | mit | 2,604 |
'use strict';
// Load the application's configuration
const config = require('../server/config');
const url = config.express_host + '/api';
// Required modules
const async = require('async');
const colors = require('colors');
const request = require('request');
// Counter for the Measurements
let counter = 1;
// Read the arguments from the command line or set them to the default values
const interval = process.argv[2] || 2000;
const thingName = process.argv[3] || 'Demo';
const thingLocLat = process.argv[4] || 51.964113;
const thingLocLng = process.argv[5] || 7.624862;
// REST API authentication token
let token;
console.log('\n////////////////////////////////////////////////////////////\n');
console.log(' STARTING DEMONSTRATION...'.cyan);
console.log('\n////////////////////////////////////////////////////////////\n');
async.waterfall([
// Create a new User
function(callback) {
console.log(' Creating a new', 'User...\n'.cyan);
const userJson = {
email: 'demo#' + Math.random().toFixed() + '@example.com',
password: 'demoPass'
};
// Post the new User
request.post({
headers: {'content-type': 'application/json'},
url: url + '/users',
json: userJson
}, function(error, response, body) {
if (!error) {
console.log(' New User', 'created.'.green);
token = body.token;
} else {
console.log(' New User creation', 'failed'.red);
}
console.log('\n------------------------------------------------------------\n');
callback(error, body._id);
});
},
// Create a new Thing
function(userId, callback) {
console.log(' Creating a new', 'Thing...\n'.cyan);
const thingJson = {
name: thingName,
loc: {
coordinates: [ thingLocLat, thingLocLng ]
},
userId: userId,
waterbodyId: '5752d2d7e5d703480187e0d9',
token: token
};
// Post the new Thing
request.post({
headers: {'content-type': 'application/json'},
url: url + '/things',
json: thingJson
}, function(error, response, body) {
if (!error) {
console.log(' New Thing', 'created.'.green);
} else {
console.log(' New Thing creation', 'failed'.red);
}
console.log('\n------------------------------------------------------------\n');
callback(error, body._id);
});
},
// Create a new Feature
function(thingId, callback) {
console.log(' Creating a new', 'Feature...\n'.cyan);
const featureJson = {
name: 'demoFeature',
unit: 'foo',
token: token
};
// Post the new Feature
request.post({
headers: {'content-type': 'application/json'},
url: url + '/features',
json: featureJson
}, function(error, response, body) {
if (!error) {
console.log(' New Feature', 'created'.green);
} else {
console.log(' New Feature creation', 'failed'.red);
}
console.log('\n------------------------------------------------------------\n');
callback(error, thingId, body._id);
});
},
// Create a new Sensor
function(thingId, featureId, callback) {
console.log(' Creating a new', 'Sensor...\n'.cyan);
const sensorJson = {
name: 'demoSensor',
interval: interval,
refLevel: 2,
warnLevel: 6,
riskLevel: 8,
thingId: thingId,
featureId: featureId,
token: token
};
// Post the new Sensor
request.post({
headers: {'content-type': 'application/json'},
url: url + '/sensors',
json: sensorJson
}, function(error, response, body) {
if (!error) {
console.log(' New Sensor', 'created.'.green);
} else {
console.log(' New Sensor creation', 'failed'.red);
}
console.log('\n------------------------------------------------------------\n');
callback(error, body._id);
});
},
// Create new Measurements in an interval
function(sensorId, callback) {
console.log(' Finished demo setup. Measuring now...'.cyan);
console.log('\n------------------------------------------------------------\n');
let value = 4;
setInterval(function() {
console.log(' Creating a new', 'Measurement...\n'.cyan);
// Calculate the Measurement's value as a random number with respect to its previous value
if (value < 1 || Math.random() > 0.5) {
value += Math.random();
} else {
value -= Math.random();
}
value = parseFloat(value.toFixed(2));
let measurementJson = {
date: Date.now(),
value: value,
sensorId: sensorId,
token: token
};
// Post the new Measurement
request.post({
headers: {'content-type': 'application/json'},
url: url + '/measurements',
json: measurementJson
}, function(error, response, body) {
if (!error) {
console.log(' New Measurement', ('#' + counter).cyan, 'created.'.green, '\nValue:', body.value.cyan);
counter++;
} else {
console.log(' New Measurement creation', 'failed'.red);
callback(error);
}
console.log('\n------------------------------------------------------------\n');
});
}, interval);
}
], function(err, result) {
if (err) {
console.log(err);
}
}); | mrunde/WoT-Vertical-Approach | server/demo/demoSensorController.js | JavaScript | mit | 5,051 |
import React from 'react'
import {HOC, Link} from 'cerebral-view-react'
import PageProgress from '../PageProgress'
// View
class AutoReload extends React.Component {
constructor (props) {
super(props)
this.state = {
secondsElapsed: 0
}
this.onInterval = this.onInterval.bind(this)
}
componentWillMount () {
this.intervals = []
}
componentWillUnmount () {
this.intervals.forEach(clearInterval)
}
componentDidMount () {
this.setInterval(this.onInterval, 1000)
}
setInterval () {
this.intervals.push(setInterval.apply(null, arguments))
}
onInterval () {
let secondsElapsed = 0
if (this.props.isEnabled) {
secondsElapsed = this.state.secondsElapsed + 1
if (secondsElapsed >= this.props.triggerAfterSeconds) {
this.trigger()
secondsElapsed = 0
}
}
if (secondsElapsed !== this.state.secondsElapsed) {
this.setState({
secondsElapsed: secondsElapsed
})
}
}
trigger () {
this.props.triggers.map((trigger) => trigger())
}
triggerNow (e) {
if (e) {
e.preventDefault()
}
if (this.props.isEnabled) {
if (this.state.secondsElapsed > 0) {
this.trigger()
this.setState({
secondsElapsed: 0
})
}
}
}
render () {
const signals = this.props.signals
const progress = {
isEnabled: this.props.isEnabled,
elapsed: this.state.secondsElapsed,
total: this.props.triggerAfterSeconds
}
return (
<div>
<PageProgress {...progress} />
<hr />
<pre>
BastardAutoloaderFromHell<br />
=========================<br />
[{'='.repeat(this.state.secondsElapsed)}{'.'.repeat(this.props.triggerAfterSeconds - this.state.secondsElapsed - 1)}]<br />
isEnabled: {this.props.isEnabled ? 'yepp' : 'nope'}<br />
triggerAfterSeconds: {this.props.triggerAfterSeconds}<br />
numberOfTriggers: {this.props.triggers.length}<br />
secondsElapsed: {this.state.secondsElapsed}<br />
secondsBeforeReload: {this.props.triggerAfterSeconds - this.state.secondsElapsed}<br />
-------------------------<br />
<Link signal={signals.app.reload.reloadingDisabled}>clickmeto_<b>disable</b>_reloading</Link><br />
--<br />
<Link signal={signals.app.reload.reloadingEnabled}>clickmeto_<b>enable</b>_reloading</Link><br />
--<br />
<Link signal={signals.app.reload.reloadingToggled}>clickmeto_<b>toggle</b>_reloading</Link><br />
-------------------------<br />
<a onClick={(e) => this.triggerNow(e)}>clickmeto_<b>trigger_NOW</b></a><br />
-------------------------<br />
<Link signal={signals.app.reload.triggerIntervalChanged} params={{interval: 10}}>clickmeto_reload_@<b>10_seconds</b></Link><br />
--<br />
<Link signal={signals.app.reload.triggerIntervalChanged} params={{interval: 20}}>clickmeto_reload_@<b>20_seconds</b></Link><br />
--<br />
<Link signal={signals.app.reload.triggerIntervalChanged} params={{interval: 30}}>clickmeto_reload_@<b>30_seconds</b></Link><br />
--<br />
<Link signal={signals.app.reload.triggerIntervalChanged} params={{interval: 60}}>clickmeto_reload_@<b>60_seconds</b></Link><br />
====<br />
<i>designed by pbit</i>
</pre>
</div>
)
}
}
// Model
AutoReload.propTypes = {
isEnabled: React.PropTypes.bool,
triggerAfterSeconds: React.PropTypes.number,
signals: React.PropTypes.object,
triggers: React.PropTypes.array
}
AutoReload.defaultProps = {
triggers: []
}
// Binding
const StatefullAutoReload = HOC(AutoReload, {
isEnabled: ['app', 'reload', 'isEnabled'],
triggerAfterSeconds: ['app', 'reload', 'triggerAfterSeconds']
})
// API
export default StatefullAutoReload
| burning-duck/twibral | src/ui/components/AutoReload/index.js | JavaScript | mit | 3,914 |
#!/bin/bash
#SBATCH --partition=mono
#SBATCH --ntasks=1
#SBATCH --time=4-0:00
#SBATCH --mem-per-cpu=8000
#SBATCH -J Deep-RBM_DBM_4_inc_bin_PARAL_base
#SBATCH -e Deep-RBM_DBM_4_inc_bin_PARAL_base.err.txt
#SBATCH -o Deep-RBM_DBM_4_inc_bin_PARAL_base.out.txt
source /etc/profile.modules
module load gcc
module load matlab
cd ~/deepLearn && srun ./deepFunction 4 'RBM' 'DBM' '128 1000 1500 10' '0 1 1 1' '4_inc_bin' 'PARAL_base' "'iteration.n_epochs', 'learning.lrate', 'learning.cd_k', 'learning.persistent_cd', 'parallel_tempering.use'" '200 1e-3 1 0 1' "'iteration.n_epochs', 'learning.persistent_cd'" '200 1' | aciditeam/matlab-ts | jobs/deepJobs_RBM_DBM_4_inc_bin_PARAL_base.sh | Shell | mit | 619 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Task Management System</title>
<!-- Bootstrap Core CSS -->
<link href="<?=base_url()?>assets/css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="<?=base_url()?>assets/css/metisMenu.min.css" rel="stylesheet">
<!-- DataTables CSS -->
<link href="<?=base_url()?>assets/css/dataTables.bootstrap.css" rel="stylesheet">
<link href="<?=base_url()?>assets/css/bootstrap-editable.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="<?=base_url()?>assets/css/main.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="<?=base_url()?>assets/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- Custom tab icons -->
<link rel="shortcut icon" href="<?=base_url()?>assets/images/favicon.ico" type="image/x-icon">
<link href="<?=base_url()?>assets/js/jquery-ui-1.11.4.custom/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url()?>assets/js/jquery-ui-1.11.4.custom/jquery-ui-custom-datepicker.css" rel="stylesheet" type="text/css" />
<input type="hidden" id="base-url" value="<?=base_url()?>"/>
<input type="hidden" id="current-page" value=""/>
<input type="hidden" id="current-status-filter" value=""/>
<input type="hidden" id="current-page-child" value=""/>
<input type="hidden" id="current-parentID" value=""/>
<input type="hidden" id="current-status-filter-child" value=""/>
<input type="hidden" id="current-child-parentID" value=""/>
<style>
.inline-block{display:inline-block;}
</style>
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-static-top text-center" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<a class="navbar-brand" href="<?=base_url();?>">
<div class="inline"> Welcome to Streamfream Task Management System </div>
</a>
</div>
</nav>
<!-- /.navbar-header -->
<!-- /.navbar-top-links --> | rudiliu/task_management | application/views/frame/header_view.php | PHP | mit | 2,394 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<title>Test Users Roles Demote</title>
</head>
<body>
<?php
require_once('test-util.php');
require_once(dirname(__FILE__) . '/../lib/ca-main.php');
echo '<div class="apitest">';
echo '<h1>users_roles_demote</h1>';
$ca = new CityApi();
$ca->debug = true;
$ca->json = true;
$userid = 238801;
$roleid = 986632;
$args = array('title' => 'Participant');
$results = $ca->users_roles_demote($userid, $roleid, $args);
echo '<h2>Formatted JSON results: </h2>';
echo '<pre>';
echo format_json($results);
echo '</pre>';
echo '</div>';
?>
</body>
</html>
| johnroberts/thecity-admin-php | test/test-users-roles-demote.php | PHP | mit | 861 |
# coffeehaus
A coffeescript shop for JVM locals.
## /!\ Extraction in progress
This library is the extraction of the coffeescript compiler used
in [coffeescripted-sbt](https://github.com/softprops/coffeescripted-sbt) for use as a standalone library
## install
(todo)
## usage
This library provides scala interfaces for compiling [vanilla][vanilla] and [iced][iced] CoffeeScript.
It uses the versions `1.6.3` and `1.6.3-b` respectively.
To compile vanilla coffeescript
```scala
coffeehaus.Compile.vanilla()("alert 'vanilla'")
```
or simply
```scala
coffeehaus.Compile("alert 'vanilla'")
```
To compile iced coffeescript
```scala
coffeehaus.Compile.iced()("alert 'iced'")
```
These will return a `Either[coffeehaus.CompilerError, String]` with the compiled source.
Don't have time to wait while your coffee's being brewed? Try moving to the side of the counter.
```scala
import coffeehaus.Compile
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
Future(Compile("alert 'vanilla'")).map { coffee =>
Thread.sleep(1000)
coffee.fold(println, println)
}
println("checkin' my tweets")
```
### Be Your Own Barista
This library will always make a best attempt at providing interfaces to the latest coffeescript compilers.
That doesn't mean you can't experiment with your own brews ( other versions of coffeescript ) by extending `coffeehaus.Compile` providing
a resource path to the source of the script. As an example the built-in vanilla coffeescript compiler is defined as follows
```scala
Vanilla extends Compile("vanilla/coffee-script.js")
```
enjoy.
Doug Tangren (softprops) 2013
[vanilla]: http://coffeescript.org/
[iced]: http://maxtaco.github.io/coffee-script/
| softprops/coffeehaus | README.md | Markdown | mit | 1,727 |
# Author: John Elkins <[email protected]>
# License: MIT <LICENSE>
from common import *
if len(sys.argv) < 2:
log('ERROR output directory is required')
time.sleep(3)
exit()
# setup the output directory, create it if needed
output_dir = sys.argv[1]
if not os.path.exists(output_dir):
os.makedirs(output_dir)
# log in and load personal library
api = open_api()
library = load_personal_library()
def playlist_handler(playlist_name, playlist_description, playlist_tracks):
# skip empty and no-name playlists
if not playlist_name: return
if len(playlist_tracks) == 0: return
# setup output files
playlist_name = playlist_name.replace('/', '')
open_log(os.path.join(output_dir,playlist_name+u'.log'))
outfile = codecs.open(os.path.join(output_dir,playlist_name+u'.csv'),
encoding='utf-8',mode='w')
# keep track of stats
stats = create_stats()
export_skipped = 0
# keep track of songids incase we need to skip duplicates
song_ids = []
log('')
log('============================================================')
log(u'Exporting '+ unicode(len(playlist_tracks)) +u' tracks from '
+playlist_name)
log('============================================================')
# add the playlist description as a "comment"
if playlist_description:
outfile.write(tsep)
outfile.write(playlist_description)
outfile.write(os.linesep)
for tnum, pl_track in enumerate(playlist_tracks):
track = pl_track.get('track')
# we need to look up these track in the library
if not track:
library_track = [
item for item in library if item.get('id')
in pl_track.get('trackId')]
if len(library_track) == 0:
log(u'!! '+str(tnum+1)+repr(pl_track))
export_skipped += 1
continue
track = library_track[0]
result_details = create_result_details(track)
if not allow_duplicates and result_details['songid'] in song_ids:
log('{D} '+str(tnum+1)+'. '+create_details_string(result_details,True))
export_skipped += 1
continue
# update the stats
update_stats(track,stats)
# export the track
song_ids.append(result_details['songid'])
outfile.write(create_details_string(result_details))
outfile.write(os.linesep)
# calculate the stats
stats_results = calculate_stats_results(stats,len(playlist_tracks))
# output the stats to the log
log('')
log_stats(stats_results)
log(u'export skipped: '+unicode(export_skipped))
# close the files
close_log()
outfile.close()
# the personal library is used so we can lookup tracks that fail to return
# info from the ...playlist_contents() call
playlist_contents = api.get_all_user_playlist_contents()
for playlist in playlist_contents:
playlist_name = playlist.get('name')
playlist_description = playlist.get('description')
playlist_tracks = playlist.get('tracks')
playlist_handler(playlist_name, playlist_description, playlist_tracks)
if export_thumbs_up:
# get thumbs up playlist
thumbs_up_tracks = []
for track in library:
if track.get('rating') is not None and int(track.get('rating')) > 1:
thumbs_up_tracks.append(track)
# modify format of each dictionary to match the data type
# of the other playlists
thumbs_up_tracks_formatted = []
for t in thumbs_up_tracks:
thumbs_up_tracks_formatted.append({'track': t})
playlist_handler('Thumbs up', 'Thumbs up tracks', thumbs_up_tracks_formatted)
if export_all:
all_tracks_formatted = []
for t in library:
all_tracks_formatted.append({'track': t})
playlist_handler('All', 'All tracks', all_tracks_formatted)
close_api()
| soulfx/gmusic-playlist | ExportLists.py | Python | mit | 3,890 |
require "./test/test_helper"
require "pinker/rule"
include Pinker
regarding "remember helps gather up things that get returned if the rule is valid." do
class Request
def initialize(path_info, query_string=nil)
@path_info = path_info
@query_string = query_string
end
end
test "stick things in memory, return them with a successful result" do
rule =
RuleBuilder.new(Request) {
declare("Path must have at least three sections"){@path_info.split("/").length>=3}
remember { |memory|
memory[:resource_type] = @path_info.split("/")[2]
}
}.build
assert{ rule.apply_to(Request.new("/v1/widgets/foo")).memory ==
{:resource_type => "widgets"}
}
end
test "disregard the results of remembers" do
rule =
RuleBuilder.new(Request) {
remember { |memory, context|
memory[:x] = "y"
nil #caused explosions at one time
}
}.build
assert{ rule.apply_to(Request.new("/v1/widgets/foo")).memory ==
{:x => "y"}
}
end
test "cache useful things across calls using context" do
the_rule =
RuleBuilder.new(Request) {
declare("Path must have at least three sections") { |call, context|
(context[:path_parts]=@path_info.split("/")).length>=3
}
with_rule(:text_is_widgets){|rule, context|rule.apply_to(context[:path_parts][2])}
rule(:text_is_widgets) {
declare("Must be widgets"){self=="widgets"}
}
remember { |memory, context|
memory[:resource_type] = context[:path_parts][2]
}
}.build
assert{ the_rule.apply_to(Request.new("/v1/widgets/foo")).satisfied? }
assert{ the_rule.apply_to(Request.new("/v1/widgets/foo")).memory ==
{:resource_type => "widgets"}
}
end
test "if a remember fails and nothing else has, bubble up the error" do
rule =
RuleBuilder.new(Request) {
declare { |call, context|
(context[:path_parts]=@path_info.split("/")).length>=3 || call.fail("Path must have at least three sections")
}
remember { |memory, context|
raise StandardError.new("blam!")
}
}.build
assert{ rescuing{ rule.apply_to(Request.new("/v1/widgets/foo")) }.message ==
"blam!"
}
end
test "if something else has already failed, swallow the exception. this is a 'best effort'/completeness failure strategy." do
rule =
RuleBuilder.new(Request) {
declare { |call, context|
@path_info.split("/").length>=99 || call.fail("Path must have at least 99 sections")
}
remember { |memory, context|
raise StandardError.new("blam!")
}
}.build
assert{ rescuing{ rule.apply_to(Request.new("/v1/widgets/foo")) }.nil? }
assert{ rule.apply_to(Request.new("/v1/widgets/foo")).problems.first.message == "Path must have at least 99 sections" }
end
test "merge together memory hashes from rules" do
grammar =
RuleBuilder.new(:foo) {
rule(:a) {
remember{|memory|memory[:a] = 1}
with_rule(:b){|rule|rule.apply_to("y")}
}
rule(:b) {
remember{|memory|memory[:b] = 2}
}
}.build
assert{ grammar.apply_to("x").memory == {:a => 1, :b => 2} }
end
end
| sconover/pinker | test/remember_test.rb | Ruby | mit | 3,447 |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
//
// Why base-58 instead of standard base-64 encoding?
// - Don't want 0OIl characters that look the same in some fonts and
// could be used to create visually identical looking account numbers.
// - A string with non-alphanumeric characters is not as easily accepted as an account number.
// - E-mail usually won't line-break if there's no punctuation to break at.
// - Double-clicking selects the whole number as one word if it's all alphanumeric.
//
#ifndef BITCOIN_BASE58_H
#define BITCOIN_BASE58_H
#include <string>
#include <vector>
#include "bignum.h"
#include "key.h"
#include "script.h"
static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
// Encode a byte sequence as a base58-encoded string
inline std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)
{
CAutoBN_CTX pctx;
CBigNum bn58 = 58;
CBigNum bn0 = 0;
// Convert big endian data to little endian
// Extra zero at the end make sure bignum will interpret as a positive number
std::vector<unsigned char> vchTmp(pend-pbegin+1, 0);
reverse_copy(pbegin, pend, vchTmp.begin());
// Convert little endian data to bignum
CBigNum bn;
bn.setvch(vchTmp);
// Convert bignum to std::string
std::string str;
// Expected size increase from base58 conversion is approximately 137%
// use 138% to be safe
str.reserve((pend - pbegin) * 138 / 100 + 1);
CBigNum dv;
CBigNum rem;
while (bn > bn0)
{
if (!BN_div(&dv, &rem, &bn, &bn58, pctx))
throw bignum_error("EncodeBase58 : BN_div failed");
bn = dv;
unsigned int c = rem.getulong();
str += pszBase58[c];
}
// Leading zeroes encoded as base58 zeros
for (const unsigned char* p = pbegin; p < pend && *p == 0; p++)
str += pszBase58[0];
// Convert little endian std::string to big endian
reverse(str.begin(), str.end());
return str;
}
// Encode a byte vector as a base58-encoded string
inline std::string EncodeBase58(const std::vector<unsigned char>& vch)
{
return EncodeBase58(&vch[0], &vch[0] + vch.size());
}
// Decode a base58-encoded string psz into byte vector vchRet
// returns true if decoding is successful
inline bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet)
{
CAutoBN_CTX pctx;
vchRet.clear();
CBigNum bn58 = 58;
CBigNum bn = 0;
CBigNum bnChar;
while (isspace(*psz))
psz++;
// Convert big endian string to bignum
for (const char* p = psz; *p; p++)
{
const char* p1 = strchr(pszBase58, *p);
if (p1 == NULL)
{
while (isspace(*p))
p++;
if (*p != '\0')
return false;
break;
}
bnChar.setulong(p1 - pszBase58);
if (!BN_mul(&bn, &bn, &bn58, pctx))
throw bignum_error("DecodeBase58 : BN_mul failed");
bn += bnChar;
}
// Get bignum as little endian data
std::vector<unsigned char> vchTmp = bn.getvch();
// Trim off sign byte if present
if (vchTmp.size() >= 2 && vchTmp.end()[-1] == 0 && vchTmp.end()[-2] >= 0x80)
vchTmp.erase(vchTmp.end()-1);
// Restore leading zeros
int nLeadingZeros = 0;
for (const char* p = psz; *p == pszBase58[0]; p++)
nLeadingZeros++;
vchRet.assign(nLeadingZeros + vchTmp.size(), 0);
// Convert little endian data to big endian
reverse_copy(vchTmp.begin(), vchTmp.end(), vchRet.end() - vchTmp.size());
return true;
}
// Decode a base58-encoded string str into byte vector vchRet
// returns true if decoding is successful
inline bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet)
{
return DecodeBase58(str.c_str(), vchRet);
}
// Encode a byte vector to a base58-encoded string, including checksum
inline std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn)
{
// add 4-byte hash check to the end
std::vector<unsigned char> vch(vchIn);
uint256 hash = Hash(vch.begin(), vch.end());
vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
return EncodeBase58(vch);
}
// Decode a base58-encoded string psz that includes a checksum, into byte vector vchRet
// returns true if decoding is successful
inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet)
{
if (!DecodeBase58(psz, vchRet))
return false;
if (vchRet.size() < 4)
{
vchRet.clear();
return false;
}
uint256 hash = Hash(vchRet.begin(), vchRet.end()-4);
if (memcmp(&hash, &vchRet.end()[-4], 4) != 0)
{
vchRet.clear();
return false;
}
vchRet.resize(vchRet.size()-4);
return true;
}
// Decode a base58-encoded string str that includes a checksum, into byte vector vchRet
// returns true if decoding is successful
inline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet)
{
return DecodeBase58Check(str.c_str(), vchRet);
}
/** Base class for all base58-encoded data */
class CBase58Data
{
protected:
// the version byte
unsigned char nVersion;
// the actually encoded data
std::vector<unsigned char> vchData;
CBase58Data()
{
nVersion = 0;
vchData.clear();
}
~CBase58Data()
{
// zero the memory, as it may contain sensitive data
if (!vchData.empty())
memset(&vchData[0], 0, vchData.size());
}
void SetData(int nVersionIn, const void* pdata, size_t nSize)
{
nVersion = nVersionIn;
vchData.resize(nSize);
if (!vchData.empty())
memcpy(&vchData[0], pdata, nSize);
}
void SetData(int nVersionIn, const unsigned char *pbegin, const unsigned char *pend)
{
SetData(nVersionIn, (void*)pbegin, pend - pbegin);
}
public:
bool SetString(const char* psz)
{
std::vector<unsigned char> vchTemp;
DecodeBase58Check(psz, vchTemp);
if (vchTemp.empty())
{
vchData.clear();
nVersion = 0;
return false;
}
nVersion = vchTemp[0];
vchData.resize(vchTemp.size() - 1);
if (!vchData.empty())
memcpy(&vchData[0], &vchTemp[1], vchData.size());
memset(&vchTemp[0], 0, vchTemp.size());
return true;
}
bool SetString(const std::string& str)
{
return SetString(str.c_str());
}
std::string ToString() const
{
std::vector<unsigned char> vch(1, nVersion);
vch.insert(vch.end(), vchData.begin(), vchData.end());
return EncodeBase58Check(vch);
}
int CompareTo(const CBase58Data& b58) const
{
if (nVersion < b58.nVersion) return -1;
if (nVersion > b58.nVersion) return 1;
if (vchData < b58.vchData) return -1;
if (vchData > b58.vchData) return 1;
return 0;
}
bool operator==(const CBase58Data& b58) const { return CompareTo(b58) == 0; }
bool operator<=(const CBase58Data& b58) const { return CompareTo(b58) <= 0; }
bool operator>=(const CBase58Data& b58) const { return CompareTo(b58) >= 0; }
bool operator< (const CBase58Data& b58) const { return CompareTo(b58) < 0; }
bool operator> (const CBase58Data& b58) const { return CompareTo(b58) > 0; }
};
/** base58-encoded Bitcoin addresses.
* Public-key-hash-addresses have version 0 (or 111 testnet).
* The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key.
* Script-hash-addresses have version 5 (or 196 testnet).
* The data vector contains RIPEMD160(SHA256(cscript)), where cscript is the serialized redemption script.
*/
class CBitcoinAddress;
class CBitcoinAddressVisitor : public boost::static_visitor<bool>
{
private:
CBitcoinAddress *addr;
public:
CBitcoinAddressVisitor(CBitcoinAddress *addrIn) : addr(addrIn) { }
bool operator()(const CKeyID &id) const;
bool operator()(const CScriptID &id) const;
bool operator()(const CNoDestination &no) const;
};
class CBitcoinAddress : public CBase58Data
{
public:
enum
{
PUBKEY_ADDRESS = 25, // Basecoin: address begin with 'B'
SCRIPT_ADDRESS = 8,
PUBKEY_ADDRESS_TEST = 111,
SCRIPT_ADDRESS_TEST = 196,
};
bool Set(const CKeyID &id) {
SetData(fTestNet ? PUBKEY_ADDRESS_TEST : PUBKEY_ADDRESS, &id, 20);
return true;
}
bool Set(const CScriptID &id) {
SetData(fTestNet ? SCRIPT_ADDRESS_TEST : SCRIPT_ADDRESS, &id, 20);
return true;
}
bool Set(const CTxDestination &dest)
{
return boost::apply_visitor(CBitcoinAddressVisitor(this), dest);
}
bool IsValid() const
{
unsigned int nExpectedSize = 20;
bool fExpectTestNet = false;
switch(nVersion)
{
case PUBKEY_ADDRESS:
nExpectedSize = 20; // Hash of public key
fExpectTestNet = false;
break;
case SCRIPT_ADDRESS:
nExpectedSize = 20; // Hash of CScript
fExpectTestNet = false;
break;
case PUBKEY_ADDRESS_TEST:
nExpectedSize = 20;
fExpectTestNet = true;
break;
case SCRIPT_ADDRESS_TEST:
nExpectedSize = 20;
fExpectTestNet = true;
break;
default:
return false;
}
return fExpectTestNet == fTestNet && vchData.size() == nExpectedSize;
}
CBitcoinAddress()
{
}
CBitcoinAddress(const CTxDestination &dest)
{
Set(dest);
}
CBitcoinAddress(const std::string& strAddress)
{
SetString(strAddress);
}
CBitcoinAddress(const char* pszAddress)
{
SetString(pszAddress);
}
CTxDestination Get() const {
if (!IsValid())
return CNoDestination();
switch (nVersion) {
case PUBKEY_ADDRESS:
case PUBKEY_ADDRESS_TEST: {
uint160 id;
memcpy(&id, &vchData[0], 20);
return CKeyID(id);
}
case SCRIPT_ADDRESS:
case SCRIPT_ADDRESS_TEST: {
uint160 id;
memcpy(&id, &vchData[0], 20);
return CScriptID(id);
}
}
return CNoDestination();
}
bool GetKeyID(CKeyID &keyID) const {
if (!IsValid())
return false;
switch (nVersion) {
case PUBKEY_ADDRESS:
case PUBKEY_ADDRESS_TEST: {
uint160 id;
memcpy(&id, &vchData[0], 20);
keyID = CKeyID(id);
return true;
}
default: return false;
}
}
bool IsScript() const {
if (!IsValid())
return false;
switch (nVersion) {
case SCRIPT_ADDRESS:
case SCRIPT_ADDRESS_TEST: {
return true;
}
default: return false;
}
}
};
bool inline CBitcoinAddressVisitor::operator()(const CKeyID &id) const { return addr->Set(id); }
bool inline CBitcoinAddressVisitor::operator()(const CScriptID &id) const { return addr->Set(id); }
bool inline CBitcoinAddressVisitor::operator()(const CNoDestination &id) const { return false; }
/** A base58-encoded secret key */
class CBitcoinSecret : public CBase58Data
{
public:
void SetSecret(const CSecret& vchSecret, bool fCompressed)
{
assert(vchSecret.size() == 32);
SetData(128 + (fTestNet ? CBitcoinAddress::PUBKEY_ADDRESS_TEST : CBitcoinAddress::PUBKEY_ADDRESS), &vchSecret[0], vchSecret.size());
if (fCompressed)
vchData.push_back(1);
}
CSecret GetSecret(bool &fCompressedOut)
{
CSecret vchSecret;
vchSecret.resize(32);
memcpy(&vchSecret[0], &vchData[0], 32);
fCompressedOut = vchData.size() == 33;
return vchSecret;
}
bool IsValid() const
{
bool fExpectTestNet = false;
switch(nVersion)
{
case (128 + CBitcoinAddress::PUBKEY_ADDRESS):
break;
case (128 + CBitcoinAddress::PUBKEY_ADDRESS_TEST):
fExpectTestNet = true;
break;
default:
return false;
}
return fExpectTestNet == fTestNet && (vchData.size() == 32 || (vchData.size() == 33 && vchData[32] == 1));
}
bool SetString(const char* pszSecret)
{
return CBase58Data::SetString(pszSecret) && IsValid();
}
bool SetString(const std::string& strSecret)
{
return SetString(strSecret.c_str());
}
CBitcoinSecret(const CSecret& vchSecret, bool fCompressed)
{
SetSecret(vchSecret, fCompressed);
}
CBitcoinSecret()
{
}
};
#endif
| basecoin/basecoin | src/base58.h | C | mit | 13,111 |
/* Client-side router settings */
Router.configure({
layoutTemplate:"layout",
notFoundTemplate:"page_not_found",
loadingTemplate:"loading"
});
Router.route("/", {
name:"home",
template:"home"
});
Router.route("/profile", {
name:"profile",
template:"profile"
});
Router.route("/admin", {
name:"admin",
template:"admin"
});
Router.route("/user/:_id", {
name:"user",
template:"user",
data: function(){
return Meteor.users.findOne({_id: this.params._id});
}
});
| RadioRevolt/DABelFish | client/router.js | JavaScript | mit | 494 |
/*---------------------------------------------------------------------------------
Name : amixer.c
Author : Marvin Raaijmakers
Description : Plugin for keyTouch that can change the volume (using amixer).
Date of last change: 24-Sep-2006
History : 24-Sep-2006 Added two new plugin functions:
"Volume increase 10%" and "Volume decrease 10%"
05-Mar-2006 - clean_exit() will be used to exit the client
process, that manages the volume bar, cleanly
- update_window() now returns a boolean indicating
if the function should be called again
29-Jan-2006 Added the GUI volume bar to the plugin
Copyright (C) 2005-2006 Marvin Raaijmakers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-----------------------------------------------------------------------------------*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <gtk/gtk.h>
#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <string.h>
#include <plugin.h>
#include <amixer-plugin.h>
void vol_increase (KTPreferences *preferences);
void vol_decrease (KTPreferences *preferences);
void vol_increase_10 (KTPreferences *preferences);
void vol_decrease_10 (KTPreferences *preferences);
void mute (KTPreferences *preferences);
static void create_window (VOLUMEBAR_INFO *volumebar_info);
static int get_current_volume (void);
static void update_volume_bar (GtkWidget *volume_bar);
static gboolean update_window (VOLUMEBAR_INFO *volumebar_info);
static void clean_exit (int sig);
static void start_window (void);
static char *get_keytouch_user_dir (void);
static void change_volume (char *command);
static Boolean is_muted = FALSE;
KeytouchPlugin plugin_struct = {
{"Amixer", "Marvin Raaijmakers", "GPL 2", "2.3",
"This plugin allows you to change the volume. It also shows\n"
"the current volume when it changes. To use this plugin amixer\n"
"needs to be installed."},
"amixer.so",
5,
{{"Volume increase", KTPluginFunctionType_Function, {.function = vol_increase}},
{"Volume decrease", KTPluginFunctionType_Function, {.function = vol_decrease}},
{"Volume increase 10%", KTPluginFunctionType_Function, {.function = vol_increase_10}},
{"Volume decrease 10%", KTPluginFunctionType_Function, {.function = vol_decrease_10}},
{"Mute", KTPluginFunctionType_Function, {.function = mute}},
}
};
void
create_window (VOLUMEBAR_INFO *volumebar_info)
/*
Input:
-
Output:
volumebar_info - The window element points to the created window and the
volume_bar element points to the volume progressbar in the
window
Returns:
-
Description:
This function creates a window with a progressbar with the following
properties:
- It is positioned in the center ot the screen.
- It has no window decorations and can not be resized by the user.
- It will allways be above other windows.
- It is visible on all desktops.
- It will not be visible in the taskbar an pager.
- It does not accept focus.
*/
{
volumebar_info->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_position (GTK_WINDOW (volumebar_info->window), GTK_WIN_POS_CENTER);
gtk_window_set_resizable (GTK_WINDOW (volumebar_info->window), FALSE);
gtk_window_set_decorated (GTK_WINDOW (volumebar_info->window), FALSE);
/* The window will allways be above others */
gtk_window_set_keep_above (GTK_WINDOW (volumebar_info->window), TRUE);
/* Let the window be visible on all desktops: */
gtk_window_stick (GTK_WINDOW (volumebar_info->window));
/* This window will not be visible in the taskbar: */
gtk_window_set_skip_taskbar_hint (GTK_WINDOW (volumebar_info->window), TRUE);
/* This window will not be visible in the pager: */
gtk_window_set_skip_pager_hint (GTK_WINDOW (volumebar_info->window), TRUE);
gtk_window_set_accept_focus (GTK_WINDOW (volumebar_info->window), FALSE);
volumebar_info->volume_bar = gtk_progress_bar_new();
gtk_widget_show (volumebar_info->volume_bar);
gtk_container_add (GTK_CONTAINER (volumebar_info->window), volumebar_info->volume_bar);
gtk_widget_set_size_request (volumebar_info->volume_bar, 231, 24);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (volumebar_info->volume_bar), 0.52);
gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (volumebar_info->volume_bar), 0.02);
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (volumebar_info->volume_bar), "Volume");
}
int
get_current_volume (void)
/*
Returns:
The current volume retrieved from amixer. -1 will be returned when
retrieving the volume failed.
*/
{
FILE *amixer;
char c;
int volume = -1;
amixer = popen ("amixer sget Master | grep \"Front Left:\"", "r");
if (amixer)
{
do {
c = getc(amixer);
/* We have found the volume when the following appears:
* '[' followed by an integer followed by '%'
*/
if (c == '[' && fscanf(amixer, "%d", &volume) && (c = getc(amixer)) == '%')
{
break;
}
volume = -1;
} while (c != '\n' && c != EOF);
pclose (amixer);
}
return (volume);
}
void
update_volume_bar (GtkWidget *volume_bar)
/*
Output:
volume_bar - Will show the percentage of the current volume
*/
{
int volume;
gchar *text;
volume = get_current_volume();
if (volume && volume != -1)
{
text = g_strdup_printf("Volume %d%%", volume);
if (text)
{
gtk_progress_bar_set_text (GTK_PROGRESS_BAR(volume_bar), text);
g_free (text);
}
}
else
{
volume = 0;
gtk_progress_bar_set_text (GTK_PROGRESS_BAR(volume_bar), "Muted");
}
gtk_progress_set_percentage (GTK_PROGRESS(volume_bar), (gdouble)volume/100.0);
/* Directly draw the progressbar: */
while (g_main_context_iteration(NULL, FALSE))
; /* NULL Statement */
}
gboolean
update_window (VOLUMEBAR_INFO *volumebar_info)
/*
Input:
volumebar_info->close_time - The time to close the window
Output:
volumebar_info - Will be updated
Returns:
TRUE if this function should be called again after UPDATE_INTERVAL
miliseconds, otherwise FALSE.
Description:
This function destroys volumebar_info->window and escapes from the GTK main
routine if the current time is later than volumebar_info->close_time. If not
then the volume bar will be updated with the current volume.
*/
{
MSGBUF msg;
Boolean close_window;
/* Check if there is a new message on the queue */
if (msgrcv(volumebar_info->msgqid, &msg, sizeof(msg.time), 1, IPC_NOWAIT) != -1)
{
volumebar_info->close_time = msg.time + SHOW_WINDOW_TIME;
}
close_window = (time(NULL) > volumebar_info->close_time);
if (!close_window)
{
update_volume_bar (volumebar_info->volume_bar);
}
else
{
gtk_widget_destroy (volumebar_info->window);
gtk_main_quit();
}
return !close_window;
}
void
start_window (void)
/*
Description:
This function creates a window with a volume bar and shows it
SHOW_WINDOW_TIME seconds when it receives a message on the message queue.
The key of the message queue is generated by running
ftok(get_keytouch_user_dir(), MSGQ_AMIXER_PROJ_ID). The messages that are
sent to this queue should contain the time they are sent. The volume window
will be showed from the time this function receives the message, until the
time the message was sent plus SHOW_WINDOW_TIME seconds.
*/
{
MSGBUF msg;
VOLUMEBAR_INFO volumebar_info;
key_t msgq_key;
char *keytouch_user_dir;
gtk_init (0, NULL);
keytouch_user_dir = get_keytouch_user_dir();
/* Get the key for the message queue */
msgq_key = ftok(keytouch_user_dir, MSGQ_AMIXER_PROJ_ID);
free (keytouch_user_dir);
if (msgq_key == -1)
{
perror ("keytouch amixer plugin");
return;
}
/* Get the message queue identifier and create the queue if necessary */
volumebar_info.msgqid = msgget(msgq_key, 0);
if (volumebar_info.msgqid == -1)
{
perror ("keytouch amixer plugin");
return;
}
while (1)
{
if (msgrcv(volumebar_info.msgqid, &msg, sizeof(msg.time), 1, 0) != -1)
{
volumebar_info.close_time = msg.time + SHOW_WINDOW_TIME;
if (time(NULL) <= volumebar_info.close_time)
{
create_window (&volumebar_info);
update_volume_bar (volumebar_info.volume_bar);
gtk_widget_show (volumebar_info.window);
g_timeout_add (UPDATE_INTERVAL, (GSourceFunc) update_window, &volumebar_info);
gtk_main();
}
}
}
}
char
*get_keytouch_user_dir (void)
/*
Returns:
The address of some new allocated space which is a string containing the
value of the environment variable HOME followed by "/.keytouch2".
*/
{
char *keytouch_dir, *home;
home = getenv("HOME");
if (home == NULL)
{
fputs ("keytouch amixer plugin: could not get environment variable $HOME", stderr);
exit (EXIT_FAILURE);
}
if (asprintf(&keytouch_dir, "%s/.keytouch2", home) == -1)
{
fputs ("keytouch amixer plugin: asprintf() failed. "
"This is probably caused because it failed to allocate memory.", stderr);
exit (EXIT_FAILURE);
}
return (keytouch_dir);
}
void
clean_exit (int sig)
{
exit (EXIT_SUCCESS);
}
void
send_volume_changed_signal (void)
/*
Description:
This function sends a signal to the child program that manages the
volumebar. The child will receive the signal and will show the volumebar.
The child process will be created if it does not exist yet.
*/
{
static int qid = -1;
MSGBUF msg;
/* If this is the first time this function was called */
if (qid == -1)
{
key_t msgq_key;
char *keytouch_user_dir;
keytouch_user_dir = get_keytouch_user_dir();
/* Get the key for the message queue */
msgq_key = ftok(keytouch_user_dir, MSGQ_AMIXER_PROJ_ID);
free (keytouch_user_dir);
if (msgq_key == -1)
{
perror ("keytouch amixer plugin");
return;
}
/* Get the message queue identifier and create the queue if necessary */
qid = msgget(msgq_key, MSGQ_PERMISSIONS | IPC_CREAT);
if (qid == -1)
{
perror ("keytouch amixer plugin");
return;
}
if (fork() == 0)
{
/* Trap key signals */
signal (SIGINT, clean_exit);
signal (SIGQUIT, clean_exit);
signal (SIGTERM, clean_exit);
/* We will now start the run_window() function in our
* child process for showing a volume bar to the user
*/
start_window();
exit (EXIT_SUCCESS); /* We will never get here because of
* the infinite loop in run_window()
*/
}
}
msg.mtype = 1;
msg.time = time(NULL);
if (msgsnd(qid, &msg, sizeof(msg.time), 0) == -1)
{
perror ("keytouch amixer plugin");
}
}
void
change_volume (char *command)
/*
Input:
command - The command that changes the volume.
Description:
This function executes 'command' in a child process and then calls
send_volume_changed_signal().
*/
{
if (fork() == 0)
{
execlp ("sh", "sh", "-c", command, NULL);
exit (EXIT_SUCCESS);
}
else
{
send_volume_changed_signal();
}
}
void
vol_increase (KTPreferences *preferences)
{
is_muted = FALSE;
change_volume ( CHANGE_VOL_CMD(VOL_DEFAULT_INCR) );
}
void
vol_decrease (KTPreferences *preferences)
{
is_muted &= !get_current_volume();
change_volume ( CHANGE_VOL_CMD(VOL_DEFAULT_DECR) );
}
void
vol_increase_10 (KTPreferences *preferences)
{
is_muted = FALSE;
change_volume ( CHANGE_VOL_CMD(VOL_10PERCENT_INCR) );
}
void
vol_decrease_10 (KTPreferences *preferences)
{
is_muted &= !get_current_volume();
change_volume ( CHANGE_VOL_CMD(VOL_10PERCENT_DECR) );
}
void
mute (KTPreferences *preferences)
{
static int prev_volume = -1;
int current_volume;
char *command = NULL;
current_volume = get_current_volume();
is_muted &= !current_volume;
if (is_muted)
{
/* Tell amixer to set the volume to prev_volume */
if (asprintf(&command, "amixer sset Master %d%% > /dev/null", prev_volume) == -1)
{
fputs ("keytouch amixer plugin: asprintf() failed. "
"This is probably caused because it failed to allocate memory.", stderr);
}
}
else if (current_volume)
{
/* Tell amixer to set the volume to 0 */
command = strdup("amixer sset Master 0% > /dev/null");
if (command == NULL)
{
perror ("keytouch amixer plugin");
}
prev_volume = current_volume;
}
/* Do we have to mute/unmute? */
if (command)
{
if (fork() == 0)
{
execlp ("sh", "sh", "-c", command, NULL);
exit (EXIT_SUCCESS);
}
else
{
send_volume_changed_signal();
}
free (command);
is_muted = !is_muted;
}
}
| paulmadore/G-Keymap | Reference Code/keymap/keytouch-2.2.4/plugins/amixer.c | C | mit | 13,098 |
<?php
namespace S327at\L51blog\Models;
use Illuminate\Database\Eloquent\Model;
class Group extends Model {
} | s327at/l51blog | src/Models/Group.php | PHP | mit | 114 |
# Dokumenttien laatiminen
Tämän ohjesivun sisältö:
- Dokumentoinnin periaatteet
- Uuden sivudokumentin laatiminen, muokkaaminen ja päivittäminen
- Taulukoiden tekeminen piazzalla
- Uuden tiedostodokumentin laatiminen, tiedoston nostaminen piazzalle, muokkaaminen ja päivittäminen
- Dokumenttien linkitys
- Kuvan liittäminen dokumenttiin
- Dokumenttien poistaminen
- Dokumenttien ja kansioiden muut tiedot
Lue myös [dokumenttien ylläpito](dokumentin_yllapito) ja [Toimintaohjeet](toimintaohjeet).
----
## Uuden dokumentin laatimisen periaatteita
Jotta prosessidokumentit (prosessikaaviot, prosessikuvaukset, apteekkiohjeet, toimintaohjeet, kokousmuistiot, sisäisten arviointien muistiot) ovat ulkoasultaan yhdenmukaiset, niille kannattaa laatia jo prosessikehittämisen alussa **mallipohjat**.
Tässä esimerkki prosessikuvauksen mallipohjasta, kun dokumentti laaditaan sivuna.

----
Näin tunnistetiedot, fontit ja otsikot tulevat kohdalleen, eikä niitä tarvitse miettiä joka kerta erikseen.
Dokumenttien yhtenäinen ulkoasu näyttää mukavalta, kertoo yhdenmukaisista toimintatavoista myös dokumentoinnissa.
----
Jos mallipohjat on jokaiselle dokumenttityypille, niille kannattaa laatia oman kansionsa Mallipohjat, josta pohjat löytyvät helposti.

Kansioiden lisäämisestä ja ylläpidosta on [tarkempaa ohjetta](kansiot).
----
Dokumentteja voi laatia piazzalle kahdella tapaa: **joko suoraan sivuna** tai **nostaa liitetiedostona** (tiedostona vanha tapa).
Nykyisin suositellaan, että kaikki perustekstit (Wordit, esim. kuvaukset, ohjeet ja muistiot) laaditaan sivuna, jolloin niiden hallinta on helpompaa ja yksinkertaisempaa.<br>
Niitä pystyy muokkaamaan suoraan piazzalla, myös hakutoiminto etsii tekstin (esim. ohjeen) sisällöstä.
Jos tekstissä on taulukko tai muita erikoismerkkejä, tekstit laaditaan teksinkäsittelyohjelmalla ja käsitellään piazzalla tiedostona, näin myös powerpoint-, pdf- ja excel-muotoiset.
Käytännössä vain prosessikaaviot, mittarit ja koulutusmateriaali vaativat tiedostokäsittelyn, muut voidaan laatia helposti sivuna.
----
## Uuden sivudokumentin laatiminen ja päivittäminen
Käytettäessä mallipohjaa (suositus) avataan Mallipohja -kansio tai kansio, jossa mallipohja on.
Valitaan kansion vihreästä valikosta **Sisältö** -> ruksataan pohja -> valitaan **Kopio**.

Tämän jälkeen avataan kansio, johon pohja halutaan siirtää (laatia uusi dokumentti).<br>
Valitaan vihreästä valikosta Sisältö -> valitaan **Leikkaa**, jolloin pohja kopioituu sopivaan kansioon.
----
Tämän jälkeen avataan siirretty pohja -> valitaan **Muokkaa -> muutetaan otsikko, tunnistetiedot** ym.
Nyt pääset kirjoittamaan tekstiä. **Tallenna** aina välillä (alaosassa Tallenna).
Sitten kun jatkat kirjoittamista, avaa dokumentti, valitse Muokkaa, muuta tarvittaessa pvm ja jatka kirjoittamista.
Sitten kun dokumentti on valmis, se lähetetään [hyväksyttäväksi](dokumentin_yllapito/#dokumentin-hyvaksyminen).
Päivitettäessä dokumenttia (dokumentti on jo hyväksytty) muuttuneet kohdat kirjoitetaan esim. kursiivilla tai miten muutokset on sovittu merkittäväksi. Kun dokumenttia muutetaan seuraavan kerran, kursiivit oikaistaan ja uudet muuttuneet kohdat kursiivilla. Kursiivia käytetään vasta kun dokumentit on hyväksytty.
Muistetaan muuttaa aina myös päivämäärä ja laatija tarvittaessa.<br>
Myös päivitetyt dokumentit lähetetään [hyväksyttäväksi](dokumentin_yllapito/#dokumentin-hyvaksyminen).
Jos et käytä mallipohjaa, avaa kansio, johon haluat laatia dokumentin. Valitse valikosta **Lisää uusi** -> **Sivu**. Avaa sitten ko. sivu -> **Muokkaa** -> aloita kirjoittaminen.
Uusi dokumentti menee alimmaiseksi. Voit siirtää sen haluamaasi paikkaan samalla tavalla kuin
[kansioiden sisältöä järjestetään](kansiot/#kansion-sisallon-jarjestaminen-uudelleen).
----
## Kuvaukset ja ohjeet aikaisemmin olleet tiedostoina
Aikaisemmin käytäntönä oli, että dokumentit laadittiin tietokoneella tiedostoina, jotka nostettiin piazzalle.<br>
Tämä käytäntö on kerrottu seuraavassa otsikossa.
__Suositeltavaa on__, että dokumentin seuraavan päivityksen yhteydessä tekstit tehdään sivuina, jotta niiden käsittely jatkossa on helpompaa.
Se tehdään näin:
- Kopioi mallipohja ko. kansioon tai laadi uusi sivu edellä kuvatun mukaisesti.
- Avaa päivitettävä tiedosto.
- Maalaa teksti alusta loppuun (yläotsikkoa ei pysty maalaamaan ainakaan helposti), vie se leikepöydälle (contrl c).
- Avaa äsken tehty sivu, valitse muokkaa, vie kursori tekstikenttään ja liitä tiedoston teksti (control w), jolloin teksti siirtyy sivulle. Lopuksi tallenna.
- Tarvittaessa poista ylimääräiset rivit, lihavoi/kursivoi sekä kirjoita päivitettävä teksti ja lopuksi tallenna.
- Poista vanha tiedosto.
Siirtymisen tiedostoista voi tehdä myös "urakkana", esim. joku keskitetysti tekee siirrot.
Muistetaan muuttaa tekijät oikeiksi.
----
## Uuden tiedostodokumentin laatiminen
- Avataan mallipohja -> tallennetaan se tietokoneelle (esim. työpöydälle) mahdollisimman kuvaavalla lyhyellä nimellä.
- Muutetaan tunnistetiedot ja jatketaan kirjoittamista tekstinkäsittelyohjelmalla.
- Tallennuksen jälkeen tiedosto siirretään piazzalle.
- Myös keskeneräiset kannattaa nostaa piazzalle.
### Tiedoston nostaminen piazzalle
Avataan kansio, johon tiedosto halutaan liittää.<br>
Valitaan vihreästä valikosta **Lisää uusi** -> **Tiedosto**.

Kirjoitetaan nimikkeeksi tiedoston nimi.
Kuvaus ei ole pakollinen, mutta suositeltava. Siinä voi hieman tarkentaa mitä tämä liitetiedosto pitää sisällään tai jotain muuta siihen liittyvää tietoa.
Varsinainen tiedosto poimitaan omalta koneelta **Browse** tai **Selaa** -toiminnolla.
Lopuksi **Tallenna**, jolla tiedosto siirtyy fyysisesti piazzalle.<br>
Työpöydältä käydään poistamassa tiedosto, jotta sinne ei kerry tiedostoja.
### Tiedoston muokkaaminen ja täydentäminen
Tiedostoja ei voi muokata suoraan piazzalla, vaan ne on aina tehtävä tekstinkäsittelyohjelmalla.
Suositeltavaa on, että päivitettävä tiedosto avataan piazzalla, jotta päivitetään viimeisintä versiota.
Tiedosto tallennetaan tietokoneelle ja tehdään muutokset koneelle.
Jos tiedostodokumentti on jo hyväksytty, muuttuneet kohdat esim. kursiivilla tai miten muutokset on sovittu merkittäväksi.
Muistetaan muuttaa aina myös päivämäärä ja laatija tarvittaessa.
Päivitetty tiedosto mostetaan piazzalle seuraavasti:
- Avataan päivitettävä tiedosto
- Valitaan **Muokkaa**
- Valitaan **Korvaa uudella tiedostolla**, haetaan tiedosto koneelta, lopuksi **Tallenna**.



----
## Taulukoiden laatiminen
Piazzalla voi laatia myös taulukoita joko omiksi dokumenteikseen (esim. koulukortit, projektisuunnitelmat) tai taulukoita sivudokumenttien tekstiin.
Taulukon laatiminen tekstidokumenttiin tehdään Muokkaa-tilassa:
- Mene dokumentissa kohtaan, johon haluat taulukon
- Valitse ylläolevasta valikosta taulukko
- Lisää sarakkeiden ja rivien määrä
- Tallenna tai täytä taulokkoa samantien
Jos laaditaan taulukkodokumentteja (esim. koulutuskortteja), tehdään näin:
- Lisää uusi sivu
- Kirjoita Nimike ja lisää tekstiin (kommentti) taulukko em. opastuksen mukaisesti
Taulukossa ei ole kaikkia excelin hienouksia, mutta perustaulukon tekemiseen varsin kätevä, esim.rivejä ja sarakkeita on helppo lisätä tai poistaa.
## Dokumenttien linkitys
Piazzalla on mahdollista myös dokumenttien linkitys, esim. asiakastyytyväisyystutkimus markkinoinnin ja asiakaspalveluprosessien mittarina tai halutaan linkittää dokumenttia sivulta toiselle.
Ylläpidon hallinnan kannalta on tärkeää, että dokumentti on vain yhdessä paikassa.
Linkitys voidaan tehdä kahdella tavalla.
### Linkitys sivulta dokumenttiin
!!! note "Huom"
Linkitys ei toimi Internet Explorerilla.<br>
Käytä Mozilla Firefoxia tai Google Chromea linkkien lisäämiseen.
Sivueditorin (tekstieditorin) tulee olla muotoa [TinyMCE](sivueditorit/#tinymce-editori).<br>
Näkyy ja muutetaan tarvittaessa piazzan pääsivulla Asetukset.
* Avataan/lisätään sivudokumentti, johon linkitys halutaan.
* Valitaan **Muokkaa**, "maalataan" linkitettävä sana/-t, valitaan editoripalkista **Lisää/muuta linkki** (ketju).
* Näyttöön avautuu Lisää/muokkaa -näkymä.
* Jos halutaan linkittää piazzalla oleva dokumentti, valitaan sisäisestä linkitettävä dokumentti, eli avataan kansioita niin pitkälle, että dokumentti löytyy.
* Ruksataan linkitettävä dokumentti ja lopuksi OK. Linkitys näkyy dokumentissa alleviivauksena.
* Vastaavasti linkitetään ulkoinen linkki (nettisvu).
Tällä tavalla on erityisen helppoa linkittää sivuna laadittuun dokumenttiin muita dokumentteja, esim. kaikki toimintaohjeet toimintaohjeluetteloon.

### Myös näin on mahdollista linkittää
Etenkin aikaisemmin suosittiin tätä kategorisoinnin kautta tapahtuvaa linkitystä, joka tehdään näin.
* Luodaan tai avataan sivu, johon linkitys halutaan.
* Valitaan **Muokkaa**, valitaan "Kategorisointi", avautuvalta sivulta valitaan **Samasta aiheesta** ja **Lisää** -toiminnolla haetaan sopiva dokumentti linkitettäväksi avaamalla kansioita niin pitkälle, että dokumentti löytyy, ja lopuksi "Tallenna".
* Makuasia kumpaako tapaa haluaa käyttää.
----
## Kuvan liittäminen dokumenttiin
Sivudokumenttiin on helppo liittää kuva esim. havainnollistaakseen tekstiä.
Kuvia voi lisätä tekstiin näin (ensin kuva haetaan piazzalle omaan kansioon):
- Avaa oma kansio (löytyy ylhäältä oikealta)
- Lisää uusi kuva, hae se tietokoneeltasi ja lopuksi tallenna (siis jos kuvaa ei ole piazzalla)
- Avaa dokumentti, johon haluat liittää kuvan. Valitse Muokkaa ja mene siihen kohtaan, johon haluat kuvan.
- Valitse ylläolevasta valikosta vasemmasta laidasta ”kuvaruutu” (lisää/muuta kuva).
- Valitse näkymän oikeasta kulmasta keskimmäinen List view.
- Valitse Pääsivu, jolloin näkyviin tulee kansiorakenteenne piazzalla.
- Valitse sieltä Käyttäjät -> oma kansiosi ja sieltä valitse kuva ja lopuksi ok
- Ja ihan viimeiseksi tallenna ko. dokumentti.
Jos kuva on jo piazzalla, liitä kuva näin:
- Avaa dokumentti, johon haluat liittää kuvan. Valitse Muokkaa ja mene siihen kohtaan, johon haluat kuvan.
- Valitse ylläolevasta valikosta vasemmasta laidasta ”kuvaruutu” (lisää/muuta kuva).
- Valitse näkymän oikeasta kulmasta keskimmäinen List view.
- Valitse Pääsivu, jolloin näkyviin tulee kansiorakenteenne piazzalla.
- Avaa kansio, jossa kuva on. Valitse kuva ja ok.
- Lopuksi tallenna dokumentti.
----
## Dokumenttien poistaminen
Piazzan dokumentit ja liitetiedostot voidaan poistaa helposti, jos niitä ei enää tarvita tai ovat vanhentuneita, ja joku uusi dokumentti korvaa ne.
Poisto voidaan tehdä monellakin tavalla, mutta yleisin on ottaa dokumentti ensin esiin, ja sen jälkeen avataan toiminnot -valikko, josta löytyy kohta **Poista**.

Ennen varsinaista poistoa piazza vielä kysyy käyttäjältä varmistuksen poistolle.
----
## Dokumenttien ja kansioiden muut tiedot
**Muuokkaa** -tilassa on mahdollista antaa myös muita sisältöön liittyviä tietoja.
Ruudulla on viisi __"välilehden"__ näköistä osioita, joista avautuu kyseiseen kansioon tai sisältöön liittyvää lisätietoa.

* __Kategorisointi__
- Voidaan antaa sisällölle joitain avainsanoja, jotka ovat hyödyllisiä esim. haettaessa tietyntyyppisiä dokumentteja **Haku**-toiminnolla.
- Sitä voidaan myös käyttää ns. älykansioissa hyödyksi, jolloin saadaan kaikki samantyyppiset dokumentit koottua __"loogiseen kansioon"__ vaikka ne fyysisesti olisivatkin hajallaan ympäri sisältörakennetta.
* __Päivät__
- Voidaan antaa dokumentin julkaisemisen alkamis- ja päättymispäivät.
- Tulee kyseeseen aika harvoin, mutta on mahdollista jos on joku tietyn ajan voimassa oleva dokumentti tai jos haluaa jukaista dokumentin tiettynä ajankohtana.
* __Omistaja__ - _tärkeä_
- Täällä voidaan käydä vaihtamassa dokumentin omistaja- tai tekijä toiseksi.
- Esim. tilanteessa jossa vastuu dokumentin tai kansion sisällöstä siirretään toiselle henkilölle, kts. [tekijän muuttaminen](kansiot/#kansion-tekijan-muuttaminen).
* __Asetukset__
- Oletusarvona, että kommentointi sallittua.

----
| netmiller/piazzadoc | sivut/dokumentin_tekeminen.md | Markdown | mit | 12,723 |
package com.calebmeyer.bettercrafting.creativetab;
import com.calebmeyer.bettercrafting.constants.Project;
import com.calebmeyer.bettercrafting.initialization.ModItems;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class CreativeTabBCT {
public static final CreativeTabs BETTER_CRAFTING_TABLES_TAB = new CreativeTabs(Project.MOD_ID) {
/**
* This method returns an item, whose icon is used for this creative tab
*
* @return an item to use for the creative tab's icon
*/
@Override
public Item getTabIconItem() {
return ModItems.craftingPanel;
}
/**
* Gets the label for this creative tab.
*
* @return the label
*/
@Override
public String getTranslatedTabLabel() {
return Project.MOD_NAME;
}
};
}
| calebmeyer/Better-Crafting-Tables | src/main/java/com/calebmeyer/bettercrafting/creativetab/CreativeTabBCT.java | Java | mit | 907 |
//Change class of "Home" and "About"
function setActive() {
document.getElementById("about").className += "active"
document.getElementById("home").setAttribute('class','no')
}
| losko/CodeNameSite | public/js/helper.js | JavaScript | mit | 184 |
<?php
class PostModel extends CI_Model
{
public $id;
public $title;
public $content;
public $date;
public $author;
public $upvotes = 0;
public $downvotes = 0;
public $voters;
public function __construct()
{
parent::__construct();
}
public function GetAll()
{
$this->db->order_by('date', 'desc');
$query = $this->db->get('posts');
return $query->result();
}
public function GetByID($id)
{
$query = $this->db->get_where('posts', array('id' => $id));
return $query->row();
}
private function Insert($post)
{
session_start();
$this->author = $_SESSION["username"];
return $this->db->insert('posts', $this);
}
private function Update($post)
{
$this->db->set('title', $this->title);
$this->db->set('content', $this->content);
$this->db->where('id', $this->id);
return $this->db->update('posts');
}
public function Delete()
{
$this->db->where('id', $this->id);
return $this->db->delete('posts');
}
public function Save()
{
if (isset($this->id))
{
return $this->Update();
}
else
{
return $this->Insert();
}
}
public function Vote()
{
$this->db->set('upvotes', $this->upvotes);
$this->db->set('downvotes', $this->downvotes);
$this->db->set('voters', $this->voters);
$this->db->where('id', $this->id);
return $this->db->update('posts');
}
}
?> | vonderborch/CS483 | final/application/models/PostModel.php | PHP | mit | 1,606 |
---
title: 'PB & Homemade J'
author: lbjay
layout: post
permalink: /2007/10/05/pb-homemade-j/
categories:
- "What's for Lunch"
---
<abbr class="unapi-id" title=""><!-- --></abbr>
<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
<a href="http://www.flickr.com/photos/37849137@N00/1490397893/" title="photo sharing"><img src="http://farm2.static.flickr.com/1243/1490397893_cac4375203_m.jpg" alt="" style="border: solid 2px #000000;" /></a><br /> <br /> <span style="font-size: 0.9em; margin-top: 0px;"><br /> <a href="http://www.flickr.com/photos/37849137@N00/1490397893/">PB & Homemade J</a><br /> <br /> Originally uploaded by <a href="http://www.flickr.com/people/37849137@N00/">jayluker</a><br /> </span>
</div>
This one’s been stuck in the Flickr queue for a couple of weeks. Also it wasn’t truly Peanut Butter, but Sunflower Butter. It just seems so awkward to call it a SFB & J.
The jelly is grape and was made by my neighbor Leah from <a href='http://en.wikipedia.org/wiki/Concord_grape' target='_blank'>Concord grapes</a> growing on a trellis right out her back door.
The pile ‘o’ orange in the foreground is some delicious carrot slaw made with honey, walnuts and dried cranberries.
<br clear="all" /> | lbjay/lbjay.github.io | _posts/2007-10-05-pb-homemade-j.md | Markdown | mit | 1,285 |
---
layout: default
---
<h2>{{ page.title }}</h2>
<div class="post">
{{ content }}
</div>
| jiko/stopabadcure | _layouts/post.html | HTML | mit | 90 |
body {
color: #ffffff;
font-family: Monospace, sans-serif;
font-size: 13px;
text-align: center;
font-weight: bold;
background-color: #000000;
margin: 0;
overflow: hidden;
cursor: none;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
}
ul {
list-style: none;
}
.found {
text-decoration: line-through;
color: #00ff00;
}
.player-information {
font-size: 1.2em;
font-weight: bold;
position: absolute;
left: 0;
top: 0;
padding: 1em;
z-index: 2147483647;
}
.items {
font-size: 1.2em;
font-weight: bold;
position: absolute;
right: 0;
top: 0;
padding-right: 1em;
z-index: 2147483647;
height: 90%;
overflow: hidden;
}
.refreshButton {
position: absolute;
left: 0;
top: 5.5em;
margin-left: 10px;
padding: 1.25em;
color: white;
font-size: larger;
text-decoration: none;
border-radius: 1em;
background-repeat: no-repeat;
background-image: url('./../ui/refresh.svg');
background-size: contain;
background-color: teal;
z-index: 2147483647;
}
/*********************
Player Settings
**********************/
#settings {
display: none;
width: 25%;
min-width: 300px;
margin: 1% auto;
}
#settings label {
display: block;
}
#settings label.inline {
display: inline-block;
}
#settings input {
padding: 5px 10px;
margin-bottom: 10px;
}
#settings input.small {
width: 25px;
}
#settings button {
display: block;
margin: 15px auto;
padding: 5px 10px;
}
| Devoxx4KidsDE/workshop-maze-vr | app/css/style.css | CSS | mit | 1,806 |
<html><body>
<h4>Windows 10 x64 (18362.329)</h4><br>
<h2>_CM_UOW_SET_VALUE_KEY_DATA</h2>
<font face="arial"> +0x000 PreparedCell : Uint4B<br>
+0x004 OldValueCell : Uint4B<br>
+0x008 NameLength : Uint2B<br>
+0x00c DataSize : Uint4B<br>
</font></body></html> | epikcraw/ggool | public/Windows 10 x64 (18362.329)/_CM_UOW_SET_VALUE_KEY_DATA.html | HTML | mit | 296 |
/// <reference types="xrm" />
export declare function findIndex(handlers: Xrm.Events.ContextSensitiveHandler[], handler: Xrm.Events.ContextSensitiveHandler): number;
| camelCaseDave/xrm-mock | dist/xrm-mock-generator/helpers/array.helper.d.ts | TypeScript | mit | 166 |
<?php
namespace Vilks\DataObject;
use Vilks\DataObject\Exception\DirectPropertySetException;
use Vilks\DataObject\Exception\PropertyNotFoundException;
use Vilks\DataObject\Exception\PropertyValidationFailedException;
use Vilks\DataObject\Exception\WrongEvolutionInheritanceException;
use Vilks\DataObject\Validator\DataObjectValidatorFactory;
/**
* Base DataObject
*
* @package Vilks\DataObject
*/
abstract class DataObject
{
private static $validators = [];
/**
* Create instance of DataObject
*
* @return static
*/
public static function create()
{
return new static;
}
/**
* Create instance of DataObject with values based on related DataObject
*
* @param DataObject $source Data source object
*
* @return static
* @throws Exception\WrongEvolutionInheritanceException If DataObjects has different chain of inheritance
*/
public static function mutate(DataObject $source)
{
$replica = static::create();
if ($replica instanceof $source) {
$properties = get_object_vars($source);
} elseif ($source instanceof $replica) {
$properties = get_object_vars($replica);
} else {
throw new WrongEvolutionInheritanceException(
$replica,
$source,
sprintf('Class "%s" must be parent or child for "%s"', get_class($source), get_class($replica))
);
}
foreach ($properties as $name => $value) {
$replica->$name = $value;
}
return $replica;
}
/**
* Magic set property of DataObject
*
* IMPORTANT: For better performance in production you need
* to overwrite method for each property in final DataObjects
*
* @param string $name
* @param array $arguments
*
* @return static
*/
public function __call($name, array $arguments)
{
$this->_isPropertyExists($name);
if (!count($arguments)) {
return $this->$name;
} else {
$value = $arguments[0];
$this->_validateDataType($name, $value);
$replica = static::_isMutable() ? $this : clone $this;
$replica->$name = $value;
return $replica;
}
}
/**
* Magic get property of DataObject
*
* IMPORTANT: For better performance in production you need
* to make properties public in final DataObjects
*
* @param string $name
*
* @return mixed
*/
public function __get($name)
{
$this->_isPropertyExists($name);
return $this->$name;
}
/**
* Disallow direct setting of properties
*
* @param string $name
* @param string $value
*
* @throws Exception\DirectPropertySetException
* @deprecated
*/
public function __set($name, $value)
{
throw new DirectPropertySetException($name, $value, $this);
}
/**
* Turning off constructor outside object
* Use Class::create()
*/
protected function __construct()
{}
/**
* List of datatypes for properties
*
* @return string[]
*/
protected static function _getDataTypes()
{
return [];
}
/**
* Setting for DataObject which set behavior on property changing.
* If it's false changing of property will generate new DataObject with same values,
* if it's true changing of property will just change property in object
*
* @return bool
*/
protected static function _isMutable()
{
return false;
}
/**
* Exclude validators from serialization
*
* @return string[]
*/
public function __sleep()
{
$properties = array_keys(get_object_vars($this));
unset($properties['validators']);
return $properties;
}
private static function _getPropertyValidator($class, $property)
{
$key = sprintf('%s.%s', $class, $property);
if (!array_key_exists($key, self::$validators)) {
$types = static::_getDataTypes();
self::$validators[$key] = array_key_exists($property, $types) ?
DataObjectValidatorFactory::getValidator($class)->getValidationCallback($types[$property]) :
null;
}
return self::$validators[$key];
}
private function _validateDataType($property, $value)
{
if (!is_null($value)) {
$validator = self::_getPropertyValidator(get_class($this), $property);
if ($validator && !$validator($value)) {
throw new PropertyValidationFailedException(
$property,
$value,
static::_getDataTypes()[$property],
$this
);
}
}
}
private function _isPropertyExists($name, $strict = true)
{
$result = property_exists($this, $name);
if ($strict && !$result) {
throw new PropertyNotFoundException($this, $name);
}
return $result;
}
}
| igrizzli/data-object | src/Vilks/DataObject/DataObject.php | PHP | mit | 5,163 |
import _plotly_utils.basevalidators
class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="showexponent",
parent_name="scatterpolar.marker.colorbar",
**kwargs
):
super(ShowexponentValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "colorbars"),
values=kwargs.pop("values", ["all", "first", "last", "none"]),
**kwargs
)
| plotly/plotly.py | packages/python/plotly/plotly/validators/scatterpolar/marker/colorbar/_showexponent.py | Python | mit | 554 |
<?php
namespace Midnight\Crawler\Plugin\TestData;
class MuryoTestData extends AbstractTestData
{
/**
* @var string
**/
protected $rss_name = 'muryo.xml';
/**
* @var array
**/
protected $html_paths = array(
'muryo/71340.html',
'muryo/71370.html',
'muryo/71376.html',
'muryo/error.html',
'muryo/error2.html'
);
}
| togusafish/app2641-_-AdultMidnight | src/Midnight/Crawler/Plugin/TestData/MuryoTestData.php | PHP | mit | 397 |
using System;
using Argus.Extensions;
namespace Argus.Data
{
/// <summary>
/// Contains a string name/value pair seperated by an equals sign. The values can be set via the properties or by passing in a
/// delimited string. E.g. FirstName=Blake.
/// </summary>
/// <remarks></remarks>
public class Parameter
{
//*********************************************************************************************************************
//
// Class: Parameter
// Organization: http://www.blakepell.com
// Initial Date: 12/19/2012
// Last Updated: 04/07/2016
// Programmer(s): Blake Pell, [email protected]
//
//*********************************************************************************************************************
/// <summary>
/// Constructor
/// </summary>
/// <remarks></remarks>
public Parameter()
{
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="name">The name of the parameter.</param>
/// <param name="value">The value of the parameter.</param>
/// <remarks></remarks>
public Parameter(string name, string value)
{
this.Name = name;
this.Value = value;
}
/// <summary>
/// Returns the name/value pair in string format. E.g. FirstName=Blake
/// </summary>
/// <returns></returns>
/// <remarks></remarks>
public override string ToString()
{
return $"{this.Name}={this.Value}";
}
/// <summary>
/// Sets the parameter based off of a passed in string via an operator.
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
/// <remarks></remarks>
public static implicit operator Parameter(string str)
{
if (string.IsNullOrWhiteSpace(str) == true)
{
throw new Exception("The a valid parameter string. A value parameter string includes a name/value pair seperated by an equals sign.");
}
if (str.Contains("=") == false)
{
throw new Exception("The a valid parameter string. A value parameter string includes a name/value pair seperated by an equals sign.");
}
// Since there was an equals sign, we will have a name/value pair.
string[] items = str.SplitPcl("=");
return new Parameter(items[0], items[1]);
}
/// <summary>
/// Sets the string based off of the current value of the parameter.
/// </summary>
/// <param name="p"></param>
/// <returns></returns>
/// <remarks></remarks>
public static implicit operator string(Parameter p)
{
return $"{p.Name}={p.Value}";
}
public string Name { get; set; }
public string Value { get; set; }
}
} | blakepell/Argus | Argus/Argus.Core/Data/Parameter.cs | C# | mit | 3,083 |
__author__ = 'miko'
from Tkinter import Frame
class GameState(Frame):
def __init__(self, *args, **kwargs):
self.stateName = kwargs["stateName"]
self.root = args[0]
self.id = kwargs["id"]
Frame.__init__(self, self.root.mainWindow)
self.config(
background="gold"
)
self.place(relwidth=1, relheight=1)
| FSI-HochschuleTrier/hacker-jeopardy | de/hochschuletrier/jpy/states/GameState.py | Python | mit | 319 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_24) on Fri Feb 22 14:06:12 EET 2013 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
javalabra.chess.core.impl.state (Chess 0.0.1-SNAPSHOT API)
</TITLE>
<META NAME="date" CONTENT="2013-02-22">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="javalabra.chess.core.impl.state (Chess 0.0.1-SNAPSHOT API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../javalabra/chess/core/impl/move/package-summary.html"><B>PREV PACKAGE</B></A>
<A HREF="../../../../../javalabra/chess/domain/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?javalabra/chess/core/impl/state/package-summary.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<H2>
Package javalabra.chess.core.impl.state
</H2>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../javalabra/chess/core/impl/state/AbstractGameState.html" title="class in javalabra.chess.core.impl.state">AbstractGameState</A></B></TD>
<TD>Abstract game state.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../javalabra/chess/core/impl/state/SelectMoveState.html" title="class in javalabra.chess.core.impl.state">SelectMoveState</A></B></TD>
<TD>State object representing state when piece on the board is selected and
game is waiting for a move to be choosen.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../javalabra/chess/core/impl/state/SelectPieceState.html" title="class in javalabra.chess.core.impl.state">SelectPieceState</A></B></TD>
<TD>State object representing state when game is waiting for piece of concrete
color to be selected.</TD>
</TR>
</TABLE>
<P>
<DL>
</DL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../javalabra/chess/core/impl/move/package-summary.html"><B>PREV PACKAGE</B></A>
<A HREF="../../../../../javalabra/chess/domain/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?javalabra/chess/core/impl/state/package-summary.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2013. All Rights Reserved.
</BODY>
</HTML>
| nfrolov/useless-chess | javadoc/javalabra/chess/core/impl/state/package-summary.html | HTML | mit | 7,218 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>18 --> 19</title>
<link href="./../../assets/style.css" rel="stylesheet">
</head>
<body>
<h2>You have to be fast</h2>
<a href="./4ac3f45b236dfce453c7b08f66748497144da944c805dd71a7d9c6d6ff5efcff.html">Teleport</a>
<hr>
<a href="./../../about.md">About</a> (Spoilers! )
<script src="./../../assets/md5.js"></script>
<script>
window.currentLevel = 7;
</script>
<script src="./../../assets/script.js"></script>
</body>
</html> | simonmysun/praxis | TAIHAO2019/pub/SmallGame/AsFastAsYouCan2/596deaa0ccc1e29ccba1a93b711a57943231695e12a907a1b27bc4e377c328de.html | HTML | mit | 550 |
from csacompendium.csa_practice.models import PracticeLevel
from csacompendium.utils.pagination import APILimitOffsetPagination
from csacompendium.utils.permissions import IsOwnerOrReadOnly
from csacompendium.utils.viewsutils import DetailViewUpdateDelete, CreateAPIViewHook
from rest_framework.filters import DjangoFilterBackend
from rest_framework.generics import CreateAPIView, ListAPIView
from rest_framework.permissions import IsAuthenticated, IsAdminUser
from .filters import PracticeLevelListFilter
from csacompendium.csa_practice.api.practicelevel.practicelevelserializers import practice_level_serializers
def practice_level_views():
"""
Practice level views
:return: All practice level views
:rtype: Object
"""
practice_level_serializer = practice_level_serializers()
class PracticeLevelCreateAPIView(CreateAPIViewHook):
"""
Creates a single record.
"""
queryset = PracticeLevel.objects.all()
serializer_class = practice_level_serializer['PracticeLevelDetailSerializer']
permission_classes = [IsAuthenticated]
class PracticeLevelListAPIView(ListAPIView):
"""
API list view. Gets all records API.
"""
queryset = PracticeLevel.objects.all()
serializer_class = practice_level_serializer['PracticeLevelListSerializer']
filter_backends = (DjangoFilterBackend,)
filter_class = PracticeLevelListFilter
pagination_class = APILimitOffsetPagination
class PracticeLevelDetailAPIView(DetailViewUpdateDelete):
"""
Updates a record.
"""
queryset = PracticeLevel.objects.all()
serializer_class = practice_level_serializer['PracticeLevelDetailSerializer']
permission_classes = [IsAuthenticated, IsAdminUser]
lookup_field = 'slug'
return {
'PracticeLevelListAPIView': PracticeLevelListAPIView,
'PracticeLevelDetailAPIView': PracticeLevelDetailAPIView,
'PracticeLevelCreateAPIView': PracticeLevelCreateAPIView
}
| nkoech/csacompendium | csacompendium/csa_practice/api/practicelevel/practicelevelviews.py | Python | mit | 2,046 |
export const ADD_COCKTAIL = 'ADD_COCKTAIL';
export const LOAD_COCKTAILS = 'LOAD_COCKTAILS';
export const ADD_SPIRIT = 'ADD_SPIRIT';
export const REMOVE_SPIRIT = 'REMOVE_SPIRIT';
export const UPDATE_HUE = 'UPDATE_HUE';
| Jack95uk/HappyHour | src/actions/types.js | JavaScript | mit | 218 |
#include <algorithm>
#include <iostream>
#include "RustyFist/DrawMe.h"
#include "RustyFist/TouchSink.h"
#include "OpenGLLayer.h"
using namespace cocos2d;
using namespace std;
OpenGLLayer::OpenGLLayer()
{
}
OpenGLLayer::~OpenGLLayer()
{
}
bool OpenGLLayer::init()
{
return Layer::init();
}
cocos2d::Scene* OpenGLLayer::scene(DrawMe* drawMe, TouchSink* ts)
{
auto scene = Scene::create();
OpenGLLayer *layer = OpenGLLayer::create();
layer->setDrawMe(drawMe);
layer->setTouchSink(ts);
scene->addChild(layer);
return scene;
}
void OpenGLLayer::draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags)
{
if (_drawMe)
_drawMe->draw();
}
void OpenGLLayer::setTouchSink(TouchSink* ts)
{
_ts = ts;
auto mouseEvents = EventListenerMouse::create();
mouseEvents->onMouseDown = [this](Event* e)
{
if(auto me = dynamic_cast<EventMouse*>(e))
{
if(_ts)
_ts->mouse({me->getCursorX(), me->getCursorY()});
}
};
mouseEvents->onMouseUp = [this](Event* e)
{
if(auto me = dynamic_cast<EventMouse*>(e))
{
if(_ts)
_ts->mouse({me->getCursorX(), me->getCursorY()});
}
};
mouseEvents->onMouseMove = [this](Event* e)
{
if(auto me = dynamic_cast<EventMouse*>(e))
{
if(_ts)
_ts->mouse({me->getCursorX(), me->getCursorY()});
}
};
_eventDispatcher->addEventListenerWithSceneGraphPriority(mouseEvents, this);
}
void OpenGLLayer::onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* unused_event)
{
sendTouch(touches);
}
void OpenGLLayer::onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* unused_event)
{
sendTouch(touches);
}
void OpenGLLayer::onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* unused_event)
{
sendTouch(touches);
}
void OpenGLLayer::onTouchesCancelled(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* unused_event)
{
sendTouch(touches);
}
void OpenGLLayer::sendTouch(const std::vector<cocos2d::Touch*>& touches)
{
std::vector<::Touch> tochs;
std::transform(touches.begin(), touches.end(), back_inserter(tochs), [](cocos2d::Touch* t)
{
return ::Touch{t->getID(), t->getLocation().x, t->getLocation().y};
});
if(_ts)
_ts->touch(tochs);
}
| Ingener74/Lost-Foot | RustyFist/src/OpenGLLayer.cpp | C++ | mit | 2,225 |
//
// PASConnectionTransformation.h
// ximber
//
// Created by Paul Samuels on 15/09/2014.
// Copyright (c) 2014 Paul Samuels. All rights reserved.
//
@import Foundation;
/**
* The connection transformation is a basic data structure that holds a block that is
* executed on each node found at the xpath
*/
@interface PASConnectionTransformation : NSObject
@property (nonatomic, copy, readonly) NSString *xPath;
@property (nonatomic, copy, readonly) NSString *(^keyTransformer)(NSString *key);
+ (instancetype)connectionTransformationWithXPath:(NSString *)xPath keyTransformer:(NSString *(^)(NSString *key))keyTransformer;
@end
| paulsamuels/ximber | ximber/Models/PASConnectionTransformation.h | C | mit | 639 |
/* icon */
.ico-file{width: 32px;height: 32px;display: inline-block;vertical-align: middle;background: url(../img/spr-icon.png) -384px 0 no-repeat;}
.ico-bt-file{background-position: 0 0}
.ico-bt-link{background-position: -32px 0}
.ico-chm{background-position: -64px 0}
.ico-xls{background-position: -96px 0}
.ico-link{background-position: -128px 0}
.ico-pdf{background-position: -160px 0}
.ico-doc{background-position: -192px 0}
.ico-ppt{background-position: -224px 0}
.ico-txt{background-position: -256px 0}
.ico-word{background-position: -288px 0}
.ico-install{background-position: -320px 0}
.ico-music{background-position: -352px 0}
.ico-unknow{background-position: -384px 0}
.ico-pic{background-position: -416px 0}
.ico-apk{background-position: -448px 0}
.ico-exe{background-position: -480px 0}
.ico-ipa{background-position: -512px 0}
.ico-ipsw{background-position: -544px 0}
.ico-iso{background-position: -576px 0}
.ico-group{background-position: -608px 0}
.ico-video{background-position: -832px 0}
.ico-avi{background-position: -640px 0}
.ico-flv{background-position: -672px 0}
.ico-mkv{background-position: -704px 0}
.ico-mov{background-position: -736px 0}
.ico-mp4{background-position: -768px 0}
.ico-mpg{background-position: -800px 0}
.ico-rm{background-position: -864px 0}
.ico-rmvb{background-position: -896px 0}
.ico-wmv{background-position: -928px 0}
.ico-rar{background-position: -960px 0}
/* 会员图标 vip */
.icvip{display:inline-block;width:42px;height:12px;background:url(../img/ic_vip.png) no-repeat 0 999em;overflow:hidden;vertical-align:-1px;margin: 0 0 0 2px;}
.icvip00{width: 36px;background-position: 0 0} .icvip01{background-position: -37px 0} .icvip02{background-position: -80px 0} .icvip03{background-position: -123px 0} .icvip04{background-position: -166px 0} .icvip05{background-position: -209px 0} .icvip06{background-position: -252px 0} .icvip00hui{background-position: 0 -18px}
.icvip00hui{width: 35px;background-position: 0px -18px}.icvip01hui{background-position: -37px -18px} .icvip02hui{background-position: -80px -18px} .icvip03hui{background-position: -123px -18px} .icvip04hui{background-position: -166px -18px} .icvip05hui{background-position: -209px -18px} .icvip06hui{background-position: -252px -18px}
/* gold vip */
.icgold00{width: 35px;background-position: 0 -36px} .icgold01{background-position: -37px -36px} .icgold02{background-position: -80px -36px} .icgold03{background-position: -123px -36px} .icgold04{background-position: -166px -36px} .icgold05{background-position: -209px -36px} .icgold06{background-position: -252px -36px} .icgold07{background-position: -295px -36px} .icgold00hui{background-position: 0 -54px}
.icgold00hui{width: 35px;background-position: 0px -54px} .icgold01hui{background-position: -37px -54px} .icgold02hui{background-position: -80px -54px} .icgold03hui{background-position: -123px -54px} .icgold04hui{background-position: -166px -54px} .icgold05hui{background-position: -209px -54px} .icgold06hui{background-position: -252px -54px} .icgold07hui{background-position: -295px -54px}
/* super vip */
.icsuper00{width: 35px;background-position: 0 -72px} .icsuper01{background-position: -37px -72px} .icsuper02{background-position: -80px -72px} .icsuper03{background-position: -123px -72px} .icsuper04{background-position: -166px -72px} .icsuper05{background-position: -209px -72px} .icsuper06{background-position: -252px -72px} .icsuper07{background-position: -295px -72px} .icsuper00hui{background-position: 0 -90px}
.icsuper00hui{width: 35px;background-position: 0px -90px} .icsuper01hui{background-position: -37px -90px} .icsuper02hui{background-position: -80px -90px} .icsuper03hui{background-position: -123px -90px} .icsuper04hui{background-position: -166px -90px} .icsuper05hui{background-position: -209px -90px}
/* another */
.icnian{width:12px;height:12px; background-position: 0px -108px;} .icnianhui{width:12px;height:12px; background-position: 0px -128px} .icdongjie{width:16px;height:16px; background-position: -19px -109px}
.icdongjiehui{width:16px;height:16px; background-position: -19px -128px} .icshuai{width:16px;height:16px; background-position: -38px -108px} .icshuaihui{width:16px;height:16px; background-position: -38px -128px}
.icqiye{width:16px;height:16px; background-position: -57px -109px} .icqiyehui{width:16px;height:16px; background-position: -57px -128px}
.ichongren{width:16px;height:16px; background-position: -76px -109px} .ichongrenhui{width:16px;height:16px; background-position: -76px -128px}
.icbao{width:16px;height:16px; background-position: -95px -109px} .icbaohui{width:16px;height:16px; background-position: -95px -128px}
.icxun{width:15px;height:16px; background-position: -116px -109px} .icxunhui{width:15px;height:16px; background-position: -116px -128px}
.icgold{width:15px;height:16px; background-position: -136px -109px} .icgoldhui{width:15px;height:14px; background-position: -136px -128px}
.icgrow{width:12px;height:14px; background-position: -155px -109px;} .icdown{width:12px;height:14px; background-position: -155px -128px;}
.ickuainiao{background-position: -338px 0;width: 36px;}
.ickuainiaohui{background-position: -338px -18px}
.icshangxing{background-position: -380px 0;width: 36px}
.icshangxinghui{background-position: -380px -18px;}
| xunleif2e/vue-lazy-component | demo/assets/css/icon.css | CSS | mit | 5,332 |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
#include "tcp_socket.h"
using namespace easynet;
//TCPSocket 已连接的服务器
TCPSocket::TCPSocket(EPOLLSvrPtr s) {
socket_handler_ = nullptr;
svr_ = s;
msg_ = nullptr;
step_ = READ_HEAD;
}
void TCPSocket::SetHandler(On_Socket_Handler h){
socket_handler_ = h;
}
void TCPSocket::OnNetMessage(){
if( nullptr == socket_handler_){
LOG(FATAL) << "tcpsocket handler is nullptr!";
return;
}
//char *buff = svr_.get()->buff_; //对数组操作一定要注意, 会有越界的可能
for(;;){
char *buff = svr_.get()->buff_;
//一直读, 直到出错
int32_t ret = NetPackage::Read(peer_.fd_, buff, MAX_SOCK_BUFF);
//LOG(INFO) << "read ok ret[" << ret << "]";
if(0 == ret ){
LOG(INFO) << "connection closed by peer fd[" << peer_.fd_ << "]";
this->KickOut();
return;
}
if( ret < 0 ){
if( EAGAIN == errno || EWOULDBLOCK == errno ){
//再次read, buff将从头开始填充
//buff = svr_.get()->buff_;
//continue;
return;
}else{
LOG(INFO) << "read fail! fd[" << peer_.fd_ << "] errno[" << errno << "] msg[" << strerror(errno) << "]";
this->KickOut();
return;
}
}
int32_t more_data = ret;
while( more_data > 0){
if( nullptr == peer_.buff_ ){
peer_.buff_ = std::make_shared<DataBuffer>(peer_.fd_, HEADER_SZ);
}
auto data_buffer = peer_.buff_.get();
int32_t need_data = data_buffer->NeedData();
//读取包头
if( READ_HEAD == step_ ){
if( more_data < need_data ) {
//包头没有读完整
data_buffer->AddData(more_data, buff);
return;
}
data_buffer->AddData(need_data, buff);
//指向body的头指针, 向前添加已经读过的内存
buff += need_data;
more_data = (more_data - need_data) < 0 ? 0:(more_data - need_data);
msg_ = (MSG* )data_buffer->GetBuffPtr();
if(VERSION != msg_->header.version_ || IDENTIFY != msg_->header.identify_){
LOG(ERROR) << "version or identify is not fit! kick out client fd[" << peer_.fd_ << "] version["
<< (int)msg_->header.version_ << "] current version[" << (int)VERSION<<"]" << "identify["
<< (int)msg_->header.identify_ << "] current identify[" << (int)IDENTIFY << "]";
this->KickOut();
LOG(INFO) << "receive msg count[" << m.GetRecvPack() << "]";
return;
}
msg_->header.length_ = ntohs(msg_->header.length_);
msg_->header.type_ = ntohs(msg_->header.type_);
//为body 申请内存
data_buffer->Resize(msg_->header.length_ + HEADER_SZ);
//重新申请内存后, 以前的msg_指向的内容不能再使用了
msg_ = (MSG* )data_buffer->GetBuffPtr();
need_data = data_buffer->NeedData();
step_ = READ_BODY;
}
//现在的step 肯定是 READ_BODY
if( more_data > 0 ) {
//读取body
if(more_data < need_data) {
data_buffer->AddData(more_data, buff);
return;
}
data_buffer->AddData(need_data, buff);
more_data = (more_data - need_data) < 0 ? 0:(more_data - need_data);
//buff读取后指针后移
buff += need_data;
m.AddRecvPack();
//客户程序只需要截获到数据信息就行, 不用关心包头
char *pMsg = (char* )(data_buffer->GetBuffPtr());
pMsg += sizeof(HEADER);
auto f = socket_handler_;
try{
f(this->getID(), pMsg,msg_->header.length_, msg_->header.type_);
}catch(...){
LOG(ERROR) << "tcpsocket handler run fail!";
}
//自动删除已经用过的packet
auto tmp = std::move(peer_.buff_);
tmp = nullptr;
peer_.buff_ = nullptr;//是不是多此一举, 就是多此一举, move 后peer_buff_ 会为nullptr
//读取新的包头
step_ = READ_HEAD;
}
}
}
}
void TCPSocket::KickOut() {
IPlayer::KickOut();
//TODO 需要再 EPOLLSvr 的map 中删除事件events_map_ 和连接信息 player_map_
}
| PickMio/NetEase | olds/network/src/tcp_socket.cc | C++ | mit | 5,843 |
{% extends 'base.html' %}
{% block content %}
<div class="row">
<div class="col-md-12">
<form action="/login" method="post">
{{ form.csrf_token }}
{{ form.next(value=next) }}
<div class="form-group">
{{ form.username.label }}
{{ form.username(class='form-control') }}
</div>
<div class="form-group">
{{ form.password.label }}
{{ form.password(class='form-control') }}
</div>
<div class="form-group">
<input type="submit" class="form-control" value="Login">
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
{% with messages = get_flashed_messages() %}
{% for message in messages %}
<div class="alert alert-info">{{ message }}</div>
{% endfor %}
{% endwith %}
</div>
</div>
{% endblock %} | douglasstarnes/vfcake2015-complete | vfcake2015app/templates/login.html | HTML | mit | 971 |
using Android.OS;
using Android.Text;
using Android.Util;
using REKT.Graphics;
using REKT.Graphics.Unsafe;
using REKT.DI;
using SkiaSharp;
using System;
using System.Text;
using D = System.Diagnostics.Debug;
using NativeActivity = Android.App.Activity;
using NativeBitmap = Android.Graphics.Bitmap;
using NativeBitmapFactory = Android.Graphics.BitmapFactory;
using NativeContext = Android.Content.Context;
using NativeRect = Android.Graphics.Rect;
using NativeDialog = Android.Support.V7.App.AlertDialog;
using NativeProgressDialog = Android.App.ProgressDialog;
using NativeColour = Android.Graphics.Color;
using NativeArrayAdapter = Android.Widget.ArrayAdapter;
using NativeView = Android.Views.View;
using System.Collections;
using NativeThread = System.Threading.Thread;
namespace REKT
{
public static class AndroidExtensions
{
/////////////////////////////////////////////////////////////////////
// STRINGS
/////////////////////////////////////////////////////////////////////
public static ISpanned ToSpannedHTML(this string rawHtml)
{
ISpanned html;
if (AndroidPlatform.Version >= BuildVersionCodes.N)
html = Html.FromHtml(rawHtml, FromHtmlOptions.ModeLegacy);
else
{
#pragma warning disable CS0618 //deprecation
html = Html.FromHtml(rawHtml);
#pragma warning restore CS0618
}
return html;
}
/////////////////////////////////////////////////////////////////////
// CONTEXTS
/////////////////////////////////////////////////////////////////////
public static SKColor ThemeColour(this NativeContext context, int themeColourID)
{
if (context == null)
throw new ArgumentNullException("context");
using (var typedValue = new TypedValue())
{
var theme = context.Theme;
theme.ResolveAttribute(themeColourID, typedValue, true);
var data = typedValue.Data;
return new SKColor(
(byte)NativeColour.GetRedComponent(data),
(byte)NativeColour.GetGreenComponent(data),
(byte)NativeColour.GetBlueComponent(data),
(byte)NativeColour.GetAlphaComponent(data));
}
}
public static NativeBitmap BitmapResource(this NativeContext context, int bitmapResourceID)
{
using (var opts = new NativeBitmapFactory.Options())
{
opts.InPreferQualityOverSpeed = true;
return NativeBitmapFactory.DecodeResource(context.Resources, bitmapResourceID, opts);
}
}
public static SKBitmap BitmapResourceSkia(this NativeContext context, int bitmapResourceID)
{
using (var nativeBmp = context.BitmapResource(bitmapResourceID))
return nativeBmp.ToSkia();
}
private static void RunOnUIThreadIfPossible(this NativeContext context, Action action)
{
if (context is NativeActivity activity)
activity.RunOnUiThread(action);
else
action();
}
public static void ShowYesNoDialog(this NativeContext context, string title, string text,
Action yesAction = null, Action noAction = null)
{
if (context == null)
throw new ArgumentNullException("context");
context.RunOnUIThreadIfPossible(() =>
{
using (var builder = new NativeDialog.Builder(context))
{
builder.SetTitle((title ?? "").Trim());
builder.SetMessage((text ?? "").Trim());
builder.SetCancelable(false);
builder.SetPositiveButton("Yes", (s, e) => { yesAction?.Invoke(); });
builder.SetNegativeButton("No", (s, e) => { noAction?.Invoke(); });
using (var dialog = builder.Create())
dialog.Show();
}
});
}
public static void ShowOKDialog(this NativeContext context, string title, string text, Action okAction = null)
{
if (context == null)
throw new ArgumentNullException("context");
context.RunOnUIThreadIfPossible(() =>
{
using (var builder = new NativeDialog.Builder(context))
{
builder.SetTitle((title ?? "").Trim());
builder.SetMessage((text ?? "").Trim());
builder.SetCancelable(false);
builder.SetPositiveButton(Android.Resource.String.Ok, (s, e) => { okAction?.Invoke(); });
using (var dialog = builder.Create())
dialog.Show();
}
});
}
public static void ShowWaitDialog(this NativeContext context, string title, string text, Action asyncTask)
{
if (context == null)
throw new ArgumentNullException("context");
if (asyncTask == null)
throw new ArgumentNullException("asyncTask");
context.RunOnUIThreadIfPossible(() =>
{
var dialog = NativeProgressDialog.Show(context, (title ?? "").Trim(), (text ?? "").Trim(), true, false);
new NativeThread(() =>
{
asyncTask?.Invoke();
dialog.Dismiss();
dialog.Dispose();
}).Start();
});
}
public static void ShowListDialog(this NativeContext context, string title, IList data, Action<int> selectionAction,
Action cancelAction = null)
{
if (context == null)
throw new ArgumentNullException("context");
if (selectionAction == null)
throw new ArgumentNullException("selectionAction");
if (data == null)
throw new ArgumentNullException("data");
context.RunOnUIThreadIfPossible(() =>
{
using (var builder = new NativeDialog.Builder(context))
{
var adapter = new NativeArrayAdapter(context, Android.Resource.Layout.SimpleListItem1, data);
builder.SetTitle((title ?? "").Trim())
.SetAdapter(adapter, (s, e) => { selectionAction.Invoke(e.Which); });
if (cancelAction != null)
builder.SetCancelable(true).SetNegativeButton(Android.Resource.String.Cancel, (s, e) => { cancelAction.Invoke(); });
else
builder.SetCancelable(false);
using (var dialog = builder.Create())
dialog.Show();
}
});
}
public static void ShowCustomDialog(this Activity activity, string title, int viewResID,
Action<NativeView> initAction = null,
Action<NativeView> okAction = null,
Action<NativeView> cancelAction = null)
{
if (activity == null)
throw new ArgumentNullException("context");
activity.RunOnUIThreadIfPossible(() =>
{
using (var builder = new NativeDialog.Builder(activity))
{
builder.SetTitle((title ?? "").Trim());
var view = activity.LayoutInflater.Inflate(viewResID, null);
initAction?.Invoke(view);
builder.SetView(view);
builder.SetPositiveButton(Android.Resource.String.Ok,
(s, e) => { okAction?.Invoke(view); });
if (cancelAction != null)
builder.SetCancelable(true).SetNegativeButton(Android.Resource.String.Cancel,
(s, e) => { cancelAction.Invoke(view); });
else
builder.SetCancelable(false);
using (var dialog = builder.Create())
dialog.Show();
}
});
}
public static void Toast(this NativeContext context, string text)
{
Android.Widget.Toast.MakeText(context, text, Android.Widget.ToastLength.Long).Show();
}
public static void LaunchWebsite(this NativeContext context, string uri)
{
using (var _uri = Android.Net.Uri.Parse(uri))
using (var intent = new Android.Content.Intent(Android.Content.Intent.ActionView, _uri))
{
intent.AddFlags(Android.Content.ActivityFlags.NewTask);
intent.AddFlags(Android.Content.ActivityFlags.NoHistory);
intent.AddFlags(Android.Content.ActivityFlags.ExcludeFromRecents);
context.StartActivity(intent);
}
}
public static ISpanned GetSpannedHTML(this NativeContext context, int resid)
{
return context.GetString(resid).ToSpannedHTML();
}
public static void LaunchAppSettings(this NativeContext context)
{
using (var _uri = Android.Net.Uri.Parse("package:" + context.PackageName))
using (var intent = new Android.Content.Intent("android.settings.APPLICATION_DETAILS_SETTINGS", _uri))
{
intent.AddFlags(Android.Content.ActivityFlags.NewTask);
intent.AddFlags(Android.Content.ActivityFlags.NoHistory);
intent.AddFlags(Android.Content.ActivityFlags.ExcludeFromRecents);
context.StartActivity(intent);
}
}
/////////////////////////////////////////////////////////////////////
// ACTIVITIES
/////////////////////////////////////////////////////////////////////
public static float CanvasScaleHint(this NativeActivity activity)
{
using (var displayMetrics = new DisplayMetrics())
{
activity.WindowManager.DefaultDisplay.GetMetrics(displayMetrics);
if (displayMetrics.ScaledDensity.IsZero()) //can this even happen??
return 1.0f;
return (displayMetrics.ScaledDensity / 3.0f).Clamp(0.4f, 1.5f);
}
}
public static void With<T>(this NativeActivity activity, int id, Action<T> viewAction) where T : Android.Views.View
{
using (var view = activity.FindViewById<T>(id))
viewAction(view);
}
/////////////////////////////////////////////////////////////////////
// SKIA
/////////////////////////////////////////////////////////////////////
public static NativeRect ToREKT(this SKRect rect)
{
return new NativeRect((int)rect.Left, (int)rect.Top,
(int)rect.Right, (int)rect.Bottom);
}
public static NativeColour ToNative(this SKColor col)
{
return new NativeColour(col.Red, col.Green, col.Blue, col.Alpha);
}
public static SKColor ToREKT(this NativeColour col)
{
return new SKColor(col.R, col.G, col.B, col.A);
}
/////////////////////////////////////////////////////////////////////
// BITMAPS
/////////////////////////////////////////////////////////////////////
public static SKBitmap ToSkia(this NativeBitmap source)
{
if (source == null)
throw new ArgumentNullException("source");
//init destination bitmap
var output = new SKBitmap(
source.Width,
source.Height,
SKColorType.Rgba8888,
SKAlphaType.Unpremul
);
//get source pixels
//"The returned colors are non-premultiplied ARGB values in the sRGB color space.",
//per https://developer.android.com/reference/android/graphics/Bitmap.html
int[] sourcePixels = new int[source.Width * source.Height];
source.GetPixels(sourcePixels, 0, source.Width, 0, 0, source.Width, source.Height);
//copy into destination
try
{
output.LockPixels();
var buffer = output.GetPixels();
unsafe
{
int* firstPixelAddr = (int*)buffer.ToPointer();
System.Threading.Tasks.Parallel.For(0, output.Height, (y) =>
{
int p = y * output.Width;
int* pixel = firstPixelAddr + p;
for (int x = 0; x < output.Width; x++, p++, pixel++)
*pixel = sourcePixels[p].SwapBytes02();
});
}
output.UnlockPixels();
}
catch (Exception e)
{
e.WriteToLog();
output.Dispose();
throw;
}
return output;
}
public static Bitmap ToREKT(this NativeBitmap source)
{
if (source == null)
throw new ArgumentNullException("source");
#if DEBUG
StringBuilder sb = new StringBuilder("Bitmap: constructing from Android.Graphics.Bitmap:");
sb.AppendLine();
sb.AppendFormattedLine("Dimensions: {0} x {1}", source.Width, source.Height);
sb.AppendFormattedLine("AllocationByteCount: {0}", source.AllocationByteCount);
sb.AppendFormattedLine("ByteCount: {0}", source.ByteCount);
sb.AppendFormattedLine("RowBytes: {0}", source.RowBytes);
sb.AppendFormattedLine("Density: {0}", source.Density);
sb.AppendFormattedLine("HasAlpha: {0}", source.HasAlpha);
sb.AppendFormattedLine("IsPremultiplied: {0}", source.IsPremultiplied);
D.WriteLine(sb);
#endif
//init destination bitmap
var output = new Bitmap(source.Width, source.Height, SKColorType.Rgba8888);
//get source pixels
//"The returned colors are non-premultiplied ARGB values in the sRGB color space.",
//per https://developer.android.com/reference/android/graphics/Bitmap.html
int[] sourcePixels = new int[source.Width * source.Height];
source.GetPixels(sourcePixels, 0, source.Width, 0, 0, source.Width, source.Height);
//copy into destination
try
{
output.Lock((buffer) =>
{
unsafe
{
byte* firstPixelAddr = (byte*)buffer.ToPointer();
Thread.Distribute((threadIndex, threadCount) =>
{
for (long y = threadIndex; y < output.Height; y += threadCount)
{
long p = y * output.Width;
for (long x = 0; x < output.Width; x++, p++)
output.SetPixel(firstPixelAddr, x, y, ((uint)sourcePixels[p]));
}
});
}
});
}
catch (Exception e)
{
e.WriteToLog();
output.Dispose();
throw;
}
return output;
}
/////////////////////////////////////////////////////////////////////
// UUIDs
/////////////////////////////////////////////////////////////////////
public static bool Equals(this Java.Util.UUID uuid, string uuidString)
{
if (uuid == null)
throw new ArgumentNullException("uuid");
if (uuidString == null)
throw new ArgumentNullException("uuidString");
return uuid.ToString().ToUpper() == uuidString.ToUpper();
}
}
} | marzer/REKT | REKT.Droid/Extensions.cs | C# | mit | 16,165 |
// animating the scroll effect
$('.screenshots').on('click', function(e){
e.preventDefault();
$("html, body").animate({ scrollTop: "950px", duration: 500 });
});
| PersonifyJS/PersonifyApp | app/public/javascripts/application.js | JavaScript | mit | 167 |
#include "strm.h"
#include <math.h>
static int
num_plus(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
strm_value x, y;
strm_get_args(strm, argc, args, "NN", &x, &y);
if (strm_int_p(x) && strm_int_p(y)) {
*ret = strm_int_value(strm_value_int(x)+strm_value_int(y));
return STRM_OK;
}
if (strm_number_p(x) && strm_number_p(y)) {
*ret = strm_float_value(strm_value_float(x)+strm_value_float(y));
return STRM_OK;
}
return STRM_NG;
}
static int
num_minus(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
if (argc == 1) {
if (strm_int_p(args[0])) {
*ret = strm_int_value(-strm_value_int(args[0]));
return STRM_OK;
}
if (strm_float_p(args[0])) {
*ret = strm_float_value(-strm_value_float(args[0]));
return STRM_OK;
}
}
else {
strm_value x, y;
strm_get_args(strm, argc, args, "NN", &x, &y);
if (strm_int_p(x) && strm_int_p(y)) {
*ret = strm_int_value(strm_value_int(x)-strm_value_int(y));
return STRM_OK;
}
if (strm_number_p(x) && strm_number_p(y)) {
*ret = strm_float_value(strm_value_float(x)-strm_value_float(y));
return STRM_OK;
}
}
return STRM_NG;
}
static int
num_mult(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
strm_value x, y;
strm_get_args(strm, argc, args, "NN", &x, &y);
if (strm_int_p(x) && strm_int_p(y)) {
*ret = strm_int_value(strm_value_int(x)*strm_value_int(y));
return STRM_OK;
}
*ret = strm_float_value(strm_value_float(x)*strm_value_float(y));
return STRM_OK;
}
static int
num_div(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
double x, y;
strm_get_args(strm, argc, args, "ff", &x, &y);
*ret = strm_float_value(x/y);
return STRM_OK;
}
static int
num_bar(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
strm_value x, y;
strm_get_args(strm, argc, args, "ii", &x, &y);
*ret = strm_int_value(strm_value_int(x)|strm_value_int(y));
return STRM_OK;
}
static int
num_mod(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
strm_value x;
strm_int y;
strm_get_args(strm, argc, args, "Ni", &x, &y);
if (strm_int_p(x)) {
*ret = strm_int_value(strm_value_int(x)%y);
return STRM_OK;
}
if (strm_float_p(x)) {
*ret = strm_float_value(fmod(strm_value_float(x), y));
return STRM_OK;
}
return STRM_NG;
}
static int
num_gt(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
double x, y;
strm_get_args(strm, argc, args, "ff", &x, &y);
*ret = strm_bool_value(x>y);
return STRM_OK;
}
static int
num_ge(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
double x, y;
strm_get_args(strm, argc, args, "ff", &x, &y);
*ret = strm_bool_value(x>=y);
return STRM_OK;
}
static int
num_lt(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
double x, y;
strm_get_args(strm, argc, args, "ff", &x, &y);
*ret = strm_bool_value(x<y);
return STRM_OK;
}
static int
num_le(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
double x, y;
strm_get_args(strm, argc, args, "ff", &x, &y);
*ret = strm_bool_value(x<=y);
return STRM_OK;
}
static int
num_number(strm_stream* strm, int argc, strm_value* args, strm_value* ret)
{
strm_get_args(strm, argc, args, "N", ret);
return STRM_OK;
}
strm_state* strm_ns_number;
void
strm_number_init(strm_state* state)
{
strm_ns_number = strm_ns_new(NULL, "number");
strm_var_def(strm_ns_number, "+", strm_cfunc_value(num_plus));
strm_var_def(strm_ns_number, "-", strm_cfunc_value(num_minus));
strm_var_def(strm_ns_number, "*", strm_cfunc_value(num_mult));
strm_var_def(strm_ns_number, "/", strm_cfunc_value(num_div));
strm_var_def(strm_ns_number, "%", strm_cfunc_value(num_mod));
strm_var_def(strm_ns_number, "|", strm_cfunc_value(num_bar));
strm_var_def(strm_ns_number, "<", strm_cfunc_value(num_lt));
strm_var_def(strm_ns_number, "<=", strm_cfunc_value(num_le));
strm_var_def(strm_ns_number, ">", strm_cfunc_value(num_gt));
strm_var_def(strm_ns_number, ">=", strm_cfunc_value(num_ge));
strm_var_def(state, "number", strm_cfunc_value(num_number));
}
| matz/streem | src/number.c | C | mit | 4,205 |
<html>
<head>
</head>
<body>
<h2>
Their Antiquity
</h2>
<span class="oldenglish">
Who
</span>
<span class="oldenglish">
were
</span>
<span class="oldenglish">
the
</span>
originall
<span class="oldenglish">
writers
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
severall
<span class="oldenglish">
Books
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
Holy
</span>
Scripture, has
<span class="english">
not
</span>
been
<span class="oldenglish">
made
</span>
<span class="oldfrench">
evident
</span>
<span class="oldenglish">
by
</span>
<span class="oldenglish">
any
</span>
<span class="oldfrench">
sufficient
</span>
<span class="oldfrench">
testimony
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
other
</span>
History, (which
<span class="oldenglish">
is
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
only
</span>
<span class="oldfrench">
proof
</span>
<span class="oldenglish">
of
</span>
<span class="oldfrench">
matter
</span>
<span class="oldenglish">
of
</span>
fact);
<span class="english">
nor
</span>
<span class="oldenglish">
can
</span>
<span class="oldenglish">
be
</span>
<span class="oldenglish">
by
</span>
<span class="oldenglish">
any
</span>
<span class="oldfrench">
arguments
</span>
<span class="oldenglish">
of
</span>
naturall Reason;
<span class="oldenglish">
for
</span>
<span class="oldfrench">
Reason
</span>
serves
<span class="oldenglish">
only
</span>
<span class="oldenglish">
to
</span>
<span class="latin">
convince
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
truth
</span>
(not
<span class="oldenglish">
of
</span>
fact, but)
<span class="oldenglish">
of
</span>
consequence.
<span class="oldenglish">
The
</span>
<span class="oldenglish">
light
</span>
<span class="oldenglish">
therefore
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
must
</span>
<span class="oldfrench">
guide
</span>
<span class="oldenglish">
us
</span>
<span class="oldenglish">
in
</span>
<span class="oldenglish">
this
</span>
question,
<span class="oldenglish">
must
</span>
<span class="oldenglish">
be
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
which
</span>
<span class="oldenglish">
is
</span>
<span class="oldenglish">
held
</span>
<span class="oldenglish">
out
</span>
<span class="oldenglish">
unto
</span>
<span class="oldenglish">
us
</span>
<span class="oldenglish">
from
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Bookes
</span>
themselves:
<span class="oldenglish">
And
</span>
<span class="oldenglish">
this
</span>
light,
<span class="oldenglish">
though
</span>
<span class="oldenglish">
it
</span>
<span class="americanenglish">
show
</span>
<span class="oldenglish">
us
</span>
<span class="english">
not
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
writer
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
every
</span>
book,
<span class="oldenglish">
yet
</span>
<span class="oldenglish">
it
</span>
<span class="oldenglish">
is
</span>
<span class="english">
not
</span>
unusefull
<span class="oldenglish">
to
</span>
<span class="oldenglish">
give
</span>
<span class="oldenglish">
us
</span>
<span class="english">
knowledge
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
time,
<span class="dutch">
wherein
</span>
<span class="oldnorse">
they
</span>
<span class="oldenglish">
were
</span>
written.
</body>
</html> | charlesreid1/wordswordswords | etymology/html/leviathan465.html | HTML | mit | 4,204 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.