code stringlengths 5 1.01M | repo_name stringlengths 5 84 | path stringlengths 4 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 5 1.01M | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|
<h3>Conteúdo do arquivo</h3>
<p>Cole aqui o conteúdo para o arquivo page2.html</p>
| ortolanph/concursotrf3 | public/sample/page2.html | HTML | mit | 85 | [
30522,
1026,
1044,
2509,
1028,
9530,
2618,
6784,
2080,
2079,
12098,
15549,
6767,
1026,
1013,
1044,
2509,
1028,
1026,
1052,
1028,
5624,
1037,
15549,
1051,
9530,
2618,
6784,
2080,
11498,
1051,
12098,
15549,
6767,
3931,
2475,
1012,
16129,
1026... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
{% extends '__base__.html' %}
{% block title %}创建账户{% endblock %}
{% block beforehead %}
<script>
var
action = '{{ action }}';
function initVM(account) {
var vm = new Vue({
el: '#vm',
data: account,
methods: {
submit: function (event) {
this.$data.date = $('#date').val();
event.preventDefault();
var $form = $('#vm').find('form');
$form.postJSON(action, this.$data, function (err, r) {
if (err) {
$form.showFormError(err);
}
else {
return location.assign('/account/' + r.id);
}
});
}
}
});
$('#vm').show();
}
$(function () {
$('#loading').hide();
initVM({
name: '',
buy_strategy: '',
sell_strategy: '',
commission_rate: 0.0002,
initial_funding: 0,
initial_bank_funding: 0,
initial_security_funding: 0,
date: getTodayString()
});
});
</script>
{% endblock %}
{% block content %}
<div id="error" class="uk-width-1-1">
</div>
<div id="loading" class="uk-width-1-1 uk-text-center">
<span><i class="uk-icon-spinner uk-icon-medium uk-icon-spin"></i> 正在加载...</span>
</div>
<div id="vm" class="uk-width-1-1">
<form v-on="submit: submit" class="uk-form uk-form-stacked">
<div class="uk-alert uk-alert-danger uk-hidden"></div>
<div class="uk-form-row">
<label class="uk-form-label">账户名称:</label>
<div class="uk-form-controls">
<input v-model="name" name="name" type="text" placeholder="账户名称" class="uk-width-1-1">
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label">买入策略:</label>
<div class="uk-form-controls">
<input v-model="buy_strategy" name="buy_strategy" type="text" placeholder="买入策略" class="uk-width-1-1">
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label">卖出策略:</label>
<div class="uk-form-controls">
<input v-model="sell_strategy" name="sell_strategy" type="text" placeholder="卖出策略" class="uk-width-1-1">
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label">手续费率:</label>
<div class="uk-form-controls">
<input v-model="commission_rate" name="commission_rate" type="text" placeholder="手续费率" class="uk-width-1-1">
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label">初始本金:</label>
<div class="uk-form-controls">
<input v-model="initial_funding" name="initial_funding" type="text" placeholder="初始本金" class="uk-width-1-1">
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label">现有银行资金:</label>
<div class="uk-form-controls">
<input v-model="initial_bank_funding" name="initial_bank_funding" type="text" placeholder="现有银行资金" class="uk-width-1-1">
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label">现有银证资金:</label>
<div class="uk-form-controls">
<input v-model="initial_security_funding" name="initial_security_funding" type="text" placeholder="现有银证资金" class="uk-width-1-1">
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label">起始日期:</label>
<div class="uk-form-controls">
<input id="date" v-model="date" name="date" type="text" data-uk-datepicker="{format:'YYYY-MM-DD'}" class="uk-width-1-1">
</div>
</div>
<div class="uk-form-row">
<button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-save"></i> 保存</button>
<a href="/account/create" class="uk-button"><i class="uk-icon-compress"></i> 基本选项</a>
<a href="/" class="uk-button"><i class="uk-icon-times"></i> 取消</a>
</div>
</form>
</div>
{% endblock %}
| charliezon/stock | www/templates/advanced_create_account.html | HTML | mit | 4,636 | [
30522,
1063,
1003,
8908,
1005,
1035,
1035,
2918,
1035,
1035,
1012,
16129,
1005,
1003,
1065,
1063,
1003,
3796,
2516,
1003,
1065,
100,
100,
100,
100,
1063,
1003,
2203,
23467,
1003,
1065,
1063,
1003,
3796,
2077,
4974,
1003,
1065,
1026,
5896,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en" dir="ltr">
<!--<![endif]-->
<!-- Usage: /eic/site/ccc-rec.nsf/tpl-eng/template-1col.html?Open&id=3 (optional: ?Open&page=filename.html&id=x) -->
<!-- Created: ; Product Code: 536; Server: stratnotes2.ic.gc.ca -->
<head>
<!-- Title begins / Début du titre -->
<title>
Quéro Métal inc. -
Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
</title>
<!-- Title ends / Fin du titre -->
<!-- Meta-data begins / Début des métadonnées -->
<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />
<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />
<!-- EPI-11240 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- MCG-202 -->
<meta content="width=device-width,initial-scale=1" name="viewport">
<!-- EPI-11567 -->
<meta name = "format-detection" content = "telephone=no">
<!-- EPI-12603 -->
<meta name="robots" content="noarchive">
<!-- EPI-11190 - Webtrends -->
<script>
var startTime = new Date();
startTime = startTime.getTime();
</script>
<!--[if gte IE 9 | !IE ]><!-->
<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">
<!--<![endif]-->
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">
<!--[if lt IE 9]>
<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="shortcut icon" />
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/ie8-wet-boew.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew.min.js"></script>
<![endif]-->
<!--[if lte IE 9]>
<![endif]-->
<noscript><link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" /></noscript>
<!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER -->
<script>dataLayer1 = [];</script>
<!-- End Google Tag Manager -->
<!-- EPI-11235 -->
<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />
</head>
<body class="home" vocab="http://schema.org/" typeof="WebPage">
<!-- EPIC HEADER BEGIN -->
<!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER -->
<noscript><iframe title="Google Tag Manager" src="//www.googletagmanager.com/ns.html?id=GTM-TLGQ9K" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer1'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer1','GTM-TLGQ9K');</script>
<!-- End Google Tag Manager -->
<!-- EPI-12801 -->
<span typeof="Organization"><meta property="legalName" content="Department_of_Industry"></span>
<ul id="wb-tphp">
<li class="wb-slc">
<a class="wb-sl" href="#wb-cont">Skip to main content</a>
</li>
<li class="wb-slc visible-sm visible-md visible-lg">
<a class="wb-sl" href="#wb-info">Skip to "About this site"</a>
</li>
</ul>
<header role="banner">
<div id="wb-bnr" class="container">
<section id="wb-lng" class="visible-md visible-lg text-right">
<h2 class="wb-inv">Language selection</h2>
<div class="row">
<div class="col-md-12">
<ul class="list-inline mrgn-bttm-0">
<li><a href="nvgt.do?V_TOKEN=1492313149693&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=38079&V_SEARCH.docsStart=38078&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn/rgstr.sec?_flId?_flxKy=e1s1&estblmntNo=234567041301&profileId=61&_evId=bck&lang=eng&V_SEARCH.showStricts=false&prtl=1&_flId?_flId?_flxKy=e1s1" title="Français" lang="fr">Français</a></li>
</ul>
</div>
</div>
</section>
<div class="row">
<div class="brand col-xs-8 col-sm-9 col-md-6">
<a href="http://www.canada.ca/en/index.html"><object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object><span class="wb-inv"> Government of Canada</span></a>
</div>
<section class="wb-mb-links col-xs-4 col-sm-3 visible-sm visible-xs" id="wb-glb-mn">
<h2>Search and menus</h2>
<ul class="list-inline text-right chvrn">
<li><a href="#mb-pnl" title="Search and menus" aria-controls="mb-pnl" class="overlay-lnk" role="button"><span class="glyphicon glyphicon-search"><span class="glyphicon glyphicon-th-list"><span class="wb-inv">Search and menus</span></span></span></a></li>
</ul>
<div id="mb-pnl"></div>
</section>
<!-- Site Search Removed -->
</div>
</div>
<nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" data-trgt="mb-pnl" data-ajax-fetch="//cdn.canada.ca/gcweb-cdn-dev/sitemenu/sitemenu-en.html" typeof="SiteNavigationElement">
<h2 class="wb-inv">Topics menu</h2>
<div class="container nvbar">
<div class="row">
<ul class="list-inline menu">
<li><a href="https://www.canada.ca/en/services/jobs.html">Jobs</a></li>
<li><a href="http://www.cic.gc.ca/english/index.asp">Immigration</a></li>
<li><a href="https://travel.gc.ca/">Travel</a></li>
<li><a href="https://www.canada.ca/en/services/business.html">Business</a></li>
<li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li>
<li><a href="http://healthycanadians.gc.ca/index-eng.php">Health</a></li>
<li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li>
<li><a href="https://www.canada.ca/en/services.html">More services</a></li>
</ul>
</div>
</div>
</nav>
<!-- EPIC BODY BEGIN -->
<nav role="navigation" id="wb-bc" class="" property="breadcrumb">
<h2 class="wb-inv">You are here:</h2>
<div class="container">
<div class="row">
<ol class="breadcrumb">
<li><a href="/eic/site/icgc.nsf/eng/home" title="Home">Home</a></li>
<li><a href="/eic/site/icgc.nsf/eng/h_07063.html" title="Industries and Business">Industries and Business</a></li>
<li><a href="/eic/site/ccc-rec.nsf/tpl-eng/../eng/home" >Canadian Company Capabilities</a></li>
</ol>
</div>
</div>
</nav>
</header>
<main id="wb-cont" role="main" property="mainContentOfPage" class="container">
<!-- End Header -->
<!-- Begin Body -->
<!-- Begin Body Title -->
<!-- End Body Title -->
<!-- Begin Body Head -->
<!-- End Body Head -->
<!-- Begin Body Content -->
<br>
<!-- Complete Profile -->
<!-- Company Information above tabbed area-->
<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>
<h1 id="wb-cont">
Company profile - Canadian Company Capabilities
</h1>
<div class="profileInfo hidden-print">
<ul class="list-inline">
<li><a href="cccSrch.do?lang=eng&profileId=&prtl=1&key.hitsPerPage=25&searchPage=%252Fapp%252Fccc%252Fsrch%252FcccBscSrch.do%253Flang%253Deng%2526amp%253Bprtl%253D1%2526amp%253Btagid%253D&V_SEARCH.scopeCategory=CCC.Root&V_SEARCH.depth=1&V_SEARCH.showStricts=false&V_SEARCH.sortSpec=title+asc&rstBtn.x=" class="btn btn-link">New Search</a> |</li>
<li><form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">
<input type="hidden" name="lang" value="eng" />
<input type="hidden" name="profileId" value="" />
<input type="hidden" name="prtl" value="1" />
<input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D" />
<input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />
<input type="hidden" name="V_SEARCH.depth" value="1" />
<input type="hidden" name="V_SEARCH.showStricts" value="false" />
<input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />
</form></li>
<li>| <a href="nvgt.do?V_SEARCH.docsStart=38077&V_DOCUMENT.docRank=38078&V_SEARCH.docsCount=3&lang=eng&prtl=1&sbPrtl=&profile=cmpltPrfl&V_TOKEN=1492313159708&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=%2fprfl.do&estblmntNo=234567125390&profileId=&key.newSearchLabel=">Previous Company</a></li>
<li>| <a href="nvgt.do?V_SEARCH.docsStart=38079&V_DOCUMENT.docRank=38080&V_SEARCH.docsCount=3&lang=eng&prtl=1&sbPrtl=&profile=cmpltPrfl&V_TOKEN=1492313159708&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=%2fprfl.do&estblmntNo=234567056705&profileId=&key.newSearchLabel=">Next Company</a></li>
</ul>
</div>
<details>
<summary>Third-Party Information Liability Disclaimer</summary>
<p>Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.</p>
</details>
<h2>
Quéro Métal inc.
</h2>
<div class="row">
<div class="col-md-5">
<h2 class="h5 mrgn-bttm-0">Legal/Operating Name:</h2>
<p>Quéro Métal inc.</p>
<div class="mrgn-tp-md"></div>
<p class="mrgn-bttm-0" ><a href="http://www.querometal.com"
target="_blank" title="Website URL">http://www.querometal.com</a></p>
<p><a href="mailto:informations@querometal.com" title="informations@querometal.com">informations@querometal.com</a></p>
</div>
<div class="col-md-4 mrgn-sm-sm">
<h2 class="h5 mrgn-bttm-0">Mailing Address:</h2>
<address class="mrgn-bttm-md">
440 Dumais St<br/>
LÉVIS,
Quebec<br/>
G6W 6P2
<br/>
</address>
<h2 class="h5 mrgn-bttm-0">Location Address:</h2>
<address class="mrgn-bttm-md">
440 Dumais St<br/>
LÉVIS,
Quebec<br/>
G6W 6P2
<br/>
</address>
<p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>:
(418) 839-0969
</p>
<p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>:
(418) 839-3810</p>
</div>
<div class="col-md-3 mrgn-tp-md">
<h2 class="wb-inv">Logo</h2>
<img class="img-responsive text-left" src="https://www.ic.gc.ca/app/ccc/srch/media?estblmntNo=123456089085&graphFileName=LogoQuero_Gros_coul.&applicationCode=AP&lang=eng" alt="Logo" />
</div>
</div>
<div class="row mrgn-tp-md mrgn-bttm-md">
<div class="col-md-12">
<h2 class="wb-inv">Company Profile</h2>
<br> QUÉRO MÉTAL is a company located in Levis (Québec) who
<br>employs around forty highly qualified steel workers. We are specialized
<br>in the fabrication and installation of steel structures for buildings of all sizes, in the fabrication of secondary steel works such as mezzanines, catwalks, conveyors, handrails and stairs as well as the fabrication of custom built steel assemblies following our clients' specifications. With the competence and expertise of their personnel and by putting forward values such as education and prevention, QUÉRO MÉTAL has obtained a high standard of quality control and has become a leader in the field of structural steel and secondary
<br>steel works. Since its foundation in 1988 QUÉRO MÉTAL applies a quality insurance program based on the ISO 9001 standard.
<br>QUÉRO MÉTAL also holds a W47.1 div 2 certification from the
<br>Canadian Welding Bureau (C.W.B.).<br>
</div>
</div>
<!-- <div class="wb-tabs ignore-session update-hash wb-eqht-off print-active"> -->
<div class="wb-tabs ignore-session">
<div class="tabpanels">
<details id="details-panel1">
<summary>
Full profile
</summary>
<!-- Tab 1 -->
<h2 class="wb-invisible">
Full profile
</h2>
<!-- Contact Information -->
<h3 class="page-header">
Contact information
</h3>
<section class="container-fluid">
<div class="row mrgn-tp-lg">
<div class="col-md-3">
<strong>
Robin
Truchon
</strong></div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Title:
</strong>
</div>
<div class="col-md-7">
<!--if client gender is not null or empty we use gender based job title-->
President
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Area of Responsibility:
</strong>
</div>
<div class="col-md-7">
Management Executive.
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Telephone:
</strong>
</div>
<div class="col-md-7">
(418) 839-0969
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Ext:
</strong>
</div>
<div class="col-md-7">
103
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Facsimile:
</strong>
</div>
<div class="col-md-7">
(418) 839-3810
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Email:
</strong>
</div>
<div class="col-md-7">
robin.truchon@querometal.com
</div>
</div>
<div class="row mrgn-tp-lg">
<div class="col-md-3">
<strong>
Eric
Christman
</strong></div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Title:
</strong>
</div>
<div class="col-md-7">
Data Provider <br>
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Telephone:
</strong>
</div>
<div class="col-md-7">
(418) 839-0969
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Facsimile:
</strong>
</div>
<div class="col-md-7">
(418) 839-3810
</div>
</div>
</section>
<p class="mrgn-tp-lg text-right small hidden-print">
<a href="#wb-cont">top of page</a>
</p>
<!-- Company Description -->
<h3 class="page-header">
Company description
</h3>
<section class="container-fluid">
<div class="row">
<div class="col-md-5">
<strong>
Country of Ownership:
</strong>
</div>
<div class="col-md-7">
Canada
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Year Established:
</strong>
</div>
<div class="col-md-7">
1988
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Exporting:
</strong>
</div>
<div class="col-md-7">
Yes
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Industry (NAICS):
</strong>
</div>
<div class="col-md-7">
332319 - Other Plate Work and Fabricated Structural Product Manufacturing
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Alternate Industries (NAICS):
</strong>
</div>
<div class="col-md-7">
238120 - Structural Steel and Precast Concrete Contractors<br>
332329 - Other Ornamental and Architectural Metal Product Manufacturing<br>
332999 - All Other Miscellaneous Fabricated Metal Product Manufacturing<br>
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Business Activity:
</strong>
</div>
<div class="col-md-7">
Manufacturer / Processor / Producer
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Number of Employees:
</strong>
</div>
<div class="col-md-7">
40
</div>
</div>
</section>
<!-- Products / Services / Licensing -->
<h3 class="page-header">
Product / Service / Licensing
</h3>
<section class="container-fluid">
<div class="row mrgn-bttm-md">
<div class="col-md-3">
<strong>
Product Name:
</strong>
</div>
<div class="col-md-9">
Structural steel <br>
</div>
</div>
<div class="row mrgn-bttm-md">
<div class="col-md-12">
Steel, transformation, fabrication, shipping, transportation and
<br>
installation of steel structures, handrails, catwalks, circular plateforms beams,
<br>
columns, miscellaneous steel according to our clients
<br>
specifications.<br>
<br>
</div>
</div>
<div class="row mrgn-bttm-md">
<div class="col-md-3">
<strong>
FSC Code:
</strong>
</div>
<div class="col-md-9">
1945-Pontoons and Floating Docks
<br>
</div>
</div>
</section>
<p class="mrgn-tp-lg text-right small hidden-print">
<a href="#wb-cont">top of page</a>
</p>
<!-- Technology Profile -->
<h3 class="page-header">
Technology profile
</h3>
<section class="container-fluid">
Cutting and hole cutting of plates using a computer assisted plasma table. Cutting and hole making of beams using a robotic cell.
</section>
<!-- Market Profile -->
<h3 class="page-header">
Market profile
</h3>
<section class="container-fluid">
<h4>
Industry sector market interests:
</h4>
<ul>
<li>Construction</li>
<li>Defence</li>
<li>Pulp and Paper</li>
</ul>
<h4>
Geographic markets:
</h4>
<h5>
Export experience:
</h5>
<ul>
<li>Algeria</li>
<li>Australia</li>
<li>Brazil</li>
<li>Iran, Islamic Republic of</li>
<li>Japan</li>
<li>United Kingdom</li>
<li>United States</li>
<li>Maine</li>
<li>Massachusetts</li>
<li>New Hampshire</li>
<li>New York</li>
</ul>
<h5>
Actively pursuing:
</h5>
<ul>
<li>Alabama</li>
<li>Alaska</li>
<li>Arizona</li>
<li>Arkansas</li>
<li>California</li>
<li>Colorado</li>
<li>Connecticut</li>
<li>Delaware</li>
<li>District of Columbia</li>
<li>Florida</li>
<li>Georgia</li>
<li>Hawaii</li>
<li>Idaho</li>
<li>Illinois</li>
<li>Indiana</li>
<li>Iowa</li>
<li>Kansas</li>
<li>Kentucky</li>
<li>Louisiana</li>
<li>Maryland</li>
<li>Michigan</li>
<li>Minnesota</li>
<li>Mississippi</li>
<li>Missouri</li>
<li>Montana</li>
<li>Nebraska</li>
<li>Nevada</li>
<li>New Jersey</li>
<li>New Mexico</li>
<li>North Carolina</li>
<li>North Dakota</li>
<li>Ohio</li>
<li>Oklahoma</li>
<li>Oregon</li>
<li>Pennsylvania</li>
<li>Rhode Island</li>
<li>South Carolina</li>
<li>South Dakota</li>
<li>Tennessee</li>
<li>Texas</li>
<li>Utah</li>
<li>Vermont</li>
<li>Virginia</li>
<li>Washington</li>
<li>West Virginia</li>
<li>Wisconsin</li>
<li>Wyoming</li>
</ul>
</section>
<p class="mrgn-tp-lg text-right small hidden-print">
<a href="#wb-cont">top of page</a>
</p>
<!-- Sector Information -->
<h3 class="page-header">
Sector information
</h3>
<section class="container-fluid">
<h4>
Total plant size:
</h4>
<div>We have a shop mesuring 100 pi x 147 pi (14700 pi2). Offices and services, on two levels, mesuring 18 pi x 100 pi (1800 pi2 x 2 = 3600 pi2).</div>
</section>
<details class="mrgn-tp-md mrgn-bttm-md">
<summary>
Third-Party Information Liability Disclaimer
</summary>
<p>
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
</p>
</details>
</details>
<details id="details-panel2">
<summary>
Contacts
</summary>
<h2 class="wb-invisible">
Contact information
</h2>
<!-- Contact Information -->
<section class="container-fluid">
<div class="row mrgn-tp-lg">
<div class="col-md-3">
<strong>
Robin
Truchon
</strong></div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Title:
</strong>
</div>
<div class="col-md-7">
<!--if client gender is not null or empty we use gender based job title-->
President
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Area of Responsibility:
</strong>
</div>
<div class="col-md-7">
Management Executive.
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Telephone:
</strong>
</div>
<div class="col-md-7">
(418) 839-0969
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Ext:
</strong>
</div>
<div class="col-md-7">
103
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Facsimile:
</strong>
</div>
<div class="col-md-7">
(418) 839-3810
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Email:
</strong>
</div>
<div class="col-md-7">
robin.truchon@querometal.com
</div>
</div>
<div class="row mrgn-tp-lg">
<div class="col-md-3">
<strong>
Eric
Christman
</strong></div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Title:
</strong>
</div>
<div class="col-md-7">
Data Provider <br>
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Telephone:
</strong>
</div>
<div class="col-md-7">
(418) 839-0969
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Facsimile:
</strong>
</div>
<div class="col-md-7">
(418) 839-3810
</div>
</div>
</section>
</details>
<details id="details-panel3">
<summary>
Description
</summary>
<h2 class="wb-invisible">
Company description
</h2>
<section class="container-fluid">
<div class="row">
<div class="col-md-5">
<strong>
Country of Ownership:
</strong>
</div>
<div class="col-md-7">
Canada
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Year Established:
</strong>
</div>
<div class="col-md-7">
1988
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Exporting:
</strong>
</div>
<div class="col-md-7">
Yes
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Industry (NAICS):
</strong>
</div>
<div class="col-md-7">
332319 - Other Plate Work and Fabricated Structural Product Manufacturing
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Alternate Industries (NAICS):
</strong>
</div>
<div class="col-md-7">
238120 - Structural Steel and Precast Concrete Contractors<br>
332329 - Other Ornamental and Architectural Metal Product Manufacturing<br>
332999 - All Other Miscellaneous Fabricated Metal Product Manufacturing<br>
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Business Activity:
</strong>
</div>
<div class="col-md-7">
Manufacturer / Processor / Producer
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Number of Employees:
</strong>
</div>
<div class="col-md-7">
40
</div>
</div>
</section>
</details>
<details id="details-panel4">
<summary>
Products, services and licensing
</summary>
<h2 class="wb-invisible">
Product / Service / Licensing
</h2>
<section class="container-fluid">
<div class="row mrgn-bttm-md">
<div class="col-md-3">
<strong>
Product Name:
</strong>
</div>
<div class="col-md-9">
Structural steel <br>
</div>
</div>
<div class="row mrgn-bttm-md">
<div class="col-md-12">
Steel, transformation, fabrication, shipping, transportation and
<br>
installation of steel structures, handrails, catwalks, circular plateforms beams,
<br>
columns, miscellaneous steel according to our clients
<br>
specifications.<br>
<br>
</div>
</div>
<div class="row mrgn-bttm-md">
<div class="col-md-3">
<strong>
FSC Code:
</strong>
</div>
<div class="col-md-9">
1945-Pontoons and Floating Docks
<br>
</div>
</div>
</section>
</details>
<details id="details-panel5">
<summary>
Technology
</summary>
<h2 class="wb-invisible">
Technology profile
</h2>
<section class="container-fluid">
Cutting and hole cutting of plates using a computer assisted plasma table. Cutting and hole making of beams using a robotic cell.
</section>
</details>
<details id="details-panel6">
<summary>
Market
</summary>
<h2 class="wb-invisible">
Market profile
</h2>
<section class="container-fluid">
<h4>
Industry sector market interests:
</h4>
<ul>
<li>Construction</li>
<li>Defence</li>
<li>Pulp and Paper</li>
</ul>
<h4>
Geographic markets:
</h4>
<h5>
Export experience:
</h5>
<ul>
<li>Algeria</li>
<li>Australia</li>
<li>Brazil</li>
<li>Iran, Islamic Republic of</li>
<li>Japan</li>
<li>United Kingdom</li>
<li>United States</li>
<li>Maine</li>
<li>Massachusetts</li>
<li>New Hampshire</li>
<li>New York</li>
</ul>
<h5>
Actively pursuing:
</h5>
<ul>
<li>Alabama</li>
<li>Alaska</li>
<li>Arizona</li>
<li>Arkansas</li>
<li>California</li>
<li>Colorado</li>
<li>Connecticut</li>
<li>Delaware</li>
<li>District of Columbia</li>
<li>Florida</li>
<li>Georgia</li>
<li>Hawaii</li>
<li>Idaho</li>
<li>Illinois</li>
<li>Indiana</li>
<li>Iowa</li>
<li>Kansas</li>
<li>Kentucky</li>
<li>Louisiana</li>
<li>Maryland</li>
<li>Michigan</li>
<li>Minnesota</li>
<li>Mississippi</li>
<li>Missouri</li>
<li>Montana</li>
<li>Nebraska</li>
<li>Nevada</li>
<li>New Jersey</li>
<li>New Mexico</li>
<li>North Carolina</li>
<li>North Dakota</li>
<li>Ohio</li>
<li>Oklahoma</li>
<li>Oregon</li>
<li>Pennsylvania</li>
<li>Rhode Island</li>
<li>South Carolina</li>
<li>South Dakota</li>
<li>Tennessee</li>
<li>Texas</li>
<li>Utah</li>
<li>Vermont</li>
<li>Virginia</li>
<li>Washington</li>
<li>West Virginia</li>
<li>Wisconsin</li>
<li>Wyoming</li>
</ul>
</section>
</details>
<details id="details-panel7">
<summary>
Sector
</summary>
<h2 class="wb-invisible">
Sector information
</h2>
<section class="container-fluid">
<h4>
Total plant size:
</h4>
<div>We have a shop mesuring 100 pi x 147 pi (14700 pi2). Offices and services, on two levels, mesuring 18 pi x 100 pi (1800 pi2 x 2 = 3600 pi2).</div>
</section>
</details>
</div>
</div>
<div class="row">
<div class="col-md-12 text-right">
Last Update Date 2016-06-16
</div>
</div>
<!--
- Artifact ID: CBW - IMBS - CCC Search WAR
- Group ID: ca.gc.ic.strategis.imbs.ccc.search
- Version: 3.26
- Built-By: bamboo
- Build Timestamp: 2017-03-02T21:29:28Z
-->
<!-- End Body Content -->
<!-- Begin Body Foot -->
<!-- End Body Foot -->
<!-- END MAIN TABLE -->
<!-- End body -->
<!-- Begin footer -->
<div class="row pagedetails">
<div class="col-sm-5 col-xs-12 datemod">
<dl id="wb-dtmd">
<dt class=" hidden-print">Date Modified:</dt>
<dd class=" hidden-print">
<span><time>2017-03-02</time></span>
</dd>
</dl>
</div>
<div class="clear visible-xs"></div>
<div class="col-sm-4 col-xs-6">
</div>
<div class="col-sm-3 col-xs-6 text-right">
</div>
<div class="clear visible-xs"></div>
</div>
</main>
<footer role="contentinfo" id="wb-info">
<nav role="navigation" class="container wb-navcurr">
<h2 class="wb-inv">About government</h2>
<!-- EPIC FOOTER BEGIN -->
<!-- EPI-11638 Contact us -->
<ul class="list-unstyled colcount-sm-2 colcount-md-3">
<li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07026.html#pageid=E048-H00000&from=Industries">Contact us</a></li>
<li><a href="https://www.canada.ca/en/government/dept.html">Departments and agencies</a></li>
<li><a href="https://www.canada.ca/en/government/publicservice.html">Public service and military</a></li>
<li><a href="https://www.canada.ca/en/news.html">News</a></li>
<li><a href="https://www.canada.ca/en/government/system/laws.html">Treaties, laws and regulations</a></li>
<li><a href="https://www.canada.ca/en/transparency/reporting.html">Government-wide reporting</a></li>
<li><a href="http://pm.gc.ca/eng">Prime Minister</a></li>
<li><a href="https://www.canada.ca/en/government/system.html">How government works</a></li>
<li><a href="http://open.canada.ca/en/">Open government</a></li>
</ul>
</nav>
<div class="brand">
<div class="container">
<div class="row">
<nav class="col-md-10 ftr-urlt-lnk">
<h2 class="wb-inv">About this site</h2>
<ul>
<li><a href="https://www.canada.ca/en/social.html">Social media</a></li>
<li><a href="https://www.canada.ca/en/mobile.html">Mobile applications</a></li>
<li><a href="http://www1.canada.ca/en/newsite.html">About Canada.ca</a></li>
<li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html">Terms and conditions</a></li>
<li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html#p1">Privacy</a></li>
</ul>
</nav>
<div class="col-xs-6 visible-sm visible-xs tofpg">
<a href="#wb-cont">Top of Page <span class="glyphicon glyphicon-chevron-up"></span></a>
</div>
<div class="col-xs-6 col-md-2 text-right">
<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>
</div>
</div>
</div>
</div>
</footer>
<!--[if gte IE 9 | !IE ]><!-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/wet-boew.min.js"></script>
<!--<![endif]-->
<!--[if lt IE 9]>
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew2.min.js"></script>
<![endif]-->
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/theme.min.js"></script>
<!-- EPI-10519 -->
<span class="wb-sessto"
data-wb-sessto='{"inactivity": 1800000, "reactionTime": 180000, "sessionalive": 1800000, "logouturl": "/app/ccc/srch/cccSrch.do?lang=eng&prtl=1"}'></span>
<script src="/eic/home.nsf/js/jQuery.externalOpensInNewWindow.js"></script>
<!-- EPI-11190 - Webtrends -->
<script src="/eic/home.nsf/js/webtrends.js"></script>
<script>var endTime = new Date();</script>
<noscript>
<div><img alt="" id="DCSIMG" width="1" height="1" src="//wt-sdc.ic.gc.ca/dcs6v67hwe0ei7wsv8g9fv50d_3k6i/njs.gif?dcsuri=/nojavascript&WT.js=No&WT.tv=9.4.0&dcssip=www.ic.gc.ca"/></div>
</noscript>
<!-- /Webtrends -->
<!-- JS deps -->
<script src="/eic/home.nsf/js/jquery.imagesloaded.js"></script>
<!-- EPI-11262 - Util JS -->
<script src="/eic/home.nsf/js/_WET_4-0_utils_canada.min.js"></script>
<!-- EPI-11383 -->
<script src="/eic/home.nsf/js/jQuery.icValidationErrors.js"></script>
<span style="display:none;" id='app-info' data-project-groupid='' data-project-artifactid='' data-project-version='' data-project-build-timestamp='' data-issue-tracking='' data-scm-sha1='' data-scm-sha1-abbrev='' data-scm-branch='' data-scm-commit-date=''></span>
</body></html>
<!-- End Footer -->
<!--
- Artifact ID: CBW - IMBS - CCC Search WAR
- Group ID: ca.gc.ic.strategis.imbs.ccc.search
- Version: 3.26
- Built-By: bamboo
- Build Timestamp: 2017-03-02T21:29:28Z
-->
| GoC-Spending/data-corporations | html/123456089085.html | HTML | mit | 56,910 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
999,
1011,
1011,
1031,
2065,
8318,
29464,
1023,
1033,
1028,
1026,
16129,
2465,
1027,
1000,
2053,
1011,
1046,
2015,
8318,
1011,
29464,
2683,
1000,
11374,
1027,
1000,
4372,
1000,
16101,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include "PagePool.h"
PagePool* PagePool::ins = nullptr;
Page* PagePool::create(int itemSize) {
auto p = Page::create(itemSize);
mp.insert(make_pair(p->getId(), p));
return p;
}
Page* PagePool::createFromFile(const string &path, int pid) {
auto buffer = new char[50];
sprintf(buffer, "%s/%d.page", path.c_str(), pid);
auto p = Page::createFromFile(buffer);
mp.insert(make_pair(p->getId(), p));
return p;
}
Page* PagePool::get(int pid) {
auto res = mp.find(pid);
if (res == mp.end()) return nullptr;
else return res->second;
}
void PagePool::writeBack() {
for (auto &pair : mp) {
pair.second->writeBack();
}
}
void PagePool::remove(int pid) {
auto res = mp.find(pid);
if (res != mp.end()) {
delete res->second;
mp.erase(res);
}
} | MegrezZhu/Database-BallTree | src/PagePool.cpp | C++ | mit | 757 | [
30522,
1001,
2421,
1000,
3931,
16869,
1012,
1044,
1000,
3931,
16869,
1008,
3931,
16869,
1024,
1024,
16021,
1027,
19701,
13876,
2099,
1025,
3931,
1008,
3931,
16869,
1024,
1024,
3443,
1006,
20014,
5167,
4697,
1007,
1063,
8285,
1052,
1027,
393... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!--
$Id: package.html 35201 2011-07-22 14:58:48Z juergens $
@version $Rev: 35201 $
@ConQAT.Rating GREEN Hash: 92C5B8CDC35E818F72E381EA1A7E7CBE
-->
<body>
Processors and nodes for analyzing ConQAT itself.
</body>
| vimaier/conqat | org.conqat.engine.self/src/org/conqat/engine/self/package.html | HTML | apache-2.0 | 224 | [
30522,
1026,
999,
1011,
1011,
1002,
8909,
1024,
7427,
1012,
16129,
28906,
24096,
2249,
1011,
5718,
1011,
2570,
2403,
1024,
5388,
1024,
4466,
2480,
18414,
2121,
21230,
1002,
1030,
2544,
1002,
7065,
1024,
28906,
24096,
1002,
1030,
9530,
19062... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Books.cpp
* Author: suyashd95
*/
#include "Books.h"
#include <iostream>
#include <cstring>
using namespace std;
Books::Books() {
stock = new int[size];
price = new float[size];
author = new const char*[size];
publisher = new const char*[size];
title = new const char*[size];
populateData();
}
void Books::populateData() {
for(int i = 0; i < size; i++) {
switch(i) {
case 0:
stock[i] = 10;
price[i] = 500.00;
author[i] = "JK Rowling";
publisher[i] = "Bloomsbury";
title[i] = "Harry Potter";
break;
case 1:
stock[i] = 0;
price[i] = 200.00;
author[i] = "Jeffrey Archer";
publisher[i] = "Penguin";
title[i] = "A Quiver Full Of Arrows";
break;
case 2:
stock[i] = 3;
price[i] = 1000.00;
author[i] = "JKR Tolkien";
publisher[i] = "Penguin";
title[i] = "The Lord Of The Rings";
break;
case 3:
stock[i] = 0;
price[i] = 80.00;
author[i] = "Danielle Steele";
publisher[i] = "Penguin";
title[i] = "A Perfect Stranger";
break;
case 4:
stock[i] = 7;
price[i] = 300.00;
author[i] = "Jane Austen";
publisher[i] = "Bloomsbury";
title[i] = "Pride & Prejudice";
break;
}
}
}
void Books::bookPurchase() {
string author, title;
cout << "Enter the author of the book: " << flush;
getline(cin, author, '\n');
cout << "Enter the title of the book: " << flush;
getline(cin, title, '\n');
char found = 'n';
for(int i = 0; i < size; i++) {
int condition1 = strcmp(this->author[i], author.c_str());
int condition2 = strcmp(this->title[i], title.c_str());
if(condition1 == 0 && condition2 == 0) {
found = 'y';
cout << endl;
cout << "Search Successful..." << endl;
cout << "Details of the Book:\n" << endl;
cout << " Author: " << this->author[i] << endl;
cout << " Title: " << this->title[i] << endl;
cout << "Publisher: " << this->publisher[i] << endl;
cout << " Price: " << this->price[i] << endl;
unsigned int requiredCopies;
cout << "Please enter the number of copies required for purchase: " << flush;
cin >> requiredCopies;
cout << endl;
if(requiredCopies <= this->stock[i])
cout << "Total Cost: " << this->price[i] * requiredCopies << endl;
else
cout << "Required copies not in stock." << endl;
break;
}
}
if(found == 'n')
cout << "\nSearch Unsuccessful...\nBook is not available." << endl;
}
Books::~Books() {
delete [] stock;
delete [] price;
delete [] author;
delete [] publisher;
delete [] title;
}
| SuyashD95/cplusplus-prog-exercises | Programming Exercises/Chapter 6 - Constructors and Destructors/Question 3/src/Books.cpp | C++ | mit | 2,512 | [
30522,
1013,
1008,
1008,
2808,
1012,
18133,
2361,
1008,
3166,
1024,
10514,
16303,
14945,
2683,
2629,
1008,
1013,
1001,
2421,
1000,
2808,
1012,
1044,
1000,
1001,
2421,
1026,
16380,
25379,
1028,
1001,
2421,
1026,
20116,
18886,
3070,
1028,
247... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Copyright 2017-2018 REAL.NET group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. */
namespace EditorPluginInterfaces
{
/// <summary>
/// Abstraction of editor's scene
/// </summary>
public interface IScene
{
}
}
| yurii-litvinov/REAL.NET | src/EditorPluginInterfaces/IScene.cs | C# | apache-2.0 | 753 | [
30522,
1013,
1008,
9385,
2418,
1011,
2760,
2613,
1012,
5658,
2177,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# WatirCrawler
A watir based web crawler
## Installation
Add this line to your application's Gemfile:
gem 'watir_crawler'
And then execute:
$ bundle
Or install it yourself as:
$ gem install watir_crawler
## Usage
See examples
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
| atlancer/watir_crawler | README.md | Markdown | mit | 487 | [
30522,
1001,
28194,
4313,
26775,
10376,
3917,
1037,
28194,
4313,
2241,
4773,
13529,
2121,
1001,
1001,
8272,
5587,
2023,
2240,
2000,
2115,
4646,
1005,
1055,
17070,
8873,
2571,
1024,
17070,
1005,
28194,
4313,
1035,
13529,
2121,
1005,
1998,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "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 COPYRIGHT
* OWNER 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.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\ORM;
use Exception;
use Doctrine\Common\EventManager;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\LockMode;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadataFactory;
use Doctrine\ORM\Query\ResultSetMapping;
use Doctrine\ORM\Proxy\ProxyFactory;
use Doctrine\ORM\Query\FilterCollection;
use Doctrine\Common\Util\ClassUtils;
/**
* The EntityManager is the central access point to ORM functionality.
*
* It is a facade to all different ORM subsystems such as UnitOfWork,
* Query Language and Repository API. Instantiation is done through
* the static create() method. The quickest way to obtain a fully
* configured EntityManager is:
*
* use Doctrine\ORM\Tools\Setup;
* use Doctrine\ORM\EntityManager;
*
* $paths = array('/path/to/entity/mapping/files');
*
* $config = Setup::createAnnotationMetadataConfiguration($paths);
* $dbParams = array('driver' => 'pdo_sqlite', 'memory' => true);
* $entityManager = EntityManager::create($dbParams, $config);
*
* For more information see
* {@link http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html}
*
* You should never attempt to inherit from the EntityManager: Inheritance
* is not a valid extension point for the EntityManager. Instead you
* should take a look at the {@see \Doctrine\ORM\Decorator\EntityManagerDecorator}
* and wrap your entity manager in a decorator.
*
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
/* final */class EntityManager implements EntityManagerInterface
{
/**
* The used Configuration.
*
* @var \Doctrine\ORM\Configuration
*/
private $config;
/**
* The database connection used by the EntityManager.
*
* @var \Doctrine\DBAL\Connection
*/
private $conn;
/**
* The metadata factory, used to retrieve the ORM metadata of entity classes.
*
* @var \Doctrine\ORM\Mapping\ClassMetadataFactory
*/
private $metadataFactory;
/**
* The UnitOfWork used to coordinate object-level transactions.
*
* @var \Doctrine\ORM\UnitOfWork
*/
private $unitOfWork;
/**
* The event manager that is the central point of the event system.
*
* @var \Doctrine\Common\EventManager
*/
private $eventManager;
/**
* The proxy factory used to create dynamic proxies.
*
* @var \Doctrine\ORM\Proxy\ProxyFactory
*/
private $proxyFactory;
/**
* The repository factory used to create dynamic repositories.
*
* @var \Doctrine\ORM\Repository\RepositoryFactory
*/
private $repositoryFactory;
/**
* The expression builder instance used to generate query expressions.
*
* @var \Doctrine\ORM\Query\Expr
*/
private $expressionBuilder;
/**
* Whether the EntityManager is closed or not.
*
* @var bool
*/
private $closed = false;
/**
* Collection of query filters.
*
* @var \Doctrine\ORM\Query\FilterCollection
*/
private $filterCollection;
/**
* Creates a new EntityManager that operates on the given database connection
* and uses the given Configuration and EventManager implementations.
*
* @param \Doctrine\DBAL\Connection $conn
* @param \Doctrine\ORM\Configuration $config
* @param \Doctrine\Common\EventManager $eventManager
*/
protected function __construct(Connection $conn, Configuration $config, EventManager $eventManager)
{
$this->conn = $conn;
$this->config = $config;
$this->eventManager = $eventManager;
$metadataFactoryClassName = $config->getClassMetadataFactoryName();
$this->metadataFactory = new $metadataFactoryClassName;
$this->metadataFactory->setEntityManager($this);
$this->metadataFactory->setCacheDriver($this->config->getMetadataCacheImpl());
$this->repositoryFactory = $config->getRepositoryFactory();
$this->unitOfWork = new UnitOfWork($this);
$this->proxyFactory = new ProxyFactory(
$this,
$config->getProxyDir(),
$config->getProxyNamespace(),
$config->getAutoGenerateProxyClasses()
);
}
/**
* {@inheritDoc}
*/
public function getConnection()
{
return $this->conn;
}
/**
* Gets the metadata factory used to gather the metadata of classes.
*
* @return \Doctrine\ORM\Mapping\ClassMetadataFactory
*/
public function getMetadataFactory()
{
return $this->metadataFactory;
}
/**
* {@inheritDoc}
*/
public function getExpressionBuilder()
{
if ($this->expressionBuilder === null) {
$this->expressionBuilder = new Query\Expr;
}
return $this->expressionBuilder;
}
/**
* {@inheritDoc}
*/
public function beginTransaction()
{
$this->conn->beginTransaction();
}
/**
* {@inheritDoc}
*/
public function transactional($func)
{
if (!is_callable($func)) {
throw new \InvalidArgumentException('Expected argument of type "callable", got "' . gettype($func) . '"');
}
$this->conn->beginTransaction();
try {
$return = call_user_func($func, $this);
$this->flush();
$this->conn->commit();
return $return ?: true;
} catch (Exception $e) {
$this->close();
$this->conn->rollback();
throw $e;
}
}
/**
* {@inheritDoc}
*/
public function commit()
{
$this->conn->commit();
}
/**
* {@inheritDoc}
*/
public function rollback()
{
$this->conn->rollback();
}
/**
* Returns the ORM metadata descriptor for a class.
*
* The class name must be the fully-qualified class name without a leading backslash
* (as it is returned by get_class($obj)) or an aliased class name.
*
* Examples:
* MyProject\Domain\User
* sales:PriceRequest
*
* @param string $className
*
* @return \Doctrine\ORM\Mapping\ClassMetadata
*
* @internal Performance-sensitive method.
*/
public function getClassMetadata($className)
{
return $this->metadataFactory->getMetadataFor($className);
}
/**
* {@inheritDoc}
*/
public function createQuery($dql = '')
{
$query = new Query($this);
if ( ! empty($dql)) {
$query->setDql($dql);
}
return $query;
}
/**
* {@inheritDoc}
*/
public function createNamedQuery($name)
{
return $this->createQuery($this->config->getNamedQuery($name));
}
/**
* {@inheritDoc}
*/
public function createNativeQuery($sql, ResultSetMapping $rsm)
{
$query = new NativeQuery($this);
$query->setSql($sql);
$query->setResultSetMapping($rsm);
return $query;
}
/**
* {@inheritDoc}
*/
public function createNamedNativeQuery($name)
{
list($sql, $rsm) = $this->config->getNamedNativeQuery($name);
return $this->createNativeQuery($sql, $rsm);
}
/**
* {@inheritDoc}
*/
public function createQueryBuilder()
{
return new QueryBuilder($this);
}
/**
* Flushes all changes to objects that have been queued up to now to the database.
* This effectively synchronizes the in-memory state of managed objects with the
* database.
*
* If an entity is explicitly passed to this method only this entity and
* the cascade-persist semantics + scheduled inserts/removals are synchronized.
*
* @param null|object|array $entity
*
* @return void
*
* @throws \Doctrine\ORM\OptimisticLockException If a version check on an entity that
* makes use of optimistic locking fails.
*/
public function flush($entity = null)
{
$this->errorIfClosed();
$this->unitOfWork->commit($entity);
}
/**
* Finds an Entity by its identifier.
*
* @param string $entityName
* @param mixed $id
* @param integer $lockMode
* @param integer|null $lockVersion
*
* @return object|null The entity instance or NULL if the entity can not be found.
*
* @throws OptimisticLockException
* @throws ORMInvalidArgumentException
* @throws TransactionRequiredException
* @throws ORMException
*/
public function find($entityName, $id, $lockMode = LockMode::NONE, $lockVersion = null)
{
$class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
if (is_object($id) && $this->metadataFactory->hasMetadataFor(ClassUtils::getClass($id))) {
$id = $this->unitOfWork->getSingleIdentifierValue($id);
if ($id === null) {
throw ORMInvalidArgumentException::invalidIdentifierBindingEntity();
}
}
if ( ! is_array($id)) {
$id = array($class->identifier[0] => $id);
}
$sortedId = array();
foreach ($class->identifier as $identifier) {
if ( ! isset($id[$identifier])) {
throw ORMException::missingIdentifierField($class->name, $identifier);
}
$sortedId[$identifier] = $id[$identifier];
}
$unitOfWork = $this->getUnitOfWork();
// Check identity map first
if (($entity = $unitOfWork->tryGetById($sortedId, $class->rootEntityName)) !== false) {
if ( ! ($entity instanceof $class->name)) {
return null;
}
switch ($lockMode) {
case LockMode::OPTIMISTIC:
$this->lock($entity, $lockMode, $lockVersion);
break;
case LockMode::PESSIMISTIC_READ:
case LockMode::PESSIMISTIC_WRITE:
$persister = $unitOfWork->getEntityPersister($class->name);
$persister->refresh($sortedId, $entity, $lockMode);
break;
}
return $entity; // Hit!
}
$persister = $unitOfWork->getEntityPersister($class->name);
switch ($lockMode) {
case LockMode::NONE:
return $persister->load($sortedId);
case LockMode::OPTIMISTIC:
if ( ! $class->isVersioned) {
throw OptimisticLockException::notVersioned($class->name);
}
$entity = $persister->load($sortedId);
$unitOfWork->lock($entity, $lockMode, $lockVersion);
return $entity;
default:
if ( ! $this->getConnection()->isTransactionActive()) {
throw TransactionRequiredException::transactionRequired();
}
return $persister->load($sortedId, null, null, array(), $lockMode);
}
}
/**
* {@inheritDoc}
*/
public function getReference($entityName, $id)
{
$class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
if ( ! is_array($id)) {
$id = array($class->identifier[0] => $id);
}
$sortedId = array();
foreach ($class->identifier as $identifier) {
if ( ! isset($id[$identifier])) {
throw ORMException::missingIdentifierField($class->name, $identifier);
}
$sortedId[$identifier] = $id[$identifier];
}
// Check identity map first, if its already in there just return it.
if (($entity = $this->unitOfWork->tryGetById($sortedId, $class->rootEntityName)) !== false) {
return ($entity instanceof $class->name) ? $entity : null;
}
if ($class->subClasses) {
return $this->find($entityName, $sortedId);
}
if ( ! is_array($sortedId)) {
$sortedId = array($class->identifier[0] => $sortedId);
}
$entity = $this->proxyFactory->getProxy($class->name, $sortedId);
$this->unitOfWork->registerManaged($entity, $sortedId, array());
return $entity;
}
/**
* {@inheritDoc}
*/
public function getPartialReference($entityName, $identifier)
{
$class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\'));
// Check identity map first, if its already in there just return it.
if (($entity = $this->unitOfWork->tryGetById($identifier, $class->rootEntityName)) !== false) {
return ($entity instanceof $class->name) ? $entity : null;
}
if ( ! is_array($identifier)) {
$identifier = array($class->identifier[0] => $identifier);
}
$entity = $class->newInstance();
$class->setIdentifierValues($entity, $identifier);
$this->unitOfWork->registerManaged($entity, $identifier, array());
$this->unitOfWork->markReadOnly($entity);
return $entity;
}
/**
* Clears the EntityManager. All entities that are currently managed
* by this EntityManager become detached.
*
* @param string|null $entityName if given, only entities of this type will get detached
*
* @return void
*/
public function clear($entityName = null)
{
$this->unitOfWork->clear($entityName);
}
/**
* {@inheritDoc}
*/
public function close()
{
$this->clear();
$this->closed = true;
}
/**
* Tells the EntityManager to make an instance managed and persistent.
*
* The entity will be entered into the database at or before transaction
* commit or as a result of the flush operation.
*
* NOTE: The persist operation always considers entities that are not yet known to
* this EntityManager as NEW. Do not pass detached entities to the persist operation.
*
* @param object $entity The instance to make managed and persistent.
*
* @return void
*
* @throws ORMInvalidArgumentException
*/
public function persist($entity)
{
if ( ! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()' , $entity);
}
$this->errorIfClosed();
$this->unitOfWork->persist($entity);
}
/**
* Removes an entity instance.
*
* A removed entity will be removed from the database at or before transaction commit
* or as a result of the flush operation.
*
* @param object $entity The entity instance to remove.
*
* @return void
*
* @throws ORMInvalidArgumentException
*/
public function remove($entity)
{
if ( ! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()' , $entity);
}
$this->errorIfClosed();
$this->unitOfWork->remove($entity);
}
/**
* Refreshes the persistent state of an entity from the database,
* overriding any local changes that have not yet been persisted.
*
* @param object $entity The entity to refresh.
*
* @return void
*
* @throws ORMInvalidArgumentException
*/
public function refresh($entity)
{
if ( ! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()' , $entity);
}
$this->errorIfClosed();
$this->unitOfWork->refresh($entity);
}
/**
* Detaches an entity from the EntityManager, causing a managed entity to
* become detached. Unflushed changes made to the entity if any
* (including removal of the entity), will not be synchronized to the database.
* Entities which previously referenced the detached entity will continue to
* reference it.
*
* @param object $entity The entity to detach.
*
* @return void
*
* @throws ORMInvalidArgumentException
*/
public function detach($entity)
{
if ( ! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#detach()' , $entity);
}
$this->unitOfWork->detach($entity);
}
/**
* Merges the state of a detached entity into the persistence context
* of this EntityManager and returns the managed copy of the entity.
* The entity passed to merge will not become associated/managed with this EntityManager.
*
* @param object $entity The detached entity to merge into the persistence context.
*
* @return object The managed copy of the entity.
*
* @throws ORMInvalidArgumentException
*/
public function merge($entity)
{
if ( ! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()' , $entity);
}
$this->errorIfClosed();
return $this->unitOfWork->merge($entity);
}
/**
* {@inheritDoc}
*
* @todo Implementation need. This is necessary since $e2 = clone $e1; throws an E_FATAL when access anything on $e:
* Fatal error: Maximum function nesting level of '100' reached, aborting!
*/
public function copy($entity, $deep = false)
{
throw new \BadMethodCallException("Not implemented.");
}
/**
* {@inheritDoc}
*/
public function lock($entity, $lockMode, $lockVersion = null)
{
$this->unitOfWork->lock($entity, $lockMode, $lockVersion);
}
/**
* Gets the repository for an entity class.
*
* @param string $entityName The name of the entity.
*
* @return \Doctrine\ORM\EntityRepository The repository class.
*/
public function getRepository($entityName)
{
return $this->repositoryFactory->getRepository($this, $entityName);
}
/**
* Determines whether an entity instance is managed in this EntityManager.
*
* @param object $entity
*
* @return boolean TRUE if this EntityManager currently manages the given entity, FALSE otherwise.
*/
public function contains($entity)
{
return $this->unitOfWork->isScheduledForInsert($entity)
|| $this->unitOfWork->isInIdentityMap($entity)
&& ! $this->unitOfWork->isScheduledForDelete($entity);
}
/**
* {@inheritDoc}
*/
public function getEventManager()
{
return $this->eventManager;
}
/**
* {@inheritDoc}
*/
public function getConfiguration()
{
return $this->config;
}
/**
* Throws an exception if the EntityManager is closed or currently not active.
*
* @return void
*
* @throws ORMException If the EntityManager is closed.
*/
private function errorIfClosed()
{
if ($this->closed) {
throw ORMException::entityManagerClosed();
}
}
/**
* {@inheritDoc}
*/
public function isOpen()
{
return (!$this->closed);
}
/**
* {@inheritDoc}
*/
public function getUnitOfWork()
{
return $this->unitOfWork;
}
/**
* {@inheritDoc}
*/
public function getHydrator($hydrationMode)
{
return $this->newHydrator($hydrationMode);
}
/**
* {@inheritDoc}
*/
public function newHydrator($hydrationMode)
{
switch ($hydrationMode) {
case Query::HYDRATE_OBJECT:
return new Internal\Hydration\ObjectHydrator($this);
case Query::HYDRATE_ARRAY:
return new Internal\Hydration\ArrayHydrator($this);
case Query::HYDRATE_SCALAR:
return new Internal\Hydration\ScalarHydrator($this);
case Query::HYDRATE_SINGLE_SCALAR:
return new Internal\Hydration\SingleScalarHydrator($this);
case Query::HYDRATE_SIMPLEOBJECT:
return new Internal\Hydration\SimpleObjectHydrator($this);
default:
if (($class = $this->config->getCustomHydrationMode($hydrationMode)) !== null) {
return new $class($this);
}
}
throw ORMException::invalidHydrationMode($hydrationMode);
}
/**
* {@inheritDoc}
*/
public function getProxyFactory()
{
return $this->proxyFactory;
}
/**
* {@inheritDoc}
*/
public function initializeObject($obj)
{
$this->unitOfWork->initializeObject($obj);
}
/**
* Factory method to create EntityManager instances.
*
* @param mixed $conn An array with the connection parameters or an existing Connection instance.
* @param Configuration $config The Configuration instance to use.
* @param EventManager $eventManager The EventManager instance to use.
*
* @return EntityManager The created EntityManager.
*
* @throws \InvalidArgumentException
* @throws ORMException
*/
public static function create($conn, Configuration $config, EventManager $eventManager = null)
{
if ( ! $config->getMetadataDriverImpl()) {
throw ORMException::missingMappingDriverImpl();
}
switch (true) {
case (is_array($conn)):
$conn = \Doctrine\DBAL\DriverManager::getConnection(
$conn, $config, ($eventManager ?: new EventManager())
);
break;
case ($conn instanceof Connection):
if ($eventManager !== null && $conn->getEventManager() !== $eventManager) {
throw ORMException::mismatchedEventManager();
}
break;
default:
throw new \InvalidArgumentException("Invalid argument: " . $conn);
}
return new EntityManager($conn, $config, $conn->getEventManager());
}
/**
* {@inheritDoc}
*/
public function getFilters()
{
if (null === $this->filterCollection) {
$this->filterCollection = new FilterCollection($this);
}
return $this->filterCollection;
}
/**
* {@inheritDoc}
*/
public function isFiltersStateClean()
{
return null === $this->filterCollection || $this->filterCollection->isClean();
}
/**
* {@inheritDoc}
*/
public function hasFilters()
{
return null !== $this->filterCollection;
}
}
| 351784144/DhtvWeiXin | vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php | PHP | bsd-3-clause | 24,823 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
2023,
4007,
2003,
3024,
2011,
1996,
9385,
13304,
1998,
16884,
1008,
1000,
2004,
2003,
1000,
1998,
2151,
4671,
2030,
13339,
10943,
3111,
1010,
2164,
1010,
2021,
2025,
1008,
3132,
2000,
1010,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/usr/bin/env python
#coding:utf-8
import cyclone.auth
import cyclone.escape
import cyclone.web
import datetime
import time
import os
from beaker.cache import cache_managers
from toughradius.manage.base import BaseHandler
from toughlib.permit import permit
from toughradius.manage import models
from toughradius.manage.settings import *
from toughradius.common import tools
import psutil
@permit.route(r"/admin")
class HomeHandler(BaseHandler):
@cyclone.web.authenticated
def get(self):
# cpuuse = psutil.cpu_percent(interval=None, percpu=True)
# memuse = psutil.virtual_memory()
# online_count = self.db.query(models.TrOnline.id).count()
# user_total = self.db.query(models.TrAccount.account_number).filter_by(status=1).count()
# self.render("index.html",config=self.settings.config,
# cpuuse=cpuuse,memuse=memuse,online_count=online_count,user_total=user_total)
self.redirect("/admin/dashboard")
@permit.route(r"/")
class HomeHandler(BaseHandler):
@cyclone.web.authenticated
def get(self):
self.redirect("/admin/dashboard")
@permit.route(r"/about")
class HomeHandler(BaseHandler):
@cyclone.web.authenticated
def get(self):
self.render("about.html")
@permit.route(r"/toughcloud/service/register")
class ToughcloudRegisterHandler(BaseHandler):
def get_toughcloud_url(self):
if os.environ.get("TR_DEV"):
return 'http://127.0.0.1:9079/customer/license/request?sid=%s'%tools.get_sys_uuid()
else:
return 'https://www.toughcloud.net/customer/license/request?sid=%s'%tools.get_sys_uuid()
@cyclone.web.authenticated
def get(self):
self.redirect(self.get_toughcloud_url())
| sumonchai/tough | toughradius/manage/system/index.py | Python | agpl-3.0 | 1,739 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
4372,
2615,
18750,
1001,
16861,
1024,
21183,
2546,
1011,
1022,
12324,
11609,
1012,
8740,
2705,
12324,
11609,
1012,
4019,
12324,
11609,
1012,
4773,
12324,
3058,
7292,
12324,
2051,
12324,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!--
@license
Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script src="d3.js"></script>
| wangyum/tensorflow | tensorflow/tensorboard/components/tf_imports_d3v4/d3.html | HTML | apache-2.0 | 634 | [
30522,
1026,
999,
1011,
1011,
1030,
6105,
9385,
2355,
1996,
23435,
12314,
6048,
1012,
2035,
2916,
9235,
1012,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
2017,
2089,
2025,
2224,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/background.gif">
<table width="177" height="100" border="0" align="center">
<tbody>
<tr>
<td width="12" height="20" class="ccolor"> </td>
<td width="12" class="ccolor"> </td>
<td width="149" class="toctitle">Site title</td>
<td width="12" class="ccolor"> </td>
<td width="12" class="ccolor"> </td>
</tr>
<tr>
<td height="80" class="ccolor"> </td>
<td class="tcolor"> </td>
<td class="tcolor">
<span class="doctitle">Document</span><br>
<span class="doccreationdate">Creation Date</span><br>
<span class="doclastchangeddate">Last Change Date</span><br>
<span class="docfilename">Filename</span></td>
<td class="tcolor"> </td>
<td class="ccolor"> </td>
</tr>
<tr>
<td width="12" height="20" class="ccolor"> </td>
<td width="12" class="ccolor"> </td>
<td width="149" class="ccolor"> </td>
<td width="12" class="ccolor"> </td>
<td width="12" class="ccolor"> </td>
</tr>
</tbody>
</table>
</body>
</html>
| ex1usive-m4d/TemplateDocx | controllers/phpdocx/lib/openoffice/openoffice.org/basis3.4/share/config/wizard/web/preview.html | HTML | bsd-3-clause | 2,374 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double OrangeLabelVersionNumber;
FOUNDATION_EXPORT const unsigned char OrangeLabelVersionString[];
| pisces/OrangeLabel | Example/Pods/Target Support Files/OrangeLabel/OrangeLabel-umbrella.h | C | mit | 314 | [
30522,
1001,
2065,
3207,
2546,
1035,
1035,
27885,
3501,
2278,
1035,
1035,
1001,
12324,
1026,
21318,
23615,
1013,
21318,
23615,
1012,
1044,
1028,
1001,
2842,
1001,
2065,
13629,
2546,
3192,
1035,
9167,
1001,
2065,
4225,
1006,
1035,
1035,
1813... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package lila.round
import akka.actor._
import akka.pattern.ask
import com.typesafe.config.Config
import scala.concurrent.duration._
import actorApi.{ GetSocketStatus, SocketStatus }
import lila.common.PimpedConfig._
import lila.hub.actorApi.map.{ Ask, Tell, TellAll }
import lila.socket.actorApi.GetVersion
import makeTimeout.large
final class Env(
config: Config,
system: ActorSystem,
db: lila.db.Env,
hub: lila.hub.Env,
ai: lila.ai.Client,
aiPerfApi: lila.ai.AiPerfApi,
crosstableApi: lila.game.CrosstableApi,
playban: lila.playban.PlaybanApi,
lightUser: String => Option[lila.common.LightUser],
userJsonView: lila.user.JsonView,
uciMemo: lila.game.UciMemo,
rematch960Cache: lila.memo.ExpireSetMemo,
isRematchCache: lila.memo.ExpireSetMemo,
onStart: String => Unit,
i18nKeys: lila.i18n.I18nKeys,
prefApi: lila.pref.PrefApi,
chatApi: lila.chat.ChatApi,
historyApi: lila.history.HistoryApi,
scheduler: lila.common.Scheduler) {
private val settings = new {
val UidTimeout = config duration "uid.timeout"
val PlayerDisconnectTimeout = config duration "player.disconnect.timeout"
val PlayerRagequitTimeout = config duration "player.ragequit.timeout"
val AnimationDuration = config duration "animation.duration"
val Moretime = config duration "moretime"
val SocketName = config getString "socket.name"
val SocketTimeout = config duration "socket.timeout"
val FinisherLockTimeout = config duration "finisher.lock.timeout"
val NetDomain = config getString "net.domain"
val ActorMapName = config getString "actor.map.name"
val CasualOnly = config getBoolean "casual_only"
val ActiveTtl = config duration "active.ttl"
val CollectionNote = config getString "collection.note"
val CollectionHistory = config getString "collection.history"
val CollectionForecast = config getString "collection.forecast"
}
import settings._
lazy val eventHistory = History(db(CollectionHistory)) _
val roundMap = system.actorOf(Props(new lila.hub.ActorMap {
def mkActor(id: String) = new Round(
gameId = id,
messenger = messenger,
takebacker = takebacker,
finisher = finisher,
rematcher = rematcher,
player = player,
drawer = drawer,
forecastApi = forecastApi,
socketHub = socketHub,
monitorMove = (ms: Option[Int]) => hub.actor.monitor ! lila.hub.actorApi.monitor.Move(ms),
moretimeDuration = Moretime,
activeTtl = ActiveTtl)
def receive: Receive = ({
case actorApi.GetNbRounds =>
nbRounds = size
hub.socket.lobby ! lila.hub.actorApi.round.NbRounds(nbRounds)
}: Receive) orElse actorMapReceive
}), name = ActorMapName)
private var nbRounds = 0
def count() = nbRounds
private val socketHub = {
val actor = system.actorOf(
Props(new lila.socket.SocketHubActor[Socket] {
private var historyPersistenceEnabled = false
def mkActor(id: String) = new Socket(
gameId = id,
history = eventHistory(id, historyPersistenceEnabled),
lightUser = lightUser,
uidTimeout = UidTimeout,
socketTimeout = SocketTimeout,
disconnectTimeout = PlayerDisconnectTimeout,
ragequitTimeout = PlayerRagequitTimeout,
simulActor = hub.actor.simul)
def receive: Receive = ({
case msg@lila.chat.actorApi.ChatLine(id, line) =>
self ! Tell(id take 8, msg)
case _: lila.hub.actorApi.Deploy =>
logwarn("Enable history persistence")
historyPersistenceEnabled = true
case msg: lila.game.actorApi.StartGame =>
self ! Tell(msg.game.id, msg)
}: Receive) orElse socketHubReceive
}),
name = SocketName)
system.lilaBus.subscribe(actor, 'tvSelect, 'startGame, 'deploy)
actor
}
lazy val socketHandler = new SocketHandler(
hub = hub,
roundMap = roundMap,
socketHub = socketHub,
messenger = messenger,
bus = system.lilaBus)
lazy val perfsUpdater = new PerfsUpdater(historyApi)
lazy val forecastApi: ForecastApi = new ForecastApi(
coll = db(CollectionForecast),
roundMap = hub.actor.roundMap)
private lazy val finisher = new Finisher(
messenger = messenger,
perfsUpdater = perfsUpdater,
aiPerfApi = aiPerfApi,
crosstableApi = crosstableApi,
playban = playban,
bus = system.lilaBus,
timeline = hub.actor.timeline,
casualOnly = CasualOnly)
private lazy val rematcher = new Rematcher(
messenger = messenger,
onStart = onStart,
rematch960Cache = rematch960Cache,
isRematchCache = isRematchCache)
private lazy val player: Player = new Player(
engine = ai,
bus = system.lilaBus,
finisher = finisher,
cheatDetector = cheatDetector,
uciMemo = uciMemo)
// public access to AI play, for setup.Processor usage
val aiPlay = player ai _
private lazy val drawer = new Drawer(
prefApi = prefApi,
messenger = messenger,
finisher = finisher)
private lazy val cheatDetector = new CheatDetector(reporter = hub.actor.report)
lazy val cli = new Cli(db, roundMap = roundMap, system = system)
lazy val messenger = new Messenger(
socketHub = socketHub,
chat = hub.actor.chat,
i18nKeys = i18nKeys)
def version(gameId: String): Fu[Int] =
socketHub ? Ask(gameId, GetVersion) mapTo manifest[Int]
private def getSocketStatus(gameId: String): Fu[SocketStatus] =
socketHub ? Ask(gameId, GetSocketStatus) mapTo manifest[SocketStatus]
lazy val jsonView = new JsonView(
chatApi = chatApi,
noteApi = noteApi,
userJsonView = userJsonView,
getSocketStatus = getSocketStatus,
canTakeback = takebacker.isAllowedByPrefs,
baseAnimationDuration = AnimationDuration,
moretimeSeconds = Moretime.toSeconds.toInt)
lazy val noteApi = new NoteApi(db(CollectionNote))
scheduler.message(2.1 seconds)(roundMap -> actorApi.GetNbRounds)
system.actorOf(
Props(classOf[Titivate], roundMap, hub.actor.bookmark),
name = "titivate")
lazy val takebacker = new Takebacker(
messenger = messenger,
uciMemo = uciMemo,
prefApi = prefApi)
lazy val tvBroadcast = system.actorOf(Props(classOf[TvBroadcast]))
def checkOutoftime(game: lila.game.Game) {
if (game.playable && game.started && !game.isUnlimited)
roundMap ! Tell(game.id, actorApi.round.Outoftime)
}
def resign(pov: lila.game.Pov) {
if (pov.game.abortable)
roundMap ! Tell(pov.game.id, actorApi.round.Abort(pov.playerId))
else if (pov.game.playable)
roundMap ! Tell(pov.game.id, actorApi.round.Resign(pov.playerId))
}
}
object Env {
lazy val current = "round" boot new Env(
config = lila.common.PlayApp loadConfig "round",
system = lila.common.PlayApp.system,
db = lila.db.Env.current,
hub = lila.hub.Env.current,
ai = lila.ai.Env.current.client,
aiPerfApi = lila.ai.Env.current.aiPerfApi,
crosstableApi = lila.game.Env.current.crosstableApi,
playban = lila.playban.Env.current.api,
lightUser = lila.user.Env.current.lightUser,
userJsonView = lila.user.Env.current.jsonView,
uciMemo = lila.game.Env.current.uciMemo,
rematch960Cache = lila.game.Env.current.cached.rematch960,
isRematchCache = lila.game.Env.current.cached.isRematch,
onStart = lila.game.Env.current.onStart,
i18nKeys = lila.i18n.Env.current.keys,
prefApi = lila.pref.Env.current.api,
chatApi = lila.chat.Env.current.api,
historyApi = lila.history.Env.current.api,
scheduler = lila.common.PlayApp.scheduler)
}
| JimmyMow/lila | modules/round/src/main/Env.scala | Scala | mit | 7,632 | [
30522,
7427,
19286,
1012,
2461,
12324,
17712,
2912,
1012,
3364,
1012,
1035,
12324,
17712,
2912,
1012,
5418,
1012,
3198,
12324,
4012,
1012,
4127,
10354,
2063,
1012,
9530,
8873,
2290,
1012,
9530,
8873,
2290,
12324,
26743,
1012,
16483,
1012,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package jlib.datastream.intraprocess;
import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;
import jlib.datastream.ezio.LineReaderObject;
import jlib.events.Command;
import jlib.utils.e.event.DuplicateCommandException;
import jlib.utils.e.oop.NonUniqueIdentifierException;
/**
* Background Daemon thread that reads user input into the console in a non-blocking daemon thread and takes actions depending on user input.
*
* Commands and command identifiers must be unique. Case sensitivity param cannot be changed after construction. Commands have arguments passed as an Object[] of Strings.
* Input source cannot be changed and commands cannot be added after the daemon is started
*
* @author J-Dierberger
*/
public class BackgroundDaemon<T extends LineReaderObject & Closeable> implements Closeable{
private ArrayList<Command> commands;
private final boolean caseSensitive;
private T reader;
private Thread daemon;
private boolean daemonStarted;
private boolean daemonClosed;
/**
* Create a BackgroundDaemon with the given case-sensitivity param and the given Commands.
*
* @param caseSensitive If Command input is case sensitive.
* @param inputSource The source of input the daemon reads from.
* @param commands The list of Commands this daemon can execute.
*/
public BackgroundDaemon(boolean caseSensitive, T inputSource, Command...commands){
this.caseSensitive = caseSensitive;
ArrayList<String> commandNames = new ArrayList<String>();
// Check for no duplicate names.
for(int i = 0; i < commands.length; i++){
if(!caseSensitive && commandNames.contains(commands[i].getName())){
throw new NonUniqueIdentifierException("Duplicate command "+commands[i].getName());
}else if(caseSensitive && commandNames.contains(commands[i].getName().toLowerCase())){
throw new NonUniqueIdentifierException("Duplicate command "+commands[i].getName().toLowerCase());
}else{
String name = commands[i].getName();
name = _caseCorrect(name);
commandNames.add(name);
}
}
// If we pass the loop without throwing exceptions then we have a valid list of commands.
this.commands = new ArrayList<Command>();
for(Command c : commands){
this.commands.add(c);
}
daemonStarted = false;
daemonClosed = false;
reader = inputSource;
}
/**
* Create a BackgroundDaemon with the given case-sensitivity param.
*
* @param caseSensitive If Command input is case sensitive.
* @param inputSource The source of input the daemon reads from.
*/
public BackgroundDaemon(boolean caseSensitive, T inputSource){
this(caseSensitive, inputSource, new Command[]{});
}
/**
* Create a BackgroundDaemon with the given list of executable Commands. Case sensitivity turned off by default. This cannot be changed after construction.
*
* @param commands The list of Commands this daemon can execute.
* @param inputSource The source of input the daemon reads from.
*/
public BackgroundDaemon(Command[] commands, T inputSource){
this(false, inputSource, new Command[]{});
}
/**
* Create a BackgroundDaemon with the given input source to read from. Case sensitivity is turned off by default. This cannot be changed after construction.
*
* @param inputSource The source of input the daemon reads from.
*/
public BackgroundDaemon(T inputSource){
this(false, inputSource, new Command[]{});
}
/**
* Start the daemon thread.
*/
public void start(){
daemon = new Thread(){
@Override
public void run(){
while(true){
try{
String in = reader.readLine();
String[] fullCommand = in.split(",");
String inputComm = fullCommand[0];
String[] args = new String[fullCommand.length-1];
for(int i = 1; i < fullCommand.length; i++){
args[i-1] = fullCommand[i].trim();
}
inputComm = _caseCorrect(inputComm);
for(Command c : commands){
String commName = c.getName();
commName = _caseCorrect(commName);
if(inputComm.equals(commName)){
c.execute((Object[])args);
break;
}
}
}catch(Throwable e){
e.printStackTrace();
}
}
}
};
daemon.setDaemon(true);
daemon.start();
daemonStarted = true;
}
/**
* Set the input source of the daemon.
*
* @param T The object to read input from. Reads line-by-line.
*/
public void setLineReaderObject(T inputSource){
_checkStarted();
reader = inputSource;
}
/**
* Add a Command to the list of Commands this daemon can execute.
*
* @param c The Command to add.
*/
public void addCommand(Command c){
_checkStarted();
if(commands.contains(c)){
throw new DuplicateCommandException("Command already exists in this daemon's list of commands.");
}
String commName = c.getName();
commName = _caseCorrect(commName);
for(Command comm : commands){
String cName = comm.getName();
cName = _caseCorrect(cName);
if(commName.equals(cName)){
throw new NonUniqueIdentifierException("Duplicate command "+cName);
}
}
commands.add(c);
}
/**
* Remove the given Command from the list of Commands this daemon can execute.
*
* @param c The Command to remove.
*/
public void removeCommand(Command c){
_checkStarted();
commands.remove(c);
}
/**
* Stop the daemon thread.
*
* @throws IOException If closing fails.
*/
public void close() throws IOException{
_checkClosed();
reader.close();
daemon.interrupt();
daemonClosed = true;
}
/**
* Check if the daemon was started.
*
* @return If the daemon was started.
*/
public boolean started(){
return daemonStarted;
}
/**
* Check if the daemon is alive.
*
* @return If the daemon thread is still alive.
*/
public boolean isAlive(){
return daemon.isAlive();
}
/**
* Check if the daemon is closed.
*
* @return If the daemon is closed.
*/
public boolean isClosed(){
return daemonClosed;
}
private void _checkStarted(){
if(daemonStarted){
throw new IllegalStateException("Illegal modification attempted; daemon already started.");
}
}
private void _checkClosed(){
if(!daemonStarted){
throw new IllegalStateException("Daemon not started; cannot close.");
}else if(daemonClosed){
throw new IllegalStateException("Daemon already closed; cannot close again.");
}
}
private String _caseCorrect(String s){
if(!caseSensitive){
return s.toLowerCase();
}else{
return s;
}
}
}
| JDierberger1/JDierberger | src/jlib/datastream/intraprocess/BackgroundDaemon.java | Java | agpl-3.0 | 6,700 | [
30522,
7427,
1046,
29521,
1012,
2951,
21422,
1012,
26721,
21572,
9623,
2015,
1025,
12324,
9262,
1012,
22834,
1012,
2485,
3085,
1025,
12324,
9262,
1012,
22834,
1012,
22834,
10288,
24422,
1025,
12324,
9262,
1012,
21183,
4014,
1012,
9140,
9863,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!doctype html>
<!-- The DOCTYPE declaration above will set the -->
<!-- browser's rendering engine into -->
<!-- "Standards Mode". Replacing this declaration -->
<!-- with a "Quirks Mode" doctype is not supported. -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link type="text/css" rel="stylesheet" href="RestGWT.css">
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>Aplicação Rest</title>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" language="javascript" src="restgwt/restgwt.nocache.js"></script>
</head>
<!-- -->
<!-- The body can have arbitrary html, or -->
<!-- you can leave the body empty if you want -->
<!-- to create a completely dynamic UI. -->
<!-- -->
<body>
<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
<noscript>
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
Your web browser must have JavaScript enabled
in order for this application to display correctly.
</div>
</noscript>
<h1>Aplicação Rest</h1>
<div id="loginContainer">
</div>
<div id="managementContainer">
</div>
</body>
</html>
| Andre-Pires/SoftwareEngineering | rest/war/RestGWT.html | HTML | apache-2.0 | 2,264 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
999,
1011,
1011,
1996,
9986,
13874,
8170,
2682,
2097,
2275,
1996,
1011,
1011,
1028,
1026,
999,
1011,
1011,
16602,
1005,
1055,
14259,
3194,
2046,
1011,
1011,
1028,
1026,
999,
1011,
1011,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Laplacea speciosa var. barbinervis (Moric.) Kobuski VARIETY
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Ericales/Theaceae/Laplacea/Laplacea speciosa/Laplacea speciosa barbinervis/README.md | Markdown | apache-2.0 | 201 | [
30522,
1001,
5001,
19217,
2050,
28699,
10735,
2050,
13075,
1012,
3347,
16765,
29074,
1006,
22993,
2278,
1012,
1007,
12849,
8286,
3211,
3528,
1001,
1001,
1001,
1001,
3570,
3970,
1001,
1001,
1001,
1001,
2429,
2000,
2248,
3269,
3415,
5950,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import unittest
import os
from ui import main
print os.getcwd()
class TestMain(unittest.TestCase):
def setUp(self):
self.m = main.MainWindow()
def test_mainWindow(self):
assert(self.m)
def test_dataframe(self):
import numpy
#Random 25x4 Numpy Matrix
self.m.render_dataframe(numpy.random.rand(25,4) ,name='devel',rownames=xrange(0,25))
assert(self.m.active_robject)
assert(self.m.active_robject.columns)
assert(self.m.active_robject.column_data)
def test_imports(self):
datasets = ['iris','Nile','morley','freeny','sleep','mtcars']
for a in datasets:
main.rsession.r('%s=%s' % (a,a))
self.m.sync_with_r()
assert(a in self.m.robjects)
unittest.main() | sdiehl/rpygtk | rpygtk/runtests.py | Python | gpl-3.0 | 818 | [
30522,
12324,
3131,
22199,
12324,
9808,
2013,
21318,
12324,
2364,
6140,
9808,
1012,
2131,
2278,
21724,
1006,
1007,
2465,
3231,
24238,
1006,
3131,
22199,
1012,
3231,
18382,
1007,
1024,
13366,
16437,
1006,
2969,
1007,
1024,
2969,
1012,
1049,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Copyright (c) 2013, Washington University in St.Louis.
All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package edu.wustl.xipApplication.recist;
import java.io.File;
import java.util.List;
import org.nema.dicom.wg23.ObjectLocator;
import edu.wustl.xipApplication.wg23.ClientToHost;
import edu.wustl.xipApplication.wg23.WG23DataModel;
public interface RECISTManager {
public abstract void parseAIMObjects(List<ObjectLocator> items);
public abstract int getNumberOfTumors();
public abstract List<Tumor> getTumors();
public abstract Tumor getTumor(String tumorName);
public abstract void setSOPInstanceUIDPrev(List<String> sopInstanceUIDPrev);
public abstract void setSOPInstanceUIDCurr(List<String> sopInstanceUIDCurr);
public abstract List<File> getAIMPrevious();
public abstract List<File> getAIMCurrent();
public abstract void setOutputDir(String outputDir);
public abstract String getOutputDir();
}
| OpenXIP/xip-app | src/edu/wustl/xipApplication/recist/RECISTManager.java | Java | apache-2.0 | 1,457 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2286,
1010,
2899,
2118,
1999,
2358,
1012,
3434,
1012,
2035,
2916,
9235,
1012,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
2017,
2089,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import { injectable, inject } from "inversify";
import { TYPES } from "../ioc/types";
const cacheKey = "AleksaDiscordServerSelection";
@injectable()
export class ServerSelectorService {
constructor(
@inject(TYPES.IConfig) private _config: IConfig,
@inject(TYPES.Logger) private _logger: ILogger,
@inject(TYPES.IBasicCache) private _cache: IBasicCache,
) { }
/**
* Change to the new server
* @param name
*/
public async changeServer(name: string): Promise<void> {
const servers: IServer[] = this._config.app.aleksa.discord.servers;
const matches = servers.filter(s => s.name.indexOf(name) > -1);
const selection = matches.length > 0
? matches[0]
: servers[0];
this._logger.info(`Changing server to ${name}`);
// Ensure never expired
this._cache.set(cacheKey, JSON.stringify(selection), 0);
}
/**
* Get the current selected server
*/
public async getServer(): Promise<IServer> {
if(await this._cache.has(cacheKey)) {
return JSON.parse(await this._cache.get(cacheKey)) as IServer;
}
return this._config.app.aleksa.discord.servers[0] as IServer;
}
}
export interface IServer {
name: string;
guildId: string;
channelId: string;
userId: string;
} | arijoon/vendaire-discord-bot | src/aleksa/server-selector.service.ts | TypeScript | mit | 1,262 | [
30522,
12324,
1063,
1999,
20614,
3085,
1010,
1999,
20614,
1065,
2013,
1000,
1999,
14028,
8757,
1000,
1025,
12324,
1063,
4127,
1065,
2013,
1000,
1012,
1012,
1013,
25941,
1013,
4127,
1000,
1025,
9530,
3367,
17053,
14839,
1027,
1000,
15669,
57... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__new_free_struct_54b.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_free.label.xml
Template File: sources-sinks-54b.tmpl.cpp
*/
/*
* @description
* CWE: 762 Mismatched Memory Management Routines
* BadSource: Allocate data using new
* GoodSource: Allocate data using malloc()
* Sinks:
* GoodSink: Deallocate data using delete
* BadSink : Deallocate data using free()
* Flow Variant: 54 Data flow: data passed as an argument from one function through three others to a fifth; all five functions are in different source files
*
* */
#include "std_testcase.h"
namespace CWE762_Mismatched_Memory_Management_Routines__new_free_struct_54
{
#ifndef OMITBAD
/* bad function declaration */
void badSink_c(twoIntsStruct * data);
void badSink_b(twoIntsStruct * data)
{
badSink_c(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void goodG2BSink_c(twoIntsStruct * data);
void goodG2BSink_b(twoIntsStruct * data)
{
goodG2BSink_c(data);
}
/* goodB2G uses the BadSource with the GoodSink */
void goodB2GSink_c(twoIntsStruct * data);
void goodB2GSink_b(twoIntsStruct * data)
{
goodB2GSink_c(data);
}
#endif /* OMITGOOD */
} /* close namespace */
| JianpingZeng/xcc | xcc/test/juliet/testcases/CWE762_Mismatched_Memory_Management_Routines/s07/CWE762_Mismatched_Memory_Management_Routines__new_free_struct_54b.cpp | C++ | bsd-3-clause | 1,396 | [
30522,
1013,
1008,
23561,
7013,
3231,
18382,
5371,
5371,
18442,
1024,
19296,
2063,
2581,
2575,
2475,
1035,
28616,
18900,
7690,
1035,
3638,
1035,
2968,
1035,
23964,
1035,
1035,
2047,
1035,
2489,
1035,
2358,
6820,
6593,
1035,
5139,
2497,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (c) 2009-2012, 2016 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * 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.
*
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "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 COPYRIGHT OWNER 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.
*/
package com.jme3.bullet.joints;
import com.jme3.bullet.objects.PhysicsRigidBody;
import com.jme3.export.*;
import com.jme3.math.Vector3f;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* <p>
* PhysicsJoint - Basic Phyiscs Joint
* </p>
*
* @author normenhansen
*/
public abstract class PhysicsJoint implements Savable {
protected long objectId = 0;
protected PhysicsRigidBody nodeA;
protected PhysicsRigidBody nodeB;
protected Vector3f pivotA;
protected Vector3f pivotB;
protected boolean collisionBetweenLinkedBodys = true;
public PhysicsJoint() {
}
/**
* @param nodeA first node of the joint
* @param nodeB second node of the joint
* @param pivotA local translation of the joint connection point in node A
* @param pivotB local translation of the joint connection point in node B
*/
public PhysicsJoint(PhysicsRigidBody nodeA, PhysicsRigidBody nodeB, Vector3f pivotA, Vector3f pivotB) {
this.nodeA = nodeA;
this.nodeB = nodeB;
this.pivotA = pivotA;
this.pivotB = pivotB;
nodeA.addJoint(this);
nodeB.addJoint(this);
}
public float getAppliedImpulse() {
return getAppliedImpulse(objectId);
}
private native float getAppliedImpulse(long objectId);
/**
* @return the constraint
*/
public long getObjectId() {
return objectId;
}
/**
* @return the collisionBetweenLinkedBodys
*/
public boolean isCollisionBetweenLinkedBodys() {
return collisionBetweenLinkedBodys;
}
/**
* toggles collisions between linked bodys<br>
* joint has to be removed from and added to PhyiscsSpace to apply this.
*
* @param collisionBetweenLinkedBodys set to false to have no collisions
* between linked bodys
*/
public void setCollisionBetweenLinkedBodys(boolean collisionBetweenLinkedBodys) {
this.collisionBetweenLinkedBodys = collisionBetweenLinkedBodys;
}
public PhysicsRigidBody getBodyA() {
return nodeA;
}
public PhysicsRigidBody getBodyB() {
return nodeB;
}
public Vector3f getPivotA() {
return pivotA;
}
public Vector3f getPivotB() {
return pivotB;
}
/**
* destroys this joint and removes it from its connected PhysicsRigidBodys
* joint lists
*/
public void destroy() {
getBodyA().removeJoint(this);
getBodyB().removeJoint(this);
}
@Override
public void write(JmeExporter ex) throws IOException {
OutputCapsule capsule = ex.getCapsule(this);
capsule.write(nodeA, "nodeA", null);
capsule.write(nodeB, "nodeB", null);
capsule.write(pivotA, "pivotA", null);
capsule.write(pivotB, "pivotB", null);
}
@Override
public void read(JmeImporter im) throws IOException {
InputCapsule capsule = im.getCapsule(this);
this.nodeA = ((PhysicsRigidBody) capsule.readSavable("nodeA", new PhysicsRigidBody()));
this.nodeB = (PhysicsRigidBody) capsule.readSavable("nodeB", new PhysicsRigidBody());
this.pivotA = (Vector3f) capsule.readSavable("pivotA", new Vector3f());
this.pivotB = (Vector3f) capsule.readSavable("pivotB", new Vector3f());
}
@Override
protected void finalize() throws Throwable {
try {
Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Finalizing Joint {0}", Long.toHexString(objectId));
finalizeNative(objectId);
} finally {
super.finalize();
}
}
protected native void finalizeNative(long objectId);
}
| bertleft/jmonkeyengine | jme3-bullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java | Java | bsd-3-clause | 5,286 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2268,
1011,
2262,
1010,
2355,
1046,
8202,
14839,
13159,
3170,
1008,
2035,
2916,
9235,
1012,
1008,
1008,
25707,
1998,
2224,
1999,
3120,
1998,
12441,
3596,
1010,
2007,
2030,
2302,
1008,
14080,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Org Capture Extension
This is an extension for Google Chrome (tm) and Firefox (tm) which adds a "Capture" button, sending the site address, title, and selected text (if any) to emacs via org-protocol, see the [Org-Mode site] for instructions for setting that up org-protocol. The extentsion itself is available at the [Chrome App Store].
# Improvements
This extension has room for improvement; Specifically, people would probably like to choose template letters other than the ones I picked for them. If you wish to add a small "options" page with an ability to select handler letters, that would be cool.
# Problems? Please [click here](#troubleshooting) or scroll to the bottom.
# Detailed setup instructions
## Install the extension
Either via the [Chrome App Store] or by dragging the extension folder to the "Extensions" tab in Chrome. If the latter is the chosen procedure then one needs to enable developer mode first, if I'm not mistaken. Note that if you choose to have a local-install, then you need to choose some icon and name it org-mode-unicorn.png, placing it in the extension's folder. Or, you can name it anything you want, but then you need to update manifest.json.
_Note_: The first time you use the extension, Chrome will ask you allow it to run ```open ....``` (on OSX) or ```xdg-open ...``` (on Linux), or ??? (On Windows). Those are the standard system mechanisms for dispatching a file/URL to the appropriate handler, so you should accept the request.
## Set up org-protocol
Detailed instructions available at [Org-Mode site].
The gist of it is to make your system recognize emacsclient as the handler of ```org-protocol://``` links. In addition, one needs to set up emacs to load org-protocol and to set up capture templates.
### Register emacsclient as the ```org-protocol``` handler
#### Under Linux (non-KDE)
``` bash
cat > "${HOME}/.local/share/applications/org-protocol.desktop" << EOF
[Desktop Entry]
Name=org-protocol
Exec=emacsclient %u
Type=Application
Terminal=false
Categories=System;
MimeType=x-scheme-handler/org-protocol;
EOF
```
And then
``` bash
update-desktop-database ~/.local/share/applications/
```
#### Under Linux (KDE)
##### Note: This is a workaround to issue #16 - See comment [here](https://github.com/sprig/org-capture-extension/issues/16#issuecomment-305050310)
Create the file
*/usr/local/bin/emacs-capture*
```sh
#!/bin/sh
# HACK: workaround for a kde-open bug (feature?) that might have
# eaten a colon from our argument, om nom nom
argv=()
for arg in "$@"; do
re='s_^org-protocol:/+capture:?/+_org-protocol://capture://_'
argv+=("$(echo -n "$arg" | sed -Ez "$re")")
done
# Note: feel free to add any other arguments you want,
# e.g. emacsclient --alternate-editor= -c "${argv[@]}"
emacsclient "${argv[@]}"
```
And the file
*$HOME/.local/share/applications/emacs-capture.desktop*
```desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Emacs Client
Exec=emacs-capture "%u"
Icon=emacs-icon
Type=Application
Terminal=false
MimeType=x-scheme-handler/org-protocol;
```
Finally, run
``` bash
kbuildsycoca4
sudo update-desktop-database
```
#### Under OSX
Start Applescript Editor. Paste the following snippet:
``` applescript
on emacsclient(input)
do shell script "/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9/emacsclient -n -c -a \"/Applications/Emacs.app/Contents/MacOS/Emacs\" '" & input & "'"
end emacsclient
on open location input
emacsclient(input)
end open location
on open inputs
repeat with raw_input in inputs
set input to POSIX path of raw_input
emacsclient(input)
end repeat
end open
on run
do shell script emacsclient("")
end run
```
Adjust the paths and save it (with 'type' as Application) under ```/Applications/EmacsClient.app``` (or whatever else you choose).
Edit (with Xcode) the file ```/Applications/Emacsclient.app/Contents/Info.plist```
And add there the following:
``` plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>org-protocol</string>
<key>CFBundleURLSchemes</key>
<array>
<string>org-protocol</string>
</array>
</dict>
</array>
```
and
``` plist
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>All</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
```
and restart the desktop. You can also download [EmacsClient.app.zip], which I prepared in advance, if you are lazy.
#### Under Windows
Open the Registry Editor (Win-R, then type `regedit`). Within `HKEY_CLASSES_ROOT`, add a key called `org-protocol`. Within `org-protocol`, set the data for the string value with the name `(Default)` to be `URL:org-protocol`, add another string value with name `URL Protocol` and no data, and add a key called `shell`.
Within `shell`, create a key called `open`.
Within `open`, create a key called `command`.
Within `command`, set the data for the string value with the name `(Default)` to `"C:\the\path\to\your\emacsclientw.exe" "%1"`, updating the path to point to your Emacs installation.
If you get stuck, see [this guide to registering a protocol handler](https://msdn.microsoft.com/en-us/library/aa767914\(v=vs.85\).aspx) and look at how registries are set up for other protocol handlers (`skype`, `ftp`, etc.). Most of your pre-existing protocol handlers have more config than you need.
### Set up handlers in emacs
If some text is selected before the button is clicked, then the following is sent to emacs:
```
org-protocol://capture:/p/<url>/<title>/selection>
```
If nothing is selected, then instead the following is sent:
```
org-protocol://capture:/L/<url>/<title>
```
This means that you need to have appropriate capture templates for "L" and for "p". Example templates below:
```lisp
(setq org-capture-templates `(
("p" "Protocol" entry (file+headline ,(concat org-directory "notes.org") "Inbox")
"* %^{Title}\nSource: %u, %c\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?")
("L" "Protocol Link" entry (file+headline ,(concat org-directory "notes.org") "Inbox")
"* %? [[%:link][%:description]] \nCaptured On: %U")
))
```
_Hint:_ You can put code in capture handlers via %() blocks. I use this mechanism to automatically close the newly crated frame in the L template. If anyone cares to know, I'll add the details.
#### Example: closins the frame after a capture
If you wish to automatically close the emacs frame after a capture, add the following template:
```lisp
("L" "Protocol Link" entry (file+headline ,(concat org-directory "notes.org") "Inbox")
"* %? [[%:link][%:description]] %(progn (setq kk/delete-frame-after-capture 2) \"\")\nCaptured On: %U"
:empty-lines 1)
```
and in the initialization of org-mode put:
```lisp
;; Kill the frame if one was created for the capture
(defvar kk/delete-frame-after-capture 0 "Whether to delete the last frame after the current capture")
(defun kk/delete-frame-if-neccessary (&rest r)
(cond
((= kk/delete-frame-after-capture 0) nil)
((> kk/delete-frame-after-capture 1)
(setq kk/delete-frame-after-capture (- kk/delete-frame-after-capture 1)))
(t
(setq kk/delete-frame-after-capture 0)
(delete-frame))))
(advice-add 'org-capture-finalize :after 'kk/delete-frame-if-neccessary)
(advice-add 'org-capture-kill :after 'kk/delete-frame-if-neccessary)
(advice-add 'org-capture-refile :after 'kk/delete-frame-if-neccessary)
```
# Troubleshooting
Is the extension not working as you expect? i.e., is it "broken"? You need to do some investigative
legwork. And if you open a ticket, provide enough information to help solve the problem!
Please describe your setup. Linux? Version. OSX? Version. Emacs? Version. org-mode? Version. Chrome? Version. How did
you get your system to send org-protocol links to emacs? Please provide the relevant capture templates.
Please find the simplest URL for which it fails (does it work on a simple address that contain only
alphanumeric characters and periods? and backslashes? and query parameters? and escaped characters?
etc.). Then open the developer console and look for the debug message that the extension gives and
add it to the ticket.
Open a terminal and run $open "COPIED-URL" (do not skip the quotes, unless what you are pasting
already has quotes around it). $open is simply open if you are on OSX and xdg-open if on
linux. COPIED-URL is obviously the url you pasted here in step 1. Does it work? Congrats, you found
where the problem is not (i.e. inside chrome). No? Does $open org-"protocol://capture:/p/a/b" work?
No? Again you found where the problem lies not. Otherwise proceed to step 3.
Call up the line you ran in the terminal with the non-working url. it will be of the form open
"org-protocol://capture:/<letter>/PIECE1/PIECE2/ with PIECE2 usually being longer and more complex
if you selected any text, and PIECE1 otherwise. Please edit the url until it is as short as possible
while still breaking (Note, % should always be proceeded by two digits/letters in the ranges 0-9 and
A-F so do not leave a percent sign with a single symbol following). You can probably trim one of the
pieces to be just one character. Add to the ticket the smallest breaking URL.
Try sending said URL directly to emacsclient, for good measure. Does it work? Again, congrats. If
you are using OSX, make sure that the emacsclient which you call is the correct one!
### P.S.
It is of course fine to ask for help with problems in your config as well.
# License
This repository is licensed as MIT license, see the LICENSE file for details.
[Org-Mode site]: http://orgmode.org/worg/org-contrib/org-protocol.html
[Chrome App Store]: https://chrome.google.com/webstore/detail/org-capture/kkkjlfejijcjgjllecmnejhogpbcigdc
[EmacsClient.app.zip]: https://github.com/sprig/org-capture-extension/raw/master/EmacsClient.app.zip
| swflint/org-capture-extension | README.md | Markdown | mit | 10,012 | [
30522,
1001,
8917,
5425,
5331,
2023,
2003,
2019,
5331,
2005,
8224,
18546,
1006,
1056,
2213,
1007,
1998,
2543,
14876,
2595,
1006,
1056,
2213,
1007,
2029,
9909,
1037,
1000,
5425,
1000,
6462,
1010,
6016,
1996,
2609,
4769,
1010,
2516,
1010,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.nifi.registry.client;
import org.apache.nifi.registry.flow.VersionedFlowSnapshot;
import org.apache.nifi.registry.flow.VersionedFlowSnapshotMetadata;
import java.io.IOException;
import java.util.List;
/**
* Client for interacting with snapshots.
*/
public interface FlowSnapshotClient {
/**
* Creates a new snapshot/version for the given flow.
*
* The snapshot object must have the version populated, and will receive an error if the submitted version is
* not the next one-up version.
*
* @param snapshot the new snapshot
* @return the created snapshot
* @throws NiFiRegistryException if an error is encountered other than IOException
* @throws IOException if an I/O error is encountered
*/
VersionedFlowSnapshot create(VersionedFlowSnapshot snapshot) throws NiFiRegistryException, IOException;
/**
* Gets the snapshot for the given bucket, flow, and version.
*
* @param bucketId the bucket id
* @param flowId the flow id
* @param version the version
* @return the snapshot with the given version of the given flow in the given bucket
* @throws NiFiRegistryException if an error is encountered other than IOException
* @throws IOException if an I/O error is encountered
*/
VersionedFlowSnapshot get(String bucketId, String flowId, int version) throws NiFiRegistryException, IOException;
/**
* Gets the snapshot for the given flow and version.
*
* @param flowId the flow id
* @param version the version
* @return the snapshot with the given version of the given flow
* @throws NiFiRegistryException if an error is encountered other than IOException
* @throws IOException if an I/O error is encountered
*/
VersionedFlowSnapshot get(String flowId, int version) throws NiFiRegistryException, IOException;
/**
* Gets the latest snapshot for the given flow.
*
* @param bucketId the bucket id
* @param flowId the flow id
* @return the snapshot with the latest version for the given flow
* @throws NiFiRegistryException if an error is encountered other than IOException
* @throws IOException if an I/O error is encountered
*/
VersionedFlowSnapshot getLatest(String bucketId, String flowId) throws NiFiRegistryException, IOException;
/**
* Gets the latest snapshot for the given flow.
*
* @param flowId the flow id
* @return the snapshot with the latest version for the given flow
* @throws NiFiRegistryException if an error is encountered other than IOException
* @throws IOException if an I/O error is encountered
*/
VersionedFlowSnapshot getLatest(String flowId) throws NiFiRegistryException, IOException;
/**
* Gets the latest snapshot metadata for the given flow.
*
* @param bucketId the bucket id
* @param flowId the flow id
* @return the snapshot metadata for the latest version of the given flow
* @throws NiFiRegistryException if an error is encountered other than IOException
* @throws IOException if an I/O error is encountered
*/
VersionedFlowSnapshotMetadata getLatestMetadata(String bucketId, String flowId) throws NiFiRegistryException, IOException;
/**
* Gets the latest snapshot metadata for the given flow.
*
* @param flowId the flow id
* @return the snapshot metadata for the latest version of the given flow
* @throws NiFiRegistryException if an error is encountered other than IOException
* @throws IOException if an I/O error is encountered
*/
VersionedFlowSnapshotMetadata getLatestMetadata(String flowId) throws NiFiRegistryException, IOException;
/**
* Gets a list of the metadata for all snapshots of a given flow.
*
* The contents of each snapshot are not part of the response.
*
* @param bucketId the bucket id
* @param flowId the flow id
* @return the list of snapshot metadata
* @throws NiFiRegistryException if an error is encountered other than IOException
* @throws IOException if an I/O error is encountered
*/
List<VersionedFlowSnapshotMetadata> getSnapshotMetadata(String bucketId, String flowId) throws NiFiRegistryException, IOException;
/**
* Gets a list of the metadata for all snapshots of a given flow.
*
* The contents of each snapshot are not part of the response.
*
* @param flowId the flow id
* @return the list of snapshot metadata
* @throws NiFiRegistryException if an error is encountered other than IOException
* @throws IOException if an I/O error is encountered
*/
List<VersionedFlowSnapshotMetadata> getSnapshotMetadata(String flowId) throws NiFiRegistryException, IOException;
}
| MikeThomsen/nifi | nifi-registry/nifi-registry-core/nifi-registry-client/src/main/java/org/apache/nifi/registry/client/FlowSnapshotClient.java | Java | apache-2.0 | 5,613 | [
30522,
1013,
1008,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
2030,
2062,
1008,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
1008,
2023,
2147,
2005,
3176,
2592,
4953,
9385,
6095,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ca@valencia" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About GSMcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>GSMcoin</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The GSMcoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>Doble click per editar la direccio o la etiqueta</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Crear nova direccio</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Copieu l'adreça seleccionada al porta-retalls del sistema</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your GSMcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a GSMcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified GSMcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>Eliminar</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-58"/>
<source>GSMcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+282"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>Synchronizing with network...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-319"/>
<source>&Overview</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show information about GSMcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+259"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-256"/>
<source>&Export...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-64"/>
<source>Send coins to a GSMcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Modify configuration options for GSMcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-202"/>
<source>GSMcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+180"/>
<source>&About GSMcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>&File</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Tabs toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>GSMcoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+75"/>
<source>%n active connection(s) to GSMcoin network</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="-312"/>
<source>About GSMcoin card</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about GSMcoin card</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>&Unlock Wallet...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+297"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid GSMcoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. GSMcoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid GSMcoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>GSMcoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start GSMcoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start GSMcoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the GSMcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Connect to the GSMcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting GSMcoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Whether to show GSMcoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting GSMcoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the GSMcoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+348"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the GSMcoin-Qt help message to get a list with possible GSMcoin command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>GSMcoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>GSMcoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the GSMcoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the GSMcoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 GSM</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>123.456 GSM</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a GSMcoin address (e.g. GSMcoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid GSMcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. GSMcoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a GSMcoin address (e.g. GSMcoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-118"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. GSMcoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this GSMcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-64"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. GSMcoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified GSMcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a GSMcoin address (e.g. GSMcoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter GSMcoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 510 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>GSMcoin version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or GSMcoind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: GSMcoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: GSMcoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 15714 or testnet: 25714)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 15715 or testnet: 25715)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong GSMcoin will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-18"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=GSMcoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "GSMcoin Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. GSMcoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>GSMcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of GSMcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart GSMcoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. GSMcoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS>
| gsmcoin/GSMcoin | src/qt/locale/bitcoin_ca@valencia.ts | TypeScript | mit | 107,620 | [
30522,
1026,
1029,
20950,
2544,
1027,
1000,
1015,
1012,
1014,
1000,
1029,
1028,
1026,
999,
9986,
13874,
24529,
1028,
1026,
24529,
2653,
1027,
1000,
6187,
1030,
13083,
1000,
2544,
1027,
1000,
1016,
1012,
1015,
1000,
1028,
1026,
6123,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
namespace _1.CountWorkingDays
{
using System;
using System.Collections.Generic;
using System.Globalization;
/// Program that reads two dates in format dd-MM-yyyy
/// and prints the number of working days between these
/// two dates inclusive.
public class Program
{
public static void Main()
{
DateTime startDate = DateTime.ParseExact(Console.ReadLine(), "dd-MM-yyyy", CultureInfo.InvariantCulture);
DateTime endDate = DateTime.ParseExact(Console.ReadLine(), "dd-MM-yyyy", CultureInfo.InvariantCulture);
List<DateTime> holidays = AddOfficialHolidays();
int dayCounter = 0;
for (DateTime currDate = startDate; currDate <= endDate; currDate = currDate.AddDays(1))
{
DateTime checkDate = new DateTime(2016, currDate.Month, currDate.Day);
if (currDate.DayOfWeek != DayOfWeek.Saturday
&& currDate.DayOfWeek != DayOfWeek.Sunday
&& !holidays.Contains(checkDate))
{
dayCounter++;
}
}
Console.WriteLine(dayCounter);
}
public static List<DateTime> AddOfficialHolidays()
{
List<DateTime> holidays = new List<DateTime>();
holidays.Add(DateTime.ParseExact("01-01-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
holidays.Add(DateTime.ParseExact("03-03-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
holidays.Add(DateTime.ParseExact("01-05-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
holidays.Add(DateTime.ParseExact("06-05-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
holidays.Add(DateTime.ParseExact("24-05-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
holidays.Add(DateTime.ParseExact("06-09-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
holidays.Add(DateTime.ParseExact("22-09-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
holidays.Add(DateTime.ParseExact("01-11-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
holidays.Add(DateTime.ParseExact("24-12-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
holidays.Add(DateTime.ParseExact("25-12-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
holidays.Add(DateTime.ParseExact("26-12-2016", "dd-MM-yyyy", CultureInfo.InvariantCulture));
return holidays;
}
}
}
| HristoSpasov/Programing-Fundamentals-Exercises | 14. 02.07.2017-ObjectsAndClasses.Exercise/Exercise/1.CountWorkingDays/1.CountWorkingDays/1.CountWorkingDays.cs | C# | mit | 2,539 | [
30522,
3415,
15327,
1035,
1015,
1012,
4175,
21398,
10259,
2015,
1063,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
24370,
1025,
1013,
1013,
1013,
2565,
2008,
9631,
2048,
5246,
1999,
4289,
20315,
1011,
3461,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//-----------------------------------------------------------------------------+
// |
// DehnenMcLaughlin.cc |
// |
// Copyright (C) 2004-2006 Walter Dehnen |
// |
// 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 (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, write to the Free Software |
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
// |
//-----------------------------------------------------------------------------+
// |
// Versions |
// 0.1 09/08/2006 WD use $NEMOINC/defacc.h |
//-----------------------------------------------------------------------------+
#undef POT_DEF
#include <iostream>
#include <utils/WDMath.h>
#include <defacc.h> // $NEMOINC/defacc.h
////////////////////////////////////////////////////////////////////////////////
namespace {
using namespace WDutils;
//////////////////////////////////////////////////////////////////////////////
class DehnenMcLaughlin {
const double GM,a,b0,e; // defininng parameters
const double ia,nM,eta,kk,Pf; // derived parameters
const BetaFunc BPs; // Beta_u( 1/eta, (1-beta0)/eta + 1/2 )
public:
static const char* name() { return "DehnenMcLaughlin"; }
DehnenMcLaughlin(const double*pars,
int npar,
const char *file)
: GM ( npar>1? -std::abs(pars[1]) : -1. ),
a ( npar>2? pars[2] : 1. ),
b0 ( npar>3? pars[3] : 0. ),
e ( npar>4? pars[4] : 3. ),
ia ( 1./a ),
nM ( (e+2)/(e-2) ),
eta ( 2*(e-2)*(2-b0)/(6+e) ),
kk ( eta*nM-3 ),
Pf ( GM*ia/eta ),
BPs ( 1./eta, (1-b0)/eta+0.5 )
{
if(npar>5 || debug(2))
std::cerr<<
"falcON Debug Info: acceleration \"DehnenMcLaughlin\""
"recognizing 5 parameters:\n"
" omega pattern speed (ignored) [0]\n"
" G*M mass; [1]\n"
" a scale radius; [1]\n"
" b0 inner halo anisotropy [0]\n"
" e assume rho/sigma_r^e is power law [3]\n"
" the potential is given by the density\n\n"
" 4+eta-2b0 M -g0 eta -2e/(2-e)\n"
" rho = - --------- --- x (1+x )\n"
" 8 Pi a\n\n"
" with x=r/a and\n\n"
" eta= 2*(e-2)*(2-b0)/(6+e) [4/9]\n"
" g0 = 1-eta/2+b0 [7/9]\n\n";
if(file)
warning("acceleration \"%s\": file \"%s\" ignored",name(),file);
if(a<=0.)
error("acceleration \"%s\": a=%f <= 0\n",name(),a);
if(e<=2.)
error("acceleration \"%s\": e=%f <= 2\n",name(),e);
if(b0>1.)
error("acceleration \"%s\": b0=%f > 1\n",name(),b0);
if(npar>5) warning("acceleration \"%s\":"
" skipped parameters beyond 5",name());
}
///
/// routine used by class SphericalPot<DehnenMcLaughlin> of defacc.h
///
/// Note that the potential for a Dehnen & McLaughlin (2005, hereafter D&M)
/// model is given by (in units of GM/a)
///
/// Psi = Psi_0 - Beta_y ( (1-beta0)/eta + 1/2, 1/eta ) / eta
///
/// with
///
/// Psi_0 = Beta( (1-beta0)/eta + 1/2, 1/eta ) / eta
///
/// and
///
/// y = x^eta / (1 + x^eta).
///
/// Here, Beta_u(p,q) the incomplete beta function, see eq (40h) of D&M.
/// At small radii (note that there is a typo in eq 40j of D&M)
///
/// Psi = Psi_0 - 2/(2+eta-2*beta0) x^(eta/2+1-beta0)
///
template<typename scalar>
void potacc(scalar const&rq,
scalar &P,
scalar &T) const
{
if(rq == 0.) {
P = Pf * BPs(1.);
T = 0;
} else {
double r = std::sqrt(rq);
double u = std::pow(ia*r,eta);
double u1 = 1./(1+u);
P = Pf * BPs(u1);
T = GM * std::pow(u*u1,nM) / (rq*r);
}
}
};
}
//------------------------------------------------------------------------------
__DEF__ACC(SphericalPot<DehnenMcLaughlin>)
//------------------------------------------------------------------------------
| jobovy/nemo | usr/dehnen/falcON/src/public/acc/DehnenMcLaughlin.cc | C++ | gpl-2.0 | 6,388 | [
30522,
1013,
1013,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using Grasshopper.Kernel.Types;
using System;
using IvyCore.MultiDimGrid;
namespace IvyGh.Type
{
public class GH_Cell : GH_Goo<Cell>
{
#region FIELDS
public override bool IsValid { get { return true; } }
public override string TypeDescription { get { return "A Cell in a Grid."; } }
public override string TypeName { get { return "Cell"; } }
#endregion
#region CONSTRUCTOR
public GH_Cell() {}
public GH_Cell(GH_Cell ghCell)
{
// no deep copy ??
this.Value = ghCell.Value;
}
public GH_Cell(Cell cell)
{
this.Value = cell;
}
#endregion
#region INSTANCE METHODS
public override object ScriptVariable()
{
return this.Value;
}
public override string ToString()
{
return this.Value.ToString();
}
public override IGH_Goo Duplicate()
{
throw new NotImplementedException();
}
public override bool CastFrom(object source)
{
//Abort immediately on bogus data.
if (source == null) { return false; }
//Use the Grasshopper Integer converter. By specifying GH_Conversion.Both
//we will get both exact and fuzzy results. You should always try to use the
//methods available through GH_Convert as they are extensive and consistent.
int val;
if (source.GetType() == typeof(Cell))
{
this.Value = (Cell)source;
return true;
}
return false;
}
#endregion
#region SERIALIZATION
#endregion
}
}
| lionpeloux/Ivy | src/IvyGh/Type/GH_Cell.cs | C# | mit | 1,797 | [
30522,
2478,
5568,
27330,
1012,
16293,
1012,
4127,
1025,
2478,
2291,
1025,
2478,
7768,
17345,
1012,
4800,
22172,
16523,
3593,
1025,
3415,
15327,
7768,
5603,
1012,
2828,
1063,
2270,
2465,
1043,
2232,
1035,
3526,
1024,
1043,
2232,
1035,
27571... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* This file is part of guh. *
* *
* Guh 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, version 2 of the License. *
* *
* Guh 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 guh. If not, see <http://www.gnu.org/licenses/>. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*!
\page openweathermap.html
\title Open Weather Map
\ingroup plugins
\ingroup services
This plugin alows you to get the current weather data from \l{http://www.openweathermap.org}.
The plugin offers two different search methods: if the user searches for a empty string,
the plugin makes an autodetction with the WAN ip and offers the user the found autodetectresult.
Otherwise the plugin return the list with the found searchresults.
\section1 Examples
\section2 Autodetect location
If you want to autodetect your location dend a discovery request with an empty string.
\code
{
"id":1,
"method":"Devices.GetDiscoveredDevices",
"params":{
"deviceClassId":"985195aa-17ad-4530-88a4-cdd753d747d7",
"discoveryParams": {
"location":""
}
}
}
\endcode
response from autodetection...
\code
{
"id": 1,
"params": {
"deviceDescriptors": [
{
"description": "AT",
"id": "{75607672-5354-428f-a752-910140c22b18}",
"title": "Vienna"
}
],
"errorMessage": "",
"success": true
},
"status": "success"
}
\endcode
\section2 Searching city
If you want to search a string send following discovery message:
\code
{
"id":1,
"method":"Devices.GetDiscoveredDevices",
"params":{
"deviceClassId":"985195aa-17ad-4530-88a4-cdd753d747d7",
"discoveryParams": {
"location":"Vie"
}
}
}
\endcode
response...
\code
{
"id": 1,
"params": {
"deviceDescriptors": [
{
"description": "DE",
"id": "{6dc6be43-5bdc-4dbd-bcbf-6f8e1f90000b}",
"title": "Viersen"
},
{
"description": "VN",
"id": "{af275298-77f1-40b4-843a-d0f3c7aef6bb}",
"title": "Viet Tri"
},
{
"description": "DE",
"id": "{86a4ab63-41b4-4348-9830-4bf6c87474bf}",
"title": "Viernheim"
},
{
"description": "AR",
"id": "{3b5f8eea-6159-4375-bd01-1f07de9c3a9d}",
"title": "Viedma"
},
{
"description": "FR",
"id": "{f3b91f26-3275-4bb4-a594-924202a2124e}",
"title": "Vierzon"
},
{
"description": "AT",
"id": "{b59d15f7-f52b-43a0-a9c5-a3fa80cbc2bd}",
"title": "Vienna"
}
],
"errorMessage": "",
"success": true
},
"status": "success"
}
\endcode
\section2 Adding a discovered city
If you want to add a dicovered city send the add "AddConfiguredDevice" message
with the deviceDescriptorId from the searchresult list. In this example the id for Vienna.
\code
{
"id":1,
"method":"Devices.AddConfiguredDevice",
"params":{
"deviceClassId":"985195aa-17ad-4530-88a4-cdd753d747d7",
"deviceDescriptorId": "b59d15f7-f52b-43a0-a9c5-a3fa80cbc2bd"
}
}
\endcode
response...
\code
{
"id": 1,
"params": {
"deviceId": "{af0f1958-b901-48da-ad97-d4d64af88cf8}",
"errorMessage": "",
"success": true
},
"status": "success"
}
\endcode
\section1 Plugin propertys:
\section2 Plugin parameters
Each configured plugin has following paramters:
\table
\header
\li Name
\li Description
\li Data Type
\row
\li location
\li This parameter holds the name of the city
\li string
\row
\li country
\li This parameter holds the country of the city
\li string
\row
\li id
\li This parameter holds the city id from \l{http://www.openweathermap.org}
\li string
\endtable
\section2 Actions
Following list contains all plugin \l{Action}s:
\table
\header
\li Name
\li Description
\li UUID
\row
\li refresh
\li This action refreshes all states.
\li cfbc6504-d86f-4856-8dfa-97b6fbb385e4
\endtable
\section2 States
Following list contains all plugin \l{State}s:
\table
\header
\li Name
\li Description
\li UUID
\li Data Type
\row
\li city name
\li The name of the city
\li fd9e7b7f-cf1f-4093-8f6d-fff5b223471f
\li string
\row
\li city id
\li The city ID for openweathermap.org
\li c6ef1c07-e817-4251-b83d-115bbf6f0ae9
\li string
\row
\li country name
\li The country name
\li 0e607a5f-1938-4e77-a146-15e9ad15bfad
\li string
\row
\li last update
\li The timestamp of the weather data from the weatherstation in unixtime
format
\li 98e48095-87da-47a4-b812-28c6c17a3e76
\li unsignend int
\row
\li temperature
\li Current temperature [Celsius]
\li 2f949fa3-ff21-4721-87ec-0a5c9d0a5b8a
\li double
\row
\li temperature minimum
\li Today temperature minimum [Clesius]
\li 701338b3-80de-4c95-8abf-26f44529d620
\li double
\row
\li temperature maximum
\li Today temperature maximum [Clesius]
\li f69bedd2-c997-4a7d-9242-76bf2aab3d3d
\li double
\row
\li humidity
\li Current relative humidity [%]
\li 3f01c9f0-206b-4477-afa2-80d6e5e54fbb
\li int
\row
\li pressure
\li Current pressure [hPa]
\li 6a57b6e9-7010-4a89-982c-ce0bc2a71f11
\li double
\row
\li wind speed
\li Current wind speed [m/s]
\li 12dc85a9-825d-4375-bef4-abd66e9e301b
\li double
\row
\li wind direction
\li The wind direction rellative to the north pole [degree]
\li a8b0383c-d615-41fe-82b8-9b797f045cc9
\li int
\row
\li cloudiness
\li This value represents how much of the sky is clowdy [%]
\li 0c1dc881-560e-40ac-a4a1-9ab69138cfe3
\li int
\row
\li weather description
\li This string describes the current weather condition in clear words
\li e71d98e3-ebd8-4abf-ad25-9ecc2d05276a
\li string
\row
\li sunset
\li The time of todays sunset in unixtime format
\li 5dd6f5a3-25d6-4e60-82ca-e934ad76a4b6
\li unsigned int
\row
\li sunrise
\li The time of todays sunrise in unixtime format
\li 413b3fc6-bd1c-46fb-8c86-03096254f94f
\li unsigned int
\endtable
*/
#include "devicepluginopenweathermap.h"
#include "plugin/device.h"
#include "devicemanager.h"
#include <QDebug>
#include <QJsonDocument>
#include <QVariantMap>
#include <QDateTime>
DeviceClassId openweathermapDeviceClassId = DeviceClassId("985195aa-17ad-4530-88a4-cdd753d747d7");
ActionTypeId updateWeatherActionTypeId = ActionTypeId("cfbc6504-d86f-4856-8dfa-97b6fbb385e4");
StateTypeId updateTimeStateTypeId = StateTypeId("36b2f09b-7d77-4fbc-a68f-23d735dda0b1");
StateTypeId temperatureStateTypeId = StateTypeId("6013402f-b5b1-46b3-8490-f0c20d62fe61");
StateTypeId temperatureMinStateTypeId = StateTypeId("14ec2781-cb04-4bbf-b097-7d01ef982630");
StateTypeId temperatureMaxStateTypeId = StateTypeId("fefe5563-452f-4833-b5cf-49c3cc67c772");
StateTypeId humidityStateTypeId = StateTypeId("6f32ec73-3240-4630-ada9-1c10b8e98123");
StateTypeId pressureStateTypeId = StateTypeId("4a42eea9-00eb-440b-915e-dbe42180f83b");
StateTypeId windSpeedStateTypeId = StateTypeId("2bf63430-e9e2-4fbf-88e6-6f1b4770f287");
StateTypeId windDirectionStateTypeId = StateTypeId("589e2ea5-65b2-4afd-9b72-e3708a589a12");
StateTypeId cloudinessStateTypeId = StateTypeId("798553bc-45c7-42eb-9105-430bddb5d9b7");
StateTypeId weatherDescriptionStateTypeId = StateTypeId("f9539108-0e0e-4736-a306-6408f8e20a26");
StateTypeId sunriseStateTypeId = StateTypeId("af155e94-9492-44e1-8608-7d0ee8b5d50d");
StateTypeId sunsetStateTypeId = StateTypeId("a1dddc3d-549f-4f20-b78b-be850548f286");
DevicePluginOpenweathermap::DevicePluginOpenweathermap()
{
m_openweaher = new OpenWeatherMap(this);
connect(m_openweaher, &OpenWeatherMap::searchResultReady, this, &DevicePluginOpenweathermap::searchResultsReady);
connect(m_openweaher, &OpenWeatherMap::weatherDataReady, this, &DevicePluginOpenweathermap::weatherDataReady);
}
DeviceManager::DeviceError DevicePluginOpenweathermap::discoverDevices(const DeviceClassId &deviceClassId, const ParamList ¶ms)
{
if(deviceClassId != openweathermapDeviceClassId){
return DeviceManager::DeviceErrorDeviceClassNotFound;
}
QString location;
foreach (const Param ¶m, params) {
if (param.name() == "location") {
location = param.value().toString();
}
}
// if we have an empty search string, perform an autodetection of the location with the WAN ip...
if (location.isEmpty()){
m_openweaher->searchAutodetect();
} else {
m_openweaher->search(location);
}
// otherwise search the given string
m_openweaher->search(location);
return DeviceManager::DeviceErrorAsync;
}
DeviceManager::DeviceSetupStatus DevicePluginOpenweathermap::setupDevice(Device *device)
{
foreach (Device *deviceListDevice, deviceManager()->findConfiguredDevices(openweathermapDeviceClassId)) {
if(deviceListDevice->paramValue("id").toString() == device->paramValue("id").toString()){
qWarning() << QString("Location " + device->paramValue("location").toString() + " already added.");
return DeviceManager::DeviceSetupStatusFailure;
}
}
device->setName("Weather from OpenWeatherMap (" + device->paramValue("location").toString() + ")");
m_openweaher->update(device->paramValue("id").toString(), device->id());
return DeviceManager::DeviceSetupStatusSuccess;
}
DeviceManager::HardwareResources DevicePluginOpenweathermap::requiredHardware() const
{
return DeviceManager::HardwareResourceTimer;
}
DeviceManager::DeviceError DevicePluginOpenweathermap::executeAction(Device *device, const Action &action)
{
if(action.actionTypeId() == updateWeatherActionTypeId){
m_openweaher->update(device->paramValue("id").toString(), device->id());
}
return DeviceManager::DeviceErrorNoError;
}
void DevicePluginOpenweathermap::guhTimer()
{
foreach (Device *device, deviceManager()->findConfiguredDevices(openweathermapDeviceClassId)) {
m_openweaher->update(device->paramValue("id").toString(), device->id());
}
}
void DevicePluginOpenweathermap::searchResultsReady(const QList<QVariantMap> &cityList)
{
QList<DeviceDescriptor> retList;
foreach (QVariantMap elemant, cityList) {
DeviceDescriptor descriptor(openweathermapDeviceClassId, elemant.value("name").toString(),elemant.value("country").toString());
ParamList params;
Param locationParam("location", elemant.value("name"));
params.append(locationParam);
Param countryParam("country", elemant.value("country"));
params.append(countryParam);
Param idParam("id", elemant.value("id"));
params.append(idParam);
descriptor.setParams(params);
retList.append(descriptor);
}
emit devicesDiscovered(openweathermapDeviceClassId,retList);
}
void DevicePluginOpenweathermap::weatherDataReady(const QByteArray &data, const DeviceId &deviceId)
{
QJsonParseError error;
QJsonDocument jsonDoc = QJsonDocument::fromJson(data, &error);
if(error.error != QJsonParseError::NoError) {
qWarning() << "failed to parse data" << data << ":" << error.errorString();
return;
}
QVariantMap dataMap = jsonDoc.toVariant().toMap();
foreach (Device *device, deviceManager()->findConfiguredDevices(openweathermapDeviceClassId)) {
if(device->id() == deviceId){
if(dataMap.contains("clouds")){
int cloudiness = dataMap.value("clouds").toMap().value("all").toInt();
device->setStateValue(cloudinessStateTypeId,cloudiness);
}
if(dataMap.contains("dt")){
uint lastUpdate = dataMap.value("dt").toUInt();
device->setStateValue(updateTimeStateTypeId,lastUpdate);
}
if(dataMap.contains("main")){
double temperatur = dataMap.value("main").toMap().value("temp").toDouble();
double temperaturMax = dataMap.value("main").toMap().value("temp_max").toDouble();
double temperaturMin = dataMap.value("main").toMap().value("temp_min").toDouble();
double pressure = dataMap.value("main").toMap().value("pressure").toDouble();
int humidity = dataMap.value("main").toMap().value("humidity").toInt();
device->setStateValue(temperatureStateTypeId,temperatur);
device->setStateValue(temperatureMinStateTypeId,temperaturMin);
device->setStateValue(temperatureMaxStateTypeId,temperaturMax);
device->setStateValue(pressureStateTypeId,pressure);
device->setStateValue(humidityStateTypeId,humidity);
}
if(dataMap.contains("sys")){
uint sunrise = dataMap.value("sys").toMap().value("sunrise").toUInt();
uint sunset = dataMap.value("sys").toMap().value("sunset").toUInt();
device->setStateValue(sunriseStateTypeId,sunrise);
device->setStateValue(sunsetStateTypeId,sunset);
}
if(dataMap.contains("weather")){
QString description = dataMap.value("weather").toMap().value("description").toString();
device->setStateValue(weatherDescriptionStateTypeId,description);
}
if(dataMap.contains("wind")){
int windDirection = dataMap.value("wind").toMap().value("deg").toInt();
double windSpeed = dataMap.value("wind").toMap().value("speed").toDouble();
device->setStateValue(windDirectionStateTypeId,windDirection);
device->setStateValue(windSpeedStateTypeId,windSpeed);
}
}
}
}
| mzanetti/guh | plugins/deviceplugins/openweathermap/devicepluginopenweathermap.cpp | C++ | gpl-2.0 | 17,008 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>PHPXRef 0.7.1 : Unnamed Project : Function Reference: keydownevent()</title>
<link rel="stylesheet" href="../sample.css" type="text/css">
<link rel="stylesheet" href="../sample-print.css" type="text/css" media="print">
<style id="hilight" type="text/css"></style>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff">
<table class="pagetitle" width="100%">
<tr>
<td valign="top" class="pagetitle">
[ <a href="../index.html">Index</a> ]
</td>
<td align="right" class="pagetitle">
<h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2>
</td>
</tr>
</table>
<!-- Generated by PHPXref 0.7.1 at Sat Nov 21 22:13:19 2015 -->
<!-- PHPXref (c) 2000-2010 Gareth Watts - gareth@omnipotent.net -->
<!-- http://phpxref.sourceforge.net/ -->
<script src="../phpxref.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
ext='.html';
relbase='../';
subdir='_functions';
filename='index.html';
cookiekey='phpxref';
handleNavFrame(relbase, subdir, filename);
logFunction('keydownevent');
// -->
</script>
<script language="JavaScript" type="text/javascript">
if (gwGetCookie('xrefnav')=='off')
document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>');
else
document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>');
</script>
<noscript>
<p class="navlinks">
[ <a href="../nav.html" target="_top">Show Explorer</a> ]
[ <a href="index.html" target="_top">Hide Navbar</a> ]
</p>
</noscript>
[<a href="../index.html">Top level directory</a>]<br>
<script language="JavaScript" type="text/javascript">
<!--
document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>');
document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">');
document.writeln('<tr><td class="searchbox-title">');
document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>');
document.writeln('<\/td><\/tr>');
document.writeln('<tr><td class="searchbox-body" id="searchbox-body">');
document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>');
document.writeln('<a class="searchbox-body" href="../_classes/index.html">Class<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="classname"><br>');
document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../_functions/index.html">Function<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="funcname"><br>');
document.writeln('<a class="searchbox-body" href="../_variables/index.html">Variable<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="varname"><br>');
document.writeln('<a class="searchbox-body" href="../_constants/index.html">Constant<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="constname"><br>');
document.writeln('<a class="searchbox-body" href="../_tables/index.html">Table<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="tablename"><br>');
document.writeln('<input type="submit" class="searchbox-button" value="Search">');
document.writeln('<\/form>');
document.writeln('<\/td><\/tr><\/table>');
document.writeln('<\/td><\/tr><\/table>');
// -->
</script>
<div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div>
<h3>Function and Method Cross Reference</h3>
<h2><a href="index.html#keydownevent">keydownevent()</a></h2>
<b>Defined at:</b><ul>
<li><a href="../rsc/js/tiny_mce/plugins/autocomplete/plugin.src.js.html#keydownevent">/rsc/js/tiny_mce/plugins/autocomplete/plugin.src.js</a> -> <a onClick="logFunction('keydownevent', '/rsc/js/tiny_mce/plugins/autocomplete/plugin.src.js.source.html#l184')" href="../rsc/js/tiny_mce/plugins/autocomplete/plugin.src.js.source.html#l184"> line 184</a></li>
</ul>
<b>No references found.</b><br><br>
</ul>
<!-- A link to the phpxref site in your customized footer file is appreciated ;-) -->
<br><hr>
<table width="100%">
<tr><td>Generated: Sat Nov 21 22:13:19 2015</td>
<td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td>
</tr>
</table>
</body></html>
| mgsolipa/b2evolution_phpxref | _functions/keydownevent.html | HTML | gpl-2.0 | 4,775 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
1014,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.zeroturnaround.zip.extra;
import static org.zeroturnaround.zip.extra.ZipConstants.BYTE_MASK;
/**
* This is a class that has been made significantly smaller (deleted a bunch of methods) and originally
* is from the Apache Ant Project (http://ant.apache.org), org.apache.tools.zip package.
* All license and other documentation is intact.
*
* Utility class that represents a two byte integer with conversion
* rules for the big endian byte order of ZIP files.
*
*/
public final class ZipShort implements Cloneable {
private static final int BYTE_1_MASK = 0xFF00;
private static final int BYTE_1_SHIFT = 8;
private final int value;
/**
* Create instance from a number.
*
* @param value the int to store as a ZipShort
* @since 1.1
*/
public ZipShort(int value) {
this.value = value;
}
/**
* Create instance from bytes.
*
* @param bytes the bytes to store as a ZipShort
* @since 1.1
*/
public ZipShort(byte[] bytes) {
this(bytes, 0);
}
/**
* Create instance from the two bytes starting at offset.
*
* @param bytes the bytes to store as a ZipShort
* @param offset the offset to start
* @since 1.1
*/
public ZipShort(byte[] bytes, int offset) {
value = ZipShort.getValue(bytes, offset);
}
/**
* Get value as two bytes in big endian byte order.
*
* @return the value as a a two byte array in big endian byte order
* @since 1.1
*/
public byte[] getBytes() {
byte[] result = new byte[2];
result[0] = (byte) (value & BYTE_MASK);
result[1] = (byte) ((value & BYTE_1_MASK) >> BYTE_1_SHIFT);
return result;
}
/**
* Get value as Java int.
*
* @return value as a Java int
* @since 1.1
*/
public int getValue() {
return value;
}
/**
* Get value as two bytes in big endian byte order.
*
* @param value the Java int to convert to bytes
* @return the converted int as a byte array in big endian byte order
*/
public static byte[] getBytes(int value) {
byte[] result = new byte[2];
result[0] = (byte) (value & BYTE_MASK);
result[1] = (byte) ((value & BYTE_1_MASK) >> BYTE_1_SHIFT);
return result;
}
/**
* Helper method to get the value as a java int from two bytes starting at given array offset
*
* @param bytes the array of bytes
* @param offset the offset to start
* @return the corresponding java int value
*/
public static int getValue(byte[] bytes, int offset) {
int value = (bytes[offset + 1] << BYTE_1_SHIFT) & BYTE_1_MASK;
value += (bytes[offset] & BYTE_MASK);
return value;
}
/**
* Helper method to get the value as a java int from a two-byte array
*
* @param bytes the array of bytes
* @return the corresponding java int value
*/
public static int getValue(byte[] bytes) {
return getValue(bytes, 0);
}
/**
* Override to make two instances with same value equal.
*
* @param o an object to compare
* @return true if the objects are equal
* @since 1.1
*/
@Override
public boolean equals(Object o) {
if (o == null || !(o instanceof ZipShort)) {
return false;
}
return value == ((ZipShort) o).getValue();
}
/**
* Override to make two instances with same value equal.
*
* @return the value stored in the ZipShort
* @since 1.1
*/
@Override
public int hashCode() {
return value;
}
@Override
public Object clone() {
try {
return super.clone();
}
catch (CloneNotSupportedException cnfe) {
// impossible
throw new RuntimeException(cnfe);
}
}
@Override
public String toString() {
return "ZipShort value: " + value;
}
}
| OhmGeek/ThanCue | src/org/zeroturnaround/zip/extra/ZipShort.java | Java | gpl-3.0 | 4,527 | [
30522,
1013,
1008,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
2030,
2062,
1008,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
1008,
2023,
2147,
2005,
3176,
2592,
4953,
9385,
6095,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"""Script to display a collection of paths after inserting one new path
Usage:
add_to_a_path.py [-U] PATHS PATH
add_to_a_path.py [-U] (-s | -i INDEX ) PATHS PATH
Options:
-h, --help Show this help and exit
-v, --version Show version number and exit
-s, --start Add the path at start of list of paths
-i INDEX, --index=INDEX The index at which the path will be inserted
Examples of use:
$ export PATH=/bin:/usr/bin
$ add_to_a_path.py PATH /usr/local/bin
PATH=/bin:/usr/bin:/usr/local/bin
$ add_to_a_path.py PATH /usr/local/bin --start
PATH=/usr/local/bin:/bin:/usr/bin
"""
from __future__ import print_function
import os
import sys
import argparse
from bdb import BdbQuit
__version__ = '0.1.0'
class ScriptError(NotImplementedError):
pass
def version():
print('%s %s' % (args, __version__))
raise SystemExit
def parse_args():
"""Parse out command line arguments"""
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
parser.add_argument('symbol', help='The bash symbol to be changed')
parser.add_argument('path', help='The path to be added')
parser.add_argument('-s', '--start', action='store_true',
help='Add the path at start of list of paths')
parser.add_argument('-i', '--index', type=int,
help='The index at which the path will be inserted')
parser.add_argument('-v', '--version', action='store_true',
help='Show version')
args = parser.parse_args()
if args.version:
version()
if not args.index:
if args.start:
args.index = 0
else:
args.index = False
return args
def _add_symbol_to_paths(paths, symbol, i):
if i is False:
i = len(paths)
result = paths[:]
if not symbol:
return result
if symbol not in result:
result.insert(i, symbol)
return result
j = result.index(symbol)
if i != j:
del result[j]
result.insert(i, symbol)
return result
def get_arg_path(args):
path = args.path
if not path:
return ''
user_path = os.path.expanduser(path)
real_path = os.path.realpath(user_path)
if not os.path.isdir(real_path):
return ''
return real_path
def split_paths(string):
if not string:
return []
return [p for p in string.split(os.path.pathsep) if p]
def get_paths(args):
symbol = args.symbol
paths_string = ''
if symbol in os.environ:
paths_string = os.environ[symbol]
elif os.path.pathsep in symbol:
paths_string = symbol
return split_paths(paths_string)
def script(args):
arg_path = get_arg_path(args)
paths = get_paths(args)
if not arg_path:
if not paths:
return False
elif os.path.isdir(arg_path):
if arg_path in paths:
paths.remove(arg_path)
paths = _add_symbol_to_paths(paths, arg_path, args.index)
else:
return False
print('='.join((args.symbol, os.path.pathsep.join(paths))))
return True
def main():
"""Run the script"""
try:
args = parse_args()
return os.EX_OK if script(args) else not os.EX_OK
except (SystemExit, BdbQuit):
pass
return os.EX_OK
if __name__ == '__main__':
sys.exit(main())
| jalanb/jab | src/python/add_to_a_path.py | Python | mit | 3,399 | [
30522,
1000,
1000,
1000,
5896,
2000,
4653,
1037,
3074,
1997,
10425,
2044,
19274,
2075,
2028,
2047,
4130,
8192,
1024,
5587,
1035,
2000,
1035,
1037,
1035,
4130,
1012,
1052,
2100,
1031,
1011,
1057,
1033,
10425,
4130,
5587,
1035,
2000,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (c) 2002 The FFmpeg Project
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#include "h263.h"
#include "mathops.h"
#include "msmpeg4.h"
#include "msmpeg4data.h"
#include "intrax8.h"
#include "wmv2.h"
static void parse_mb_skip(Wmv2Context * w){
int mb_x, mb_y;
MpegEncContext * const s= &w->s;
uint32_t * const mb_type = s->current_picture_ptr->f.mb_type;
w->skip_type= get_bits(&s->gb, 2);
switch(w->skip_type){
case SKIP_TYPE_NONE:
for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_16x16 | MB_TYPE_L0;
}
}
break;
case SKIP_TYPE_MPEG:
for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
}
}
break;
case SKIP_TYPE_ROW:
for(mb_y=0; mb_y<s->mb_height; mb_y++){
if(get_bits1(&s->gb)){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
}
}else{
for(mb_x=0; mb_x<s->mb_width; mb_x++){
mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
}
}
}
break;
case SKIP_TYPE_COL:
for(mb_x=0; mb_x<s->mb_width; mb_x++){
if(get_bits1(&s->gb)){
for(mb_y=0; mb_y<s->mb_height; mb_y++){
mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
}
}else{
for(mb_y=0; mb_y<s->mb_height; mb_y++){
mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
}
}
}
break;
}
}
static int decode_ext_header(Wmv2Context *w){
MpegEncContext * const s= &w->s;
GetBitContext gb;
int fps;
int code;
if(s->avctx->extradata_size<4) return -1;
init_get_bits(&gb, s->avctx->extradata, 32);
fps = get_bits(&gb, 5);
s->bit_rate = get_bits(&gb, 11)*1024;
w->mspel_bit = get_bits1(&gb);
s->loop_filter = get_bits1(&gb);
w->abt_flag = get_bits1(&gb);
w->j_type_bit = get_bits1(&gb);
w->top_left_mv_flag= get_bits1(&gb);
w->per_mb_rl_bit = get_bits1(&gb);
code = get_bits(&gb, 3);
if(code==0) return -1;
s->slice_height = s->mb_height / code;
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
av_log(s->avctx, AV_LOG_DEBUG, "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, slices:%d\n",
fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit, w->top_left_mv_flag, w->per_mb_rl_bit, code, s->loop_filter,
code);
}
return 0;
}
int ff_wmv2_decode_picture_header(MpegEncContext * s)
{
Wmv2Context * const w= (Wmv2Context*)s;
int code;
if(s->picture_number==0)
decode_ext_header(w);
s->pict_type = get_bits1(&s->gb) + 1;
if(s->pict_type == AV_PICTURE_TYPE_I){
code = get_bits(&s->gb, 7);
av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code);
}
s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
if(s->qscale <= 0)
return -1;
return 0;
}
int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s)
{
Wmv2Context * const w= (Wmv2Context*)s;
if (s->pict_type == AV_PICTURE_TYPE_I) {
if(w->j_type_bit) w->j_type= get_bits1(&s->gb);
else w->j_type= 0; //FIXME check
if(!w->j_type){
if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
else s->per_mb_rl_table= 0;
if(!s->per_mb_rl_table){
s->rl_chroma_table_index = decode012(&s->gb);
s->rl_table_index = decode012(&s->gb);
}
s->dc_table_index = get_bits1(&s->gb);
}
s->inter_intra_pred= 0;
s->no_rounding = 1;
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
s->qscale,
s->rl_chroma_table_index,
s->rl_table_index,
s->dc_table_index,
s->per_mb_rl_table,
w->j_type);
}
}else{
int cbp_index;
w->j_type=0;
parse_mb_skip(w);
cbp_index= decode012(&s->gb);
if(s->qscale <= 10){
int map[3]= {0,2,1};
w->cbp_table_index= map[cbp_index];
}else if(s->qscale <= 20){
int map[3]= {1,0,2};
w->cbp_table_index= map[cbp_index];
}else{
int map[3]= {2,1,0};
w->cbp_table_index= map[cbp_index];
}
if(w->mspel_bit) s->mspel= get_bits1(&s->gb);
else s->mspel= 0; //FIXME check
if(w->abt_flag){
w->per_mb_abt= get_bits1(&s->gb)^1;
if(!w->per_mb_abt){
w->abt_type= decode012(&s->gb);
}
}
if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
else s->per_mb_rl_table= 0;
if(!s->per_mb_rl_table){
s->rl_table_index = decode012(&s->gb);
s->rl_chroma_table_index = s->rl_table_index;
}
s->dc_table_index = get_bits1(&s->gb);
s->mv_table_index = get_bits1(&s->gb);
s->inter_intra_pred= 0;//(s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
s->no_rounding ^= 1;
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
av_log(s->avctx, AV_LOG_DEBUG, "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
s->rl_table_index,
s->rl_chroma_table_index,
s->dc_table_index,
s->mv_table_index,
s->per_mb_rl_table,
s->qscale,
s->mspel,
w->per_mb_abt,
w->abt_type,
w->cbp_table_index,
s->inter_intra_pred);
}
}
s->esc3_level_length= 0;
s->esc3_run_length= 0;
s->picture_number++; //FIXME ?
if(w->j_type){
ff_intrax8_decode_picture(&w->x8, 2*s->qscale, (s->qscale-1)|1 );
return 1;
}
return 0;
}
static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr){
MpegEncContext * const s= &w->s;
int ret;
ret= ff_msmpeg4_decode_motion(s, mx_ptr, my_ptr);
if(ret<0) return -1;
if((((*mx_ptr)|(*my_ptr)) & 1) && s->mspel)
w->hshift= get_bits1(&s->gb);
else
w->hshift= 0;
//printf("%d %d ", *mx_ptr, *my_ptr);
return 0;
}
static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py){
MpegEncContext * const s= &w->s;
int xy, wrap, diff, type;
int16_t *A, *B, *C, *mot_val;
wrap = s->b8_stride;
xy = s->block_index[0];
mot_val = s->current_picture.f.motion_val[0][xy];
A = s->current_picture.f.motion_val[0][xy - 1];
B = s->current_picture.f.motion_val[0][xy - wrap];
C = s->current_picture.f.motion_val[0][xy + 2 - wrap];
if(s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
diff= FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1]));
else
diff=0;
if(diff >= 8)
type= get_bits1(&s->gb);
else
type= 2;
if(type == 0){
*px= A[0];
*py= A[1];
}else if(type == 1){
*px= B[0];
*py= B[1];
}else{
/* special case for first (slice) line */
if (s->first_slice_line) {
*px = A[0];
*py = A[1];
} else {
*px = mid_pred(A[0], B[0], C[0]);
*py = mid_pred(A[1], B[1], C[1]);
}
}
return mot_val;
}
static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, int cbp){
MpegEncContext * const s= &w->s;
static const int sub_cbp_table[3]= {2,3,1};
int sub_cbp;
if(!cbp){
s->block_last_index[n] = -1;
return 0;
}
if(w->per_block_abt)
w->abt_type= decode012(&s->gb);
w->abt_type_table[n]= w->abt_type;
if(w->abt_type){
// const uint8_t *scantable= w->abt_scantable[w->abt_type-1].permutated;
const uint8_t *scantable= w->abt_scantable[w->abt_type-1].scantable;
// const uint8_t *scantable= w->abt_type-1 ? w->abt_scantable[1].permutated : w->abt_scantable[0].scantable;
sub_cbp= sub_cbp_table[ decode012(&s->gb) ];
// printf("S%d", sub_cbp);
if(sub_cbp&1){
if (ff_msmpeg4_decode_block(s, block, n, 1, scantable) < 0)
return -1;
}
if(sub_cbp&2){
if (ff_msmpeg4_decode_block(s, w->abt_block2[n], n, 1, scantable) < 0)
return -1;
}
s->block_last_index[n] = 63;
return 0;
}else{
return ff_msmpeg4_decode_block(s, block, n, 1, s->inter_scantable.permutated);
}
}
int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
{
Wmv2Context * const w= (Wmv2Context*)s;
int cbp, code, i;
uint8_t *coded_val;
if(w->j_type) return 0;
if (s->pict_type == AV_PICTURE_TYPE_P) {
if (IS_SKIP(s->current_picture.f.mb_type[s->mb_y * s->mb_stride + s->mb_x])) {
/* skip mb */
s->mb_intra = 0;
for(i=0;i<6;i++)
s->block_last_index[i] = -1;
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16;
s->mv[0][0][0] = 0;
s->mv[0][0][1] = 0;
s->mb_skipped = 1;
w->hshift=0;
return 0;
}
code = get_vlc2(&s->gb, ff_mb_non_intra_vlc[w->cbp_table_index].table, MB_NON_INTRA_VLC_BITS, 3);
if (code < 0)
return -1;
s->mb_intra = (~code & 0x40) >> 6;
cbp = code & 0x3f;
} else {
s->mb_intra = 1;
code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
if (code < 0){
av_log(s->avctx, AV_LOG_ERROR, "II-cbp illegal at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
/* predict coded block pattern */
cbp = 0;
for(i=0;i<6;i++) {
int val = ((code >> (5 - i)) & 1);
if (i < 4) {
int pred = ff_msmpeg4_coded_block_pred(s, i, &coded_val);
val = val ^ pred;
*coded_val = val;
}
cbp |= val << (5 - i);
}
}
if (!s->mb_intra) {
int mx, my;
//printf("P at %d %d\n", s->mb_x, s->mb_y);
wmv2_pred_motion(w, &mx, &my);
if(cbp){
s->dsp.clear_blocks(s->block[0]);
if(s->per_mb_rl_table){
s->rl_table_index = decode012(&s->gb);
s->rl_chroma_table_index = s->rl_table_index;
}
if(w->abt_flag && w->per_mb_abt){
w->per_block_abt= get_bits1(&s->gb);
if(!w->per_block_abt)
w->abt_type= decode012(&s->gb);
}else
w->per_block_abt=0;
}
if (wmv2_decode_motion(w, &mx, &my) < 0)
return -1;
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16;
s->mv[0][0][0] = mx;
s->mv[0][0][1] = my;
for (i = 0; i < 6; i++) {
if (wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1) < 0)
{
av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding inter block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
return -1;
}
}
} else {
//if(s->pict_type==AV_PICTURE_TYPE_P)
// printf("%d%d ", s->inter_intra_pred, cbp);
//printf("I at %d %d %d %06X\n", s->mb_x, s->mb_y, ((cbp&3)? 1 : 0) +((cbp&0x3C)? 2 : 0), show_bits(&s->gb, 24));
s->ac_pred = get_bits1(&s->gb);
if(s->inter_intra_pred){
s->h263_aic_dir= get_vlc2(&s->gb, ff_inter_intra_vlc.table, INTER_INTRA_VLC_BITS, 1);
// printf("%d%d %d %d/", s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
}
if(s->per_mb_rl_table && cbp){
s->rl_table_index = decode012(&s->gb);
s->rl_chroma_table_index = s->rl_table_index;
}
s->dsp.clear_blocks(s->block[0]);
for (i = 0; i < 6; i++) {
if (ff_msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0)
{
av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding intra block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
return -1;
}
}
}
return 0;
}
static av_cold int wmv2_decode_init(AVCodecContext *avctx){
Wmv2Context * const w= avctx->priv_data;
if(avctx->idct_algo==FF_IDCT_AUTO){
avctx->idct_algo=FF_IDCT_WMV2;
}
if(ff_msmpeg4_decode_init(avctx) < 0)
return -1;
ff_wmv2_common_init(w);
ff_intrax8_common_init(&w->x8,&w->s);
return 0;
}
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
{
Wmv2Context *w = avctx->priv_data;
ff_intrax8_common_end(&w->x8);
return ff_h263_decode_end(avctx);
}
AVCodec ff_wmv2_decoder = {
.name = "wmv2",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WMV2,
.priv_data_size = sizeof(Wmv2Context),
.init = wmv2_decode_init,
.close = wmv2_decode_end,
.decode = ff_h263_decode_frame,
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
.pix_fmts = ff_pixfmt_list_420,
};
| alts/silver_rocket | Extdeps/ffmpeg/src/libavcodec/wmv2dec.c | C | gpl-2.0 | 14,812 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2526,
1996,
21461,
8737,
13910,
2622,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
21461,
8737,
13910,
1012,
1008,
1008,
21461,
8737,
13910,
2003,
2489,
4007,
1025,
2017,
2064,
2417,
2923,
3089,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// xfail-win32
extern mod extra;
use std::comm;
use std::task;
use std::uint;
fn die() {
fail!();
}
fn iloop() {
task::spawn(|| die() );
let (p, c) = comm::stream::<()>();
loop {
// Sending and receiving here because these actions yield,
// at which point our child can kill us.
c.send(());
p.recv();
// The above comment no longer makes sense but I'm
// reluctant to remove a linked failure test case.
task::yield();
}
}
pub fn main() {
for uint::range(0u, 16u) |_i| {
task::spawn_unlinked(|| iloop() );
}
}
| j16r/rust | src/test/run-pass/send-iloop.rs | Rust | apache-2.0 | 1,072 | [
30522,
1013,
1013,
30524,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1026,
6105,
1011,
15895,
2030,
1013,
1013,
8299,
1024,
1013,
1013,
7479,
1012,
15895,
1012,
8917,
1013,
15943,
1013,
6105,
1011,
1016,
1012,
1014,
1028,
2030,
1996,
10210,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2011-2021 Fraunhofer ISE
*
* This file is part of OpenMUC.
* For more information visit http://www.openmuc.org
*
* OpenMUC 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.
*
* OpenMUC 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 OpenMUC. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.openmuc.framework.lib.osgi.deployment;
/**
* Helper interface to set services
*/
public interface ServiceAccess {
/**
* @param serviceRef
* The service to set
*/
public void setService(Object serviceRef);
}
| isc-konstanz/OpenMUC | projects/lib/osgi/src/main/java/org/openmuc/framework/lib/osgi/deployment/ServiceAccess.java | Java | gpl-3.0 | 1,029 | [
30522,
1013,
1008,
1008,
9385,
2249,
1011,
25682,
25312,
4609,
14586,
2121,
2003,
2063,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
2330,
12274,
2278,
1012,
1008,
2005,
2062,
2592,
3942,
8299,
1024,
1013,
1013,
7479,
1012,
2330,
12274,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 26032, " ListView ItemTapped doesn't get called for the selected item ", PlatformAffected.iOS)]
public partial class Bugzilla26032 : TestContentPage
{
#if APP
public Bugzilla26032 ()
{
InitializeComponent ();
var data = new[] { "1", "2", "3", "4", "5" };
var dataContext = new[] { "1 Context", "2 Context", "3 Context", "4 Context", "5 Context" };
List1.ItemsSource = data;
List2.ItemsSource = dataContext;
}
public void OnItemTapped(object sender, ItemTappedEventArgs e)
{
Log.Text = string.Format("Item '{0}' tapped\n{1}", e.Item, Log.Text);
}
public void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
{
Log.Text = string.Format("Item '{0}' selected\n{1}", e.SelectedItem, Log.Text);
}
#endif
protected override void Init ()
{
}
#if UITEST
[Test]
public void SelectedItemTap ()
{
var id = "1";
var idContext = "1 Context";
var initalLog = "Item '{0}' tapped\nItem '{0}' selected\n";
var forId1 = string.Format (initalLog, id);
RunningApp.WaitForElement (q => q.Marked (id));
RunningApp.Tap (q => q.Marked (id));
RunningApp.WaitForElement (q => q.Text (forId1));
RunningApp.Tap (q => q.Marked (id));
forId1 = string.Format ( "Item '{0}' tapped\n" + initalLog, id);
RunningApp.WaitForElement (q => q.Text (forId1));
var forIdContext = string.Format (initalLog, idContext);
RunningApp.WaitForElement (q => q.Marked (idContext));
RunningApp.Tap (q => q.Marked (idContext));
RunningApp.WaitForElement (q => q.Text (forIdContext + forId1));
RunningApp.Tap (q => q.Marked (idContext));
forIdContext = string.Format ( "Item '{0}' tapped\n" + initalLog, idContext);
RunningApp.WaitForElement (q => q.Text (forIdContext + forId1));
}
#endif
}
}
| xjpeter/Xamarin.Forms | Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26032.xaml.cs | C# | mit | 2,087 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
1060,
8067,
6657,
1012,
3596,
1025,
2478,
1060,
8067,
6657,
1012,
3596,
1012,
7661,
19321,
3089,
8569,
4570,
1025,
2478,
1060,
8067,
6657,
1012,
3596,
1012,
4722,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
@font-face{font-family:'FontAwesome';src:url('../font/fontawesome-webfont.eot?v=3.2.1');src:url('../font/fontawesome-webfont.eot?#iefix&v=3.2.1') format('embedded-opentype'),url('../font/fontawesome-webfont.woff?v=3.2.1') format('woff'),url('../font/fontawesome-webfont.ttf?v=3.2.1') format('truetype'),url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg');font-weight:normal;font-style:normal;}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing: grayscale;*margin-right:.3em;}
[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none;}
.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em;}
a [class^="icon-"],a [class*=" icon-"]{display:inline;}
[class^="icon-"].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.1428571428571428em;text-align:right;padding-right:0.2857142857142857em;}[class^="icon-"].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.4285714285714286em;}
.icons-ul{margin-left:2.142857142857143em;list-style-type:none;}.icons-ul>li{position:relative;}
.icons-ul .icon-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;text-align:center;line-height:inherit;}
[class^="icon-"].hide,[class*=" icon-"].hide{display:none;}
.icon-muted{color:#eeeeee;}
.icon-light{color:#ffffff;}
.icon-dark{color:#333333;}
.icon-border{border:solid 1px #eeeeee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
.icon-2x{font-size:2em;}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
.icon-3x{font-size:3em;}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
.icon-4x{font-size:4em;}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
.icon-5x{font-size:5em;}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;}
.pull-right{float:right;}
.pull-left{float:left;}
[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em;}
[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em;}
[class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0;}
.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none;}
.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em;}
.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block;}
.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em;}
.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em;}
.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em;}
.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em;}
.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0;}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em;}
.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em;}
.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em;}
.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{line-height:inherit;}
.icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%;}.icon-stack [class^="icon-"],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em;}
.icon-stack .icon-stack-base{font-size:2em;*line-height:1em;}
.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;}
a .icon-stack,a .icon-spin{display:inline-block;text-decoration:none;}
@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);} 100%{-moz-transform:rotate(359deg);}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);} 100%{-webkit-transform:rotate(359deg);}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);} 100%{-o-transform:rotate(359deg);}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg);} 100%{-ms-transform:rotate(359deg);}}@keyframes spin{0%{transform:rotate(0deg);} 100%{transform:rotate(359deg);}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);}
.icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);}
.icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);}
.icon-flip-horizontal:before{-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1);}
.icon-flip-vertical:before{-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1);}
a .icon-rotate-90:before,a .icon-rotate-180:before,a .icon-rotate-270:before,a .icon-flip-horizontal:before,a .icon-flip-vertical:before{display:inline-block;}
.icon-glass:before{content:"\f000";}
.icon-music:before{content:"\f001";}
.icon-search:before{content:"\f002";}
.icon-envelope-alt:before{content:"\f003";}
.icon-heart:before{content:"\f004";}
.icon-star:before{content:"\f005";}
.icon-star-empty:before{content:"\f006";}
.icon-user:before{content:"\f007";}
.icon-film:before{content:"\f008";}
.icon-th-large:before{content:"\f009";}
.icon-th:before{content:"\f00a";}
.icon-th-list:before{content:"\f00b";}
.icon-ok:before{content:"\f00c";}
.icon-remove:before{content:"\f00d";}
.icon-zoom-in:before{content:"\f00e";}
.icon-zoom-out:before{content:"\f010";}
.icon-power-off:before,.icon-off:before{content:"\f011";}
.icon-signal:before{content:"\f012";}
.icon-gear:before,.icon-cog:before{content:"\f013";}
.icon-trash:before{content:"\f014";}
.icon-home:before{content:"\f015";}
.icon-file-alt:before{content:"\f016";}
.icon-time:before{content:"\f017";}
.icon-road:before{content:"\f018";}
.icon-download-alt:before{content:"\f019";}
.icon-download:before{content:"\f01a";}
.icon-upload:before{content:"\f01b";}
.icon-inbox:before{content:"\f01c";}
.icon-play-circle:before{content:"\f01d";}
.icon-rotate-right:before,.icon-repeat:before{content:"\f01e";}
.icon-refresh:before{content:"\f021";}
.icon-list-alt:before{content:"\f022";}
.icon-lock:before{content:"\f023";}
.icon-flag:before{content:"\f024";}
.icon-headphones:before{content:"\f025";}
.icon-volume-off:before{content:"\f026";}
.icon-volume-down:before{content:"\f027";}
.icon-volume-up:before{content:"\f028";}
.icon-qrcode:before{content:"\f029";}
.icon-barcode:before{content:"\f02a";}
.icon-tag:before{content:"\f02b";}
.icon-tags:before{content:"\f02c";}
.icon-book:before{content:"\f02d";}
.icon-bookmark:before{content:"\f02e";}
.icon-print:before{content:"\f02f";}
.icon-camera:before{content:"\f030";}
.icon-font:before{content:"\f031";}
.icon-bold:before{content:"\f032";}
.icon-italic:before{content:"\f033";}
.icon-text-height:before{content:"\f034";}
.icon-text-width:before{content:"\f035";}
.icon-align-left:before{content:"\f036";}
.icon-align-center:before{content:"\f037";}
.icon-align-right:before{content:"\f038";}
.icon-align-justify:before{content:"\f039";}
.icon-list:before{content:"\f03a";}
.icon-indent-left:before{content:"\f03b";}
.icon-indent-right:before{content:"\f03c";}
.icon-facetime-video:before{content:"\f03d";}
.icon-picture:before{content:"\f03e";}
.icon-pencil:before{content:"\f040";}
.icon-map-marker:before{content:"\f041";}
.icon-adjust:before{content:"\f042";}
.icon-tint:before{content:"\f043";}
.icon-edit:before{content:"\f044";}
.icon-share:before{content:"\f045";}
.icon-check:before{content:"\f046";}
.icon-move:before{content:"\f047";}
.icon-step-backward:before{content:"\f048";}
.icon-fast-backward:before{content:"\f049";}
.icon-backward:before{content:"\f04a";}
.icon-play:before{content:"\f04b";}
.icon-pause:before{content:"\f04c";}
.icon-stop:before{content:"\f04d";}
.icon-forward:before{content:"\f04e";}
.icon-fast-forward:before{content:"\f050";}
.icon-step-forward:before{content:"\f051";}
.icon-eject:before{content:"\f052";}
.icon-chevron-left:before{content:"\f053";}
.icon-chevron-right:before{content:"\f054";}
.icon-plus-sign:before{content:"\f055";}
.icon-minus-sign:before{content:"\f056";}
.icon-remove-sign:before{content:"\f057";}
.icon-ok-sign:before{content:"\f058";}
.icon-question-sign:before{content:"\f059";}
.icon-info-sign:before{content:"\f05a";}
.icon-screenshot:before{content:"\f05b";}
.icon-remove-circle:before{content:"\f05c";}
.icon-ok-circle:before{content:"\f05d";}
.icon-ban-circle:before{content:"\f05e";}
.icon-arrow-left:before{content:"\f060";}
.icon-arrow-right:before{content:"\f061";}
.icon-arrow-up:before{content:"\f062";}
.icon-arrow-down:before{content:"\f063";}
.icon-mail-forward:before,.icon-share-alt:before{content:"\f064";}
.icon-resize-full:before{content:"\f065";}
.icon-resize-small:before{content:"\f066";}
.icon-plus:before{content:"\f067";}
.icon-minus:before{content:"\f068";}
.icon-asterisk:before{content:"\f069";}
.icon-exclamation-sign:before{content:"\f06a";}
.icon-gift:before{content:"\f06b";}
.icon-leaf:before{content:"\f06c";}
.icon-fire:before{content:"\f06d";}
.icon-eye-open:before{content:"\f06e";}
.icon-eye-close:before{content:"\f070";}
.icon-warning-sign:before{content:"\f071";}
.icon-plane:before{content:"\f072";}
.icon-calendar:before{content:"\f073";}
.icon-random:before{content:"\f074";}
.icon-comment:before{content:"\f075";}
.icon-magnet:before{content:"\f076";}
.icon-chevron-up:before{content:"\f077";}
.icon-chevron-down:before{content:"\f078";}
.icon-retweet:before{content:"\f079";}
.icon-shopping-cart:before{content:"\f07a";}
.icon-folder-close:before{content:"\f07b";}
.icon-folder-open:before{content:"\f07c";}
.icon-resize-vertical:before{content:"\f07d";}
.icon-resize-horizontal:before{content:"\f07e";}
.icon-bar-chart:before{content:"\f080";}
.icon-twitter-sign:before{content:"\f081";}
.icon-facebook-sign:before{content:"\f082";}
.icon-camera-retro:before{content:"\f083";}
.icon-key:before{content:"\f084";}
.icon-gears:before,.icon-cogs:before{content:"\f085";}
.icon-comments:before{content:"\f086";}
.icon-thumbs-up-alt:before{content:"\f087";}
.icon-thumbs-down-alt:before{content:"\f088";}
.icon-star-half:before{content:"\f089";}
.icon-heart-empty:before{content:"\f08a";}
.icon-signout:before{content:"\f08b";}
.icon-linkedin-sign:before{content:"\f08c";}
.icon-pushpin:before{content:"\f08d";}
.icon-external-link:before{content:"\f08e";}
.icon-signin:before{content:"\f090";}
.icon-trophy:before{content:"\f091";}
.icon-github-sign:before{content:"\f092";}
.icon-upload-alt:before{content:"\f093";}
.icon-lemon:before{content:"\f094";}
.icon-phone:before{content:"\f095";}
.icon-unchecked:before,.icon-check-empty:before{content:"\f096";}
.icon-bookmark-empty:before{content:"\f097";}
.icon-phone-sign:before{content:"\f098";}
.icon-twitter:before{content:"\f099";}
.icon-facebook:before{content:"\f09a";}
.icon-github:before{content:"\f09b";}
.icon-unlock:before{content:"\f09c";}
.icon-credit-card:before{content:"\f09d";}
.icon-rss:before{content:"\f09e";}
.icon-hdd:before{content:"\f0a0";}
.icon-bullhorn:before{content:"\f0a1";}
.icon-bell:before{content:"\f0a2";}
.icon-certificate:before{content:"\f0a3";}
.icon-hand-right:before{content:"\f0a4";}
.icon-hand-left:before{content:"\f0a5";}
.icon-hand-up:before{content:"\f0a6";}
.icon-hand-down:before{content:"\f0a7";}
.icon-circle-arrow-left:before{content:"\f0a8";}
.icon-circle-arrow-right:before{content:"\f0a9";}
.icon-circle-arrow-up:before{content:"\f0aa";}
.icon-circle-arrow-down:before{content:"\f0ab";}
.icon-globe:before{content:"\f0ac";}
.icon-wrench:before{content:"\f0ad";}
.icon-tasks:before{content:"\f0ae";}
.icon-filter:before{content:"\f0b0";}
.icon-briefcase:before{content:"\f0b1";}
.icon-fullscreen:before{content:"\f0b2";}
.icon-group:before{content:"\f0c0";}
.icon-link:before{content:"\f0c1";}
.icon-cloud:before{content:"\f0c2";}
.icon-beaker:before{content:"\f0c3";}
.icon-cut:before{content:"\f0c4";}
.icon-copy:before{content:"\f0c5";}
.icon-paperclip:before,.icon-paper-clip:before{content:"\f0c6";}
.icon-save:before{content:"\f0c7";}
.icon-sign-blank:before{content:"\f0c8";}
.icon-reorder:before{content:"\f0c9";}
.icon-list-ul:before{content:"\f0ca";}
.icon-list-ol:before{content:"\f0cb";}
.icon-strikethrough:before{content:"\f0cc";}
.icon-underline:before{content:"\f0cd";}
.icon-table:before{content:"\f0ce";}
.icon-magic:before{content:"\f0d0";}
.icon-truck:before{content:"\f0d1";}
.icon-pinterest:before{content:"\f0d2";}
.icon-pinterest-sign:before{content:"\f0d3";}
.icon-google-plus-sign:before{content:"\f0d4";}
.icon-google-plus:before{content:"\f0d5";}
.icon-money:before{content:"\f0d6";}
.icon-caret-down:before{content:"\f0d7";}
.icon-caret-up:before{content:"\f0d8";}
.icon-caret-left:before{content:"\f0d9";}
.icon-caret-right:before{content:"\f0da";}
.icon-columns:before{content:"\f0db";}
.icon-sort:before{content:"\f0dc";}
.icon-sort-down:before{content:"\f0dd";}
.icon-sort-up:before{content:"\f0de";}
.icon-envelope:before{content:"\f0e0";}
.icon-linkedin:before{content:"\f0e1";}
.icon-rotate-left:before,.icon-undo:before{content:"\f0e2";}
.icon-legal:before{content:"\f0e3";}
.icon-dashboard:before{content:"\f0e4";}
.icon-comment-alt:before{content:"\f0e5";}
.icon-comments-alt:before{content:"\f0e6";}
.icon-bolt:before{content:"\f0e7";}
.icon-sitemap:before{content:"\f0e8";}
.icon-umbrella:before{content:"\f0e9";}
.icon-paste:before{content:"\f0ea";}
.icon-lightbulb:before{content:"\f0eb";}
.icon-exchange:before{content:"\f0ec";}
.icon-cloud-download:before{content:"\f0ed";}
.icon-cloud-upload:before{content:"\f0ee";}
.icon-user-md:before{content:"\f0f0";}
.icon-stethoscope:before{content:"\f0f1";}
.icon-suitcase:before{content:"\f0f2";}
.icon-bell-alt:before{content:"\f0f3";}
.icon-coffee:before{content:"\f0f4";}
.icon-food:before{content:"\f0f5";}
.icon-file-text-alt:before{content:"\f0f6";}
.icon-building:before{content:"\f0f7";}
.icon-hospital:before{content:"\f0f8";}
.icon-ambulance:before{content:"\f0f9";}
.icon-medkit:before{content:"\f0fa";}
.icon-fighter-jet:before{content:"\f0fb";}
.icon-beer:before{content:"\f0fc";}
.icon-h-sign:before{content:"\f0fd";}
.icon-plus-sign-alt:before{content:"\f0fe";}
.icon-double-angle-left:before{content:"\f100";}
.icon-double-angle-right:before{content:"\f101";}
.icon-double-angle-up:before{content:"\f102";}
.icon-double-angle-down:before{content:"\f103";}
.icon-angle-left:before{content:"\f104";}
.icon-angle-right:before{content:"\f105";}
.icon-angle-up:before{content:"\f106";}
.icon-angle-down:before{content:"\f107";}
.icon-desktop:before{content:"\f108";}
.icon-laptop:before{content:"\f109";}
.icon-tablet:before{content:"\f10a";}
.icon-mobile-phone:before{content:"\f10b";}
.icon-circle-blank:before{content:"\f10c";}
.icon-quote-left:before{content:"\f10d";}
.icon-quote-right:before{content:"\f10e";}
.icon-spinner:before{content:"\f110";}
.icon-circle:before{content:"\f111";}
.icon-mail-reply:before,.icon-reply:before{content:"\f112";}
.icon-github-alt:before{content:"\f113";}
.icon-folder-close-alt:before{content:"\f114";}
.icon-folder-open-alt:before{content:"\f115";}
.icon-expand-alt:before{content:"\f116";}
.icon-collapse-alt:before{content:"\f117";}
.icon-smile:before{content:"\f118";}
.icon-frown:before{content:"\f119";}
.icon-meh:before{content:"\f11a";}
.icon-gamepad:before{content:"\f11b";}
.icon-keyboard:before{content:"\f11c";}
.icon-flag-alt:before{content:"\f11d";}
.icon-flag-checkered:before{content:"\f11e";}
.icon-terminal:before{content:"\f120";}
.icon-code:before{content:"\f121";}
.icon-reply-all:before{content:"\f122";}
.icon-mail-reply-all:before{content:"\f122";}
.icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123";}
.icon-location-arrow:before{content:"\f124";}
.icon-crop:before{content:"\f125";}
.icon-code-fork:before{content:"\f126";}
.icon-unlink:before{content:"\f127";}
.icon-question:before{content:"\f128";}
.icon-info:before{content:"\f129";}
.icon-exclamation:before{content:"\f12a";}
.icon-superscript:before{content:"\f12b";}
.icon-subscript:before{content:"\f12c";}
.icon-eraser:before{content:"\f12d";}
.icon-puzzle-piece:before{content:"\f12e";}
.icon-microphone:before{content:"\f130";}
.icon-microphone-off:before{content:"\f131";}
.icon-shield:before{content:"\f132";}
.icon-calendar-empty:before{content:"\f133";}
.icon-fire-extinguisher:before{content:"\f134";}
.icon-rocket:before{content:"\f135";}
.icon-maxcdn:before{content:"\f136";}
.icon-chevron-sign-left:before{content:"\f137";}
.icon-chevron-sign-right:before{content:"\f138";}
.icon-chevron-sign-up:before{content:"\f139";}
.icon-chevron-sign-down:before{content:"\f13a";}
.icon-html5:before{content:"\f13b";}
.icon-css3:before{content:"\f13c";}
.icon-anchor:before{content:"\f13d";}
.icon-unlock-alt:before{content:"\f13e";}
.icon-bullseye:before{content:"\f140";}
.icon-ellipsis-horizontal:before{content:"\f141";}
.icon-ellipsis-vertical:before{content:"\f142";}
.icon-rss-sign:before{content:"\f143";}
.icon-play-sign:before{content:"\f144";}
.icon-ticket:before{content:"\f145";}
.icon-minus-sign-alt:before{content:"\f146";}
.icon-check-minus:before{content:"\f147";}
.icon-level-up:before{content:"\f148";}
.icon-level-down:before{content:"\f149";}
.icon-check-sign:before{content:"\f14a";}
.icon-edit-sign:before{content:"\f14b";}
.icon-external-link-sign:before{content:"\f14c";}
.icon-share-sign:before{content:"\f14d";}
.icon-compass:before{content:"\f14e";}
.icon-collapse:before{content:"\f150";}
.icon-collapse-top:before{content:"\f151";}
.icon-expand:before{content:"\f152";}
.icon-euro:before,.icon-eur:before{content:"\f153";}
.icon-gbp:before{content:"\f154";}
.icon-dollar:before,.icon-usd:before{content:"\f155";}
.icon-rupee:before,.icon-inr:before{content:"\f156";}
.icon-yen:before,.icon-jpy:before{content:"\f157";}
.icon-renminbi:before,.icon-cny:before{content:"\f158";}
.icon-won:before,.icon-krw:before{content:"\f159";}
.icon-bitcoin:before,.icon-btc:before{content:"\f15a";}
.icon-file:before{content:"\f15b";}
.icon-file-text:before{content:"\f15c";}
.icon-sort-by-alphabet:before{content:"\f15d";}
.icon-sort-by-alphabet-alt:before{content:"\f15e";}
.icon-sort-by-attributes:before{content:"\f160";}
.icon-sort-by-attributes-alt:before{content:"\f161";}
.icon-sort-by-order:before{content:"\f162";}
.icon-sort-by-order-alt:before{content:"\f163";}
.icon-thumbs-up:before{content:"\f164";}
.icon-thumbs-down:before{content:"\f165";}
.icon-youtube-sign:before{content:"\f166";}
.icon-youtube:before{content:"\f167";}
.icon-xing:before{content:"\f168";}
.icon-xing-sign:before{content:"\f169";}
.icon-youtube-play:before{content:"\f16a";}
.icon-dropbox:before{content:"\f16b";}
.icon-stackexchange:before{content:"\f16c";}
.icon-instagram:before{content:"\f16d";}
.icon-flickr:before{content:"\f16e";}
.icon-adn:before{content:"\f170";}
.icon-bitbucket:before{content:"\f171";}
.icon-bitbucket-sign:before{content:"\f172";}
.icon-tumblr:before{content:"\f173";}
.icon-tumblr-sign:before{content:"\f174";}
.icon-long-arrow-down:before{content:"\f175";}
.icon-long-arrow-up:before{content:"\f176";}
.icon-long-arrow-left:before{content:"\f177";}
.icon-long-arrow-right:before{content:"\f178";}
.icon-apple:before{content:"\f179";}
.icon-windows:before{content:"\f17a";}
.icon-android:before{content:"\f17b";}
.icon-linux:before{content:"\f17c";}
.icon-dribbble:before{content:"\f17d";}
.icon-skype:before{content:"\f17e";}
.icon-foursquare:before{content:"\f180";}
.icon-trello:before{content:"\f181";}
.icon-female:before{content:"\f182";}
.icon-male:before{content:"\f183";}
.icon-gittip:before{content:"\f184";}
.icon-sun:before{content:"\f185";}
.icon-moon:before{content:"\f186";}
.icon-archive:before{content:"\f187";}
.icon-bug:before{content:"\f188";}
.icon-vk:before{content:"\f189";}
.icon-weibo:before{content:"\f18a";}
.icon-renren:before{content:"\f18b";}
| wenhaofan/blog | target/blog-1.0.0.1/assets/back/css/login/font-awesome.min.css | CSS | gpl-3.0 | 22,522 | [
30522,
1030,
15489,
1011,
2227,
1063,
15489,
1011,
2155,
1024,
1005,
15489,
10376,
2229,
8462,
1005,
1025,
5034,
2278,
1024,
24471,
2140,
1006,
1005,
1012,
1012,
1013,
15489,
1013,
15489,
10376,
2229,
8462,
1011,
4773,
14876,
3372,
1012,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#<pycode(py_choose)>
class Choose:
"""
Choose - class for choose() with callbacks
"""
def __init__(self, list, title, flags=0, deflt=1, icon=37):
self.list = list
self.title = title
self.flags = flags
self.x0 = -1
self.x1 = -1
self.y0 = -1
self.y1 = -1
self.width = -1
self.deflt = deflt
self.icon = icon
# HACK: Add a circular reference for non-modal choosers. This prevents the GC
# from collecting the class object the callbacks need. Unfortunately this means
# that the class will never be collected, unless refhack is set to None explicitly.
if (flags & Choose2.CH_MODAL) == 0:
self.refhack = self
def sizer(self):
"""
Callback: sizer - returns the length of the list
"""
return len(self.list)
def getl(self, n):
"""
Callback: getl - get one item from the list
"""
if n == 0:
return self.title
if n <= self.sizer():
return str(self.list[n-1])
else:
return "<Empty>"
def ins(self):
pass
def update(self, n):
pass
def edit(self, n):
pass
def enter(self, n):
print "enter(%d) called" % n
def destroy(self):
pass
def get_icon(self, n):
pass
def choose(self):
"""
choose - Display the choose dialogue
"""
old = set_script_timeout(0)
n = _idaapi.choose_choose(
self,
self.flags,
self.x0,
self.y0,
self.x1,
self.y1,
self.width,
self.deflt,
self.icon)
set_script_timeout(old)
return n
#</pycode(py_choose)>
| nihilus/src | pywraps/py_choose.py | Python | bsd-3-clause | 1,595 | [
30522,
1001,
1026,
1052,
2100,
16044,
1006,
1052,
2100,
1035,
5454,
1007,
1028,
2465,
5454,
1024,
1000,
1000,
1000,
5454,
1011,
2465,
2005,
5454,
1006,
1007,
2007,
2655,
12221,
1000,
1000,
1000,
13366,
1035,
1035,
1999,
4183,
1035,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* linux/drivers/i2c/chips/twl4030-power.c
*
* Handle TWL4030 Power initialization
*
* Copyright (C) 2008 Nokia Corporation
* Copyright (C) 2006 Texas Instruments, Inc
*
* Written by Kalle Jokiniemi
* Peter De Schrijver <peter.de-schrijver@nokia.com>
* Several fixes by Amit Kucheria <amit.kucheria@verdurent.com>
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file "COPYING" in the main directory of this
* archive for more details.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/i2c/twl.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <asm/mach-types.h>
static u8 twl4030_start_script_address = 0x2b;
/* Register bits for P1, P2 and P3_SW_EVENTS */
#define PWR_STOPON_PRWON BIT(6)
#define PWR_STOPON_SYSEN BIT(5)
#define PWR_ENABLE_WARMRESET BIT(4)
#define PWR_LVL_WAKEUP BIT(3)
#define PWR_DEVACT BIT(2)
#define PWR_DEVSLP BIT(1)
#define PWR_DEVOFF BIT(0)
/* Register bits for CFG_P1_TRANSITION (also for P2 and P3) */
#define STARTON_SWBUG BIT(7) /* Start on watchdog */
#define STARTON_VBUS BIT(5) /* Start on VBUS */
#define STARTON_VBAT BIT(4) /* Start on battery insert */
#define STARTON_RTC BIT(3) /* Start on RTC */
#define STARTON_USB BIT(2) /* Start on USB host */
#define STARTON_CHG BIT(1) /* Start on charger */
#define STARTON_PWON BIT(0) /* Start on PWRON button */
#define SEQ_OFFSYNC (1 << 0)
#define PHY_TO_OFF_PM_MASTER(p) (p - 0x36)
#define PHY_TO_OFF_PM_RECEIVER(p) (p - 0x5b)
/* resource - hfclk */
#define R_HFCLKOUT_DEV_GRP PHY_TO_OFF_PM_RECEIVER(0xe6)
/* PM events */
#define R_P1_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x46)
#define R_P2_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x47)
#define R_P3_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x48)
#define R_CFG_P1_TRANSITION PHY_TO_OFF_PM_MASTER(0x36)
#define R_CFG_P2_TRANSITION PHY_TO_OFF_PM_MASTER(0x37)
#define R_CFG_P3_TRANSITION PHY_TO_OFF_PM_MASTER(0x38)
#define END_OF_SCRIPT 0x3f
#define R_SEQ_ADD_A2S PHY_TO_OFF_PM_MASTER(0x55)
#define R_SEQ_ADD_S2A12 PHY_TO_OFF_PM_MASTER(0x56)
#define R_SEQ_ADD_S2A3 PHY_TO_OFF_PM_MASTER(0x57)
#define R_SEQ_ADD_WARM PHY_TO_OFF_PM_MASTER(0x58)
#define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59)
#define R_MEMORY_DATA PHY_TO_OFF_PM_MASTER(0x5a)
/* resource configuration registers
<RESOURCE>_DEV_GRP at address 'n+0'
<RESOURCE>_TYPE at address 'n+1'
<RESOURCE>_REMAP at address 'n+2'
<RESOURCE>_DEDICATED at address 'n+3'
*/
#define DEV_GRP_OFFSET 0
#define TYPE_OFFSET 1
#define REMAP_OFFSET 2
#define DEDICATED_OFFSET 3
/* Bit positions in the registers */
/* <RESOURCE>_DEV_GRP */
#define DEV_GRP_SHIFT 5
#define DEV_GRP_MASK (7 << DEV_GRP_SHIFT)
/* <RESOURCE>_TYPE */
#define TYPE_SHIFT 0
#define TYPE_MASK (7 << TYPE_SHIFT)
#define TYPE2_SHIFT 3
#define TYPE2_MASK (3 << TYPE2_SHIFT)
/* <RESOURCE>_REMAP */
#define SLEEP_STATE_SHIFT 0
#define SLEEP_STATE_MASK (0xf << SLEEP_STATE_SHIFT)
#define OFF_STATE_SHIFT 4
#define OFF_STATE_MASK (0xf << OFF_STATE_SHIFT)
static u8 res_config_addrs[] = {
[RES_VAUX1] = 0x17,
[RES_VAUX2] = 0x1b,
[RES_VAUX3] = 0x1f,
[RES_VAUX4] = 0x23,
[RES_VMMC1] = 0x27,
[RES_VMMC2] = 0x2b,
[RES_VPLL1] = 0x2f,
[RES_VPLL2] = 0x33,
[RES_VSIM] = 0x37,
[RES_VDAC] = 0x3b,
[RES_VINTANA1] = 0x3f,
[RES_VINTANA2] = 0x43,
[RES_VINTDIG] = 0x47,
[RES_VIO] = 0x4b,
[RES_VDD1] = 0x55,
[RES_VDD2] = 0x63,
[RES_VUSB_1V5] = 0x71,
[RES_VUSB_1V8] = 0x74,
[RES_VUSB_3V1] = 0x77,
[RES_VUSBCP] = 0x7a,
[RES_REGEN] = 0x7f,
[RES_NRES_PWRON] = 0x82,
[RES_CLKEN] = 0x85,
[RES_SYSEN] = 0x88,
[RES_HFCLKOUT] = 0x8b,
[RES_32KCLKOUT] = 0x8e,
[RES_RESET] = 0x91,
[RES_MAIN_REF] = 0x94,
};
/*
* Usable values for .remap_sleep and .remap_off
* Based on table "5.3.3 Resource Operating modes"
*/
enum {
TWL_REMAP_OFF = 0,
TWL_REMAP_SLEEP = 8,
TWL_REMAP_ACTIVE = 9,
};
/*
* Macros to configure the PM register states for various resources.
* Note that we can make MSG_SINGULAR etc private to this driver once
* omap3 has been made DT only.
*/
#define TWL_DFLT_DELAY 2 /* typically 2 32 KiHz cycles */
#define TWL_DEV_GRP_P123 (DEV_GRP_P1 | DEV_GRP_P2 | DEV_GRP_P3)
#define TWL_RESOURCE_SET(res, state) \
{ MSG_SINGULAR(DEV_GRP_NULL, (res), (state)), TWL_DFLT_DELAY }
#define TWL_RESOURCE_ON(res) TWL_RESOURCE_SET(res, RES_STATE_ACTIVE)
#define TWL_RESOURCE_OFF(res) TWL_RESOURCE_SET(res, RES_STATE_OFF)
#define TWL_RESOURCE_RESET(res) TWL_RESOURCE_SET(res, RES_STATE_WRST)
/*
* It seems that type1 and type2 is just the resource init order
* number for the type1 and type2 group.
*/
#define TWL_RESOURCE_SET_ACTIVE(res, state) \
{ MSG_SINGULAR(DEV_GRP_NULL, (res), RES_STATE_ACTIVE), (state) }
#define TWL_RESOURCE_GROUP_RESET(group, type1, type2) \
{ MSG_BROADCAST(DEV_GRP_NULL, (group), (type1), (type2), \
RES_STATE_WRST), TWL_DFLT_DELAY }
#define TWL_RESOURCE_GROUP_SLEEP(group, type, type2) \
{ MSG_BROADCAST(DEV_GRP_NULL, (group), (type), (type2), \
RES_STATE_SLEEP), TWL_DFLT_DELAY }
#define TWL_RESOURCE_GROUP_ACTIVE(group, type, type2) \
{ MSG_BROADCAST(DEV_GRP_NULL, (group), (type), (type2), \
RES_STATE_ACTIVE), TWL_DFLT_DELAY }
#define TWL_REMAP_SLEEP(res, devgrp, typ, typ2) \
{ .resource = (res), .devgroup = (devgrp), \
.type = (typ), .type2 = (typ2), \
.remap_off = TWL_REMAP_OFF, \
.remap_sleep = TWL_REMAP_SLEEP, }
#define TWL_REMAP_OFF(res, devgrp, typ, typ2) \
{ .resource = (res), .devgroup = (devgrp), \
.type = (typ), .type2 = (typ2), \
.remap_off = TWL_REMAP_OFF, .remap_sleep = TWL_REMAP_OFF, }
static int twl4030_write_script_byte(u8 address, u8 byte)
{
int err;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, address, R_MEMORY_ADDRESS);
if (err)
goto out;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, byte, R_MEMORY_DATA);
out:
return err;
}
static int twl4030_write_script_ins(u8 address, u16 pmb_message,
u8 delay, u8 next)
{
int err;
address *= 4;
err = twl4030_write_script_byte(address++, pmb_message >> 8);
if (err)
goto out;
err = twl4030_write_script_byte(address++, pmb_message & 0xff);
if (err)
goto out;
err = twl4030_write_script_byte(address++, delay);
if (err)
goto out;
err = twl4030_write_script_byte(address++, next);
out:
return err;
}
static int twl4030_write_script(u8 address, struct twl4030_ins *script,
int len)
{
int err = -EINVAL;
for (; len; len--, address++, script++) {
if (len == 1) {
err = twl4030_write_script_ins(address,
script->pmb_message,
script->delay,
END_OF_SCRIPT);
if (err)
break;
} else {
err = twl4030_write_script_ins(address,
script->pmb_message,
script->delay,
address + 1);
if (err)
break;
}
}
return err;
}
static int twl4030_config_wakeup3_sequence(u8 address)
{
int err;
u8 data;
/* Set SLEEP to ACTIVE SEQ address for P3 */
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, address, R_SEQ_ADD_S2A3);
if (err)
goto out;
/* P3 LVL_WAKEUP should be on LEVEL */
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data, R_P3_SW_EVENTS);
if (err)
goto out;
data |= PWR_LVL_WAKEUP;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P3_SW_EVENTS);
out:
if (err)
pr_err("TWL4030 wakeup sequence for P3 config error\n");
return err;
}
static int twl4030_config_wakeup12_sequence(u8 address)
{
int err = 0;
u8 data;
/* Set SLEEP to ACTIVE SEQ address for P1 and P2 */
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, address, R_SEQ_ADD_S2A12);
if (err)
goto out;
/* P1/P2 LVL_WAKEUP should be on LEVEL */
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data, R_P1_SW_EVENTS);
if (err)
goto out;
data |= PWR_LVL_WAKEUP;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P1_SW_EVENTS);
if (err)
goto out;
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data, R_P2_SW_EVENTS);
if (err)
goto out;
data |= PWR_LVL_WAKEUP;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P2_SW_EVENTS);
if (err)
goto out;
if (machine_is_omap_3430sdp() || machine_is_omap_ldp()) {
/* Disabling AC charger effect on sleep-active transitions */
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data,
R_CFG_P1_TRANSITION);
if (err)
goto out;
data &= ~(1<<1);
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data,
R_CFG_P1_TRANSITION);
if (err)
goto out;
}
out:
if (err)
pr_err("TWL4030 wakeup sequence for P1 and P2" \
"config error\n");
return err;
}
static int twl4030_config_sleep_sequence(u8 address)
{
int err;
/* Set ACTIVE to SLEEP SEQ address in T2 memory*/
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, address, R_SEQ_ADD_A2S);
if (err)
pr_err("TWL4030 sleep sequence config error\n");
return err;
}
static int twl4030_config_warmreset_sequence(u8 address)
{
int err;
u8 rd_data;
/* Set WARM RESET SEQ address for P1 */
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, address, R_SEQ_ADD_WARM);
if (err)
goto out;
/* P1/P2/P3 enable WARMRESET */
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &rd_data, R_P1_SW_EVENTS);
if (err)
goto out;
rd_data |= PWR_ENABLE_WARMRESET;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P1_SW_EVENTS);
if (err)
goto out;
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &rd_data, R_P2_SW_EVENTS);
if (err)
goto out;
rd_data |= PWR_ENABLE_WARMRESET;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P2_SW_EVENTS);
if (err)
goto out;
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &rd_data, R_P3_SW_EVENTS);
if (err)
goto out;
rd_data |= PWR_ENABLE_WARMRESET;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P3_SW_EVENTS);
out:
if (err)
pr_err("TWL4030 warmreset seq config error\n");
return err;
}
static int twl4030_configure_resource(struct twl4030_resconfig *rconfig)
{
int rconfig_addr;
int err;
u8 type;
u8 grp;
u8 remap;
if (rconfig->resource > TOTAL_RESOURCES) {
pr_err("TWL4030 Resource %d does not exist\n",
rconfig->resource);
return -EINVAL;
}
rconfig_addr = res_config_addrs[rconfig->resource];
/* Set resource group */
err = twl_i2c_read_u8(TWL_MODULE_PM_RECEIVER, &grp,
rconfig_addr + DEV_GRP_OFFSET);
if (err) {
pr_err("TWL4030 Resource %d group could not be read\n",
rconfig->resource);
return err;
}
if (rconfig->devgroup != TWL4030_RESCONFIG_UNDEF) {
grp &= ~DEV_GRP_MASK;
grp |= rconfig->devgroup << DEV_GRP_SHIFT;
err = twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER,
grp, rconfig_addr + DEV_GRP_OFFSET);
if (err < 0) {
pr_err("TWL4030 failed to program devgroup\n");
return err;
}
}
/* Set resource types */
err = twl_i2c_read_u8(TWL_MODULE_PM_RECEIVER, &type,
rconfig_addr + TYPE_OFFSET);
if (err < 0) {
pr_err("TWL4030 Resource %d type could not be read\n",
rconfig->resource);
return err;
}
if (rconfig->type != TWL4030_RESCONFIG_UNDEF) {
type &= ~TYPE_MASK;
type |= rconfig->type << TYPE_SHIFT;
}
if (rconfig->type2 != TWL4030_RESCONFIG_UNDEF) {
type &= ~TYPE2_MASK;
type |= rconfig->type2 << TYPE2_SHIFT;
}
err = twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER,
type, rconfig_addr + TYPE_OFFSET);
if (err < 0) {
pr_err("TWL4030 failed to program resource type\n");
return err;
}
/* Set remap states */
err = twl_i2c_read_u8(TWL_MODULE_PM_RECEIVER, &remap,
rconfig_addr + REMAP_OFFSET);
if (err < 0) {
pr_err("TWL4030 Resource %d remap could not be read\n",
rconfig->resource);
return err;
}
if (rconfig->remap_off != TWL4030_RESCONFIG_UNDEF) {
remap &= ~OFF_STATE_MASK;
remap |= rconfig->remap_off << OFF_STATE_SHIFT;
}
if (rconfig->remap_sleep != TWL4030_RESCONFIG_UNDEF) {
remap &= ~SLEEP_STATE_MASK;
remap |= rconfig->remap_sleep << SLEEP_STATE_SHIFT;
}
err = twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER,
remap,
rconfig_addr + REMAP_OFFSET);
if (err < 0) {
pr_err("TWL4030 failed to program remap\n");
return err;
}
return 0;
}
static int load_twl4030_script(struct twl4030_script *tscript,
u8 address)
{
int err;
static int order;
/* Make sure the script isn't going beyond last valid address (0x3f) */
if ((address + tscript->size) > END_OF_SCRIPT) {
pr_err("TWL4030 scripts too big error\n");
return -EINVAL;
}
err = twl4030_write_script(address, tscript->script, tscript->size);
if (err)
goto out;
if (tscript->flags & TWL4030_WRST_SCRIPT) {
err = twl4030_config_warmreset_sequence(address);
if (err)
goto out;
}
if (tscript->flags & TWL4030_WAKEUP12_SCRIPT) {
/* Reset any existing sleep script to avoid hangs on reboot */
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
R_SEQ_ADD_A2S);
if (err)
goto out;
err = twl4030_config_wakeup12_sequence(address);
if (err)
goto out;
order = 1;
}
if (tscript->flags & TWL4030_WAKEUP3_SCRIPT) {
err = twl4030_config_wakeup3_sequence(address);
if (err)
goto out;
}
if (tscript->flags & TWL4030_SLEEP_SCRIPT) {
if (!order)
pr_warning("TWL4030: Bad order of scripts (sleep "\
"script before wakeup) Leads to boot"\
"failure on some boards\n");
err = twl4030_config_sleep_sequence(address);
}
out:
return err;
}
int twl4030_remove_script(u8 flags)
{
int err = 0;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err) {
pr_err("twl4030: unable to unlock PROTECT_KEY\n");
return err;
}
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG2,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err) {
pr_err("twl4030: unable to unlock PROTECT_KEY\n");
return err;
}
if (flags & TWL4030_WRST_SCRIPT) {
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
R_SEQ_ADD_WARM);
if (err)
return err;
}
if (flags & TWL4030_WAKEUP12_SCRIPT) {
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
R_SEQ_ADD_S2A12);
if (err)
return err;
}
if (flags & TWL4030_WAKEUP3_SCRIPT) {
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
R_SEQ_ADD_S2A3);
if (err)
return err;
}
if (flags & TWL4030_SLEEP_SCRIPT) {
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
R_SEQ_ADD_A2S);
if (err)
return err;
}
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err)
pr_err("TWL4030 Unable to relock registers\n");
return err;
}
static int
twl4030_power_configure_scripts(const struct twl4030_power_data *pdata)
{
int err;
int i;
u8 address = twl4030_start_script_address;
for (i = 0; i < pdata->num; i++) {
err = load_twl4030_script(pdata->scripts[i], address);
if (err)
return err;
address += pdata->scripts[i]->size;
}
return 0;
}
static void twl4030_patch_rconfig(struct twl4030_resconfig *common,
struct twl4030_resconfig *board)
{
while (common->resource) {
struct twl4030_resconfig *b = board;
while (b->resource) {
if (b->resource == common->resource) {
*common = *b;
break;
}
b++;
}
common++;
}
}
static int
twl4030_power_configure_resources(const struct twl4030_power_data *pdata)
{
struct twl4030_resconfig *resconfig = pdata->resource_config;
struct twl4030_resconfig *boardconf = pdata->board_config;
int err;
if (resconfig) {
if (boardconf)
twl4030_patch_rconfig(resconfig, boardconf);
while (resconfig->resource) {
err = twl4030_configure_resource(resconfig);
if (err)
return err;
resconfig++;
}
}
return 0;
}
static int twl4030_starton_mask_and_set(u8 bitmask, u8 bitvalues)
{
u8 regs[3] = { TWL4030_PM_MASTER_CFG_P1_TRANSITION,
TWL4030_PM_MASTER_CFG_P2_TRANSITION,
TWL4030_PM_MASTER_CFG_P3_TRANSITION, };
u8 val;
int i, err;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err)
goto relock;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
TWL4030_PM_MASTER_KEY_CFG2,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err)
goto relock;
for (i = 0; i < sizeof(regs); i++) {
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER,
&val, regs[i]);
if (err)
break;
val = (~bitmask & val) | (bitmask & bitvalues);
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
val, regs[i]);
if (err)
break;
}
if (err)
pr_err("TWL4030 Register access failed: %i\n", err);
relock:
return twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0,
TWL4030_PM_MASTER_PROTECT_KEY);
}
/*
* In master mode, start the power off sequence.
* After a successful execution, TWL shuts down the power to the SoC
* and all peripherals connected to it.
*/
void twl4030_power_off(void)
{
int err;
/* Disable start on charger or VBUS as it can break poweroff */
err = twl4030_starton_mask_and_set(STARTON_VBUS | STARTON_CHG, 0);
if (err)
pr_err("TWL4030 Unable to configure start-up\n");
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, PWR_DEVOFF,
TWL4030_PM_MASTER_P1_SW_EVENTS);
if (err)
pr_err("TWL4030 Unable to power off\n");
}
static bool twl4030_power_use_poweroff(const struct twl4030_power_data *pdata,
struct device_node *node)
{
if (pdata && pdata->use_poweroff)
return true;
if (of_property_read_bool(node, "ti,system-power-controller"))
return true;
if (of_property_read_bool(node, "ti,use_poweroff"))
return true;
return false;
}
#ifdef CONFIG_OF
/* Generic warm reset configuration for omap3 */
static struct twl4030_ins omap3_wrst_seq[] = {
TWL_RESOURCE_OFF(RES_NRES_PWRON),
TWL_RESOURCE_OFF(RES_RESET),
TWL_RESOURCE_RESET(RES_MAIN_REF),
TWL_RESOURCE_GROUP_RESET(RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R2),
TWL_RESOURCE_RESET(RES_VUSB_3V1),
TWL_RESOURCE_GROUP_RESET(RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R1),
TWL_RESOURCE_GROUP_RESET(RES_GRP_RC, RES_TYPE_ALL, RES_TYPE2_R0),
TWL_RESOURCE_ON(RES_RESET),
TWL_RESOURCE_ON(RES_NRES_PWRON),
};
static struct twl4030_script omap3_wrst_script = {
.script = omap3_wrst_seq,
.size = ARRAY_SIZE(omap3_wrst_seq),
.flags = TWL4030_WRST_SCRIPT,
};
static struct twl4030_script *omap3_reset_scripts[] = {
&omap3_wrst_script,
};
static struct twl4030_resconfig omap3_rconfig[] = {
TWL_REMAP_SLEEP(RES_HFCLKOUT, DEV_GRP_P3, -1, -1),
TWL_REMAP_SLEEP(RES_VDD1, DEV_GRP_P1, -1, -1),
TWL_REMAP_SLEEP(RES_VDD2, DEV_GRP_P1, -1, -1),
{ 0, 0 },
};
static struct twl4030_power_data omap3_reset = {
.scripts = omap3_reset_scripts,
.num = ARRAY_SIZE(omap3_reset_scripts),
.resource_config = omap3_rconfig,
};
/* Recommended generic default idle configuration for off-idle */
/* Broadcast message to put res to sleep */
static struct twl4030_ins omap3_idle_sleep_on_seq[] = {
TWL_RESOURCE_GROUP_SLEEP(RES_GRP_ALL, RES_TYPE_ALL, 0),
};
static struct twl4030_script omap3_idle_sleep_on_script = {
.script = omap3_idle_sleep_on_seq,
.size = ARRAY_SIZE(omap3_idle_sleep_on_seq),
.flags = TWL4030_SLEEP_SCRIPT,
};
/* Broadcast message to put res to active */
static struct twl4030_ins omap3_idle_wakeup_p12_seq[] = {
TWL_RESOURCE_GROUP_ACTIVE(RES_GRP_ALL, RES_TYPE_ALL, 0),
};
static struct twl4030_script omap3_idle_wakeup_p12_script = {
.script = omap3_idle_wakeup_p12_seq,
.size = ARRAY_SIZE(omap3_idle_wakeup_p12_seq),
.flags = TWL4030_WAKEUP12_SCRIPT,
};
/* Broadcast message to put res to active */
static struct twl4030_ins omap3_idle_wakeup_p3_seq[] = {
TWL_RESOURCE_SET_ACTIVE(RES_CLKEN, 0x37),
TWL_RESOURCE_GROUP_ACTIVE(RES_GRP_ALL, RES_TYPE_ALL, 0),
};
static struct twl4030_script omap3_idle_wakeup_p3_script = {
.script = omap3_idle_wakeup_p3_seq,
.size = ARRAY_SIZE(omap3_idle_wakeup_p3_seq),
.flags = TWL4030_WAKEUP3_SCRIPT,
};
static struct twl4030_script *omap3_idle_scripts[] = {
&omap3_idle_wakeup_p12_script,
&omap3_idle_wakeup_p3_script,
&omap3_wrst_script,
&omap3_idle_sleep_on_script,
};
/*
* Recommended configuration based on "Recommended Sleep
* Sequences for the Zoom Platform":
* http://omappedia.com/wiki/File:Recommended_Sleep_Sequences_Zoom.pdf
* Note that the type1 and type2 seem to be just the init order number
* for type1 and type2 groups as specified in the document mentioned
* above.
*/
static struct twl4030_resconfig omap3_idle_rconfig[] = {
TWL_REMAP_SLEEP(RES_VAUX1, TWL4030_RESCONFIG_UNDEF, 0, 0),
TWL_REMAP_SLEEP(RES_VAUX2, TWL4030_RESCONFIG_UNDEF, 0, 0),
TWL_REMAP_SLEEP(RES_VAUX3, TWL4030_RESCONFIG_UNDEF, 0, 0),
TWL_REMAP_SLEEP(RES_VAUX4, TWL4030_RESCONFIG_UNDEF, 0, 0),
TWL_REMAP_SLEEP(RES_VMMC1, TWL4030_RESCONFIG_UNDEF, 0, 0),
TWL_REMAP_SLEEP(RES_VMMC2, TWL4030_RESCONFIG_UNDEF, 0, 0),
TWL_REMAP_OFF(RES_VPLL1, DEV_GRP_P1, 3, 1),
TWL_REMAP_SLEEP(RES_VPLL2, DEV_GRP_P1, 0, 0),
TWL_REMAP_SLEEP(RES_VSIM, TWL4030_RESCONFIG_UNDEF, 0, 0),
TWL_REMAP_SLEEP(RES_VDAC, TWL4030_RESCONFIG_UNDEF, 0, 0),
TWL_REMAP_SLEEP(RES_VINTANA1, TWL_DEV_GRP_P123, 1, 2),
TWL_REMAP_SLEEP(RES_VINTANA2, TWL_DEV_GRP_P123, 0, 2),
TWL_REMAP_SLEEP(RES_VINTDIG, TWL_DEV_GRP_P123, 1, 2),
TWL_REMAP_SLEEP(RES_VIO, TWL_DEV_GRP_P123, 2, 2),
TWL_REMAP_OFF(RES_VDD1, DEV_GRP_P1, 4, 1),
TWL_REMAP_OFF(RES_VDD2, DEV_GRP_P1, 3, 1),
TWL_REMAP_SLEEP(RES_VUSB_1V5, TWL4030_RESCONFIG_UNDEF, 0, 0),
TWL_REMAP_SLEEP(RES_VUSB_1V8, TWL4030_RESCONFIG_UNDEF, 0, 0),
TWL_REMAP_SLEEP(RES_VUSB_3V1, TWL_DEV_GRP_P123, 0, 0),
/* Resource #20 USB charge pump skipped */
TWL_REMAP_SLEEP(RES_REGEN, TWL_DEV_GRP_P123, 2, 1),
TWL_REMAP_SLEEP(RES_NRES_PWRON, TWL_DEV_GRP_P123, 0, 1),
TWL_REMAP_SLEEP(RES_CLKEN, TWL_DEV_GRP_P123, 3, 2),
TWL_REMAP_SLEEP(RES_SYSEN, TWL_DEV_GRP_P123, 6, 1),
TWL_REMAP_SLEEP(RES_HFCLKOUT, DEV_GRP_P3, 0, 2),
TWL_REMAP_SLEEP(RES_32KCLKOUT, TWL_DEV_GRP_P123, 0, 0),
TWL_REMAP_SLEEP(RES_RESET, TWL_DEV_GRP_P123, 6, 0),
TWL_REMAP_SLEEP(RES_MAIN_REF, TWL_DEV_GRP_P123, 0, 0),
{ /* Terminator */ },
};
static struct twl4030_power_data omap3_idle = {
.scripts = omap3_idle_scripts,
.num = ARRAY_SIZE(omap3_idle_scripts),
.resource_config = omap3_idle_rconfig,
};
/* Disable 32 KiHz oscillator during idle */
static struct twl4030_resconfig osc_off_rconfig[] = {
TWL_REMAP_OFF(RES_CLKEN, DEV_GRP_P1 | DEV_GRP_P3, 3, 2),
{ /* Terminator */ },
};
static struct twl4030_power_data osc_off_idle = {
.scripts = omap3_idle_scripts,
.num = ARRAY_SIZE(omap3_idle_scripts),
.resource_config = omap3_idle_rconfig,
.board_config = osc_off_rconfig,
};
static struct of_device_id twl4030_power_of_match[] = {
{
.compatible = "ti,twl4030-power",
},
{
.compatible = "ti,twl4030-power-reset",
.data = &omap3_reset,
},
{
.compatible = "ti,twl4030-power-idle",
.data = &omap3_idle,
},
{
.compatible = "ti,twl4030-power-idle-osc-off",
.data = &osc_off_idle,
},
{ },
};
MODULE_DEVICE_TABLE(of, twl4030_power_of_match);
#endif /* CONFIG_OF */
static int twl4030_power_probe(struct platform_device *pdev)
{
const struct twl4030_power_data *pdata = dev_get_platdata(&pdev->dev);
struct device_node *node = pdev->dev.of_node;
const struct of_device_id *match;
int err = 0;
int err2 = 0;
u8 val;
if (!pdata && !node) {
dev_err(&pdev->dev, "Platform data is missing\n");
return -EINVAL;
}
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1,
TWL4030_PM_MASTER_PROTECT_KEY);
err |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER,
TWL4030_PM_MASTER_KEY_CFG2,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err) {
pr_err("TWL4030 Unable to unlock registers\n");
return err;
}
match = of_match_device(of_match_ptr(twl4030_power_of_match),
&pdev->dev);
if (match && match->data)
pdata = match->data;
if (pdata) {
err = twl4030_power_configure_scripts(pdata);
if (err) {
pr_err("TWL4030 failed to load scripts\n");
goto relock;
}
err = twl4030_power_configure_resources(pdata);
if (err) {
pr_err("TWL4030 failed to configure resource\n");
goto relock;
}
}
/* Board has to be wired properly to use this feature */
if (twl4030_power_use_poweroff(pdata, node) && !pm_power_off) {
/* Default for SEQ_OFFSYNC is set, lets ensure this */
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val,
TWL4030_PM_MASTER_CFG_P123_TRANSITION);
if (err) {
pr_warning("TWL4030 Unable to read registers\n");
} else if (!(val & SEQ_OFFSYNC)) {
val |= SEQ_OFFSYNC;
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, val,
TWL4030_PM_MASTER_CFG_P123_TRANSITION);
if (err) {
pr_err("TWL4030 Unable to setup SEQ_OFFSYNC\n");
goto relock;
}
}
pm_power_off = twl4030_power_off;
}
relock:
err2 = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err2) {
pr_err("TWL4030 Unable to relock registers\n");
return err2;
}
return err;
}
static int twl4030_power_remove(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver twl4030_power_driver = {
.driver = {
.name = "twl4030_power",
.of_match_table = of_match_ptr(twl4030_power_of_match),
},
.probe = twl4030_power_probe,
.remove = twl4030_power_remove,
};
module_platform_driver(twl4030_power_driver);
MODULE_AUTHOR("Nokia Corporation");
MODULE_AUTHOR("Texas Instruments, Inc.");
MODULE_DESCRIPTION("Power management for TWL4030");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:twl4030_power");
| systemdaemon/systemd | src/linux/drivers/mfd/twl4030-power.c | C | gpl-2.0 | 25,688 | [
30522,
1013,
1008,
1008,
11603,
1013,
6853,
1013,
1045,
2475,
2278,
1013,
11772,
1013,
1056,
13668,
30524,
3988,
3989,
1008,
1008,
9385,
1006,
1039,
1007,
2263,
22098,
3840,
1008,
9385,
1006,
1039,
1007,
2294,
3146,
5693,
1010,
4297,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#icon
this is icons
| atsumo/design | icon/README.md | Markdown | mit | 21 | [
30522,
1001,
12696,
2023,
2003,
18407,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {BaseHarnessFilters} from '@angular/cdk/testing';
/** A set of criteria that can be used to filter a list of `MatMenuHarness` instances. */
export interface MenuHarnessFilters extends BaseHarnessFilters {
/** Only find instances whose trigger text matches the given value. */
triggerText?: string | RegExp;
}
/** A set of criteria that can be used to filter a list of `MatMenuItemHarness` instances. */
export interface MenuItemHarnessFilters extends BaseHarnessFilters {
/** Only find instances whose text matches the given value. */
text?: string | RegExp;
/** Only find instances that have a sub-menu. */
hasSubmenu?: boolean;
}
| josephperrott/material2 | src/material/menu/testing/menu-harness-filters.ts | TypeScript | mit | 856 | [
30522,
1013,
1008,
1008,
1008,
1030,
6105,
1008,
9385,
8224,
11775,
2035,
2916,
9235,
1012,
1008,
1008,
2224,
1997,
2023,
3120,
3642,
2003,
9950,
2011,
2019,
10210,
1011,
2806,
6105,
2008,
2064,
2022,
1008,
2179,
1999,
1996,
6105,
5371,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Menu\Node;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\Menu\Node;
/**
* A Component type of node for MenuTree
*
* @see Node
*
* @since 3.8.0
*/
class Component extends Node
{
/**
* Node Title
*
* @var string
*
* @since 3.8.0
*/
protected $title = null;
/**
* The component name for this node link
*
* @var string
*
* @since 3.8.0
*/
protected $element = null;
/**
* Node Link
*
* @var string
*
* @since 3.8.0
*/
protected $link = null;
/**
* Link Target
*
* @var string
*
* @since 3.8.0
*/
protected $target = null;
/**
* Link title icon
*
* @var string
*
* @since 3.8.0
*/
protected $icon = null;
/**
* Constructor for the class.
*
* @param string $title The title of the node
* @param string $element The component name
* @param string $link The node link
* @param string $target The link target
* @param string $class The CSS class for the node
* @param string $id The node id
* @param string $icon The title icon for the node
*
* @since 3.8.0
*/
public function __construct($title, $element, $link, $target = null, $class = null, $id = null, $icon = null)
{
$this->title = $title;
$this->element = $element;
$this->link = $link ? OutputFilter::ampReplace($link) : 'index.php?option=' . $element;
$this->target = $target;
$this->class = $class;
$this->id = $id;
$this->icon = $icon;
parent::__construct();
}
/**
* Get an attribute value
*
* @param string $name The attribute name
*
* @return mixed
*
* @since 3.8.0
*/
public function get($name)
{
switch ($name)
{
case 'title':
case 'element':
case 'link':
case 'target':
case 'icon':
return $this->$name;
}
return parent::get($name);
}
}
| joomla-projects/media-manager-improvement | libraries/src/Menu/Node/Component.php | PHP | gpl-2.0 | 2,140 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
28576,
19968,
2050,
999,
4180,
2968,
2291,
1008,
1008,
1030,
9385,
9385,
1006,
1039,
1007,
2384,
1011,
2760,
2330,
3120,
5609,
1010,
4297,
1012,
2035,
2916,
9235,
1012,
1008,
1030,
6105,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (c) 2016 Christian Micocci. This file is part of Concerto.
*
* Concerto 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.
*
* Concerto 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 Concerto. If not, see <http://www.gnu.org/licenses/>.
*/
package com.n_micocci.concerto.filters;
import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.MidiMessage;
import javax.sound.midi.ShortMessage;
public class FilterVelocity extends AbstractMidiFilter {
private int velocity;
public FilterVelocity(int velocity) {
this.velocity = velocity;
}
@Override
public void send(MidiMessage midiMessage, long l) {
int status = midiMessage.getStatus();
if (status / 16 == 0x8 || status / 16 == 0x9) {
byte[] message = midiMessage.getMessage();
int note = message[1];
try {
midiMessage = new ShortMessage(status, note, message[2] != 0 ? velocity : 0);
} catch (InvalidMidiDataException e) {
e.printStackTrace();
}
}
getReceiver().send(midiMessage, l);
}
}
| iksoiks/concerto-framework-core | src/com/n_micocci/concerto/filters/FilterVelocity.java | Java | gpl-3.0 | 1,590 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2355,
3017,
23025,
10085,
6895,
1012,
2023,
5371,
2003,
2112,
1997,
10405,
1012,
1008,
1008,
10405,
2003,
2489,
4007,
1024,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#ifndef __LUALAYER
#define __LUALAYER
#include "LuaCpp.h"
#ifdef __cplusplus
extern "C" {
#endif
int luaLayer(lua_State *L);
#ifdef __cplusplus
}
#endif
#endif | GraphicGame/quick-ejoy2d | quick/engine_lua_interface/LuaLayer.h | C | mit | 163 | [
30522,
1001,
2065,
13629,
2546,
1035,
1035,
11320,
7911,
10532,
1001,
9375,
1035,
1035,
11320,
7911,
10532,
1001,
2421,
1000,
11320,
6305,
9397,
1012,
1044,
1000,
1001,
2065,
3207,
2546,
1035,
1035,
18133,
7393,
24759,
2271,
4654,
16451,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>V8 API Reference Guide for node.js v7.0.0 - v7.1.0: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v7.0.0 - v7.1.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><b>experimental</b></li><li class="navelem"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">FastAccessorBuilder</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">v8::experimental::FastAccessorBuilder Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Call</b>(v8::FunctionCallback callback, ValueId value_id) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>CheckFlagSetOrReturnNull</b>(ValueId value_id, int mask) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>CheckNotZeroOrJump</b>(ValueId value_id, LabelId label_id) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>CheckNotZeroOrReturnNull</b>(ValueId value_id) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetReceiver</b>() (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Goto</b>(LabelId label_id) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>IntegerConstant</b>(int int_constant) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>LoadInternalField</b>(ValueId value_id, int field_no) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>LoadInternalFieldUnchecked</b>(ValueId value_id, int field_no) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>LoadObject</b>(ValueId value_id, int offset) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>LoadValue</b>(ValueId value_id, int offset) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>MakeLabel</b>() (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>New</b>(Isolate *isolate) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ReturnValue</b>(ValueId value_id) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SetLabel</b>(LabelId label_id) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToSmi</b>(ValueId value_id) (defined in <a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a>)</td><td class="entry"><a class="el" href="classv8_1_1experimental_1_1FastAccessorBuilder.html">v8::experimental::FastAccessorBuilder</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
| v8-dox/v8-dox.github.io | 6bbdd66/html/classv8_1_1experimental_1_1FastAccessorBuilder-members.html | HTML | mit | 10,825 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
1060,
11039,
19968,
1015,
1012,
1014,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
.hover:hover
{
cursor: pointer;
}
.date,
.module
{
white-space: nowrap;
}
.clear-input {
font-weight: bolder;
border: 1px solid #CCC;
background: #DDD;
z-index: 1;
top: 16px;
right: 13px;
display: block;
width: 18px;
height: 18px;
position: absolute;
border-radius: 50%;
padding: 0px 5px;
color: white;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
font-size: 12px;
line-height: 15px;
}
.clear-input:hover {
background: #CCC;
}
.clear-input:active {
background: #AAA;
}
td
{
position: relative;
}
.inspector .inspector
{
padding: 0px 20px;
}
.value
{
color: blue;
}
.key
{
position: relative;
color: red;
}
.key:before
{
display: block;
content: "";
width: 10px;
height: 10px;
position: absolute;
top: 18px;
left: 7px;
border-bottom: 1px solid black;
border-left: 1px solid black;
}
.key.array:before
{
width: 30px;
}
.key-type
{
margin: 0px 5px;
color: green;
font-size: 9px;
}
.value-type
{
margin: 0px 5px;
color: gray;
font-size: 10px;
}
| megatolya/loggy | lib/server/public/css/app.css | CSS | mit | 1,144 | [
30522,
1012,
25215,
2099,
1024,
25215,
2099,
1063,
12731,
25301,
2099,
1024,
20884,
1025,
1065,
1012,
3058,
1010,
1012,
11336,
30524,
2094,
1025,
1062,
1011,
5950,
1024,
1015,
1025,
2327,
1024,
2385,
2361,
2595,
1025,
2157,
1024,
2410,
2361... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.sling.maven.slingstart.run;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import org.apache.commons.io.IOUtils;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
/**
* Stops the running launchpad instances.
*
*/
@Mojo(
name = "stop",
defaultPhase = LifecyclePhase.POST_INTEGRATION_TEST,
threadSafe = true
)
public class StopMojo extends StartMojo {
@Override
public void execute() throws MojoExecutionException {
if (this.skipLaunchpad) {
this.getLog().info("Executing of the stop-multiple launchpad mojo is disabled by configuration.");
return;
}
// read configurations
final Properties launchpadConfigProps = new Properties();
Reader reader = null;
try {
reader = new FileReader(this.systemPropertiesFile);
launchpadConfigProps.load(reader);
} catch ( final IOException ioe) {
throw new MojoExecutionException("Unable to read launchpad runner configuration properties.", ioe);
} finally {
IOUtils.closeQuietly(reader);
}
final int instances = Integer.valueOf(launchpadConfigProps.getProperty("launchpad.instances"));
final List<ProcessDescription> configurations = new ArrayList<ProcessDescription>();
for(int i=1;i<=instances;i++) {
final String id = launchpadConfigProps.getProperty("launchpad.instance.id." + String.valueOf(i));
final ProcessDescription config = ProcessDescriptionProvider.getInstance().getRunConfiguration(id);
if ( config == null ) {
getLog().warn("No launchpad configuration found for instance " + id);
} else {
configurations.add(config);
}
}
if (configurations.size() > 0) {
getLog().info(new StringBuilder("Stopping ").append(configurations.size()).append(" Launchpad instances").toString());
for (final ProcessDescription cfg : configurations) {
try {
LauncherCallable.stop(this.getLog(), cfg);
ProcessDescriptionProvider.getInstance().removeRunConfiguration(cfg.getId());
} catch (Exception e) {
throw new MojoExecutionException("Could not stop launchpad " + cfg.getId(), e);
}
}
} else {
getLog().warn("No stored configuration file was found at " + this.systemPropertiesFile + " - no Launchapd will be stopped");
}
}
}
| dulvac/sling | tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/StopMojo.java | Java | apache-2.0 | 3,583 | [
30522,
1013,
1008,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
2030,
2062,
1008,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
1008,
2023,
2147,
2005,
3176,
2592,
4953,
9385,
6095,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.pahlsoft.ws.iaas.provision.deploy.behaviors;
import org.apache.log4j.Logger;
import com.pahlsoft.ws.iaas.provision.generated.InstructionType;
import com.pahlsoft.ws.iaas.provision.generated.ProvisionProperties;
import com.pahlsoft.ws.iaas.provision.generated.ProvisionResponse;
import com.pahlsoft.ws.iaas.utilities.PropertyParser;
public class JbossDeployBehavior implements DeployBehavior {
public Logger LOG = Logger.getLogger(JbossDeployBehavior.class);
public ProvisionResponse pr = new ProvisionResponse();
public ProvisionResponse deploy(String hostname, ProvisionProperties props) {
LOG.info("Deploying JBOSS :" + hostname);
PropertyParser.listProps(props);
pr.setHostname(hostname);
pr.setProperties(props);
pr.setInstruction(InstructionType.DEPLOY);
pr.setStatus(true);
return pr;
}
public ProvisionResponse redeploy(String hostname, ProvisionProperties props) {
LOG.info("Redeploying JBOSS :" + hostname);
PropertyParser.listProps(props);
pr.setHostname(hostname);
pr.setProperties(props);
pr.setInstruction(InstructionType.REDEPLOY);
pr.setStatus(true);
return pr;
}
public ProvisionResponse clean(String hostname, ProvisionProperties props) {
LOG.info("Cleaning JBOSS :" + hostname);
PropertyParser.listProps(props);
pr.setHostname(hostname);
pr.setProperties(props);
pr.setInstruction(InstructionType.CLEAN);
pr.setStatus(true);
return pr;
}
public ProvisionResponse backup(String hostname, ProvisionProperties props) {
LOG.info("Backing Up JBOSS :" + hostname);
PropertyParser.listProps(props);
pr.setHostname(hostname);
pr.setProperties(props);
pr.setInstruction(InstructionType.BACKUP);
pr.setStatus(true);
return pr;
}
public ProvisionResponse configure(String hostname, ProvisionProperties props) {
LOG.info("Configuring JBOSS :" + hostname);
PropertyParser.listProps(props);
pr.setHostname(hostname);
pr.setProperties(props);
pr.setInstruction(InstructionType.CONFIGURE);
pr.setStatus(true);
return pr;
}
public ProvisionResponse install(String hostname, ProvisionProperties props) {
LOG.info("Installing JBOSS :" + hostname);
PropertyParser.listProps(props);
pr.setHostname(hostname);
pr.setProperties(props);
pr.setInstruction(InstructionType.INSTALL);
pr.setStatus(true);
return pr;
}
}
| ajpahl1008/iaas | iaas-provision-service/src/main/java/com/pahlsoft/ws/iaas/provision/behaviors/deploy/JbossDeployBehavior.java | Java | lgpl-3.0 | 2,342 | [
30522,
7427,
4012,
1012,
6643,
7317,
6499,
6199,
1012,
1059,
2015,
1012,
24264,
3022,
1012,
9347,
1012,
21296,
1012,
15592,
1025,
12324,
8917,
1012,
15895,
1012,
8833,
2549,
3501,
1012,
8833,
4590,
1025,
12324,
4012,
1012,
6643,
7317,
6499,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<title _locid="PortabilityAnalysis0">.NET Portability Report</title>
<style>
/* Body style, for the entire document */
body {
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1 {
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2 {
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3 {
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
h4 {
font-weight: normal;
font-size: 12pt;
margin: 0;
padding: 0 0 0 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a {
color: #1382CE;
}
/* Paragraph text (for longer informational messages) */
p {
font-size: 10pt;
}
/* Table styles */
table {
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th {
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td {
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
.NoBreakingChanges {
color: darkgreen;
font-weight:bold;
}
.FewBreakingChanges {
color: orange;
font-weight:bold;
}
.ManyBreakingChanges {
color: red;
font-weight:bold;
}
.BreakDetails {
margin-left: 30px;
}
.CompatMessage {
font-style: italic;
font-size: 10pt;
}
.GoodMessage {
color: darkgreen;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink {
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover {
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered {
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell {
width: 100%;
}
/* Padding around the content after the h1 */
#content {
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table {
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table {
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded {
min-width: 18px;
min-height: 18px;
background-repeat: no-repeat;
background-position: center;
}
/* Success icon encoded */
.IconSuccessEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==);
}
/* Information icon encoded */
.IconInfoEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
}
/* Warning icon encoded */
.IconWarningEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
}
/* Error icon encoded */
.IconErrorEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
}
</style>
</head>
<body>
<h1 _locid="PortabilityReport">.NET Portability Report</h1>
<div id="content">
<div id="submissionId" style="font-size:8pt;">
<p>
<i>
Submission Id
2dfb379f-a496-4451-a136-896faf7668f2
</i>
</p>
</div>
<h2 _locid="SummaryTitle">
<a name="Portability Summary"></a>Portability Summary
</h2>
<div id="summary">
<table>
<tbody>
<tr>
<th>Assembly</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
</tr>
<tr>
<td><strong><a href="#FlitBit.IoC">FlitBit.IoC</a></strong></td>
<td class="text-center">94.84 %</td>
<td class="text-center">92.08 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">92.08 %</td>
</tr>
</tbody>
</table>
</div>
<div id="details">
<a name="FlitBit.IoC"><h3>FlitBit.IoC</h3></a>
<table>
<tbody>
<tr>
<th>Target type</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
<th>Recommended changes</th>
</tr>
<tr>
<td>System.ApplicationException</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use other exception types.</td>
</tr>
<tr>
<td style="padding-left:2em">#ctor</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use other exception types.</td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use other exception types.</td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use other exception types.</td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String,System.Exception)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use other exception types.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Delegate</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Reflection.RuntimeReflectionExtensions.GetMethodInfo</td>
</tr>
<tr>
<td style="padding-left:2em">get_Method</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Reflection.RuntimeReflectionExtensions.GetMethodInfo</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Exception</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove usage.</td>
</tr>
<tr>
<td style="padding-left:2em">add_SerializeObjectState(System.EventHandler{System.Runtime.Serialization.SafeSerializationEventArgs})</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove usage.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.ICloneable</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove usage. Implement cloning operation yourself if needed.</td>
</tr>
<tr>
<td style="padding-left:2em">Clone</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove usage. Implement cloning operation yourself if needed.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Binder</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use an overload that does not take a Binder.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.BindingFlags</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.ILGenerator</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">DeclareLocal(System.Type)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">DefineLabel</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">MarkLabel(System.Reflection.Emit.Label)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">ThrowException(System.Type)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.Label</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.LocalBuilder</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.ModuleBuilder</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.MemberInfo</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">IsDefined(System.Type,System.Boolean)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Module</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetType(System.String,System.Boolean,System.Boolean)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.ParameterModifier</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use an overload that does not take a ParameterModifier array.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.PropertyInfo</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use PropertyInfo.SetMethod property</td>
</tr>
<tr>
<td style="padding-left:2em">GetGetMethod</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use PropertyInfo.GetMethod property</td>
</tr>
<tr>
<td style="padding-left:2em">GetSetMethod</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use PropertyInfo.SetMethod property</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.TypeFilter</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Object,System.IntPtr)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Runtime.ConstrainedExecution.Cer</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Runtime.ConstrainedExecution.Consistency</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Runtime.ConstrainedExecution.ReliabilityContractAttribute</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove usage</td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Runtime.ConstrainedExecution.Consistency,System.Runtime.ConstrainedExecution.Cer)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove usage</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Runtime.Remoting.Messaging.CallContext</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Consider using System.Threading.AsyncLocal<T></td>
</tr>
<tr>
<td style="padding-left:2em">LogicalGetData(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">LogicalSetData(System.String,System.Object)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Runtime.Serialization.ISafeSerializationData</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>either 1) Delete Serialization info from exceptions (since this can't be remoted) or 2) Use a different serialization technology if not for exceptions.</td>
</tr>
<tr>
<td style="padding-left:2em">CompleteDeserialization(System.Object)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>either 1) Delete Serialization info from exceptions (since this can't be remoted) or 2) Use a different serialization technology if not for exceptions.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Runtime.Serialization.SafeSerializationEventArgs</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>either 1) Delete Serialization info from exceptions (since this can't be remoted) or 2) Use a different serialization technology if not for exceptions.</td>
</tr>
<tr>
<td style="padding-left:2em">AddSerializedState(System.Runtime.Serialization.ISafeSerializationData)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>either 1) Delete Serialization info from exceptions (since this can't be remoted) or 2) Use a different serialization technology if not for exceptions.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Runtime.Serialization.SerializationInfo</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove serialization constructors on custom Exception types</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Threading.Thread</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Threading.Interlocked.MemoryBarrier instead</td>
</tr>
<tr>
<td style="padding-left:2em">MemoryBarrier</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use System.Threading.Interlocked.MemoryBarrier instead</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Type</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Equivalent available: Add using for System.Reflection, and reference System.Reflection.TypeExtensions </td>
</tr>
<tr>
<td style="padding-left:2em">EmptyTypes</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>new Type[0] (or create your own static property which returns a cached version of this)</td>
</tr>
<tr>
<td style="padding-left:2em">FindInterfaces(System.Reflection.TypeFilter,System.Object)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Assembly</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().Assembly</td>
</tr>
<tr>
<td style="padding-left:2em">get_BaseType</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().BaseType</td>
</tr>
<tr>
<td style="padding-left:2em">get_IsAbstract</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().IsAbstract</td>
</tr>
<tr>
<td style="padding-left:2em">get_IsClass</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().IsClass</td>
</tr>
<tr>
<td style="padding-left:2em">get_IsGenericType</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().IsGenericType</td>
</tr>
<tr>
<td style="padding-left:2em">get_IsGenericTypeDefinition</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().IsGenericTypeDefinition</td>
</tr>
<tr>
<td style="padding-left:2em">get_IsInterface</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().IsInterface</td>
</tr>
<tr>
<td style="padding-left:2em">get_IsPrimitive</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().IsPrimitive</td>
</tr>
<tr>
<td style="padding-left:2em">get_IsValueType</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().IsValueType</td>
</tr>
<tr>
<td style="padding-left:2em">GetConstructor(System.Reflection.BindingFlags,System.Reflection.Binder,System.Type[],System.Reflection.ParameterModifier[])</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use GetConstructor(Type[]) to search for public constructors by parameter type or filter the results of GetConstructors(BindingFlags) using LINQ for other queries.</td>
</tr>
<tr>
<td style="padding-left:2em">GetConstructor(System.Type[])</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetConstructors(System.Reflection.BindingFlags)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Equivalent available: Add using for System.Reflection, and reference System.Reflection.TypeExtensions </td>
</tr>
<tr>
<td style="padding-left:2em">GetGenericArguments</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetInterfaces</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetMethod(System.String)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetMethod(System.String,System.Reflection.BindingFlags)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Equivalent available: Add using for System.Reflection, and reference System.Reflection.TypeExtensions </td>
</tr>
<tr>
<td style="padding-left:2em">GetMethod(System.String,System.Type[],System.Reflection.ParameterModifier[])</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use GetMethod(string, Type[]) to search for public methods by name and parameter type or filter the results of GetMethods(BindingFlags) using LINQ for other queries.</td>
</tr>
<tr>
<td style="padding-left:2em">GetMethods</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetProperties</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetProperty(System.String)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">IsAssignableFrom(System.Type)</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
<p>
<a href="#Portability Summary">Back to Summary</a>
</p>
</div>
</div>
</body>
</html> | kuhlenh/port-to-core | Reports/fl/flitbit.ioc.3.2.1/FlitBit.IoC-net451.html | HTML | mit | 52,198 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
20950,
3619,
1024,
5796,
2595,
14540,
1027,
1000,
24471,
2078,
1024,
8040,
28433,
2015,
1011,
7513,
1011,
4012,
1024,
1060,
14540,
2102,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
418... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Device Connect SDK for iOS: DConnectMessage クラス</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Device Connect SDK for iOS
 <span id="projectnumber">1.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- 構築: Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'検索');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('../../',true,false,'search.php','検索');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">実体メソッド</a> |
<a href="#pub-static-methods">クラスメソッド</a> |
<a href="../../d7/d0f/interface_d_connect_message-members.html">全メンバ一覧</a> </div>
<div class="headertitle">
<div class="title">DConnectMessage クラス</div> </div>
</div><!--header-->
<div class="contents">
<p>Device Connect上でやり取りされるメッセージ。
<a href="../../d1/d81/interface_d_connect_message.html#details">[詳解]</a></p>
<p><code>#import <<a class="el" href="../../db/d77/_d_connect_message_8h_source.html">DConnectMessage.h</a>></code></p>
<div class="dynheader">
DConnectMessage の継承関係図</div>
<div class="dyncontent">
<div class="center">
<img src="../../d1/d81/interface_d_connect_message.png" usemap="#DConnectMessage_map" alt=""/>
<map id="DConnectMessage_map" name="DConnectMessage_map">
<area href="../../dd/d1c/interface_d_connect_request_message.html" title="リクエストデータを提供するクラス。 " alt="DConnectRequestMessage" shape="rect" coords="0,112,174,136"/>
<area href="../../df/d9a/interface_d_connect_response_message.html" title="レスポンスデータを提供するクラス。 " alt="DConnectResponseMessage" shape="rect" coords="184,112,358,136"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
実体メソッド</h2></td></tr>
<tr class="memitem:a374223547d4442b5cdc7668c12e72817"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a374223547d4442b5cdc7668c12e72817">setInteger:forKey:</a></td></tr>
<tr class="memdesc:a374223547d4442b5cdc7668c12e72817"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでintを登録する。 <a href="#a374223547d4442b5cdc7668c12e72817">[詳解]</a><br /></td></tr>
<tr class="separator:a374223547d4442b5cdc7668c12e72817"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a135908207e62ce777cc9ac320b3c98b4"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a135908207e62ce777cc9ac320b3c98b4">setLong:forKey:</a></td></tr>
<tr class="memdesc:a135908207e62ce777cc9ac320b3c98b4"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでlongを登録する。 <a href="#a135908207e62ce777cc9ac320b3c98b4">[詳解]</a><br /></td></tr>
<tr class="separator:a135908207e62ce777cc9ac320b3c98b4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aae68fc20ea01523f5777d51a6629610f"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#aae68fc20ea01523f5777d51a6629610f">setLongLong:forKey:</a></td></tr>
<tr class="memdesc:aae68fc20ea01523f5777d51a6629610f"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでlong longを登録する。 <a href="#aae68fc20ea01523f5777d51a6629610f">[詳解]</a><br /></td></tr>
<tr class="separator:aae68fc20ea01523f5777d51a6629610f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9b8634bc278decb07ecf1ae475982a47"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a9b8634bc278decb07ecf1ae475982a47">setFloat:forKey:</a></td></tr>
<tr class="memdesc:a9b8634bc278decb07ecf1ae475982a47"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでfloatを登録する。 <a href="#a9b8634bc278decb07ecf1ae475982a47">[詳解]</a><br /></td></tr>
<tr class="separator:a9b8634bc278decb07ecf1ae475982a47"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad01aa8bef1318dfd63197e883d5b77cb"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#ad01aa8bef1318dfd63197e883d5b77cb">setDouble:forKey:</a></td></tr>
<tr class="memdesc:ad01aa8bef1318dfd63197e883d5b77cb"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでdoubleを登録する。 <a href="#ad01aa8bef1318dfd63197e883d5b77cb">[詳解]</a><br /></td></tr>
<tr class="separator:ad01aa8bef1318dfd63197e883d5b77cb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa757353dfb9e571905da2617594497c7"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#aa757353dfb9e571905da2617594497c7">setBool:forKey:</a></td></tr>
<tr class="memdesc:aa757353dfb9e571905da2617594497c7"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでBOOLを登録する。 <a href="#aa757353dfb9e571905da2617594497c7">[詳解]</a><br /></td></tr>
<tr class="separator:aa757353dfb9e571905da2617594497c7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0abe260f362cc950637c6ad4fce3e8ce"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a0abe260f362cc950637c6ad4fce3e8ce">setData:forKey:</a></td></tr>
<tr class="memdesc:a0abe260f362cc950637c6ad4fce3e8ce"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでNSDataを登録する。 <a href="#a0abe260f362cc950637c6ad4fce3e8ce">[詳解]</a><br /></td></tr>
<tr class="separator:a0abe260f362cc950637c6ad4fce3e8ce"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae50228c873b8d599585abbcc503cd64e"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#ae50228c873b8d599585abbcc503cd64e">setString:forKey:</a></td></tr>
<tr class="memdesc:ae50228c873b8d599585abbcc503cd64e"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでNSStringを登録する。 <a href="#ae50228c873b8d599585abbcc503cd64e">[詳解]</a><br /></td></tr>
<tr class="separator:ae50228c873b8d599585abbcc503cd64e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2a221bb59a23f225680cca460b7077d6"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a2a221bb59a23f225680cca460b7077d6">setArray:forKey:</a></td></tr>
<tr class="memdesc:a2a221bb59a23f225680cca460b7077d6"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでDConnectArrayを登録する。 <a href="#a2a221bb59a23f225680cca460b7077d6">[詳解]</a><br /></td></tr>
<tr class="separator:a2a221bb59a23f225680cca460b7077d6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0549e1350475a9450a774295ced353e4"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a0549e1350475a9450a774295ced353e4">setMessage:forKey:</a></td></tr>
<tr class="memdesc:a0549e1350475a9450a774295ced353e4"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでmessageを登録する。 <a href="#a0549e1350475a9450a774295ced353e4">[詳解]</a><br /></td></tr>
<tr class="separator:a0549e1350475a9450a774295ced353e4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af6e2eeb8274da76b02f4c91b46dd2fea"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#af6e2eeb8274da76b02f4c91b46dd2fea">setNumber:forKey:</a></td></tr>
<tr class="memdesc:af6e2eeb8274da76b02f4c91b46dd2fea"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーでNSNumberを登録する。 <a href="#af6e2eeb8274da76b02f4c91b46dd2fea">[詳解]</a><br /></td></tr>
<tr class="separator:af6e2eeb8274da76b02f4c91b46dd2fea"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4081c69794fa7bb30b0f16db6c617e87"><td class="memItemLeft" align="right" valign="top">(int) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a4081c69794fa7bb30b0f16db6c617e87">integerForKey:</a></td></tr>
<tr class="memdesc:a4081c69794fa7bb30b0f16db6c617e87"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのintを取得する。 <a href="#a4081c69794fa7bb30b0f16db6c617e87">[詳解]</a><br /></td></tr>
<tr class="separator:a4081c69794fa7bb30b0f16db6c617e87"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a978059e0a087c7f88fe41a5aca846b49"><td class="memItemLeft" align="right" valign="top">(long) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a978059e0a087c7f88fe41a5aca846b49">longForKey:</a></td></tr>
<tr class="memdesc:a978059e0a087c7f88fe41a5aca846b49"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのlongを取得する。 <a href="#a978059e0a087c7f88fe41a5aca846b49">[詳解]</a><br /></td></tr>
<tr class="separator:a978059e0a087c7f88fe41a5aca846b49"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a004bdd610d340d45595ffa24aec0acce"><td class="memItemLeft" align="right" valign="top">(long long) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a004bdd610d340d45595ffa24aec0acce">longLongForKey:</a></td></tr>
<tr class="memdesc:a004bdd610d340d45595ffa24aec0acce"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのlong longを取得する。 <a href="#a004bdd610d340d45595ffa24aec0acce">[詳解]</a><br /></td></tr>
<tr class="separator:a004bdd610d340d45595ffa24aec0acce"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac8b64574973fd8e57ed3654eb868035c"><td class="memItemLeft" align="right" valign="top">(float) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#ac8b64574973fd8e57ed3654eb868035c">floatForKey:</a></td></tr>
<tr class="memdesc:ac8b64574973fd8e57ed3654eb868035c"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのfloatを取得する。 <a href="#ac8b64574973fd8e57ed3654eb868035c">[詳解]</a><br /></td></tr>
<tr class="separator:ac8b64574973fd8e57ed3654eb868035c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a169bbfbfe5a4522d2c2400d90f6a5382"><td class="memItemLeft" align="right" valign="top">(double) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a169bbfbfe5a4522d2c2400d90f6a5382">doubleForKey:</a></td></tr>
<tr class="memdesc:a169bbfbfe5a4522d2c2400d90f6a5382"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのdoubleを取得する。 <a href="#a169bbfbfe5a4522d2c2400d90f6a5382">[詳解]</a><br /></td></tr>
<tr class="separator:a169bbfbfe5a4522d2c2400d90f6a5382"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac132c289cabf779f446f030479d51599"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#ac132c289cabf779f446f030479d51599">boolForKey:</a></td></tr>
<tr class="memdesc:ac132c289cabf779f446f030479d51599"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのBOOLを取得する。 <a href="#ac132c289cabf779f446f030479d51599">[詳解]</a><br /></td></tr>
<tr class="separator:ac132c289cabf779f446f030479d51599"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7cc7853b5c31ec4b1d5bc3ceb6f0db16"><td class="memItemLeft" align="right" valign="top">(NSData *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a7cc7853b5c31ec4b1d5bc3ceb6f0db16">dataForKey:</a></td></tr>
<tr class="memdesc:a7cc7853b5c31ec4b1d5bc3ceb6f0db16"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのNSDataを取得する。 <a href="#a7cc7853b5c31ec4b1d5bc3ceb6f0db16">[詳解]</a><br /></td></tr>
<tr class="separator:a7cc7853b5c31ec4b1d5bc3ceb6f0db16"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a56b5efbe6ae63310d05703d43c68f6ed"><td class="memItemLeft" align="right" valign="top">(NSString *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a56b5efbe6ae63310d05703d43c68f6ed">stringForKey:</a></td></tr>
<tr class="memdesc:a56b5efbe6ae63310d05703d43c68f6ed"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのNSStringを取得する。 <a href="#a56b5efbe6ae63310d05703d43c68f6ed">[詳解]</a><br /></td></tr>
<tr class="separator:a56b5efbe6ae63310d05703d43c68f6ed"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aec98eec10519fe9b985bfaeb1cb37b13"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="../../d2/df4/interface_d_connect_array.html">DConnectArray</a> *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#aec98eec10519fe9b985bfaeb1cb37b13">arrayForKey:</a></td></tr>
<tr class="memdesc:aec98eec10519fe9b985bfaeb1cb37b13"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのDConnectArrayを取得する。 <a href="#aec98eec10519fe9b985bfaeb1cb37b13">[詳解]</a><br /></td></tr>
<tr class="separator:aec98eec10519fe9b985bfaeb1cb37b13"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6d29e6d792cc082ac0775c9e006188e5"><td class="memItemLeft" align="right" valign="top">(<a class="el" href="../../d1/d81/interface_d_connect_message.html">DConnectMessage</a> *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a6d29e6d792cc082ac0775c9e006188e5">messageForKey:</a></td></tr>
<tr class="memdesc:a6d29e6d792cc082ac0775c9e006188e5"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのDConnectMessageを取得する。 <a href="#a6d29e6d792cc082ac0775c9e006188e5">[詳解]</a><br /></td></tr>
<tr class="separator:a6d29e6d792cc082ac0775c9e006188e5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a252136ddc8507664580cc81e5e869467"><td class="memItemLeft" align="right" valign="top">(NSNumber *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a252136ddc8507664580cc81e5e869467">numberForKey:</a></td></tr>
<tr class="memdesc:a252136ddc8507664580cc81e5e869467"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのNSNumberを取得する。 <a href="#a252136ddc8507664580cc81e5e869467">[詳解]</a><br /></td></tr>
<tr class="separator:a252136ddc8507664580cc81e5e869467"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a837bef8157297c0409ef2a6f5f4aa735"><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a837bef8157297c0409ef2a6f5f4aa735">objectForKey:</a></td></tr>
<tr class="memdesc:a837bef8157297c0409ef2a6f5f4aa735"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーのオブジェクトを取得する。 <a href="#a837bef8157297c0409ef2a6f5f4aa735">[詳解]</a><br /></td></tr>
<tr class="separator:a837bef8157297c0409ef2a6f5f4aa735"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3b975f62a26d45b5998074aebb87d643"><td class="memItemLeft" align="right" valign="top">(BOOL) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a3b975f62a26d45b5998074aebb87d643">hasKey:</a></td></tr>
<tr class="memdesc:a3b975f62a26d45b5998074aebb87d643"><td class="mdescLeft"> </td><td class="mdescRight">指定されたキーが存在するかチェックする。 <a href="#a3b975f62a26d45b5998074aebb87d643">[詳解]</a><br /></td></tr>
<tr class="separator:a3b975f62a26d45b5998074aebb87d643"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a217ccf7c8ea264aba109123b392873d8"><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a217ccf7c8ea264aba109123b392873d8">convertToJSONObject</a></td></tr>
<tr class="memdesc:a217ccf7c8ea264aba109123b392873d8"><td class="mdescLeft"> </td><td class="mdescRight">JSONオブジェクトに変換する。 <a href="#a217ccf7c8ea264aba109123b392873d8">[詳解]</a><br /></td></tr>
<tr class="separator:a217ccf7c8ea264aba109123b392873d8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abf0927d24eedb183b2306322c05bd603"><td class="memItemLeft" align="right" valign="top">(NSString *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#abf0927d24eedb183b2306322c05bd603">convertToJSONString</a></td></tr>
<tr class="memdesc:abf0927d24eedb183b2306322c05bd603"><td class="mdescLeft"> </td><td class="mdescRight">JSON文字列に変換する。 <a href="#abf0927d24eedb183b2306322c05bd603">[詳解]</a><br /></td></tr>
<tr class="separator:abf0927d24eedb183b2306322c05bd603"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a639f2735e7476636e98f014b43ab48e2"><td class="memItemLeft" align="right" valign="top">(NSArray *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a639f2735e7476636e98f014b43ab48e2">allKeys</a></td></tr>
<tr class="memdesc:a639f2735e7476636e98f014b43ab48e2"><td class="mdescLeft"> </td><td class="mdescRight">キーの一覧を返す。 <a href="#a639f2735e7476636e98f014b43ab48e2">[詳解]</a><br /></td></tr>
<tr class="separator:a639f2735e7476636e98f014b43ab48e2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad1885f00cb186f3e8393a614f2fd4055"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#ad1885f00cb186f3e8393a614f2fd4055">setVersion:</a></td></tr>
<tr class="memdesc:ad1885f00cb186f3e8393a614f2fd4055"><td class="mdescLeft"> </td><td class="mdescRight">レスポンスにDeviceConnectManagerのバージョン名を設定する。 <a href="#ad1885f00cb186f3e8393a614f2fd4055">[詳解]</a><br /></td></tr>
<tr class="separator:ad1885f00cb186f3e8393a614f2fd4055"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1f2720ff6e27a211c3e537d49433e96b"><td class="memItemLeft" align="right" valign="top">(NSString *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a1f2720ff6e27a211c3e537d49433e96b">version</a></td></tr>
<tr class="memdesc:a1f2720ff6e27a211c3e537d49433e96b"><td class="mdescLeft"> </td><td class="mdescRight">DeviceConnectManagerのバージョン名を取得する。 <a href="#a1f2720ff6e27a211c3e537d49433e96b">[詳解]</a><br /></td></tr>
<tr class="separator:a1f2720ff6e27a211c3e537d49433e96b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8aa47fef47d25300260513769dd10374"><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a8aa47fef47d25300260513769dd10374">setProduct:</a></td></tr>
<tr class="memdesc:a8aa47fef47d25300260513769dd10374"><td class="mdescLeft"> </td><td class="mdescRight">レスポンスにDeviceConnectManagerの名前を設定する。 <a href="#a8aa47fef47d25300260513769dd10374">[詳解]</a><br /></td></tr>
<tr class="separator:a8aa47fef47d25300260513769dd10374"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6817c0181b5b652de749472e0d8797b4"><td class="memItemLeft" align="right" valign="top">(NSString *) </td><td class="memItemRight" valign="bottom">- <a class="el" href="../../d1/d81/interface_d_connect_message.html#a6817c0181b5b652de749472e0d8797b4">product</a></td></tr>
<tr class="memdesc:a6817c0181b5b652de749472e0d8797b4"><td class="mdescLeft"> </td><td class="mdescRight">DeviceConnectManagerの名前を取得する。 <a href="#a6817c0181b5b652de749472e0d8797b4">[詳解]</a><br /></td></tr>
<tr class="separator:a6817c0181b5b652de749472e0d8797b4"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
クラスメソッド</h2></td></tr>
<tr class="memitem:a8f0a55b0c17ae28616b17f1dbe2ae61e"><td class="memItemLeft" align="right" valign="top">(instancetype) </td><td class="memItemRight" valign="bottom">+ <a class="el" href="../../d1/d81/interface_d_connect_message.html#a8f0a55b0c17ae28616b17f1dbe2ae61e">initWithDictionary:</a></td></tr>
<tr class="memdesc:a8f0a55b0c17ae28616b17f1dbe2ae61e"><td class="mdescLeft"> </td><td class="mdescRight">指定されたNSDictionaryをコピーしてDConnectMessageを作成する。 <a href="#a8f0a55b0c17ae28616b17f1dbe2ae61e">[詳解]</a><br /></td></tr>
<tr class="separator:a8f0a55b0c17ae28616b17f1dbe2ae61e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adac3f58007605bb701f07d7cefdf2984"><td class="memItemLeft" align="right" valign="top">(instancetype) </td><td class="memItemRight" valign="bottom">+ <a class="el" href="../../d1/d81/interface_d_connect_message.html#adac3f58007605bb701f07d7cefdf2984">message</a></td></tr>
<tr class="memdesc:adac3f58007605bb701f07d7cefdf2984"><td class="mdescLeft"> </td><td class="mdescRight">DConnectMessageのインスタンスを作成する。 <a href="#adac3f58007605bb701f07d7cefdf2984">[詳解]</a><br /></td></tr>
<tr class="separator:adac3f58007605bb701f07d7cefdf2984"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">詳解</h2>
<div class="textblock"><p>Device Connect上でやり取りされるメッセージ。 </p>
<div class="fragment"><div class="line"><a class="code" href="../../d1/d81/interface_d_connect_message.html">DConnectMessage</a> *<a class="code" href="../../d8/d21/category_d_connect_message_07_d_connect_message_creation_08.html#adac3f58007605bb701f07d7cefdf2984">message</a> = [<a class="code" href="../../d1/d81/interface_d_connect_message.html">DConnectMessage</a> <a class="code" href="../../d8/d21/category_d_connect_message_07_d_connect_message_creation_08.html#adac3f58007605bb701f07d7cefdf2984">message</a>];</div><div class="line">[message setInteger:0 forKey:<span class="stringliteral">@"sample"</span>];</div></div><!-- fragment --> </div><h2 class="groupheader">メソッド詳解</h2>
<a id="a639f2735e7476636e98f014b43ab48e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a639f2735e7476636e98f014b43ab48e2">◆ </a></span>allKeys()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (NSArray *) allKeys </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>キーの一覧を返す。 </p>
<dl class="section return"><dt>戻り値</dt><dd>キーの一覧 </dd></dl>
</div>
</div>
<a id="aec98eec10519fe9b985bfaeb1cb37b13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aec98eec10519fe9b985bfaeb1cb37b13">◆ </a></span>arrayForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (<a class="el" href="../../d2/df4/interface_d_connect_array.html">DConnectArray</a> *) arrayForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのDConnectArrayを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">DConnectArrayのインスタンス</td><td></td></tr>
<tr><td class="paramname">nil</td><td>指定されたキーに対応するDConnectArrayが存在しない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ac132c289cabf779f446f030479d51599"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac132c289cabf779f446f030479d51599">◆ </a></span>boolForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) boolForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのBOOLを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">数値</td><td></td></tr>
<tr><td class="paramname">NO</td><td>キーが登録されていない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a217ccf7c8ea264aba109123b392873d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a217ccf7c8ea264aba109123b392873d8">◆ </a></span>convertToJSONObject()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) convertToJSONObject </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>JSONオブジェクトに変換する。 </p>
<p>Foundationオブジェクトから生成されたJSONデータを返す。 戻り値は NSJSONSerialization::JSONObjectWithData:options:error:の戻り値と同じになる。</p>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">JSONオブジェクト</td><td>変換後のJSONオブジェクト </td></tr>
<tr><td class="paramname">nil</td><td>JSONのパースに失敗した場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="abf0927d24eedb183b2306322c05bd603"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf0927d24eedb183b2306322c05bd603">◆ </a></span>convertToJSONString()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (NSString *) convertToJSONString </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>JSON文字列に変換する。 </p>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">JSON文字列</td><td>変換後のJSON文字列 </td></tr>
<tr><td class="paramname">nil</td><td>JSONのパースに失敗した場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a7cc7853b5c31ec4b1d5bc3ceb6f0db16"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7cc7853b5c31ec4b1d5bc3ceb6f0db16">◆ </a></span>dataForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (NSData *) dataForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのNSDataを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">NSDataのインスタンス</td><td></td></tr>
<tr><td class="paramname">nil</td><td>指定されたキーに対応するNSDataが存在しない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a169bbfbfe5a4522d2c2400d90f6a5382"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a169bbfbfe5a4522d2c2400d90f6a5382">◆ </a></span>doubleForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (double) doubleForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのdoubleを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">数値</td><td></td></tr>
<tr><td class="paramname">DBL_MIN</td><td>キーが登録されていない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ac8b64574973fd8e57ed3654eb868035c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac8b64574973fd8e57ed3654eb868035c">◆ </a></span>floatForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (float) floatForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのfloatを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">数値</td><td></td></tr>
<tr><td class="paramname">FLT_MIN</td><td>キーが登録されていない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a3b975f62a26d45b5998074aebb87d643"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b975f62a26d45b5998074aebb87d643">◆ </a></span>hasKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) hasKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーが存在するかチェックする。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>存在確認を行うキー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">YES</td><td>存在する場合 </td></tr>
<tr><td class="paramname">NO</td><td>存在しない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a8f0a55b0c17ae28616b17f1dbe2ae61e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f0a55b0c17ae28616b17f1dbe2ae61e">◆ </a></span>initWithDictionary:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">+ (instancetype) initWithDictionary: </td>
<td></td>
<td class="paramtype">(NSDictionary *) </td>
<td class="paramname"><em>dict</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたNSDictionaryをコピーしてDConnectMessageを作成する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">dict</td><td>コピーするNSDictionary </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">DConnectMessageのインスタンス</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a4081c69794fa7bb30b0f16db6c617e87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4081c69794fa7bb30b0f16db6c617e87">◆ </a></span>integerForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (int) integerForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのintを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">数値</td><td></td></tr>
<tr><td class="paramname">INT_MIN</td><td>キーが登録されていない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a978059e0a087c7f88fe41a5aca846b49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a978059e0a087c7f88fe41a5aca846b49">◆ </a></span>longForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (long) longForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのlongを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">数値</td><td></td></tr>
<tr><td class="paramname">LONG_MIN</td><td>キーが登録されていない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a004bdd610d340d45595ffa24aec0acce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a004bdd610d340d45595ffa24aec0acce">◆ </a></span>longLongForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (long long) longLongForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのlong longを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">数値</td><td></td></tr>
<tr><td class="paramname">LONG_LONG_MIN</td><td>キーが登録されていない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="adac3f58007605bb701f07d7cefdf2984"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adac3f58007605bb701f07d7cefdf2984">◆ </a></span>message()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">+ (instancetype) message </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>DConnectMessageのインスタンスを作成する。 </p>
<dl class="section return"><dt>戻り値</dt><dd>DConnectMessageのインスタンス </dd></dl>
<p><a class="el" href="../../d8/d21/category_d_connect_message_07_d_connect_message_creation_08.html#adac3f58007605bb701f07d7cefdf2984">DConnectMessage(DConnectMessageCreation)</a> カテゴリーから提供されています。</p>
</div>
</div>
<a id="a6d29e6d792cc082ac0775c9e006188e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6d29e6d792cc082ac0775c9e006188e5">◆ </a></span>messageForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (<a class="el" href="../../d1/d81/interface_d_connect_message.html">DConnectMessage</a> *) messageForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのDConnectMessageを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">DConnectMessageのインスタンス</td><td></td></tr>
<tr><td class="paramname">nil</td><td>指定されたキーに対応するDConnectMessageが存在しない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a252136ddc8507664580cc81e5e869467"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a252136ddc8507664580cc81e5e869467">◆ </a></span>numberForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (NSNumber *) numberForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのNSNumberを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">NSNumberのインスタンス</td><td></td></tr>
<tr><td class="paramname">nil</td><td>指定されたキーに対応するNSNumberが存在しない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a837bef8157297c0409ef2a6f5f4aa735"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a837bef8157297c0409ef2a6f5f4aa735">◆ </a></span>objectForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) objectForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのオブジェクトを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">指定されたキーで設定されているオブジェクト</td><td></td></tr>
<tr><td class="paramname">nil</td><td>指定されたキーに対応するオブジェクトが存在しない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a6817c0181b5b652de749472e0d8797b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6817c0181b5b652de749472e0d8797b4">◆ </a></span>product()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (NSString *) product </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>DeviceConnectManagerの名前を取得する。 </p>
<dl class="section return"><dt>戻り値</dt><dd>result DeviceConnectManagerの名前 </dd></dl>
</div>
</div>
<a id="a2a221bb59a23f225680cca460b7077d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a221bb59a23f225680cca460b7077d6">◆ </a></span>setArray:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setArray: </td>
<td></td>
<td class="paramtype">(<a class="el" href="../../d2/df4/interface_d_connect_array.html">DConnectArray</a> *) </td>
<td class="paramname"><em>array</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでDConnectArrayを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">array</td><td>配列 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aa757353dfb9e571905da2617594497c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa757353dfb9e571905da2617594497c7">◆ </a></span>setBool:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setBool: </td>
<td></td>
<td class="paramtype">(BOOL) </td>
<td class="paramname"><em>num</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでBOOLを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>数値 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a0abe260f362cc950637c6ad4fce3e8ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0abe260f362cc950637c6ad4fce3e8ce">◆ </a></span>setData:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setData: </td>
<td></td>
<td class="paramtype">(NSData *) </td>
<td class="paramname"><em>data</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでNSDataを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>NSData </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ad01aa8bef1318dfd63197e883d5b77cb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad01aa8bef1318dfd63197e883d5b77cb">◆ </a></span>setDouble:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setDouble: </td>
<td></td>
<td class="paramtype">(double) </td>
<td class="paramname"><em>num</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでdoubleを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>数値 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a9b8634bc278decb07ecf1ae475982a47"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b8634bc278decb07ecf1ae475982a47">◆ </a></span>setFloat:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setFloat: </td>
<td></td>
<td class="paramtype">(float) </td>
<td class="paramname"><em>num</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでfloatを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>数値 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a374223547d4442b5cdc7668c12e72817"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a374223547d4442b5cdc7668c12e72817">◆ </a></span>setInteger:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setInteger: </td>
<td></td>
<td class="paramtype">(int) </td>
<td class="paramname"><em>num</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでintを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>数値 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a135908207e62ce777cc9ac320b3c98b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a135908207e62ce777cc9ac320b3c98b4">◆ </a></span>setLong:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setLong: </td>
<td></td>
<td class="paramtype">(long) </td>
<td class="paramname"><em>num</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでlongを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>数値 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aae68fc20ea01523f5777d51a6629610f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae68fc20ea01523f5777d51a6629610f">◆ </a></span>setLongLong:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setLongLong: </td>
<td></td>
<td class="paramtype">(long long) </td>
<td class="paramname"><em>num</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでlong longを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>数値 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a0549e1350475a9450a774295ced353e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0549e1350475a9450a774295ced353e4">◆ </a></span>setMessage:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setMessage: </td>
<td></td>
<td class="paramtype">(<a class="el" href="../../d1/d81/interface_d_connect_message.html">DConnectMessage</a> *) </td>
<td class="paramname"><em>message</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでmessageを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">message</td><td>メッセージ </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="af6e2eeb8274da76b02f4c91b46dd2fea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af6e2eeb8274da76b02f4c91b46dd2fea">◆ </a></span>setNumber:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setNumber: </td>
<td></td>
<td class="paramtype">(NSNumber *) </td>
<td class="paramname"><em>number</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでNSNumberを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">number</td><td>数値 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a8aa47fef47d25300260513769dd10374"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8aa47fef47d25300260513769dd10374">◆ </a></span>setProduct:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setProduct: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>product</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>レスポンスにDeviceConnectManagerの名前を設定する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">product</td><td>DeviceConnectManagerの名前 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ae50228c873b8d599585abbcc503cd64e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae50228c873b8d599585abbcc503cd64e">◆ </a></span>setString:forKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setString: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>string</em></td>
</tr>
<tr>
<td class="paramkey">forKey:</td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーでNSStringを登録する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">string</td><td>文字列 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ad1885f00cb186f3e8393a614f2fd4055"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad1885f00cb186f3e8393a614f2fd4055">◆ </a></span>setVersion:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setVersion: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>version</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>レスポンスにDeviceConnectManagerのバージョン名を設定する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">version</td><td>DeviceConnectManagerのバージョン名 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a56b5efbe6ae63310d05703d43c68f6ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a56b5efbe6ae63310d05703d43c68f6ed">◆ </a></span>stringForKey:()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (NSString *) stringForKey: </td>
<td></td>
<td class="paramtype">(NSString *) </td>
<td class="paramname"><em>aKey</em></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>指定されたキーのNSStringを取得する。 </p>
<dl class="params"><dt>引数</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">aKey</td><td>キー </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>戻り値</dt><dd>
<table class="retval">
<tr><td class="paramname">NSStringのインスタンス</td><td></td></tr>
<tr><td class="paramname">nil</td><td>指定されたキーに対応するNSStringが存在しない場合 </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a1f2720ff6e27a211c3e537d49433e96b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f2720ff6e27a211c3e537d49433e96b">◆ </a></span>version()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (NSString *) version </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>DeviceConnectManagerのバージョン名を取得する。 </p>
<dl class="section return"><dt>戻り値</dt><dd>result DeviceConnectManagerのバージョン名 </dd></dl>
</div>
</div>
<hr/>このクラス詳解は次のファイルから抽出されました:<ul>
<li>DConnectSDK/DConnectSDK/<a class="el" href="../../db/d77/_d_connect_message_8h_source.html">DConnectMessage.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
2020年07月06日(月) 12時59分49秒作成 - Device Connect SDK for iOS / 構成:  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
| DeviceConnect/DeviceConnect-Docs | Specification/API_Reference/iOS_SDK/d1/d81/interface_d_connect_message.html | HTML | mit | 60,937 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
1060,
11039,
19968,
1015,
1012,
1014,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using Newtonsoft.Json;
namespace Fr8Data.DataTransferObjects
{
public class WebServiceDTO
{
[JsonProperty("id")]
public int Id { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("iconPath")]
public string IconPath { get; set; }
}
} | Fr8org/Fr8Core.NET | Data/DataTransferObjects/WebServiceDTO.cs | C# | apache-2.0 | 321 | [
30522,
2478,
8446,
6499,
6199,
1012,
1046,
3385,
1025,
3415,
15327,
10424,
2620,
2850,
2696,
1012,
2951,
6494,
3619,
7512,
16429,
20614,
2015,
1063,
2270,
2465,
4773,
8043,
7903,
2098,
3406,
1063,
1031,
1046,
3385,
21572,
4842,
3723,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Registrar protocol messages
*
* Copyright (C) 2012, Broadcom Corporation
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
* the contents of this file may not be disclosed to third parties, copied
* or duplicated in any form, in whole or in part, without the prior
* written permission of Broadcom Corporation.
*
* $Id: reg_protomsg.h 292703 2011-10-28 03:05:19Z $
*/
#ifndef _WPS_MSG_H
#define _WPS_MSG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <reg_prototlv.h>
#include <wps_sslist.h>
/* Message Structures */
/* Message M1 */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvUuid uuid;
CTlvMacAddr macAddr;
CTlvEnrolleeNonce enrolleeNonce;
CTlvPublicKey publicKey;
CTlvAuthTypeFlags authTypeFlags;
CTlvEncrTypeFlags encrTypeFlags;
CTlvConnTypeFlags connTypeFlags;
CTlvConfigMethods configMethods;
CTlvScState scState;
CTlvManufacturer manufacturer;
CTlvModelName modelName;
CTlvModelNumber modelNumber;
CTlvSerialNum serialNumber;
CTlvPrimDeviceType primDeviceType;
CTlvDeviceName deviceName;
CTlvRfBand rfBand;
CTlvAssocState assocState;
CTlvDevicePwdId devPwdId;
CTlvConfigError configError;
CTlvOsVersion osVersion;
CTlvVendorExt vendorExt;
CSubTlvVersion2 version2; /* C: WSC 2.0 */
CSubTlvReqToEnr reqToEnr; /* O: WSC 2.0 */
} WpsM1;
/* Message M2 */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvEnrolleeNonce enrolleeNonce;
CTlvRegistrarNonce registrarNonce;
CTlvUuid uuid;
CTlvPublicKey publicKey;
CTlvAuthTypeFlags authTypeFlags;
CTlvEncrTypeFlags encrTypeFlags;
CTlvConnTypeFlags connTypeFlags;
CTlvConfigMethods configMethods;
CTlvManufacturer manufacturer;
CTlvModelName modelName;
CTlvModelNumber modelNumber;
CTlvSerialNum serialNumber;
CTlvPrimDeviceType primDeviceType;
CTlvDeviceName deviceName;
CTlvRfBand rfBand;
CTlvAssocState assocState;
CTlvConfigError configError;
CTlvDevicePwdId devPwdId;
CTlvOsVersion osVersion;
CTlvEncrSettings encrSettings;
CTlvVendorExt vendorExt;
CSubTlvVersion2 version2; /* C: WSC 2.0 */
CTlvAuthenticator authenticator;
} WpsM2;
/* Message M2D */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvEnrolleeNonce enrolleeNonce;
CTlvRegistrarNonce registrarNonce;
CTlvUuid uuid;
CTlvAuthTypeFlags authTypeFlags;
CTlvEncrTypeFlags encrTypeFlags;
CTlvConnTypeFlags connTypeFlags;
CTlvConfigMethods configMethods;
CTlvManufacturer manufacturer;
CTlvModelName modelName;
CTlvModelNumber modelNumber;
CTlvSerialNum serialNumber;
CTlvPrimDeviceType primDeviceType;
CTlvDeviceName deviceName;
CTlvRfBand rfBand;
CTlvAssocState assocState;
CTlvConfigError configError;
CTlvDevicePwdId devPwdId;
CTlvOsVersion osVersion;
CTlvVendorExt vendorExt;
CSubTlvVersion2 version2; /* C: WSC 2.0 */
} WpsM2D;
/* Message M3 */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvRegistrarNonce registrarNonce;
CTlvHash eHash1;
CTlvHash eHash2;
CTlvVendorExt vendorExt;
CSubTlvVersion2 version2; /* C: WSC 2.0 */
CTlvAuthenticator authenticator;
} WpsM3;
/* Message M4 */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvEnrolleeNonce enrolleeNonce;
CTlvHash rHash1;
CTlvHash rHash2;
CTlvEncrSettings encrSettings;
CTlvVendorExt vendorExt;
CSubTlvVersion2 version2; /* C: WSC 2.0 */
CTlvAuthenticator authenticator;
} WpsM4;
/* Message M5 */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvRegistrarNonce registrarNonce;
CTlvEncrSettings encrSettings;
CTlvVendorExt vendorExt;
CSubTlvVersion2 version2; /* C: WSC 2.0 */
CTlvAuthenticator authenticator;
} WpsM5;
/* Message M6 */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvEnrolleeNonce enrolleeNonce;
CTlvEncrSettings encrSettings;
CTlvVendorExt vendorExt;
CSubTlvVersion2 version2; /* C: WSC 2.0 */
CTlvAuthenticator authenticator;
} WpsM6;
/* Message M7 */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvRegistrarNonce registrarNonce;
CTlvEncrSettings encrSettings;
CTlvX509CertReq x509CertReq;
CTlvVendorExt vendorExt;
CSubTlvSettingsDelayTime settingsDelayTime; /* O: WSC 2.0 */
CSubTlvVersion2 version2; /* C: WSC 2.0 */
CTlvAuthenticator authenticator;
} WpsM7;
/* Message M8 */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvEnrolleeNonce enrolleeNonce;
CTlvEncrSettings encrSettings;
CTlvX509Cert x509Cert;
CTlvVendorExt vendorExt;
CSubTlvVersion2 version2; /* C: WSC 2.0 */
CTlvAuthenticator authenticator;
} WpsM8;
/* ACK and DONE Messages */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvEnrolleeNonce enrolleeNonce;
CTlvRegistrarNonce registrarNonce;
CTlvVendorExt vendorExt;
CSubTlvVersion2 version2; /* C: WSC 2.0 */
} WpsACK, WpsDone;
/* NACK Message */
typedef struct {
CTlvVersion version;
CTlvMsgType msgType;
CTlvEnrolleeNonce enrolleeNonce;
CTlvRegistrarNonce registrarNonce;
CTlvConfigError configError;
CTlvVendorExt vendorExt;
CSubTlvVersion2 version2; /* C: WSC 2.0 */
} WpsNACK;
/* Encrypted settings for various messages */
/*
* M4, M5, M6 - contain only Nonce and vendor extension
* this structure doesn't allocate dyamic memory
* doesn't need a free function at the moment.
*/
typedef struct {
CTlvNonce nonce; /* could be RS1, ES1 or RS2 */
CTlvAuthenticator keyWrapAuth; /* reuse Authenticator data struct */
} TlvEsNonce;
/* M7 */
/* NOTE : this structure MUST be freed using reg_msg_m7enr_del */
typedef struct {
int es_type;
CTlvNonce nonce; /* ES2 */
CTlvIdentityProof idProof;
CTlvAuthenticator keyWrapAuth; /* reuse Authenticator data struct */
} EsM7Enr;
/* NOTE : this structure MUST be freed using reg_msg_m7ap_del */
typedef struct {
int es_type;
CTlvNonce nonce; /* ES2 */
CTlvSsid ssid;
CTlvMacAddr macAddr;
CTlvAuthType authType;
CTlvEncrType encrType;
WPS_SSLIST *nwKeyIndex;
WPS_SSLIST *nwKey;
CTlvWEPTransmitKey wepIdx;
CTlvAuthenticator keyWrapAuth; /* reuse Authenticator data struct */
} EsM7Ap;
/* M8 */
/* NOTE : this structure MUST be freed using reg_msg_m8ap_del */
typedef struct {
int es_type;
CTlvNwIndex nwIndex;
CTlvSsid ssid;
CTlvAuthType authType;
CTlvEncrType encrType;
WPS_SSLIST *nwKeyIndex;
WPS_SSLIST *nwKey;
CTlvMacAddr macAddr;
CTlvNewPwd new_pwd;
CTlvDevicePwdId pwdId;
CTlvWEPTransmitKey wepIdx;
CTlvAuthenticator keyWrapAuth; /* reuse Authenticator data struct */
} EsM8Ap;
typedef struct {
int es_type;
WPS_SSLIST *credential;
CTlvNewPwd new_pwd;
CTlvDevicePwdId pwdId;
CTlvAuthenticator keyWrapAuth; /* reuse Authenticator data struct */
} EsM8Sta;
#define ES_TYPE_M7ENR 1
#define ES_TYPE_M7AP 2
#define ES_TYPE_M8AP 3
#define ES_TYPE_M8STA 4
void reg_msg_init(void *m, int type);
int reg_msg_version_check(uint8 msgId, BufferObj *theBuf, TlvObj_uint8 *version, TlvObj_uint8 *msgType);
void reg_msg_nonce_parse(TlvEsNonce *t, uint16 theType, BufferObj *theBuf, BufferObj *authKey);
void reg_msg_nonce_write(TlvEsNonce *t, BufferObj *theBuf, BufferObj *authKey);
uint32 reg_msg_m7enr_parse(EsM7Enr *t, BufferObj *theBuf, BufferObj *authKey, bool allocate);
void reg_msg_m7enr_write(EsM7Enr *t, BufferObj *theBuf, BufferObj *authKey);
uint32 reg_msg_m7ap_parse(EsM7Ap *tlv, BufferObj *theBuf, BufferObj *authKey, bool allocate);
void reg_msg_m7ap_write(EsM7Ap *tlv, BufferObj *theBuf, BufferObj *authKey);
void reg_msg_m8ap_parse(EsM8Ap *t, BufferObj *theBuf, BufferObj *authKey, bool allocate);
void reg_msg_m8ap_write(EsM8Ap *t, BufferObj *theBuf, BufferObj *authKey, bool b_wsp_version2);
void reg_msg_m8sta_parse(EsM8Sta *t, BufferObj *theBuf, BufferObj *authKey, bool allocate);
void reg_msg_m8sta_write(EsM8Sta *t, BufferObj *theBuf);
void reg_msg_m8sta_write_cred(EsM8Sta *t, BufferObj *theBuf);
void reg_msg_m8sta_write_key(EsM8Sta *t, BufferObj *theBuf, BufferObj *authKey);
void *reg_msg_es_new(int es_type);
void reg_msg_es_del(void *tlv, bool content_only);
#ifdef __cplusplus
}
#endif
#endif /* _WPS_MSG_H */
| wkritzinger/asuswrt-merlin | release/src-rt/wps/common/include/reg_protomsg.h | C | gpl-2.0 | 8,016 | [
30522,
1013,
1008,
1008,
24580,
8778,
7696,
1008,
1008,
9385,
1006,
1039,
1007,
2262,
1010,
5041,
9006,
3840,
1008,
2035,
2916,
9235,
1012,
1008,
1008,
2023,
2003,
19106,
16350,
3120,
3642,
1997,
5041,
9006,
3840,
1025,
1008,
1996,
8417,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Ischaemum zeylanicolum Bor SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Ischaemum/Ischaemum zeylanicolum/README.md | Markdown | apache-2.0 | 176 | [
30522,
1001,
2003,
7507,
6633,
2819,
27838,
23943,
8713,
4747,
2819,
8945,
2099,
2427,
1001,
1001,
1001,
1001,
3570,
3970,
1001,
1001,
1001,
1001,
2429,
2000,
2248,
3269,
3415,
5950,
1001,
1001,
1001,
1001,
2405,
1999,
19701,
1001,
1001,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/usr/bin/env python
"""
RSS Reader for C-Power 1200
Copyright 2010-2012 Michael Farrell <http://micolous.id.au/>
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 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 Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from cpower1200 import *
import feedparser
from sys import argv
FEED = 'http://news.google.com.au/news?pz=1&cf=all&ned=au&hl=en&output=rss'
d = feedparser.parse(FEED)
s = CPower1200(argv[1])
# Define one window at the top of the screen, and one in the lower part of the screen
s.send_window(dict(x=0, y=0, h=8, w=64), dict(x=0, y=8, h=8, w=64))
header = s.format_text(d.feed.title, RED, 0)
articles = ''
for i, article in enumerate(d.entries[:4]):
print "entry %d: %s" % (i, article.title)
colour = YELLOW if i % 2 == 0 else GREEN
articles += s.format_text(article.title + ' ', colour)
# send to sign
#s.send_text(0, header, effect=EFFECT_NONE)
s.send_clock(0, display_year=False, display_month=False, display_day=False, display_hour=True, display_minute=True, display_second=True, multiline=False, red=255,green=0,blue=0)
s.send_text(1, articles, speed=10)
| micolous/ledsign | cpower1200_rss.py | Python | lgpl-3.0 | 1,615 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
4372,
2615,
18750,
1000,
1000,
1000,
12667,
2015,
8068,
2005,
1039,
1011,
2373,
14840,
9385,
2230,
1011,
2262,
2745,
16248,
1026,
8299,
1024,
1013,
1013,
23025,
12898,
2271,
1012,
8909,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
//Include Common Files @1-B7C59DAA
define("RelativePath", ".");
define("PathToCurrentPage", "/");
define("FileName", "report_patient_attendance.php");
include_once(RelativePath . "/Common.php");
include_once(RelativePath . "/Template.php");
include_once(RelativePath . "/Sorter.php");
include_once(RelativePath . "/Navigator.php");
//End Include Common Files
//Include Page implementation @2-203FAEA1
include_once(RelativePath . "/topmenu.php");
//End Include Page implementation
//patient_visit_pregnancy ReportGroup class @3-0A3A88AB
class clsReportGrouppatient_visit_pregnancy {
public $GroupType;
public $mode; //1 - open, 2 - close
public $Report_TotalRecords, $_Report_TotalRecordsAttributes;
public $Report_Row_Number, $_Report_Row_NumberAttributes;
public $NextVisit, $_NextVisitAttributes;
public $FamilyName, $_FamilyNameAttributes;
public $GivenName, $_GivenNameAttributes;
public $Town, $_TownAttributes;
public $MobilePhone, $_MobilePhoneAttributes;
public $Report_CurrentDate, $_Report_CurrentDateAttributes;
public $Attributes;
public $ReportTotalIndex = 0;
public $PageTotalIndex;
public $PageNumber;
public $RowNumber;
public $Parent;
function clsReportGrouppatient_visit_pregnancy(& $parent) {
$this->Parent = & $parent;
$this->Attributes = $this->Parent->Attributes->GetAsArray();
}
function SetControls($PrevGroup = "") {
$this->NextVisit = $this->Parent->NextVisit->Value;
$this->FamilyName = $this->Parent->FamilyName->Value;
$this->GivenName = $this->Parent->GivenName->Value;
$this->Town = $this->Parent->Town->Value;
$this->MobilePhone = $this->Parent->MobilePhone->Value;
}
function SetTotalControls($mode = "", $PrevGroup = "") {
$this->Report_TotalRecords = $this->Parent->Report_TotalRecords->GetTotalValue($mode);
$this->Report_Row_Number = $this->Parent->Report_Row_Number->GetTotalValue($mode);
$this->_Report_TotalRecordsAttributes = $this->Parent->Report_TotalRecords->Attributes->GetAsArray();
$this->_Sorter_NextVisitAttributes = $this->Parent->Sorter_NextVisit->Attributes->GetAsArray();
$this->_Sorter_TownAttributes = $this->Parent->Sorter_Town->Attributes->GetAsArray();
$this->_Sorter_MobilePhoneAttributes = $this->Parent->Sorter_MobilePhone->Attributes->GetAsArray();
$this->_Report_Row_NumberAttributes = $this->Parent->Report_Row_Number->Attributes->GetAsArray();
$this->_NextVisitAttributes = $this->Parent->NextVisit->Attributes->GetAsArray();
$this->_FamilyNameAttributes = $this->Parent->FamilyName->Attributes->GetAsArray();
$this->_GivenNameAttributes = $this->Parent->GivenName->Attributes->GetAsArray();
$this->_TownAttributes = $this->Parent->Town->Attributes->GetAsArray();
$this->_MobilePhoneAttributes = $this->Parent->MobilePhone->Attributes->GetAsArray();
$this->_Report_CurrentDateAttributes = $this->Parent->Report_CurrentDate->Attributes->GetAsArray();
$this->_NavigatorAttributes = $this->Parent->Navigator->Attributes->GetAsArray();
}
function SyncWithHeader(& $Header) {
$Header->Report_TotalRecords = $this->Report_TotalRecords;
$Header->_Report_TotalRecordsAttributes = $this->_Report_TotalRecordsAttributes;
$Header->Report_Row_Number = $this->Report_Row_Number;
$Header->_Report_Row_NumberAttributes = $this->_Report_Row_NumberAttributes;
$this->NextVisit = $Header->NextVisit;
$Header->_NextVisitAttributes = $this->_NextVisitAttributes;
$this->Parent->NextVisit->Value = $Header->NextVisit;
$this->Parent->NextVisit->Attributes->RestoreFromArray($Header->_NextVisitAttributes);
$this->FamilyName = $Header->FamilyName;
$Header->_FamilyNameAttributes = $this->_FamilyNameAttributes;
$this->Parent->FamilyName->Value = $Header->FamilyName;
$this->Parent->FamilyName->Attributes->RestoreFromArray($Header->_FamilyNameAttributes);
$this->GivenName = $Header->GivenName;
$Header->_GivenNameAttributes = $this->_GivenNameAttributes;
$this->Parent->GivenName->Value = $Header->GivenName;
$this->Parent->GivenName->Attributes->RestoreFromArray($Header->_GivenNameAttributes);
$this->Town = $Header->Town;
$Header->_TownAttributes = $this->_TownAttributes;
$this->Parent->Town->Value = $Header->Town;
$this->Parent->Town->Attributes->RestoreFromArray($Header->_TownAttributes);
$this->MobilePhone = $Header->MobilePhone;
$Header->_MobilePhoneAttributes = $this->_MobilePhoneAttributes;
$this->Parent->MobilePhone->Value = $Header->MobilePhone;
$this->Parent->MobilePhone->Attributes->RestoreFromArray($Header->_MobilePhoneAttributes);
}
function ChangeTotalControls() {
$this->Report_TotalRecords = $this->Parent->Report_TotalRecords->GetValue();
$this->Report_Row_Number = $this->Parent->Report_Row_Number->GetValue();
}
}
//End patient_visit_pregnancy ReportGroup class
//patient_visit_pregnancy GroupsCollection class @3-B03F70FA
class clsGroupsCollectionpatient_visit_pregnancy {
public $Groups;
public $mPageCurrentHeaderIndex;
public $PageSize;
public $TotalPages = 0;
public $TotalRows = 0;
public $CurrentPageSize = 0;
public $Pages;
public $Parent;
public $LastDetailIndex;
function clsGroupsCollectionpatient_visit_pregnancy(& $parent) {
$this->Parent = & $parent;
$this->Groups = array();
$this->Pages = array();
$this->mReportTotalIndex = 0;
$this->mPageTotalIndex = 1;
}
function & InitGroup() {
$group = new clsReportGrouppatient_visit_pregnancy($this->Parent);
$group->RowNumber = $this->TotalRows + 1;
$group->PageNumber = $this->TotalPages;
$group->PageTotalIndex = $this->mPageCurrentHeaderIndex;
return $group;
}
function RestoreValues() {
$this->Parent->Report_TotalRecords->Value = $this->Parent->Report_TotalRecords->initialValue;
$this->Parent->Report_Row_Number->Value = $this->Parent->Report_Row_Number->initialValue;
$this->Parent->NextVisit->Value = $this->Parent->NextVisit->initialValue;
$this->Parent->FamilyName->Value = $this->Parent->FamilyName->initialValue;
$this->Parent->GivenName->Value = $this->Parent->GivenName->initialValue;
$this->Parent->Town->Value = $this->Parent->Town->initialValue;
$this->Parent->MobilePhone->Value = $this->Parent->MobilePhone->initialValue;
}
function OpenPage() {
$this->TotalPages++;
$Group = & $this->InitGroup();
$this->Parent->Page_Header->CCSEventResult = CCGetEvent($this->Parent->Page_Header->CCSEvents, "OnInitialize", $this->Parent->Page_Header);
if ($this->Parent->Page_Header->Visible)
$this->CurrentPageSize = $this->CurrentPageSize + $this->Parent->Page_Header->Height;
$Group->SetTotalControls("GetNextValue");
$this->Parent->Page_Header->CCSEventResult = CCGetEvent($this->Parent->Page_Header->CCSEvents, "OnCalculate", $this->Parent->Page_Header);
$Group->SetControls();
$Group->Mode = 1;
$Group->GroupType = "Page";
$Group->PageTotalIndex = count($this->Groups);
$this->mPageCurrentHeaderIndex = count($this->Groups);
$this->Groups[] = & $Group;
$this->Pages[] = count($this->Groups) == 2 ? 0 : count($this->Groups) - 1;
$this->Parent->Report_Row_Number->Reset();
}
function OpenGroup($groupName) {
$Group = "";
$OpenFlag = false;
if ($groupName == "Report") {
$Group = & $this->InitGroup(true);
$this->Parent->Report_Header->CCSEventResult = CCGetEvent($this->Parent->Report_Header->CCSEvents, "OnInitialize", $this->Parent->Report_Header);
if ($this->Parent->Report_Header->Visible)
$this->CurrentPageSize = $this->CurrentPageSize + $this->Parent->Report_Header->Height;
$Group->SetTotalControls("GetNextValue");
$this->Parent->Report_Header->CCSEventResult = CCGetEvent($this->Parent->Report_Header->CCSEvents, "OnCalculate", $this->Parent->Report_Header);
$Group->SetControls();
$Group->Mode = 1;
$Group->GroupType = "Report";
$this->Groups[] = & $Group;
$this->OpenPage();
}
}
function ClosePage() {
$Group = & $this->InitGroup();
$this->Parent->Page_Footer->CCSEventResult = CCGetEvent($this->Parent->Page_Footer->CCSEvents, "OnInitialize", $this->Parent->Page_Footer);
$Group->SetTotalControls("GetPrevValue");
$Group->SyncWithHeader($this->Groups[$this->mPageCurrentHeaderIndex]);
$this->Parent->Page_Footer->CCSEventResult = CCGetEvent($this->Parent->Page_Footer->CCSEvents, "OnCalculate", $this->Parent->Page_Footer);
$Group->SetControls();
$this->Parent->Report_Row_Number->Reset();
$this->RestoreValues();
$this->CurrentPageSize = 0;
$Group->Mode = 2;
$Group->GroupType = "Page";
$this->Groups[] = & $Group;
}
function CloseGroup($groupName)
{
$Group = "";
if ($groupName == "Report") {
$Group = & $this->InitGroup(true);
$this->Parent->Report_Footer->CCSEventResult = CCGetEvent($this->Parent->Report_Footer->CCSEvents, "OnInitialize", $this->Parent->Report_Footer);
if ($this->Parent->Page_Footer->Visible)
$OverSize = $this->Parent->Report_Footer->Height + $this->Parent->Page_Footer->Height;
else
$OverSize = $this->Parent->Report_Footer->Height;
if (($this->PageSize > 0) and $this->Parent->Report_Footer->Visible and ($this->CurrentPageSize + $OverSize > $this->PageSize)) {
$this->ClosePage();
$this->OpenPage();
}
$Group->SetTotalControls("GetPrevValue");
$Group->SyncWithHeader($this->Groups[0]);
if ($this->Parent->Report_Footer->Visible)
$this->CurrentPageSize = $this->CurrentPageSize + $this->Parent->Report_Footer->Height;
$this->Parent->Report_Footer->CCSEventResult = CCGetEvent($this->Parent->Report_Footer->CCSEvents, "OnCalculate", $this->Parent->Report_Footer);
$Group->SetControls();
$this->RestoreValues();
$Group->Mode = 2;
$Group->GroupType = "Report";
$this->Groups[] = & $Group;
$this->ClosePage();
return;
}
}
function AddItem()
{
$Group = & $this->InitGroup(true);
$this->Parent->Detail->CCSEventResult = CCGetEvent($this->Parent->Detail->CCSEvents, "OnInitialize", $this->Parent->Detail);
if ($this->Parent->Page_Footer->Visible)
$OverSize = $this->Parent->Detail->Height + $this->Parent->Page_Footer->Height;
else
$OverSize = $this->Parent->Detail->Height;
if (($this->PageSize > 0) and $this->Parent->Detail->Visible and ($this->CurrentPageSize + $OverSize > $this->PageSize)) {
$this->ClosePage();
$this->OpenPage();
}
$this->TotalRows++;
if ($this->LastDetailIndex)
$PrevGroup = & $this->Groups[$this->LastDetailIndex];
else
$PrevGroup = "";
$Group->SetTotalControls("", $PrevGroup);
if ($this->Parent->Detail->Visible)
$this->CurrentPageSize = $this->CurrentPageSize + $this->Parent->Detail->Height;
$this->Parent->Detail->CCSEventResult = CCGetEvent($this->Parent->Detail->CCSEvents, "OnCalculate", $this->Parent->Detail);
$Group->SetControls($PrevGroup);
$this->LastDetailIndex = count($this->Groups);
$this->Groups[] = & $Group;
}
}
//End patient_visit_pregnancy GroupsCollection class
class clsReportpatient_visit_pregnancy { //patient_visit_pregnancy Class @3-7908F56E
//patient_visit_pregnancy Variables @3-7EE097B6
public $ComponentType = "Report";
public $PageSize;
public $ComponentName;
public $Visible;
public $Errors;
public $CCSEvents = array();
public $CCSEventResult;
public $RelativePath = "";
public $ViewMode = "Web";
public $TemplateBlock;
public $PageNumber;
public $RowNumber;
public $TotalRows;
public $TotalPages;
public $ControlsVisible = array();
public $IsEmpty;
public $Attributes;
public $DetailBlock, $Detail;
public $Report_FooterBlock, $Report_Footer;
public $Report_HeaderBlock, $Report_Header;
public $Page_FooterBlock, $Page_Footer;
public $Page_HeaderBlock, $Page_Header;
public $SorterName, $SorterDirection;
public $ds;
public $DataSource;
public $UseClientPaging = false;
//Report Controls
public $StaticControls, $RowControls, $Report_FooterControls, $Report_HeaderControls;
public $Page_FooterControls, $Page_HeaderControls;
public $Sorter_NextVisit;
public $Sorter_Town;
public $Sorter_MobilePhone;
//End patient_visit_pregnancy Variables
//Class_Initialize Event @3-991F507C
function clsReportpatient_visit_pregnancy($RelativePath = "", & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "patient_visit_pregnancy";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->Detail = new clsSection($this);
$MinPageSize = 0;
$MaxSectionSize = 0;
$this->Detail->Height = 1;
$MaxSectionSize = max($MaxSectionSize, $this->Detail->Height);
$this->Report_Footer = new clsSection($this);
$this->Report_Header = new clsSection($this);
$this->Page_Footer = new clsSection($this);
$this->Page_Footer->Height = 2;
$MinPageSize += $this->Page_Footer->Height;
$this->Page_Header = new clsSection($this);
$this->Page_Header->Height = 1;
$MinPageSize += $this->Page_Header->Height;
$this->Errors = new clsErrors();
$this->DataSource = new clspatient_visit_pregnancyDataSource($this);
$this->ds = & $this->DataSource;
$this->ViewMode = CCGetParam("ViewMode", "Web");
$PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(is_numeric($PageSize) && $PageSize > 0) {
$this->PageSize = $PageSize;
} else if($this->ViewMode == "Print") {
if (!is_numeric($PageSize) || $PageSize < 0)
$this->PageSize = 50;
else if ($PageSize == "0")
$this->PageSize = 0;
else
$this->PageSize = $PageSize;
} else {
if (!is_numeric($PageSize) || $PageSize < 0)
$this->PageSize = 40;
else if ($PageSize == "0")
$this->PageSize = 100;
else
$this->PageSize = min(100, $PageSize);
}
$MinPageSize += $MaxSectionSize;
if ($this->PageSize && $MinPageSize && $this->PageSize < $MinPageSize)
$this->PageSize = $MinPageSize;
$this->PageNumber = $this->ViewMode == "Print" ? 1 : intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0 ) {
$this->PageNumber = 1;
}
$this->SorterName = CCGetParam("patient_visit_pregnancyOrder", "");
$this->SorterDirection = CCGetParam("patient_visit_pregnancyDir", "");
$this->Report_TotalRecords = new clsControl(ccsReportLabel, "Report_TotalRecords", "Report_TotalRecords", ccsText, "", 0, $this);
$this->Report_TotalRecords->TotalFunction = "Count";
$this->Report_TotalRecords->IsEmptySource = true;
$this->Sorter_NextVisit = new clsSorter($this->ComponentName, "Sorter_NextVisit", $FileName, $this);
$this->Sorter_Town = new clsSorter($this->ComponentName, "Sorter_Town", $FileName, $this);
$this->Sorter_MobilePhone = new clsSorter($this->ComponentName, "Sorter_MobilePhone", $FileName, $this);
$this->Report_Row_Number = new clsControl(ccsReportLabel, "Report_Row_Number", "Report_Row_Number", ccsInteger, "", 0, $this);
$this->Report_Row_Number->TotalFunction = "Count";
$this->Report_Row_Number->IsEmptySource = true;
$this->NextVisit = new clsControl(ccsReportLabel, "NextVisit", "NextVisit", ccsDate, $DefaultDateFormat, "", $this);
$this->FamilyName = new clsControl(ccsReportLabel, "FamilyName", "FamilyName", ccsMemo, "", "", $this);
$this->GivenName = new clsControl(ccsReportLabel, "GivenName", "GivenName", ccsMemo, "", "", $this);
$this->Town = new clsControl(ccsReportLabel, "Town", "Town", ccsText, "", "", $this);
$this->MobilePhone = new clsControl(ccsReportLabel, "MobilePhone", "MobilePhone", ccsText, "", "", $this);
$this->NoRecords = new clsPanel("NoRecords", $this);
$this->PageBreak = new clsPanel("PageBreak", $this);
$this->Report_CurrentDate = new clsControl(ccsReportLabel, "Report_CurrentDate", "Report_CurrentDate", ccsText, array('ShortDate'), "", $this);
$this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpCentered, $this);
$this->Navigator->PageSizes = array("1", "5", "10", "25", "50");
}
//End Class_Initialize Event
//Initialize Method @3-6C59EE65
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = $this->PageSize;
$this->DataSource->AbsolutePage = $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//CheckErrors Method @3-7D922354
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->Report_TotalRecords->Errors->Count());
$errors = ($errors || $this->Report_Row_Number->Errors->Count());
$errors = ($errors || $this->NextVisit->Errors->Count());
$errors = ($errors || $this->FamilyName->Errors->Count());
$errors = ($errors || $this->GivenName->Errors->Count());
$errors = ($errors || $this->Town->Errors->Count());
$errors = ($errors || $this->MobilePhone->Errors->Count());
$errors = ($errors || $this->Report_CurrentDate->Errors->Count());
$errors = ($errors || $this->Errors->Count());
$errors = ($errors || $this->DataSource->Errors->Count());
return $errors;
}
//End CheckErrors Method
//GetErrors Method @3-14C2FE01
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->Report_TotalRecords->Errors->ToString());
$errors = ComposeStrings($errors, $this->Report_Row_Number->Errors->ToString());
$errors = ComposeStrings($errors, $this->NextVisit->Errors->ToString());
$errors = ComposeStrings($errors, $this->FamilyName->Errors->ToString());
$errors = ComposeStrings($errors, $this->GivenName->Errors->ToString());
$errors = ComposeStrings($errors, $this->Town->Errors->ToString());
$errors = ComposeStrings($errors, $this->MobilePhone->Errors->ToString());
$errors = ComposeStrings($errors, $this->Report_CurrentDate->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
//Show Method @3-7CF9D6DD
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->DataSource->Parameters["urls_FamilyName"] = CCGetFromGet("s_FamilyName", NULL);
$this->DataSource->Parameters["urls_GivenName"] = CCGetFromGet("s_GivenName", NULL);
$this->DataSource->Parameters["urls_NextVisit"] = CCGetFromGet("s_NextVisit", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$Groups = new clsGroupsCollectionpatient_visit_pregnancy($this);
$Groups->PageSize = $this->PageSize > 0 ? $this->PageSize : 0;
$is_next_record = $this->DataSource->next_record();
$this->IsEmpty = ! $is_next_record;
while($is_next_record) {
$this->DataSource->SetValues();
$this->NextVisit->SetValue($this->DataSource->NextVisit->GetValue());
$this->FamilyName->SetValue($this->DataSource->FamilyName->GetValue());
$this->GivenName->SetValue($this->DataSource->GivenName->GetValue());
$this->Town->SetValue($this->DataSource->Town->GetValue());
$this->MobilePhone->SetValue($this->DataSource->MobilePhone->GetValue());
$this->Report_TotalRecords->SetValue(1);
$this->Report_Row_Number->SetValue(1);
if (count($Groups->Groups) == 0) $Groups->OpenGroup("Report");
$Groups->AddItem();
$is_next_record = $this->DataSource->next_record();
}
if (!count($Groups->Groups))
$Groups->OpenGroup("Report");
else
$this->NoRecords->Visible = false;
$Groups->CloseGroup("Report");
$this->TotalPages = $Groups->TotalPages;
$this->TotalRows = $Groups->TotalRows;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$this->Attributes->Show();
$ReportBlock = "Report " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $ReportBlock;
if($this->CheckErrors()) {
$Tpl->replaceblock("", $this->GetErrors());
$Tpl->block_path = $ParentPath;
return;
} else {
$items = & $Groups->Groups;
$i = $Groups->Pages[min($this->PageNumber, $Groups->TotalPages) - 1];
$this->ControlsVisible["Report_Row_Number"] = $this->Report_Row_Number->Visible;
$this->ControlsVisible["NextVisit"] = $this->NextVisit->Visible;
$this->ControlsVisible["FamilyName"] = $this->FamilyName->Visible;
$this->ControlsVisible["GivenName"] = $this->GivenName->Visible;
$this->ControlsVisible["Town"] = $this->Town->Visible;
$this->ControlsVisible["MobilePhone"] = $this->MobilePhone->Visible;
do {
$this->Attributes->RestoreFromArray($items[$i]->Attributes);
$this->RowNumber = $items[$i]->RowNumber;
switch ($items[$i]->GroupType) {
Case "":
$Tpl->block_path = $ParentPath . "/" . $ReportBlock . "/Section Detail";
$this->Report_Row_Number->SetValue($items[$i]->Report_Row_Number);
$this->Report_Row_Number->Attributes->RestoreFromArray($items[$i]->_Report_Row_NumberAttributes);
$this->NextVisit->SetValue($items[$i]->NextVisit);
$this->NextVisit->Attributes->RestoreFromArray($items[$i]->_NextVisitAttributes);
$this->FamilyName->SetValue($items[$i]->FamilyName);
$this->FamilyName->Attributes->RestoreFromArray($items[$i]->_FamilyNameAttributes);
$this->GivenName->SetValue($items[$i]->GivenName);
$this->GivenName->Attributes->RestoreFromArray($items[$i]->_GivenNameAttributes);
$this->Town->SetValue($items[$i]->Town);
$this->Town->Attributes->RestoreFromArray($items[$i]->_TownAttributes);
$this->MobilePhone->SetValue($items[$i]->MobilePhone);
$this->MobilePhone->Attributes->RestoreFromArray($items[$i]->_MobilePhoneAttributes);
$this->Detail->CCSEventResult = CCGetEvent($this->Detail->CCSEvents, "BeforeShow", $this->Detail);
$this->Attributes->Show();
$this->Report_Row_Number->Show();
$this->NextVisit->Show();
$this->FamilyName->Show();
$this->GivenName->Show();
$this->Town->Show();
$this->MobilePhone->Show();
$Tpl->block_path = $ParentPath . "/" . $ReportBlock;
if ($this->Detail->Visible)
$Tpl->parseto("Section Detail", true, "Section Detail");
break;
case "Report":
if ($items[$i]->Mode == 1) {
$this->Report_TotalRecords->SetValue($items[$i]->Report_TotalRecords);
$this->Report_TotalRecords->Attributes->RestoreFromArray($items[$i]->_Report_TotalRecordsAttributes);
$this->Report_Header->CCSEventResult = CCGetEvent($this->Report_Header->CCSEvents, "BeforeShow", $this->Report_Header);
if ($this->Report_Header->Visible) {
$Tpl->block_path = $ParentPath . "/" . $ReportBlock . "/Section Report_Header";
$this->Attributes->Show();
$this->Report_TotalRecords->Show();
$Tpl->block_path = $ParentPath . "/" . $ReportBlock;
$Tpl->parseto("Section Report_Header", true, "Section Detail");
}
}
if ($items[$i]->Mode == 2) {
$this->Report_Footer->CCSEventResult = CCGetEvent($this->Report_Footer->CCSEvents, "BeforeShow", $this->Report_Footer);
if ($this->Report_Footer->Visible) {
$Tpl->block_path = $ParentPath . "/" . $ReportBlock . "/Section Report_Footer";
$this->NoRecords->Show();
$this->Attributes->Show();
$Tpl->block_path = $ParentPath . "/" . $ReportBlock;
$Tpl->parseto("Section Report_Footer", true, "Section Detail");
}
}
break;
case "Page":
if ($items[$i]->Mode == 1) {
$this->Page_Header->CCSEventResult = CCGetEvent($this->Page_Header->CCSEvents, "BeforeShow", $this->Page_Header);
if ($this->Page_Header->Visible) {
$Tpl->block_path = $ParentPath . "/" . $ReportBlock . "/Section Page_Header";
$this->Attributes->Show();
$this->Sorter_NextVisit->Show();
$this->Sorter_Town->Show();
$this->Sorter_MobilePhone->Show();
$Tpl->block_path = $ParentPath . "/" . $ReportBlock;
$Tpl->parseto("Section Page_Header", true, "Section Detail");
}
}
if ($items[$i]->Mode == 2 && !$this->UseClientPaging || $items[$i]->Mode == 1 && $this->UseClientPaging) {
$this->PageBreak->Visible = (($i < count($items) - 1) && ($this->ViewMode == "Print"));
$this->Report_CurrentDate->SetValue(CCFormatDate(CCGetDateArray(), $this->Report_CurrentDate->Format));
$this->Report_CurrentDate->Attributes->RestoreFromArray($items[$i]->_Report_CurrentDateAttributes);
$this->Navigator->PageNumber = $items[$i]->PageNumber;
$this->Navigator->TotalPages = $Groups->TotalPages;
$this->Navigator->Visible = ("Print" != $this->ViewMode);
$this->Page_Footer->CCSEventResult = CCGetEvent($this->Page_Footer->CCSEvents, "BeforeShow", $this->Page_Footer);
if ($this->Page_Footer->Visible) {
$Tpl->block_path = $ParentPath . "/" . $ReportBlock . "/Section Page_Footer";
$this->PageBreak->Show();
$this->Report_CurrentDate->Show();
$this->Navigator->Show();
$this->Attributes->Show();
$Tpl->block_path = $ParentPath . "/" . $ReportBlock;
$Tpl->parseto("Section Page_Footer", true, "Section Detail");
}
}
break;
}
$i++;
} while ($i < count($items) && ($this->ViewMode == "Print" || !($i > 1 && $items[$i]->GroupType == 'Page' && $items[$i]->Mode == 1)));
$Tpl->block_path = $ParentPath;
$Tpl->parse($ReportBlock);
$this->DataSource->close();
}
}
//End Show Method
} //End patient_visit_pregnancy Class @3-FCB6E20C
class clspatient_visit_pregnancyDataSource extends clsDBregistry_db { //patient_visit_pregnancyDataSource Class @3-E097A973
//DataSource Variables @3-BA0495E6
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $wp;
// Datasource fields
public $NextVisit;
public $FamilyName;
public $GivenName;
public $Town;
public $MobilePhone;
//End DataSource Variables
//DataSourceClass_Initialize Event @3-005AAE1B
function clspatient_visit_pregnancyDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Report patient_visit_pregnancy";
$this->Initialize();
$this->NextVisit = new clsField("NextVisit", ccsDate, $this->DateFormat);
$this->FamilyName = new clsField("FamilyName", ccsMemo, "");
$this->GivenName = new clsField("GivenName", ccsMemo, "");
$this->Town = new clsField("Town", ccsText, "");
$this->MobilePhone = new clsField("MobilePhone", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @3-61932089
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "NextVisit";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_NextVisit" => array("NextVisit", ""),
"Sorter_Town" => array("Town", ""),
"Sorter_MobilePhone" => array("MobilePhone", "")));
}
//End SetOrder Method
//Prepare Method @3-DF4378F9
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_FamilyName", ccsMemo, "", "", $this->Parameters["urls_FamilyName"], "", false);
$this->wp->AddParameter("2", "urls_GivenName", ccsMemo, "", "", $this->Parameters["urls_GivenName"], "", false);
$this->wp->AddParameter("3", "urls_NextVisit", ccsDate, $DefaultDateFormat, $this->DateFormat, $this->Parameters["urls_NextVisit"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "FamilyName", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsMemo),false);
$this->wp->Criterion[2] = $this->wp->Operation(opContains, "GivenName", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsMemo),false);
$this->wp->Criterion[3] = $this->wp->Operation(opEqual, "NextVisit", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsDate),false);
$this->Where = $this->wp->opAND(
false, $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]),
$this->wp->Criterion[3]);
}
//End Prepare Method
//Open Method @3-D0E36D33
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->SQL = "SELECT GivenName, FamilyName, pregnancy.PatientID AS pregnancy_PatientID, pregnancy.PregnancyID AS pregnancy_PregnancyID, visit.PregnancyID AS visit_PregnancyID,\n\n" .
"NextVisit, Town, MobilePhone \n\n" .
"FROM (pregnancy INNER JOIN visit ON\n\n" .
"visit.PregnancyID = pregnancy.PregnancyID) INNER JOIN patient ON\n\n" .
"pregnancy.PatientID = patient.PatientID {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
$this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @3-27CE33EE
function SetValues()
{
$this->NextVisit->SetDBValue(trim($this->f("NextVisit")));
$this->FamilyName->SetDBValue($this->f("FamilyName"));
$this->GivenName->SetDBValue($this->f("GivenName"));
$this->Town->SetDBValue($this->f("Town"));
$this->MobilePhone->SetDBValue($this->f("MobilePhone"));
}
//End SetValues Method
} //End patient_visit_pregnancyDataSource Class @3-FCB6E20C
class clsRecordpatient_pregnancy_visit { //patient_pregnancy_visit Class @19-FEC7DD99
//Variables @19-9E315808
// Public variables
public $ComponentType = "Record";
public $ComponentName;
public $Parent;
public $HTMLFormAction;
public $PressedButton;
public $Errors;
public $ErrorBlock;
public $FormSubmitted;
public $FormEnctype;
public $Visible;
public $IsEmpty;
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $InsertAllowed = false;
public $UpdateAllowed = false;
public $DeleteAllowed = false;
public $ReadAllowed = false;
public $EditMode = false;
public $ds;
public $DataSource;
public $ValidatingControls;
public $Controls;
public $Attributes;
// Class variables
//End Variables
//Class_Initialize Event @19-78194A9C
function clsRecordpatient_pregnancy_visit($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->Visible = true;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record patient_pregnancy_visit/Error";
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "patient_pregnancy_visit";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$CCSForm = explode(":", CCGetFromGet("ccsForm", ""), 2);
if(sizeof($CCSForm) == 1)
$CCSForm[1] = "";
list($FormName, $FormMethod) = $CCSForm;
$this->FormEnctype = "application/x-www-form-urlencoded";
$this->FormSubmitted = ($FormName == $this->ComponentName);
$Method = $this->FormSubmitted ? ccsPost : ccsGet;
$this->Button_DoSearch = new clsButton("Button_DoSearch", $Method, $this);
$this->s_FamilyName = new clsControl(ccsTextBox, "s_FamilyName", "s_FamilyName", ccsMemo, "", CCGetRequestParam("s_FamilyName", $Method, NULL), $this);
$this->s_GivenName = new clsControl(ccsTextBox, "s_GivenName", "s_GivenName", ccsMemo, "", CCGetRequestParam("s_GivenName", $Method, NULL), $this);
$this->s_NextVisit = new clsControl(ccsTextBox, "s_NextVisit", $CCSLocales->GetText("NextVisit"), ccsDate, $DefaultDateFormat, CCGetRequestParam("s_NextVisit", $Method, NULL), $this);
$this->DatePicker_s_NextVisit = new clsDatePicker("DatePicker_s_NextVisit", "patient_pregnancy_visit", "s_NextVisit", $this);
}
}
//End Class_Initialize Event
//Validate Method @19-C1FA5038
function Validate()
{
global $CCSLocales;
$Validation = true;
$Where = "";
$Validation = ($this->s_FamilyName->Validate() && $Validation);
$Validation = ($this->s_GivenName->Validate() && $Validation);
$Validation = ($this->s_NextVisit->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this);
$Validation = $Validation && ($this->s_FamilyName->Errors->Count() == 0);
$Validation = $Validation && ($this->s_GivenName->Errors->Count() == 0);
$Validation = $Validation && ($this->s_NextVisit->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @19-F155B3BF
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->s_FamilyName->Errors->Count());
$errors = ($errors || $this->s_GivenName->Errors->Count());
$errors = ($errors || $this->s_NextVisit->Errors->Count());
$errors = ($errors || $this->DatePicker_s_NextVisit->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//MasterDetail @19-ED598703
function SetPrimaryKeys($keyArray)
{
$this->PrimaryKeys = $keyArray;
}
function GetPrimaryKeys()
{
return $this->PrimaryKeys;
}
function GetPrimaryKey($keyName)
{
return $this->PrimaryKeys[$keyName];
}
//End MasterDetail
//Operation Method @19-8474E6D0
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
if(!$this->FormSubmitted) {
return;
}
if($this->FormSubmitted) {
$this->PressedButton = "Button_DoSearch";
if($this->Button_DoSearch->Pressed) {
$this->PressedButton = "Button_DoSearch";
}
}
$Redirect = "report_patient_attendance.php";
if($this->Validate()) {
if($this->PressedButton == "Button_DoSearch") {
$Redirect = "report_patient_attendance.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", array("Button_DoSearch", "Button_DoSearch_x", "Button_DoSearch_y")));
if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick", $this->Button_DoSearch)) {
$Redirect = "";
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//Show Method @19-880A8ACF
function Show()
{
global $CCSUseAmp;
global $Tpl;
global $FileName;
global $CCSLocales;
$Error = "";
if(!$this->Visible)
return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$RecordBlock = "Record " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $RecordBlock;
$this->EditMode = $this->EditMode && $this->ReadAllowed;
if (!$this->FormSubmitted) {
}
if($this->FormSubmitted || $this->CheckErrors()) {
$Error = "";
$Error = ComposeStrings($Error, $this->s_FamilyName->Errors->ToString());
$Error = ComposeStrings($Error, $this->s_GivenName->Errors->ToString());
$Error = ComposeStrings($Error, $this->s_NextVisit->Errors->ToString());
$Error = ComposeStrings($Error, $this->DatePicker_s_NextVisit->Errors->ToString());
$Error = ComposeStrings($Error, $this->Errors->ToString());
$Tpl->SetVar("Error", $Error);
$Tpl->Parse("Error", false);
}
$CCSForm = $this->EditMode ? $this->ComponentName . ":" . "Edit" : $this->ComponentName;
$this->HTMLFormAction = $FileName . "?" . CCAddParam(CCGetQueryString("QueryString", ""), "ccsForm", $CCSForm);
$Tpl->SetVar("Action", !$CCSUseAmp ? $this->HTMLFormAction : str_replace("&", "&", $this->HTMLFormAction));
$Tpl->SetVar("HTMLFormName", $this->ComponentName);
$Tpl->SetVar("HTMLFormEnctype", $this->FormEnctype);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
$this->Attributes->Show();
if(!$this->Visible) {
$Tpl->block_path = $ParentPath;
return;
}
$this->Button_DoSearch->Show();
$this->s_FamilyName->Show();
$this->s_GivenName->Show();
$this->s_NextVisit->Show();
$this->DatePicker_s_NextVisit->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End patient_pregnancy_visit Class @19-FCB6E20C
//Initialize Page @1-A0648225
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
$Attributes = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = FileName;
$Redirect = "";
$TemplateFileName = "report_patient_attendance.html";
$BlockToParse = "main";
$TemplateEncoding = "UTF-8";
$ContentType = "text/html";
$PathToRoot = "./";
$Charset = $Charset ? $Charset : "utf-8";
//End Initialize Page
//Check SSL @1-E30DD771
CCCheckSSL();
//End Check SSL
//Include events file @1-5E4E68BA
include_once("./report_patient_attendance_events.php");
//End Include events file
//Before Initialize @1-E870CEBC
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage);
//End Before Initialize
//Initialize Objects @1-AB50EE7E
$DBregistry_db = new clsDBregistry_db();
$MainPage->Connections["registry_db"] = & $DBregistry_db;
$Attributes = new clsAttributes("page:");
$MainPage->Attributes = & $Attributes;
// Controls
$topmenu = new clstopmenu("", "topmenu", $MainPage);
$topmenu->Initialize();
$patient_visit_pregnancy = new clsReportpatient_visit_pregnancy("", $MainPage);
$patient_pregnancy_visit = new clsRecordpatient_pregnancy_visit("", $MainPage);
$Report_Print = new clsControl(ccsLink, "Report_Print", "Report_Print", ccsText, "", CCGetRequestParam("Report_Print", ccsGet, NULL), $MainPage);
$Report_Print->Page = "report_patient_attendance.php";
$MainPage->topmenu = & $topmenu;
$MainPage->patient_visit_pregnancy = & $patient_visit_pregnancy;
$MainPage->patient_pregnancy_visit = & $patient_pregnancy_visit;
$MainPage->Report_Print = & $Report_Print;
$Report_Print->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$Report_Print->Parameters = CCAddParam($Report_Print->Parameters, "ViewMode", "Print");
$patient_visit_pregnancy->Initialize();
BindEvents();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
if ($Charset) {
header("Content-Type: " . $ContentType . "; charset=" . $Charset);
} else {
header("Content-Type: " . $ContentType);
}
//End Initialize Objects
//Initialize HTML Template @1-A06E9207
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
$Tpl = new clsTemplate($FileEncoding, $TemplateEncoding);
$Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "UTF-8", "replace");
$Tpl->block_path = "/$BlockToParse";
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
$Attributes->SetValue("pathToRoot", "");
$Attributes->Show();
//End Initialize HTML Template
//Execute Components @1-2E8B2959
$topmenu->Operations();
$patient_pregnancy_visit->Operation();
//End Execute Components
//Go to destination page @1-8DA03BE2
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBregistry_db->close();
header("Location: " . $Redirect);
$topmenu->Class_Terminate();
unset($topmenu);
unset($patient_visit_pregnancy);
unset($patient_pregnancy_visit);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-32FC1D1C
$topmenu->Show();
$patient_visit_pregnancy->Show();
$patient_pregnancy_visit->Show();
$Report_Print->Show();
$Tpl->block_path = "";
$Tpl->Parse($BlockToParse, false);
if (!isset($main_block)) $main_block = $Tpl->GetVar($BlockToParse);
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
if ($CCSEventResult) echo $main_block;
//End Show Page
//Unload Page @1-B8A5C190
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBregistry_db->close();
$topmenu->Class_Terminate();
unset($topmenu);
unset($patient_visit_pregnancy);
unset($patient_pregnancy_visit);
unset($Tpl);
//End Unload Page
?>
| isamllr/mch-registry | report_patient_attendance.php | PHP | gpl-3.0 | 44,956 | [
30522,
1026,
1029,
25718,
1013,
1013,
2421,
2691,
6764,
1030,
1015,
1011,
1038,
2581,
2278,
28154,
2850,
2050,
9375,
1006,
1000,
5816,
15069,
1000,
1010,
1000,
1012,
1000,
1007,
1025,
9375,
1006,
1000,
4130,
3406,
10841,
14343,
3372,
13704,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.wso2.carbon.bpmn.core.internal;
import org.activiti.engine.ProcessEngines;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.bpmn.core.ActivitiEngineBuilder;
import org.wso2.carbon.bpmn.core.BPMNServerHolder;
import org.wso2.carbon.bpmn.core.db.DataSourceHandler;
import org.wso2.carbon.bpmn.core.deployment.TenantManager;
import org.wso2.carbon.bpmn.core.exception.BPMNMetaDataTableCreationException;
import org.wso2.carbon.bpmn.core.exception.DatabaseConfigurationException;
import org.wso2.carbon.registry.core.service.RegistryService;
/**
* @scr.component name="org.wso2.carbon.bpmn.core.internal.BPMNServiceComponent" immediate="true"
* @scr.reference name="registry.service" interface="org.wso2.carbon.registry.core.service.RegistryService"
* cardinality="1..1" policy="dynamic" bind="setRegistryService" unbind="unsetRegistryService"
*/
public class BPMNServiceComponent {
private static Log log = LogFactory.getLog(BPMNServiceComponent.class);
protected void activate(ComponentContext ctxt) {
log.info("Initializing the BPMN core component...");
try {
BPMNServerHolder holder = BPMNServerHolder.getInstance();
ActivitiEngineBuilder activitiEngineBuilder = new ActivitiEngineBuilder();
holder.setEngine(activitiEngineBuilder.buildEngine());
holder.setTenantManager(new TenantManager());
DataSourceHandler dataSourceHandler = new DataSourceHandler();
dataSourceHandler.initDataSource(activitiEngineBuilder.getDataSourceJndiName());
dataSourceHandler.closeDataSource();
} catch (BPMNMetaDataTableCreationException e) {
log.error("Could not create BPMN checksum table", e);
} catch (DatabaseConfigurationException e) {
log.error("Could not create BPMN checksum table", e);
}catch (Throwable e) {
log.error("Failed to initialize the BPMN core component.", e);
}
}
protected void deactivate(ComponentContext ctxt) {
log.info("Stopping the BPMN core component...");
ProcessEngines.destroy();
}
protected void setRegistryService(RegistryService registrySvc) {
if (log.isDebugEnabled()) {
log.debug("RegistryService bound to the BPMN component");
}
BPMNServerHolder.getInstance().setRegistryService(registrySvc);
}
public void unsetRegistryService(RegistryService registryService) {
if (log.isDebugEnabled()) {
log.debug("RegistryService unbound from the BPMN component");
}
BPMNServerHolder.getInstance().unsetRegistryService(registryService);
}
}
| maheshika/carbon-business-process | components/bpmn/org.wso2.carbon.bpmn/src/main/java/org/wso2/carbon/bpmn/core/internal/BPMNServiceComponent.java | Java | apache-2.0 | 3,411 | [
30522,
1013,
1008,
1008,
1008,
9385,
1006,
1039,
1007,
2297,
1010,
1059,
6499,
2475,
4297,
1012,
1006,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
6499,
2475,
1012,
30524,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
2007,
1996,
6105,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"
# ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default) and
# :mongoid (bson_ext recommended) by default. Other ORMs may be
# available as additional gems.
require 'devise/orm/active_record'
# ==> Configuration for any authentication mechanism
# Configure which keys are used when authenticating a user. The default is
# just :email. You can configure it to use [:username, :subdomain], so for
# authenticating a user, both parameters are required. Remember that those
# parameters are used only when authenticating and not when retrieving from
# session. If you need permissions, you should implement that in a before filter.
# You can also supply a hash where the value is a boolean determining whether
# or not authentication should be aborted when the value is not present.
# config.authentication_keys = [ :email ]
# Configure parameters from the request object used for authentication. Each entry
# given should be a request method and it will automatically be passed to the
# find_for_authentication method and considered in your model lookup. For instance,
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
# The same considerations mentioned for authentication_keys also apply to request_keys.
# config.request_keys = []
# Configure which authentication keys should be case-insensitive.
# These keys will be downcased upon creating or modifying a user and when used
# to authenticate or find a user. Default is :email.
config.case_insensitive_keys = [ :email ]
# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating or
# modifying a user and when used to authenticate or find a user. Default is :email.
config.strip_whitespace_keys = [ :email ]
# Tell if authentication through request.params is enabled. True by default.
# It can be set to an array that will enable params authentication only for the
# given strategies, for example, `config.params_authenticatable = [:database]` will
# enable it only for database (email + password) authentication.
# config.params_authenticatable = true
# Tell if authentication through HTTP Basic Auth is enabled. False by default.
# It can be set to an array that will enable http authentication only for the
# given strategies, for example, `config.http_authenticatable = [:token]` will
# enable it only for token authentication.
# config.http_authenticatable = false
# If http headers should be returned for AJAX requests. True by default.
# config.http_authenticatable_on_xhr = true
# The realm used in Http Basic Authentication. "Application" by default.
# config.http_authentication_realm = "Application"
# It will change confirmation, password recovery and other workflows
# to behave the same regardless if the e-mail provided was right or wrong.
# Does not affect registerable.
# config.paranoid = true
# By default Devise will store the user in session. You can skip storage for
# :http_auth and :token_auth by adding those symbols to the array below.
# Notice that if you are skipping storage for all authentication paths, you
# may want to disable generating routes to Devise's sessions controller by
# passing :skip => :sessions to `devise_for` in your config/routes.rb
config.skip_session_storage = [:http_auth]
# ==> Configuration for :database_authenticatable
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
# using other encryptors, it sets how many times you want the password re-encrypted.
#
# Limiting the stretches to just one in testing will increase the performance of
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
# a value less than 10 in other environments.
config.stretches = Rails.env.test? ? 1 : 10
# Setup a pepper to generate the encrypted password.
# config.pepper = "513098171f1582e4360d1e2b8b13de4906234f4dbac0a2c50bb4a24a570befcf7a3505fa6ebcedd96df940bacfb80e9ec8ef293b4cd464149294cb95ace524ba"
# ==> Configuration for :confirmable
# A period that the user is allowed to access the website even without
# confirming his account. For instance, if set to 2.days, the user will be
# able to access the website for two days without confirming his account,
# access will be blocked just in the third day. Default is 0.days, meaning
# the user cannot access the website without confirming his account.
# config.allow_unconfirmed_access_for = 2.days
# If true, requires any email changes to be confirmed (exactly the same way as
# initial account confirmation) to be applied. Requires additional unconfirmed_email
# db field (see migrations). Until confirmed new email is stored in
# unconfirmed email column, and copied to email column on successful confirmation.
config.reconfirmable = true
# Defines which key will be used when confirming an account
# config.confirmation_keys = [ :email ]
# ==> Configuration for :rememberable
# The time the user will be remembered without asking for credentials again.
# config.remember_for = 2.weeks
# If true, extends the user's remember period when remembered via cookie.
# config.extend_remember_period = false
# Options to be passed to the created cookie. For instance, you can set
# :secure => true in order to force SSL only cookies.
# config.rememberable_options = {}
# ==> Configuration for :validatable
# Range for password length. Default is 6..128.
# config.password_length = 6..128
# Email regex used to validate email formats. It simply asserts that
# an one (and only one) @ exists in the given string. This is mainly
# to give user feedback and not to assert the e-mail validity.
# config.email_regexp = /\A[^@]+@[^@]+\z/
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
# time the user will be asked for credentials again. Default is 30 minutes.
# config.timeout_in = 30.minutes
# ==> Configuration for :lockable
# Defines which strategy will be used to lock an account.
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
# :none = No lock strategy. You should handle locking by yourself.
# config.lock_strategy = :failed_attempts
# Defines which key will be used when locking and unlocking an account
# config.unlock_keys = [ :email ]
# Defines which strategy will be used to unlock an account.
# :email = Sends an unlock link to the user email
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
# :both = Enables both strategies
# :none = No unlock strategy. You should handle unlocking by yourself.
# config.unlock_strategy = :both
# Number of authentication tries before locking an account if lock_strategy
# is failed attempts.
# config.maximum_attempts = 20
# Time interval to unlock the account if :time is enabled as unlock_strategy.
# config.unlock_in = 1.hour
# ==> Configuration for :recoverable
#
# Defines which key will be used when recovering the password for an account
# config.reset_password_keys = [ :email ]
# Time interval you can reset your password with a reset password key.
# Don't put a too small interval or your users won't have the time to
# change their passwords.
config.reset_password_within = 6.hours
# ==> Configuration for :encryptable
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
# REST_AUTH_SITE_KEY to pepper)
# config.encryptor = :sha512
# ==> Configuration for :token_authenticatable
# Defines name of the authentication token params key
# config.token_authentication_key = :auth_token
# ==> Scopes configuration
# Turn scoped views on. Before rendering "sessions/new", it will first check for
# "users/sessions/new". It's turned off by default because it's slower if you
# are using only default views.
# config.scoped_views = false
# Configure the default scope given to Warden. By default it's the first
# devise role declared in your routes (usually :user).
# config.default_scope = :user
# Configure sign_out behavior.
# Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
# The default is true, which means any logout action will sign out all active scopes.
# config.sign_out_all_scopes = true
# ==> Navigation configuration
# Lists the formats that should be treated as navigational. Formats like
# :html, should redirect to the sign in page when the user does not have
# access, but formats like :xml or :json, should return 401.
#
# If you have any extra navigational formats, like :iphone or :mobile, you
# should add them to the navigational formats lists.
#
# The "*/*" below is required to match Internet Explorer requests.
# config.navigational_formats = ["*/*", :html]
# The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = Rails.env.test? ? :get : :delete
# ==> OmniAuth
# Add a new OmniAuth provider. Check the wiki for more information on setting
# up on your models and hooks.
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
# ==> Warden configuration
# If you want to use other strategies, that are not supported by Devise, or
# change the failure app, you can configure them inside the config.warden block.
#
# config.warden do |manager|
# manager.intercept_401 = false
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
# end
end
| woese/guara-crm | config/initializers/devise.rb | Ruby | mit | 10,530 | [
30522,
1001,
2224,
2023,
8103,
2000,
9530,
8873,
27390,
2063,
14386,
3366,
5653,
2121,
1010,
13745,
18008,
1998,
2061,
5743,
1012,
1001,
2116,
1997,
2122,
9563,
7047,
2064,
2022,
2275,
3442,
1999,
2115,
2944,
1012,
14386,
3366,
1012,
16437,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Core\UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JMS\Serializer\Annotation as JMS;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity
* @ORM\Table(name="google_accounts", indexes={@ORM\Index(columns={"user_id"}), @ORM\Index(columns={"followers_count"})})
* @UniqueEntity(
* fields={"socialAccountId"},
* message="errors.social_account_exist"
* )
*
* @JMS\ExclusionPolicy("all")
*/
class GoogleAccount implements SocialAccountInterface
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*
* @JMS\Expose
*/
protected $id;
/**
* @ORM\OneToOne(targetEntity="Core\UserBundle\Entity\User", inversedBy="googleAccount")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
*/
protected $user;
/**
* @ORM\Column(type="string")
* @Assert\NotBlank(message="errors.global.not_blank")
*
* @JMS\Groups({"OnlyForAdmin"})
* @JMS\Expose
*/
protected $name;
/**
* @ORM\Column(type="string", unique=true)
* @Assert\NotBlank(message="errors.global.not_blank")
*
* @JMS\Groups({"OnlyForAdmin"})
* @JMS\Expose
*/
protected $email;
/**
* @ORM\Column(type="string")
* @Assert\NotBlank(message="errors.global.not_blank")
*
* @JMS\Groups({"OnlyForAdmin"})
* @JMS\Expose
*/
protected $language;
/**
* @ORM\Column(name="social_account_id", type="string", unique=true)
* @Assert\NotBlank(message="errors.global.not_blank")
*
* @JMS\Groups({"OnlyForAdmin"})
* @JMS\Expose
*/
protected $socialAccountId;
/**
* @ORM\Column(name="followers_count", type="integer")
* @Assert\NotBlank(message="errors.global.not_blank")
*
* @JMS\Expose
*/
protected $followersCount;
/**
* @ORM\Column(name="youtube_followers_count", type="integer", nullable=true)
*
* @JMS\Expose
*/
protected $youtubeFollowersCount;
/**
* @ORM\Column(name="created_at", type="datetime")
* @Assert\NotBlank(message="errors.global.not_blank")
* @Assert\DateTime
*
* @JMS\Groups({"OnlyForAdmin"})
* @JMS\Expose
*/
protected $createdAt;
/**
* @ORM\Column(name="updated_at", type="datetime")
* @Assert\NotBlank(message="errors.global.not_blank")
* @Assert\DateTime
*
* @JMS\Groups({"OnlyForAdmin"})
* @JMS\Expose
*/
protected $updatedAt;
/**
* @ORM\Column(name="youtube_updated_at", type="datetime", nullable=true)
* @Assert\DateTime
*
* @JMS\Groups({"OnlyForAdmin"})
* @JMS\Expose
*/
protected $youtubeUpdatedAt;
public function __construct()
{
$this->createdAt = new \DateTime();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set name.
*
* @param string $name
*
* @return GoogleAccount
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name.
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set email.
*
* @param string $email
*
* @return GoogleAccount
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get email.
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set language.
*
* @param string $language
*
* @return GoogleAccount
*/
public function setLanguage($language)
{
$this->language = $language;
return $this;
}
/**
* Get language.
*
* @return string
*/
public function getLanguage()
{
return $this->language;
}
/**
* Set socialAccountId.
*
* @param string $socialAccountId
*
* @return GoogleAccount
*/
public function setSocialAccountId($socialAccountId)
{
$this->socialAccountId = $socialAccountId;
return $this;
}
/**
* Get socialAccountId.
*
* @return string
*/
public function getSocialAccountId()
{
return $this->socialAccountId;
}
/**
* Set followersCount.
*
* @param int $followersCount
*
* @return GoogleAccount
*/
public function setFollowersCount($followersCount)
{
$this->followersCount = $followersCount;
return $this;
}
/**
* Get followersCount.
*
* @return int
*/
public function getFollowersCount()
{
return $this->followersCount;
}
/**
* Set createdAt.
*
* @param \DateTime $createdAt
*
* @return GoogleAccount
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt.
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set user.
*
* @param \Core\UserBundle\Entity\User $user
*
* @return GoogleAccount
*/
public function setUser(\Core\UserBundle\Entity\User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user.
*
* @return \Core\UserBundle\Entity\User
*/
public function getUser()
{
return $this->user;
}
/**
* Set youtubeFollowersCount.
*
* @param int $youtubeFollowersCount
*
* @return GoogleAccount
*/
public function setYoutubeFollowersCount($youtubeFollowersCount)
{
$this->youtubeFollowersCount = $youtubeFollowersCount;
return $this;
}
/**
* Get youtubeFollowersCount.
*
* @return int
*/
public function getYoutubeFollowersCount()
{
return $this->youtubeFollowersCount;
}
/**
* Set updatedAt.
*
* @param \DateTime $updatedAt
*
* @return FacebookAccount
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt.
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set youtubeUpdatedAt.
*
* @param \DateTime $youtubeUpdatedAt
*
* @return FacebookAccount
*/
public function setYoutubeUpdatedAt($youtubeUpdatedAt)
{
$this->youtubeUpdatedAt = $youtubeUpdatedAt;
return $this;
}
/**
* Get youtubeUpdatedAt.
*
* @return \DateTime
*/
public function getYoutubeUpdatedAt()
{
return $this->youtubeUpdatedAt;
}
}
| mikecpl/cashforpost | src/Core/UserBundle/Entity/GoogleAccount.php | PHP | mit | 7,092 | [
30522,
1026,
1029,
25718,
3415,
15327,
4563,
1032,
5310,
27265,
2571,
1032,
9178,
1025,
2224,
8998,
1032,
2030,
2213,
1032,
12375,
2004,
2030,
2213,
1025,
2224,
25353,
2213,
14876,
4890,
1032,
6922,
1032,
9398,
8844,
1032,
14679,
2004,
2086... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>GLFW: Globals</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<div class="glfwheader">
<a href="http://www.glfw.org/" id="glfwhome">GLFW</a>
<ul class="glfwnavbar">
<li><a href="http://www.glfw.org/documentation.html">Documentation</a></li>
<li><a href="http://www.glfw.org/download.html">Download</a></li>
<li><a href="http://www.glfw.org/media.html">Media</a></li>
<li><a href="http://www.glfw.org/community.html">Community</a></li>
</ul>
</div>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li class="current"><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_func.html"><span>Functions</span></a></li>
<li><a href="globals_type.html"><span>Typedefs</span></a></li>
<li class="current"><a href="globals_defs.html"><span>Macros</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="globals_defs.html#index_a"><span>a</span></a></li>
<li><a href="globals_defs_b.html#index_b"><span>b</span></a></li>
<li><a href="globals_defs_c.html#index_c"><span>c</span></a></li>
<li><a href="globals_defs_d.html#index_d"><span>d</span></a></li>
<li><a href="globals_defs_e.html#index_e"><span>e</span></a></li>
<li><a href="globals_defs_f.html#index_f"><span>f</span></a></li>
<li><a href="globals_defs_g.html#index_g"><span>g</span></a></li>
<li><a href="globals_defs_h.html#index_h"><span>h</span></a></li>
<li><a href="globals_defs_i.html#index_i"><span>i</span></a></li>
<li><a href="globals_defs_j.html#index_j"><span>j</span></a></li>
<li><a href="globals_defs_k.html#index_k"><span>k</span></a></li>
<li><a href="globals_defs_l.html#index_l"><span>l</span></a></li>
<li class="current"><a href="globals_defs_m.html#index_m"><span>m</span></a></li>
<li><a href="globals_defs_n.html#index_n"><span>n</span></a></li>
<li><a href="globals_defs_o.html#index_o"><span>o</span></a></li>
<li><a href="globals_defs_p.html#index_p"><span>p</span></a></li>
<li><a href="globals_defs_r.html#index_r"><span>r</span></a></li>
<li><a href="globals_defs_s.html#index_s"><span>s</span></a></li>
<li><a href="globals_defs_t.html#index_t"><span>t</span></a></li>
<li><a href="globals_defs_v.html#index_v"><span>v</span></a></li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
 
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
<li>GLFW_MAXIMIZED
: <a class="el" href="glfw3_8h.html#ad8ccb396253ad0b72c6d4c917eb38a03">glfw3.h</a>
</li>
<li>GLFW_MOD_ALT
: <a class="el" href="group__mods.html#gad2acd5633463c29e07008687ea73c0f4">glfw3.h</a>
</li>
<li>GLFW_MOD_CONTROL
: <a class="el" href="group__mods.html#ga6ed94871c3208eefd85713fa929d45aa">glfw3.h</a>
</li>
<li>GLFW_MOD_SHIFT
: <a class="el" href="group__mods.html#ga14994d3196c290aaa347248e51740274">glfw3.h</a>
</li>
<li>GLFW_MOD_SUPER
: <a class="el" href="group__mods.html#ga6b64ba10ea0227cf6f42efd0a220aba1">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_1
: <a class="el" href="group__buttons.html#ga181a6e875251fd8671654eff00f9112e">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_2
: <a class="el" href="group__buttons.html#ga604b39b92c88ce9bd332e97fc3f4156c">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_3
: <a class="el" href="group__buttons.html#ga0130d505563d0236a6f85545f19e1721">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_4
: <a class="el" href="group__buttons.html#ga53f4097bb01d5521c7d9513418c91ca9">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_5
: <a class="el" href="group__buttons.html#gaf08c4ddecb051d3d9667db1d5e417c9c">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_6
: <a class="el" href="group__buttons.html#gae8513e06aab8aa393b595f22c6d8257a">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_7
: <a class="el" href="group__buttons.html#ga8b02a1ab55dde45b3a3883d54ffd7dc7">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_8
: <a class="el" href="group__buttons.html#ga35d5c4263e0dc0d0a4731ca6c562f32c">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_LAST
: <a class="el" href="group__buttons.html#gab1fd86a4518a9141ec7bcde2e15a2fdf">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_LEFT
: <a class="el" href="group__buttons.html#gaf37100431dcd5082d48f95ee8bc8cd56">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_MIDDLE
: <a class="el" href="group__buttons.html#ga34a4d2a701434f763fd93a2ff842b95a">glfw3.h</a>
</li>
<li>GLFW_MOUSE_BUTTON_RIGHT
: <a class="el" href="group__buttons.html#ga3e2f2cf3c4942df73cc094247d275e74">glfw3.h</a>
</li>
</ul>
</div><!-- contents -->
<address class="footer">
<p>
Last update on Wed Feb 1 2017 for GLFW 3.2.1
</p>
</address>
</body>
</html>
| MichaelCoughlinAN/Odds-N-Ends | C++/OpenGL_Example_1/build/glfw-3.2.1/docs/html/globals_defs_m.html | HTML | gpl-3.0 | 7,738 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
1060,
11039,
19968,
1015,
1012,
1014,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
30524,
7479,
1012,
1059,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2012 Max Toro Q.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MvcAccount {
/// <summary>
/// A <see cref="PasswordService"/> that does not encrypt passwords.
/// </summary>
public class ClearTextPasswordService : PasswordService {
/// <summary>
/// Returns <paramref name="clearTextPassword"/> unchanged.
/// </summary>
/// <param name="clearTextPassword">The password in clear text.</param>
/// <returns><paramref name="clearTextPassword"/> unchanged.</returns>
public override string ProcessPasswordForStorage(string clearTextPassword) {
return clearTextPassword;
}
/// <summary>
/// Compares a password provided by a user to one that is stored.
/// </summary>
/// <param name="clearTextPassword">The password in clear text provided by a user.</param>
/// <param name="storedPassword">The stored password.</param>
/// <returns>true if the passwords are equal; otherwise false.</returns>
public override bool PasswordEquals(string clearTextPassword, string storedPassword) {
return String.Equals(clearTextPassword, storedPassword, StringComparison.Ordinal);
}
}
}
| ZenHiro/MvcAccount | src/MvcAccount/ClearTextPasswordService.cs | C# | apache-2.0 | 1,818 | [
30522,
1013,
1013,
9385,
2262,
4098,
23790,
1053,
1012,
1013,
1013,
1013,
1013,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1013,
1013,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* 前台 报纸客户端基类 生成类
* @category iCMS
* @package iCMS_FrameWork1_RuleClass_Gen_Newspaper
* @author zhangchi
*/
class NewspaperBaseClientGen extends BaseClientGen
{
//检查当前版面是否属于免费内容
function IsFreeReadByNewspaperArticleId($newspaperArticleId)
{
$result = false;
$newspaperArticlePublicData = new NewspaperArticlePublicData();
$newspaperPagePublicData = new NewspaperPagePublicData();
$newspaperPublicData = new NewspaperPublicData();
$newspaperArticleTitle = $newspaperArticlePublicData->GetNewspaperArticleTitle($newspaperArticleId, true);
$newspaperArticleType = $newspaperArticlePublicData->GetNewspaperArticleType($newspaperArticleId, true);
$newspaperPageId = $newspaperArticlePublicData->GetNewspaperPageId($newspaperArticleId, true);
$newspaperPageName = $newspaperPagePublicData->GetNewspaperPageName($newspaperPageId, true);
$newspaperId = $newspaperPagePublicData->GetNewspaperId($newspaperPageId, true);
//如果文章属于广告类别或者文章所属版面名称带了广告两字或文章标题带有广告两字可以免费查看
if ($newspaperArticleType == 2
|| (!empty($newspaperPageName) && strpos($newspaperPageName, "广告") !== false)
|| (!empty($newspaperArticleTitle) && strpos($newspaperArticleTitle, "广告") !== false)
) {
$result = true;
}
else if ($newspaperId > 0 && $newspaperPageId > 0) { //当日报纸免费
$publishDate = $newspaperPublicData->GetPublishDate($newspaperId, true);
$publishDate = date("Y-m-d", strtotime($publishDate));
$nowDate = date("Y-m-d", time());
if ($publishDate == $nowDate) {
$result = true;
}
}
// else if ($newspaperId > 0 && $newspaperPageId > 0) { //当日报纸前八版免费
// $pageIndex = self::GetNewspaperPageIndex($newspaperId, $newspaperPageId);
// $publishDate = $newspaperPublicData->GetPublishDate($newspaperId, true);
// $publishDate = date("Y-m-d", strtotime($publishDate));
// $nowDate = date("Y-m-d", time());
// if ($publishDate == $nowDate && $pageIndex >= 0 && $pageIndex < 8) {
// $result = true;
// }
// }
return $result;
}
//得到当前版面序号
function GetNewspaperPageIndex($newspaperId,$newspaperPageId)
{
$result=-1;
if ($newspaperId > 0 && $newspaperPageId > 0) {
$newspaperPagePublicData = new NewspaperPagePublicData();
$newspaperPageIdList = $newspaperPagePublicData->GetNewspaperIdList($newspaperId, true);
if (count($newspaperPageIdList) > 0) {
$newspaperPageIdArr = array();
foreach($newspaperPageIdList as $columnValue) {
$newspaperPageIdArr[] = $columnValue["NewspaperPageId"];
}
$result = array_search($newspaperPageId, $newspaperPageIdArr);
}
}
return $result;
}
//根据用户判断是否能看报纸
function IsAuthorizedUser($siteId,$userId,$newspaperArticleId)
{
$result=false;
if ($userId > 0){
//是否购买了报纸
$newspaperArticlePublicData = new NewspaperArticlePublicData();
$newspaperPagePublicData = new NewspaperPagePublicData();
$newspaperPageId = $newspaperArticlePublicData->GetNewspaperPageId($newspaperArticleId, true);
$newspaperId = $newspaperPagePublicData->GetNewspaperId($newspaperPageId, true);
$newspaperPublicData = new NewspaperPublicData();
$channelId=$newspaperPublicData->GetChannelId($newspaperId, true);
$publishDate=$newspaperPublicData->GetPublishDate($newspaperId, true);
$userOrderNewspaperPublicData = new UserOrderNewspaperPublicData();
$isBuy = $userOrderNewspaperPublicData->CheckIsBoughtInTimeByChannelId($userId, $channelId, $publishDate);
//可以直接免费看付费报纸
$canExplore = parent::GetUserPopedomBoolValue($siteId,$userId,UserPopedomData::UserCanExploreMustPayNewspaper);
//购买了报纸或有权限可以直接免费看报纸
if ($isBuy>0 || $canExplore){
$result=true;
}
}
return $result;
}
} | unique525/gb_0 | FrameWork1/RuleClass/Gen/Newspaper/NewspaperBaseClientGen.php | PHP | gpl-3.0 | 4,509 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
1776,
100,
100,
100,
100,
100,
100,
100,
100,
1910,
1854,
100,
1008,
1030,
4696,
24582,
5244,
1008,
1030,
7427,
24582,
5244,
1035,
7705,
2487,
1035,
3627,
26266,
1035,
8991,
1035,
3780,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2012-2014 Netherlands eScience Center.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at the following location:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For the full license, see: LICENSE.txt (located in the root folder of this distribution).
* ---
*/
// source:
package nl.esciencecenter.ptk.web;
/**
* Interface for Managed HTTP Streams.
*/
public interface WebStream {
public boolean autoClose();
//public boolean isChunked();
}
| NLeSC/Platinum | ptk-web/src/main/java/nl/esciencecenter/ptk/web/WebStream.java | Java | apache-2.0 | 941 | [
30522,
1013,
1008,
1008,
9385,
2262,
1011,
2297,
4549,
9686,
23402,
5897,
2415,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1012,
1008,
2017,
2089,
2025,
2224,
2023,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# This shell snippet unsets all variables/functions that can be used in
# a package template and can also be used in subpkgs.
## VARIABLES
unset -v noarch conf_files mutable_files preserve triggers
unset -v depends run_depends replaces provides conflicts tags
# hooks/post-install/03-strip-and-debug-pkgs
unset -v nostrip nostrip_files
# hooks/pre-pkg/04-generate-runtime-deps
unset -v noverifyrdeps allow_unknown_shlibs shlib_requires
# hooks/pre-pkg/06-prepare-32bit
unset -v lib32depends lib32disabled lib32files lib32mode lib32symlinks
# hooks/pre-pkg/06-shlib-provides
unset -v noshlibprovides shlib_provides
# xbps-triggers: system-accounts
unset -v system_accounts system_groups
# xbps-triggers: font-dirs
unset -v font_dirs
# xbps-triggers: xml-catalog
unset -v xml_entries sgml_entries xml_catalogs sgml_catalogs
# xbps-triggers: pycompile
unset -v pycompile_version pycompile_dirs pycompile_module
# xbps-triggers: dkms
unset -v dkms_modules
# xbps-triggers: kernel-hooks
unset -v kernel_hooks_version
# xbps-triggers: mkdirs
unset -v make_dirs
# xbps-triggers: binfmts
unset -v binfmts
| ylixir/void-packages | common/environment/setup-subpkg/subpkg.sh | Shell | bsd-2-clause | 1,110 | [
30522,
1001,
2023,
5806,
1055,
3490,
29519,
4895,
13462,
2015,
2035,
10857,
1013,
4972,
2008,
2064,
2022,
2109,
1999,
1001,
1037,
7427,
23561,
1998,
2064,
2036,
2022,
2109,
1999,
4942,
2361,
2243,
5620,
1012,
1001,
1001,
10857,
4895,
13462,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import { Injectable } from '@angular/core';
@Injectable()
export class AuthConfiguration {
// The Issuer Identifier for the OpenID Provider (which is typically obtained during Discovery) MUST exactly match the value of the iss (issuer) Claim.
public iss = 'http://robustidentity.tmentorsinc.com'; //identity server
public server = 'http://robustidentity.tmentorsinc.com';//identity server
public redirect_url = 'http://robust.tmentorsinc.com';
// This is required to get the signing keys so that the signiture of the Jwt can be validated.
public jwks_url = 'http://robustidentity.tmentorsinc.com/.well-known/openid-configuration/jwks';
public userinfo_url = 'https://robustidentity.tmentorsinc.com/connect/userinfo';
public logoutEndSession_url = 'http://robustidentity.tmentorsinc.com/connect/endsession';
// The Client MUST validate that the aud (audience) Claim contains its client_id value registered at the Issuer identified by the iss (issuer) Claim as an audience.
// The ID Token MUST be rejected if the ID Token does not list the Client as a valid audience, or if it contains additional audiences not trusted by the Client.
public client_id = 'angularclient';
public response_type = 'id_token token';
public scope = 'openid profile RobustAPI';
public post_logout_redirect_uri = 'http://robust.tmentorsinc/Unauthorized';
} | ShaimaaHamdan/AngularJS-4-Startar | Robust/src/app/auth.configuration.ts | TypeScript | mit | 1,398 | [
30522,
12324,
1063,
1999,
20614,
3085,
1065,
2013,
1005,
1030,
16108,
1013,
4563,
1005,
1025,
1030,
1999,
20614,
3085,
1006,
1007,
9167,
2465,
8740,
2705,
8663,
8873,
27390,
3370,
1063,
1013,
1013,
1996,
3277,
2099,
8909,
4765,
18095,
2005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2016 <chaishushan{AT}gmail.com>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ptyy
// 数据版本号
const DataVersion = "20160519"
| chai2010/ptyy | version.go | GO | bsd-3-clause | 236 | [
30522,
1013,
1013,
9385,
2355,
1026,
15775,
4509,
20668,
2319,
1063,
2012,
1065,
20917,
4014,
1012,
4012,
1028,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
2224,
1997,
2023,
3120,
3642,
2003,
9950,
2011,
1037,
18667,
2094,
1011,
2806,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* =============================================================
* bootstrap-collapse.js v2.3.2
* http://getbootstrap.com/2.3.2/javascript.html#collapse
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function ($) {
"use strict"; // jshint ;_;
/* COLLAPSE PUBLIC CLASS DEFINITION
* ================================ */
var Collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, $.fn.collapse.defaults, options)
if (this.options.parent) {
this.$parent = $(this.options.parent)
}
this.options.toggle && this.toggle()
}
Collapse.prototype = {
constructor: Collapse
, dimension: function () {
var hasWidth = this.$element.hasClass('width')
return hasWidth ? 'width' : 'height'
}
, show: function () {
var dimension
, scroll
, actives
, hasData
if (this.transitioning || this.$element.hasClass('in')) return
dimension = this.dimension()
scroll = $.camelCase(['scroll', dimension].join('-'))
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
if (actives && actives.length) {
hasData = actives.data('collapse')
if (hasData && hasData.transitioning) return
actives.collapse('hide')
hasData || actives.data('collapse', null)
}
this.$element[dimension](0)
this.transition('addClass', $.Event('show'), 'shown')
$.support.transition && this.$element[dimension](this.$element[0][scroll])
}
, hide: function () {
var dimension
if (this.transitioning || !this.$element.hasClass('in')) return
dimension = this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass', $.Event('hide'), 'hidden')
this.$element[dimension](0)
}
, reset: function (size) {
var dimension = this.dimension()
this.$element
.removeClass('collapse')
[dimension](size || 'auto')
[0].offsetWidth
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
return this
}
, transition: function (method, startEvent, completeEvent) {
var that = this
, complete = function () {
if (startEvent.type == 'show') that.reset()
that.transitioning = 0
that.$element.trigger(completeEvent)
}
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
this.transitioning = 1
this.$element[method]('in')
$.support.transition && this.$element.hasClass('collapse') ?
this.$element.one($.support.transition.end, complete) :
complete()
}
, toggle: function () {
this[this.$element.hasClass('in') ? 'hide' : 'show']()
}
}
/* COLLAPSE PLUGIN DEFINITION
* ========================== */
var old = $.fn.collapse
$.fn.collapse = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('collapse')
, options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.collapse.defaults = {
toggle: true
}
$.fn.collapse.Constructor = Collapse
/* COLLAPSE NO CONFLICT
* ==================== */
$.fn.collapse.noConflict = function () {
$.fn.collapse = old
return this
}
/* COLLAPSE DATA-API
* ================= */
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href
, target = $this.attr('data-target')
|| e.preventDefault()
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
, option = $(target).data('collapse') ? 'toggle' : $this.data()
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
$(target).collapse(option)
})
}(window.jQuery);
| nfelix/mvmt | public/assets/rails_admin/bootstrap/bootstrap-collapse-3387a8b21abb7862bae6aac8337d6b26.js | JavaScript | mit | 4,731 | [
30522,
1013,
1008,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/layers/tiled_layer.h"
#include <algorithm>
#include <vector>
#include "base/auto_reset.h"
#include "base/basictypes.h"
#include "build/build_config.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/tiled_layer_impl.h"
#include "cc/resources/layer_updater.h"
#include "cc/resources/prioritized_resource.h"
#include "cc/resources/priority_calculator.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/occlusion_tracker.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "ui/gfx/rect_conversions.h"
namespace cc {
// Maximum predictive expansion of the visible area.
static const int kMaxPredictiveTilesCount = 2;
// Number of rows/columns of tiles to pre-paint.
// We should increase these further as all textures are
// prioritized and we insure performance doesn't suffer.
static const int kPrepaintRows = 4;
static const int kPrepaintColumns = 2;
class UpdatableTile : public LayerTilingData::Tile {
public:
static scoped_ptr<UpdatableTile> Create(
scoped_ptr<LayerUpdater::Resource> updater_resource) {
return make_scoped_ptr(new UpdatableTile(updater_resource.Pass()));
}
LayerUpdater::Resource* updater_resource() { return updater_resource_.get(); }
PrioritizedResource* managed_resource() {
return updater_resource_->texture();
}
bool is_dirty() const { return !dirty_rect.IsEmpty(); }
// Reset update state for the current frame. This should occur before painting
// for all layers. Since painting one layer can invalidate another layer after
// it has already painted, mark all non-dirty tiles as valid before painting
// such that invalidations during painting won't prevent them from being
// pushed.
void ResetUpdateState() {
update_rect = gfx::Rect();
occluded = false;
partial_update = false;
valid_for_frame = !is_dirty();
}
// This promises to update the tile and therefore also guarantees the tile
// will be valid for this frame. dirty_rect is copied into update_rect so we
// can continue to track re-entrant invalidations that occur during painting.
void MarkForUpdate() {
valid_for_frame = true;
update_rect = dirty_rect;
dirty_rect = gfx::Rect();
}
gfx::Rect dirty_rect;
gfx::Rect update_rect;
bool partial_update;
bool valid_for_frame;
bool occluded;
private:
explicit UpdatableTile(scoped_ptr<LayerUpdater::Resource> updater_resource)
: partial_update(false),
valid_for_frame(false),
occluded(false),
updater_resource_(updater_resource.Pass()) {}
scoped_ptr<LayerUpdater::Resource> updater_resource_;
DISALLOW_COPY_AND_ASSIGN(UpdatableTile);
};
TiledLayer::TiledLayer()
: ContentsScalingLayer(),
texture_format_(RGBA_8888),
skips_draw_(false),
failed_update_(false),
tiling_option_(AUTO_TILE) {
tiler_ =
LayerTilingData::Create(gfx::Size(), LayerTilingData::HAS_BORDER_TEXELS);
}
TiledLayer::~TiledLayer() {}
scoped_ptr<LayerImpl> TiledLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
return TiledLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>();
}
void TiledLayer::UpdateTileSizeAndTilingOption() {
DCHECK(layer_tree_host());
gfx::Size default_tile_size = layer_tree_host()->settings().default_tile_size;
gfx::Size max_untiled_layer_size =
layer_tree_host()->settings().max_untiled_layer_size;
int layer_width = content_bounds().width();
int layer_height = content_bounds().height();
gfx::Size tile_size(std::min(default_tile_size.width(), layer_width),
std::min(default_tile_size.height(), layer_height));
// Tile if both dimensions large, or any one dimension large and the other
// extends into a second tile but the total layer area isn't larger than that
// of the largest possible untiled layer. This heuristic allows for long
// skinny layers (e.g. scrollbars) that are Nx1 tiles to minimize wasted
// texture space but still avoids creating very large tiles.
bool any_dimension_large = layer_width > max_untiled_layer_size.width() ||
layer_height > max_untiled_layer_size.height();
bool any_dimension_one_tile =
(layer_width <= default_tile_size.width() ||
layer_height <= default_tile_size.height()) &&
(layer_width * layer_height) <= (max_untiled_layer_size.width() *
max_untiled_layer_size.height());
bool auto_tiled = any_dimension_large && !any_dimension_one_tile;
bool is_tiled;
if (tiling_option_ == ALWAYS_TILE)
is_tiled = true;
else if (tiling_option_ == NEVER_TILE)
is_tiled = false;
else
is_tiled = auto_tiled;
gfx::Size requested_size = is_tiled ? tile_size : content_bounds();
const int max_size =
layer_tree_host()->GetRendererCapabilities().max_texture_size;
requested_size.SetToMin(gfx::Size(max_size, max_size));
SetTileSize(requested_size);
}
void TiledLayer::UpdateBounds() {
gfx::Size old_tiling_size = tiler_->tiling_size();
gfx::Size new_tiling_size = content_bounds();
if (old_tiling_size == new_tiling_size)
return;
tiler_->SetTilingSize(new_tiling_size);
// Invalidate any areas that the new bounds exposes.
Region new_region =
SubtractRegions(gfx::Rect(new_tiling_size), gfx::Rect(old_tiling_size));
for (Region::Iterator new_rects(new_region); new_rects.has_rect();
new_rects.next())
InvalidateContentRect(new_rects.rect());
UpdateDrawsContent(HasDrawableContent());
}
void TiledLayer::SetTileSize(const gfx::Size& size) {
tiler_->SetTileSize(size);
UpdateDrawsContent(HasDrawableContent());
}
void TiledLayer::SetBorderTexelOption(
LayerTilingData::BorderTexelOption border_texel_option) {
tiler_->SetBorderTexelOption(border_texel_option);
UpdateDrawsContent(HasDrawableContent());
}
bool TiledLayer::HasDrawableContent() const {
bool has_more_than_one_tile =
(tiler_->num_tiles_x() > 1) || (tiler_->num_tiles_y() > 1);
return !(tiling_option_ == NEVER_TILE && has_more_than_one_tile) &&
ContentsScalingLayer::HasDrawableContent();
}
void TiledLayer::ReduceMemoryUsage() {
if (Updater())
Updater()->ReduceMemoryUsage();
}
void TiledLayer::SetIsMask(bool is_mask) {
set_tiling_option(is_mask ? NEVER_TILE : AUTO_TILE);
}
void TiledLayer::PushPropertiesTo(LayerImpl* layer) {
ContentsScalingLayer::PushPropertiesTo(layer);
TiledLayerImpl* tiled_layer = static_cast<TiledLayerImpl*>(layer);
tiled_layer->set_skips_draw(skips_draw_);
tiled_layer->SetTilingData(*tiler_);
std::vector<UpdatableTile*> invalid_tiles;
for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin();
iter != tiler_->tiles().end();
++iter) {
int i = iter->first.first;
int j = iter->first.second;
UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second);
// TODO(enne): This should not ever be null.
if (!tile)
continue;
if (!tile->managed_resource()->have_backing_texture()) {
// Evicted tiles get deleted from both layers
invalid_tiles.push_back(tile);
continue;
}
if (!tile->valid_for_frame) {
// Invalidated tiles are set so they can get different debug colors.
tiled_layer->PushInvalidTile(i, j);
continue;
}
tiled_layer->PushTileProperties(
i,
j,
tile->managed_resource()->resource_id(),
tile->opaque_rect(),
tile->managed_resource()->contents_swizzled());
}
for (std::vector<UpdatableTile*>::const_iterator iter = invalid_tiles.begin();
iter != invalid_tiles.end();
++iter)
tiler_->TakeTile((*iter)->i(), (*iter)->j());
// TiledLayer must push properties every frame, since viewport state and
// occlusion from anywhere in the tree can change what the layer decides to
// push to the impl tree.
needs_push_properties_ = true;
}
PrioritizedResourceManager* TiledLayer::ResourceManager() {
if (!layer_tree_host())
return NULL;
return layer_tree_host()->contents_texture_manager();
}
const PrioritizedResource* TiledLayer::ResourceAtForTesting(int i,
int j) const {
UpdatableTile* tile = TileAt(i, j);
if (!tile)
return NULL;
return tile->managed_resource();
}
void TiledLayer::SetLayerTreeHost(LayerTreeHost* host) {
if (host && host != layer_tree_host()) {
for (LayerTilingData::TileMap::const_iterator
iter = tiler_->tiles().begin();
iter != tiler_->tiles().end();
++iter) {
UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second);
// TODO(enne): This should not ever be null.
if (!tile)
continue;
tile->managed_resource()->SetTextureManager(
host->contents_texture_manager());
}
}
ContentsScalingLayer::SetLayerTreeHost(host);
}
UpdatableTile* TiledLayer::TileAt(int i, int j) const {
return static_cast<UpdatableTile*>(tiler_->TileAt(i, j));
}
UpdatableTile* TiledLayer::CreateTile(int i, int j) {
CreateUpdaterIfNeeded();
scoped_ptr<UpdatableTile> tile(
UpdatableTile::Create(Updater()->CreateResource(ResourceManager())));
tile->managed_resource()->SetDimensions(tiler_->tile_size(), texture_format_);
UpdatableTile* added_tile = tile.get();
tiler_->AddTile(tile.PassAs<LayerTilingData::Tile>(), i, j);
added_tile->dirty_rect = tiler_->TileRect(added_tile);
// Temporary diagnostic crash.
CHECK(added_tile);
CHECK(TileAt(i, j));
return added_tile;
}
void TiledLayer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
InvalidateContentRect(LayerRectToContentRect(dirty_rect));
ContentsScalingLayer::SetNeedsDisplayRect(dirty_rect);
}
void TiledLayer::InvalidateContentRect(const gfx::Rect& content_rect) {
UpdateBounds();
if (tiler_->is_empty() || content_rect.IsEmpty() || skips_draw_)
return;
for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin();
iter != tiler_->tiles().end();
++iter) {
UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second);
DCHECK(tile);
// TODO(enne): This should not ever be null.
if (!tile)
continue;
gfx::Rect bound = tiler_->TileRect(tile);
bound.Intersect(content_rect);
tile->dirty_rect.Union(bound);
}
}
// Returns true if tile is dirty and only part of it needs to be updated.
bool TiledLayer::TileOnlyNeedsPartialUpdate(UpdatableTile* tile) {
return !tile->dirty_rect.Contains(tiler_->TileRect(tile)) &&
tile->managed_resource()->have_backing_texture();
}
bool TiledLayer::UpdateTiles(int left,
int top,
int right,
int bottom,
ResourceUpdateQueue* queue,
const OcclusionTracker<Layer>* occlusion,
bool* updated) {
CreateUpdaterIfNeeded();
bool ignore_occlusions = !occlusion;
if (!HaveTexturesForTiles(left, top, right, bottom, ignore_occlusions)) {
failed_update_ = true;
return false;
}
gfx::Rect update_rect;
gfx::Rect paint_rect;
MarkTilesForUpdate(
&update_rect, &paint_rect, left, top, right, bottom, ignore_occlusions);
if (paint_rect.IsEmpty())
return true;
*updated = true;
UpdateTileTextures(
update_rect, paint_rect, left, top, right, bottom, queue, occlusion);
return true;
}
void TiledLayer::MarkOcclusionsAndRequestTextures(
int left,
int top,
int right,
int bottom,
const OcclusionTracker<Layer>* occlusion) {
int occluded_tile_count = 0;
bool succeeded = true;
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
UpdatableTile* tile = TileAt(i, j);
DCHECK(tile); // Did SetTexturePriorities get skipped?
// TODO(enne): This should not ever be null.
if (!tile)
continue;
// Did ResetUpdateState get skipped? Are we doing more than one occlusion
// pass?
DCHECK(!tile->occluded);
gfx::Rect visible_tile_rect = gfx::IntersectRects(
tiler_->tile_bounds(i, j), visible_content_rect());
if (!draw_transform_is_animating() && occlusion &&
occlusion->Occluded(
render_target(), visible_tile_rect, draw_transform())) {
tile->occluded = true;
occluded_tile_count++;
} else {
succeeded &= tile->managed_resource()->RequestLate();
}
}
}
}
bool TiledLayer::HaveTexturesForTiles(int left,
int top,
int right,
int bottom,
bool ignore_occlusions) {
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
UpdatableTile* tile = TileAt(i, j);
DCHECK(tile); // Did SetTexturePriorites get skipped?
// TODO(enne): This should not ever be null.
if (!tile)
continue;
// Ensure the entire tile is dirty if we don't have the texture.
if (!tile->managed_resource()->have_backing_texture())
tile->dirty_rect = tiler_->TileRect(tile);
// If using occlusion and the visible region of the tile is occluded,
// don't reserve a texture or update the tile.
if (tile->occluded && !ignore_occlusions)
continue;
if (!tile->managed_resource()->can_acquire_backing_texture())
return false;
}
}
return true;
}
void TiledLayer::MarkTilesForUpdate(gfx::Rect* update_rect,
gfx::Rect* paint_rect,
int left,
int top,
int right,
int bottom,
bool ignore_occlusions) {
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
UpdatableTile* tile = TileAt(i, j);
DCHECK(tile); // Did SetTexturePriorites get skipped?
// TODO(enne): This should not ever be null.
if (!tile)
continue;
if (tile->occluded && !ignore_occlusions)
continue;
// Prepare update rect from original dirty rects.
update_rect->Union(tile->dirty_rect);
// TODO(reveman): Decide if partial update should be allowed based on cost
// of update. https://bugs.webkit.org/show_bug.cgi?id=77376
if (tile->is_dirty() &&
!layer_tree_host()->AlwaysUsePartialTextureUpdates()) {
// If we get a partial update, we use the same texture, otherwise return
// the current texture backing, so we don't update visible textures
// non-atomically. If the current backing is in-use, it won't be
// deleted until after the commit as the texture manager will not allow
// deletion or recycling of in-use textures.
if (TileOnlyNeedsPartialUpdate(tile) &&
layer_tree_host()->RequestPartialTextureUpdate()) {
tile->partial_update = true;
} else {
tile->dirty_rect = tiler_->TileRect(tile);
tile->managed_resource()->ReturnBackingTexture();
}
}
paint_rect->Union(tile->dirty_rect);
tile->MarkForUpdate();
}
}
}
void TiledLayer::UpdateTileTextures(const gfx::Rect& update_rect,
const gfx::Rect& paint_rect,
int left,
int top,
int right,
int bottom,
ResourceUpdateQueue* queue,
const OcclusionTracker<Layer>* occlusion) {
// The update_rect should be in layer space. So we have to convert the
// paint_rect from content space to layer space.
float width_scale =
paint_properties().bounds.width() /
static_cast<float>(content_bounds().width());
float height_scale =
paint_properties().bounds.height() /
static_cast<float>(content_bounds().height());
update_rect_ = gfx::ScaleRect(update_rect, width_scale, height_scale);
// Calling PrepareToUpdate() calls into WebKit to paint, which may have the
// side effect of disabling compositing, which causes our reference to the
// texture updater to be deleted. However, we can't free the memory backing
// the SkCanvas until the paint finishes, so we grab a local reference here to
// hold the updater alive until the paint completes.
scoped_refptr<LayerUpdater> protector(Updater());
gfx::Rect painted_opaque_rect;
Updater()->PrepareToUpdate(paint_rect,
tiler_->tile_size(),
1.f / width_scale,
1.f / height_scale,
&painted_opaque_rect);
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
UpdatableTile* tile = TileAt(i, j);
DCHECK(tile); // Did SetTexturePriorites get skipped?
// TODO(enne): This should not ever be null.
if (!tile)
continue;
gfx::Rect tile_rect = tiler_->tile_bounds(i, j);
// Use update_rect as the above loop copied the dirty rect for this frame
// to update_rect.
gfx::Rect dirty_rect = tile->update_rect;
if (dirty_rect.IsEmpty())
continue;
// Save what was painted opaque in the tile. Keep the old area if the
// paint didn't touch it, and didn't paint some other part of the tile
// opaque.
gfx::Rect tile_painted_rect = gfx::IntersectRects(tile_rect, paint_rect);
gfx::Rect tile_painted_opaque_rect =
gfx::IntersectRects(tile_rect, painted_opaque_rect);
if (!tile_painted_rect.IsEmpty()) {
gfx::Rect paint_inside_tile_opaque_rect =
gfx::IntersectRects(tile->opaque_rect(), tile_painted_rect);
bool paint_inside_tile_opaque_rect_is_non_opaque =
!paint_inside_tile_opaque_rect.IsEmpty() &&
!tile_painted_opaque_rect.Contains(paint_inside_tile_opaque_rect);
bool opaque_paint_not_inside_tile_opaque_rect =
!tile_painted_opaque_rect.IsEmpty() &&
!tile->opaque_rect().Contains(tile_painted_opaque_rect);
if (paint_inside_tile_opaque_rect_is_non_opaque ||
opaque_paint_not_inside_tile_opaque_rect)
tile->set_opaque_rect(tile_painted_opaque_rect);
}
// source_rect starts as a full-sized tile with border texels included.
gfx::Rect source_rect = tiler_->TileRect(tile);
source_rect.Intersect(dirty_rect);
// Paint rect not guaranteed to line up on tile boundaries, so
// make sure that source_rect doesn't extend outside of it.
source_rect.Intersect(paint_rect);
tile->update_rect = source_rect;
if (source_rect.IsEmpty())
continue;
const gfx::Point anchor = tiler_->TileRect(tile).origin();
// Calculate tile-space rectangle to upload into.
gfx::Vector2d dest_offset = source_rect.origin() - anchor;
CHECK_GE(dest_offset.x(), 0);
CHECK_GE(dest_offset.y(), 0);
// Offset from paint rectangle to this tile's dirty rectangle.
gfx::Vector2d paint_offset = source_rect.origin() - paint_rect.origin();
CHECK_GE(paint_offset.x(), 0);
CHECK_GE(paint_offset.y(), 0);
CHECK_LE(paint_offset.x() + source_rect.width(), paint_rect.width());
CHECK_LE(paint_offset.y() + source_rect.height(), paint_rect.height());
tile->updater_resource()->Update(
queue, source_rect, dest_offset, tile->partial_update);
}
}
}
// This picks a small animated layer to be anything less than one viewport. This
// is specifically for page transitions which are viewport-sized layers. The
// extra tile of padding is due to these layers being slightly larger than the
// viewport in some cases.
bool TiledLayer::IsSmallAnimatedLayer() const {
if (!draw_transform_is_animating() && !screen_space_transform_is_animating())
return false;
gfx::Size viewport_size =
layer_tree_host() ? layer_tree_host()->device_viewport_size()
: gfx::Size();
gfx::Rect content_rect(content_bounds());
return content_rect.width() <=
viewport_size.width() + tiler_->tile_size().width() &&
content_rect.height() <=
viewport_size.height() + tiler_->tile_size().height();
}
namespace {
// TODO(epenner): Remove this and make this based on distance once distance can
// be calculated for offscreen layers. For now, prioritize all small animated
// layers after 512 pixels of pre-painting.
void SetPriorityForTexture(const gfx::Rect& visible_rect,
const gfx::Rect& tile_rect,
bool draws_to_root,
bool is_small_animated_layer,
PrioritizedResource* texture) {
int priority = PriorityCalculator::LowestPriority();
if (!visible_rect.IsEmpty()) {
priority = PriorityCalculator::PriorityFromDistance(
visible_rect, tile_rect, draws_to_root);
}
if (is_small_animated_layer) {
priority = PriorityCalculator::max_priority(
priority, PriorityCalculator::SmallAnimatedLayerMinPriority());
}
if (priority != PriorityCalculator::LowestPriority())
texture->set_request_priority(priority);
}
} // namespace
void TiledLayer::SetTexturePriorities(const PriorityCalculator& priority_calc) {
UpdateBounds();
ResetUpdateState();
UpdateScrollPrediction();
if (tiler_->has_empty_bounds())
return;
bool draws_to_root = !render_target()->parent();
bool small_animated_layer = IsSmallAnimatedLayer();
// Minimally create the tiles in the desired pre-paint rect.
gfx::Rect create_tiles_rect = IdlePaintRect();
if (small_animated_layer)
create_tiles_rect = gfx::Rect(content_bounds());
if (!create_tiles_rect.IsEmpty()) {
int left, top, right, bottom;
tiler_->ContentRectToTileIndices(
create_tiles_rect, &left, &top, &right, &bottom);
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
if (!TileAt(i, j))
CreateTile(i, j);
}
}
}
// Now update priorities on all tiles we have in the layer, no matter where
// they are.
for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin();
iter != tiler_->tiles().end();
++iter) {
UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second);
// TODO(enne): This should not ever be null.
if (!tile)
continue;
gfx::Rect tile_rect = tiler_->TileRect(tile);
SetPriorityForTexture(predicted_visible_rect_,
tile_rect,
draws_to_root,
small_animated_layer,
tile->managed_resource());
}
}
Region TiledLayer::VisibleContentOpaqueRegion() const {
if (skips_draw_)
return Region();
if (contents_opaque())
return visible_content_rect();
return tiler_->OpaqueRegionInContentRect(visible_content_rect());
}
void TiledLayer::ResetUpdateState() {
skips_draw_ = false;
failed_update_ = false;
LayerTilingData::TileMap::const_iterator end = tiler_->tiles().end();
for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin();
iter != end;
++iter) {
UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second);
// TODO(enne): This should not ever be null.
if (!tile)
continue;
tile->ResetUpdateState();
}
}
namespace {
gfx::Rect ExpandRectByDelta(const gfx::Rect& rect, const gfx::Vector2d& delta) {
int width = rect.width() + std::abs(delta.x());
int height = rect.height() + std::abs(delta.y());
int x = rect.x() + ((delta.x() < 0) ? delta.x() : 0);
int y = rect.y() + ((delta.y() < 0) ? delta.y() : 0);
return gfx::Rect(x, y, width, height);
}
}
void TiledLayer::UpdateScrollPrediction() {
// This scroll prediction is very primitive and should be replaced by a
// a recursive calculation on all layers which uses actual scroll/animation
// velocities. To insure this doesn't miss-predict, we only use it to predict
// the visible_rect if:
// - content_bounds() hasn't changed.
// - visible_rect.size() hasn't changed.
// These two conditions prevent rotations, scales, pinch-zooms etc. where
// the prediction would be incorrect.
gfx::Vector2d delta = visible_content_rect().CenterPoint() -
previous_visible_rect_.CenterPoint();
predicted_scroll_ = -delta;
predicted_visible_rect_ = visible_content_rect();
if (previous_content_bounds_ == content_bounds() &&
previous_visible_rect_.size() == visible_content_rect().size()) {
// Only expand the visible rect in the major scroll direction, to prevent
// massive paints due to diagonal scrolls.
gfx::Vector2d major_scroll_delta =
(std::abs(delta.x()) > std::abs(delta.y())) ?
gfx::Vector2d(delta.x(), 0) :
gfx::Vector2d(0, delta.y());
predicted_visible_rect_ =
ExpandRectByDelta(visible_content_rect(), major_scroll_delta);
// Bound the prediction to prevent unbounded paints, and clamp to content
// bounds.
gfx::Rect bound = visible_content_rect();
bound.Inset(-tiler_->tile_size().width() * kMaxPredictiveTilesCount,
-tiler_->tile_size().height() * kMaxPredictiveTilesCount);
bound.Intersect(gfx::Rect(content_bounds()));
predicted_visible_rect_.Intersect(bound);
}
previous_content_bounds_ = content_bounds();
previous_visible_rect_ = visible_content_rect();
}
bool TiledLayer::Update(ResourceUpdateQueue* queue,
const OcclusionTracker<Layer>* occlusion) {
DCHECK(!skips_draw_ && !failed_update_); // Did ResetUpdateState get skipped?
// Tiled layer always causes commits to wait for activation, as it does
// not support pending trees.
SetNextCommitWaitsForActivation();
bool updated = false;
{
base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_,
true);
updated |= ContentsScalingLayer::Update(queue, occlusion);
UpdateBounds();
}
if (tiler_->has_empty_bounds() || !DrawsContent())
return false;
// Animation pre-paint. If the layer is small, try to paint it all
// immediately whether or not it is occluded, to avoid paint/upload
// hiccups while it is animating.
if (IsSmallAnimatedLayer()) {
int left, top, right, bottom;
tiler_->ContentRectToTileIndices(gfx::Rect(content_bounds()),
&left,
&top,
&right,
&bottom);
UpdateTiles(left, top, right, bottom, queue, NULL, &updated);
if (updated)
return updated;
// This was an attempt to paint the entire layer so if we fail it's okay,
// just fallback on painting visible etc. below.
failed_update_ = false;
}
if (predicted_visible_rect_.IsEmpty())
return updated;
// Visible painting. First occlude visible tiles and paint the non-occluded
// tiles.
int left, top, right, bottom;
tiler_->ContentRectToTileIndices(
predicted_visible_rect_, &left, &top, &right, &bottom);
MarkOcclusionsAndRequestTextures(left, top, right, bottom, occlusion);
skips_draw_ = !UpdateTiles(
left, top, right, bottom, queue, occlusion, &updated);
if (skips_draw_)
tiler_->reset();
if (skips_draw_ || updated)
return true;
// If we have already painting everything visible. Do some pre-painting while
// idle.
gfx::Rect idle_paint_content_rect = IdlePaintRect();
if (idle_paint_content_rect.IsEmpty())
return updated;
// Prepaint anything that was occluded but inside the layer's visible region.
if (!UpdateTiles(left, top, right, bottom, queue, NULL, &updated) ||
updated)
return updated;
int prepaint_left, prepaint_top, prepaint_right, prepaint_bottom;
tiler_->ContentRectToTileIndices(idle_paint_content_rect,
&prepaint_left,
&prepaint_top,
&prepaint_right,
&prepaint_bottom);
// Then expand outwards one row/column at a time until we find a dirty
// row/column to update. Increment along the major and minor scroll directions
// first.
gfx::Vector2d delta = -predicted_scroll_;
delta = gfx::Vector2d(delta.x() == 0 ? 1 : delta.x(),
delta.y() == 0 ? 1 : delta.y());
gfx::Vector2d major_delta =
(std::abs(delta.x()) > std::abs(delta.y())) ? gfx::Vector2d(delta.x(), 0)
: gfx::Vector2d(0, delta.y());
gfx::Vector2d minor_delta =
(std::abs(delta.x()) <= std::abs(delta.y())) ? gfx::Vector2d(delta.x(), 0)
: gfx::Vector2d(0, delta.y());
gfx::Vector2d deltas[4] = { major_delta, minor_delta, -major_delta,
-minor_delta };
for (int i = 0; i < 4; i++) {
if (deltas[i].y() > 0) {
while (bottom < prepaint_bottom) {
++bottom;
if (!UpdateTiles(
left, bottom, right, bottom, queue, NULL, &updated) ||
updated)
return updated;
}
}
if (deltas[i].y() < 0) {
while (top > prepaint_top) {
--top;
if (!UpdateTiles(
left, top, right, top, queue, NULL, &updated) ||
updated)
return updated;
}
}
if (deltas[i].x() < 0) {
while (left > prepaint_left) {
--left;
if (!UpdateTiles(
left, top, left, bottom, queue, NULL, &updated) ||
updated)
return updated;
}
}
if (deltas[i].x() > 0) {
while (right < prepaint_right) {
++right;
if (!UpdateTiles(
right, top, right, bottom, queue, NULL, &updated) ||
updated)
return updated;
}
}
}
return updated;
}
void TiledLayer::OnOutputSurfaceCreated() {
// Ensure that all textures are of the right format.
for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin();
iter != tiler_->tiles().end();
++iter) {
UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second);
if (!tile)
continue;
PrioritizedResource* resource = tile->managed_resource();
resource->SetDimensions(resource->size(), texture_format_);
}
}
bool TiledLayer::NeedsIdlePaint() {
// Don't trigger more paints if we failed (as we'll just fail again).
if (failed_update_ || visible_content_rect().IsEmpty() ||
tiler_->has_empty_bounds() || !DrawsContent())
return false;
gfx::Rect idle_paint_content_rect = IdlePaintRect();
if (idle_paint_content_rect.IsEmpty())
return false;
int left, top, right, bottom;
tiler_->ContentRectToTileIndices(
idle_paint_content_rect, &left, &top, &right, &bottom);
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
UpdatableTile* tile = TileAt(i, j);
DCHECK(tile); // Did SetTexturePriorities get skipped?
if (!tile)
continue;
bool updated = !tile->update_rect.IsEmpty();
bool can_acquire =
tile->managed_resource()->can_acquire_backing_texture();
bool dirty =
tile->is_dirty() || !tile->managed_resource()->have_backing_texture();
if (!updated && can_acquire && dirty)
return true;
}
}
return false;
}
gfx::Rect TiledLayer::IdlePaintRect() {
// Don't inflate an empty rect.
if (visible_content_rect().IsEmpty())
return gfx::Rect();
gfx::Rect prepaint_rect = visible_content_rect();
prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns,
-tiler_->tile_size().height() * kPrepaintRows);
gfx::Rect content_rect(content_bounds());
prepaint_rect.Intersect(content_rect);
return prepaint_rect;
}
} // namespace cc
| sencha/chromium-spacewalk | cc/layers/tiled_layer.cc | C++ | bsd-3-clause | 32,370 | [
30522,
1013,
1013,
9385,
2249,
1996,
10381,
21716,
5007,
6048,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
2224,
1997,
2023,
3120,
3642,
2003,
9950,
2011,
1037,
18667,
2094,
1011,
2806,
6105,
2008,
2064,
2022,
1013,
1013,
2179,
1999,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
var keypress = require("keypress");
// var Spark = require("spark-io");
var Spark = require("../");
var five = require("johnny-five");
var Sumobot = require("sumobot")(five);
keypress(process.stdin);
var board = new five.Board({
io: new Spark({
token: process.env.SPARK_TOKEN,
deviceId: process.env.SPARK_DEVICE_2
})
});
board.on("ready", function() {
console.log("Welcome to Sumobot Jr: Light Bot!");
var bot = new Sumobot({
left: "D0",
right: "D1",
speed: 0.50
});
var light = new five.Sensor("A0");
var isQuitting = false;
light.on("change", function() {
if (isQuitting || this.value === null) {
return;
}
if (this.value < 512) {
bot.fwd();
} else {
bot.rev();
}
});
// Ensure the bot is stopped
bot.stop();
});
| gregory-j-weaver/nodebots-a2handsonmuseum | node_modules/particle-io/eg/lightbot.js | JavaScript | mit | 804 | [
30522,
13075,
3145,
20110,
1027,
5478,
1006,
1000,
3145,
20110,
1000,
1007,
1025,
1013,
1013,
13075,
12125,
1027,
5478,
1006,
1000,
12125,
1011,
22834,
1000,
1007,
1025,
13075,
12125,
1027,
5478,
1006,
1000,
1012,
1012,
1013,
1000,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/* SVN FILE: $Id: 0500_052f.php 7118 2008-06-04 20:49:29Z gwoo $ */
/**
* Case Folding Properties.
*
* Provides case mapping of Unicode characters for code points U+0500 through U+052F
*
* @see http://www.unicode.org/Public/UNIDATA/UCD.html
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
* @see http://www.unicode.org/reports/tr21/tr21-5.html
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision: 7118 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* The upper field is the decimal value of the upper case character
*
* The lower filed is an array of the decimal values that form the lower case version of a character.
*
* The status field is:
* C: common case folding, common mappings shared by both simple and full mappings.
* F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces.
* S: simple case folding, mappings to single characters where different from F.
* T: special case for uppercase I and dotted uppercase I
* - For non-Turkic languages, this mapping is normally not used.
* - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters.
* Note that the Turkic mappings do not maintain canonical equivalence without additional processing.
* See the discussions of case mapping in the Unicode Standard for more information.
*/
$config['0500_052f'][] = array('upper' => 1280, 'status' => 'C', 'lower' => array(1281)); /* CYRILLIC CAPITAL LETTER KOMI DE */
$config['0500_052f'][] = array('upper' => 1282, 'status' => 'C', 'lower' => array(1283)); /* CYRILLIC CAPITAL LETTER KOMI DJE */
$config['0500_052f'][] = array('upper' => 1284, 'status' => 'C', 'lower' => array(1285)); /* CYRILLIC CAPITAL LETTER KOMI ZJE */
$config['0500_052f'][] = array('upper' => 1286, 'status' => 'C', 'lower' => array(1287)); /* CYRILLIC CAPITAL LETTER KOMI DZJE */
$config['0500_052f'][] = array('upper' => 1288, 'status' => 'C', 'lower' => array(1289)); /* CYRILLIC CAPITAL LETTER KOMI LJE */
$config['0500_052f'][] = array('upper' => 1290, 'status' => 'C', 'lower' => array(1291)); /* CYRILLIC CAPITAL LETTER KOMI NJE */
$config['0500_052f'][] = array('upper' => 1292, 'status' => 'C', 'lower' => array(1293)); /* CYRILLIC CAPITAL LETTER KOMI SJE */
$config['0500_052f'][] = array('upper' => 1294, 'status' => 'C', 'lower' => array(1295)); /* CYRILLIC CAPITAL LETTER KOMI TJE */
?> | jonaustin/craigslist-housing-mapper | cake/config/unicode/casefolding/0500_052f.php | PHP | mit | 3,178 | [
30522,
1026,
1029,
25718,
1013,
1008,
17917,
2078,
5371,
1024,
1002,
8909,
1024,
28714,
2692,
1035,
5709,
2475,
2546,
1012,
25718,
6390,
15136,
2263,
1011,
5757,
1011,
5840,
2322,
1024,
4749,
1024,
2756,
2480,
1043,
12155,
2080,
1002,
1008,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
$(document).ready(function() {
//Note: default min/max ranges are defined outside of this JS file
//include "js/BoulderRouteGradingSystems.js" before running this script
//generate Bouldering rating selection upon click
//Find which boulder grading system is selected and update the difficulty range
//**********************************************
$("select[name='boulder-rating-select']").click(function()
{
var boulderGradingSelect = document.getElementById("boulder-rating-select");
boulderGradingID = boulderGradingSelect.options[boulderGradingSelect.selectedIndex].value;
console.log(boulderGradingID);
var maxBoulder = boulderRatings[boulderGradingID].length - 1;
var boulderingMinRange = "<div id='boulderprefs'><p>Minimum bouldering rating: <select name='minBoulderRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxBoulder;i++) {
if (i==selectMinBoulder) {
boulderingMinRange += "<option value="+i+" selected>"+boulderRatings[boulderGradingID][i]+"</option>";
} else {
boulderingMinRange += "<option value="+i+">"+boulderRatings[boulderGradingID][i]+"</option>";
}
}
boulderingMinRange += "</option></select>";
//get max value of bouldering range
var boulderingMaxRange = "<p>Maximum bouldering rating: <select name='maxBoulderRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxBoulder;i++) {
if (i==Math.min(maxBoulder,selectMaxBoulder)) {
boulderingMaxRange += "<option value="+i+" selected>"+boulderRatings[boulderGradingID][i]+"</option>";
} else {
boulderingMaxRange += "<option value="+i+">"+boulderRatings[boulderGradingID][i]+"</option>";
}
}
boulderingMaxRange += "</option></select></div>";
document.getElementById("boulderprefs").innerHTML =
boulderingMinRange + boulderingMaxRange;
});
//**********************************************
//initialize the boulder grading system
var maxBoulder = boulderRatings[boulderGradingID].length - 1;
var boulderingMinRange = "<div id='boulderprefs'><p>Minimum bouldering rating: <select name='minBoulderRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxBoulder;i++) {
if (i==selectMinBoulder) {
boulderingMinRange += "<option value="+i+" selected>"+boulderRatings[boulderGradingID][i]+"</option>";
} else {
boulderingMinRange += "<option value="+i+">"+boulderRatings[boulderGradingID][i]+"</option>";
}
}
boulderingMinRange += "</option></select>";
//get max value of bouldering range
var boulderingMaxRange = "<p>Maximum bouldering rating: <select name='maxBoulderRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxBoulder;i++) {
if (i==Math.min(maxBoulder,selectMaxBoulder)) {
boulderingMaxRange += "<option value="+i+" selected>"+boulderRatings[boulderGradingID][i]+"</option>";
} else {
boulderingMaxRange += "<option value="+i+">"+boulderRatings[boulderGradingID][i]+"</option>";
}
}
boulderingMaxRange += "</option></select></div>";
//************************
//Update TR and lead when clicked
//******************************
$("select[name='route-rating-select']").click(function()
{
var routeGradingSelect = document.getElementById("route-rating-select");
routeGradingID = routeGradingSelect.options[routeGradingSelect.selectedIndex].value;
console.log(routeGradingID);
var maxRoute = routeRatings[routeGradingID].length - 1;
//generate TR rating selection
var TRMinRange = "<div id='trprefs'><p>Minimum top-rope rating: <select name='minTRRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxRoute;i++) {
if (i==selectMinTR) {
TRMinRange +="<option value="+i+" selected>"+
routeRatings[routeGradingID][i]+"</option>";
} else {
TRMinRange += "<option value="+i+">"+
routeRatings[routeGradingID][i]+"</option>";
}
}
TRMinRange += "</option></select>";
var TRMaxRange = "<p>Maximum top-rope rating: <select name='maxTRRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxRoute;i++) {
if (i==Math.min(maxRoute,selectMaxTR)) {
TRMaxRange +="<option value="+i+" selected>"+
routeRatings[routeGradingID][i]+"</option>";
} else {
TRMaxRange += "<option value="+i+">"+
routeRatings[routeGradingID][i]+"</option>";
}
}
TRMaxRange += "</option></select></div>";
//generate lead rating selection
var LeadMinRange = "<div id='leadprefs'><p>Minimum lead rating: <select name='minLeadRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxRoute;i++) {
if (i==selectMinL) {
LeadMinRange +="<option value="+i+" selected>"+
routeRatings[routeGradingID][i]+"</option>";
} else {
LeadMinRange += "<option value="+i+">"+
routeRatings[routeGradingID][i]+"</option>";
}
}
LeadMinRange += "</option></select>";
var LeadMaxRange = "<p>Maximum lead rating: <select name='maxLeadRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxRoute;i++) {
if (i==Math.min(maxRoute,selectMaxL)) {
LeadMaxRange +="<option value="+i+" selected>"+
routeRatings[routeGradingID][i]+"</option>";
} else {
LeadMaxRange += "<option value="+i+">"+
routeRatings[routeGradingID][i]+"</option>";
}
}
LeadMaxRange += "</option></select></div>";
document.getElementById("trprefs").innerHTML = TRMinRange + TRMaxRange;
document.getElementById("leadprefs").innerHTML =
LeadMinRange + LeadMaxRange;
});
//**********************************
//Initialize TR and Lead selections
var maxRoute = routeRatings[routeGradingID].length - 1;
//generate TR rating selection
var TRMinRange = "<div id='trprefs'><p>Minimum top-rope rating: <select name='minTRRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxRoute;i++) {
if (i==selectMinTR) {
TRMinRange +="<option value="+i+" selected>"+
routeRatings[routeGradingID][i]+"</option>";
} else {
TRMinRange += "<option value="+i+">"+
routeRatings[routeGradingID][i]+"</option>";
}
}
TRMinRange += "</option></select>";
var TRMaxRange = "<p>Maximum top-rope rating: <select name='maxTRRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxRoute;i++) {
if (i==Math.min(maxRoute,selectMaxTR)) {
TRMaxRange +="<option value="+i+" selected>"+
routeRatings[routeGradingID][i]+"</option>";
} else {
TRMaxRange += "<option value="+i+">"+
routeRatings[routeGradingID][i]+"</option>";
}
}
TRMaxRange += "</option></select></div>";
//generate lead rating selection
var LeadMinRange = "<div id='leadprefs'><p>Minimum lead rating: <select name='minLeadRange' class='form-control' id='rating-range-select'>";
for (var i = 0;i<=maxRoute;i++) {
if (i==selectMinL) {
LeadMinRange +="<option value="+i+" selected>"+
routeRatings[routeGradingID][i]+"</option>";
} else {
LeadMinRange += "<option value="+i+">"+
routeRatings[routeGradingID][i]+"</option>";
}
}
LeadMinRange += "</option></select>";
var LeadMaxRange = "<p>Maximum lead rating: <select name='maxLeadRange' class='form-control' id='rating-range-select'> ";
for (var i = 0;i<=maxRoute;i++) {
if (i==Math.min(maxRoute,selectMaxL)) {
LeadMaxRange +="<option value="+i+" selected>"+
routeRatings[routeGradingID][i]+"</option>";
} else {
LeadMaxRange += "<option value="+i+">"+
routeRatings[routeGradingID][i]+"</option>";
}
}
LeadMaxRange += "</option></select></div>";
//write rating preferences to html
document.getElementById("ratingrange").innerHTML =
boulderingMinRange + boulderingMaxRange + TRMinRange + TRMaxRange +
LeadMinRange + LeadMaxRange;
$("select[name='country-select']").click(function()
{
//get country value
var country = document.getElementById("country-select");
var countryID = country.options[country.selectedIndex].value;
console.log(countryID);
//determine best guess for grading system?
});
$("input[name='showBoulder']").click(function()
{
if ($(this).is(':checked')) {
$("#boulderprefs").show();
}
else {
$("#boulderprefs").hide();
}
});
$("input[name='showTR']").click(function()
{
if ($(this).is(':checked')) {
$("#trprefs").show();
}
else {
$("#trprefs").hide();
}
});
$("input[name='showLead']").click(function()
{
if ($(this).is(':checked')) {
$("#leadprefs").show();
}
else {
$("#leadprefs").hide();
}
});
});
| shimizust/trackyourclimb | js/preferences.js | JavaScript | mit | 8,494 | [
30522,
1002,
1006,
6254,
1007,
1012,
3201,
1006,
3853,
1006,
1007,
1063,
1013,
1013,
3602,
1024,
12398,
8117,
1013,
4098,
8483,
2024,
4225,
2648,
1997,
2023,
1046,
2015,
5371,
1013,
1013,
2421,
1000,
1046,
2015,
1013,
13264,
22494,
2618,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<title>Exam</title>
<link href="style.css" rel="stylesheet" />
<link href="responsive.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Droid+Serif:400,400italic' rel='stylesheet' type='text/css'>
<script src="js/scripts.js"></script>
</head>
<body>
<div id="container">
<header>
<h1><a href="#" title="Return to the homepage">Exam</a></h1>
<nav role="navigation">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Archives</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<div id="content" role="main">
<article>
<h2><a href="#">Getting started</a></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sed turpis turpis, eu mattis sem. Sed tristique porta cursus. Class <a href="#">aptent taciti</a> sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec vestibulum, enim nec condimentum ullamcorper, magna ipsum sagittis sapien, vel egestas lorem mi et neque. Nulla ultrices felis eget arcu vulputate at hendrerit augue euismod. Nulla at velit ac turpis sollicitudin consequat. Etiam leo tortor, faucibus a consectetur et, consequat venenatis velit. Curabitur tempus sem vitae elit gravida a suscipit leo placerat.</p>
<ul class="postinfo">
<li>17th October 2011</li>
<li>Posted in <a href="#">Articles</a></li>
<li><a href="#">Continue Reading »</a></li>
</ul>
</article>
<article>
<h2><a href="#">Top 12 tips for new student</a></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sed turpis turpis, eu mattis sem. Sed tristique porta cursus. Class <a href="#">aptent taciti</a> sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec vestibulum, enim nec condimentum ullamcorper, magna ipsum sagittis sapien, vel egestas lorem mi et neque. Nulla ultrices felis eget arcu vulputate at hendrerit augue euismod.</p>
<ul class="postinfo">
<li>17th October 2011</li>
<li>Posted in <a href="#">Articles</a></li>
<li><a href="#">Continue Reading »</a></li>
</ul>
</article>
<article>
<h2><a href="#">10 super exam tips</a></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sed turpis turpis, eu mattis sem. Sed tristique porta cursus. Class <a href="#">aptent taciti</a> sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec vestibulum, enim nec condimentum ullamcorper, magna ipsum sagittis sapien, vel egestas lorem mi et neque. Nulla ultrices felis eget arcu vulputate at hendrerit augue euismod.</p>
<ul class="postinfo">
<li>17th October 2011</li>
<li>Posted in <a href="#">Articles</a></li>
<li><a href="#">Continue Reading »</a></li>
</ul>
</article>
<nav id="pagination">
<ul>
<li class="older"><a href="#">« Older posts</a></li>
<li class="newer"><a href="#">Newer posts »</a></li>
</ul>
</nav>
</div>
<aside id="sidebar">
<section id="about">
<h3>About me</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus semper eros quis efficitur faucibus. <a href="#" class="more">Find out more »</a></p>
</section>
<section id="categories">
<h3>Categories</h3>
<ul>
<li><a href="#">Articles</a></li>
<li><a href="#">Design</a></li>
<li><a href="#">Graphics</a></li>
<li><a href="#">Inspiration</a></li>
<li><a href="#">Retro</a></li>
</ul>
</section>
<section id="social">
<h3>Social</h3>
<ul>
<li><a href="#">Twitter</a></li>
<li><a href="#">Facebook</a></li>
<li><a href="#">Flickr</a></li>
<li><a href="#">Behance</a></li>
<li><a href="#">Last.FM</a></li>
<li><a href="#">YouTube</a></li>
</ul>
</section>
<section id="latest">
<h3>Latest posts</h3>
<ul>
<li><a href="#">Getting your stock photos seen</a></li>
<li><a href="#">Top 10 tips for new bloggers</a></li>
<li><a href="#">10 fantastic photography tips</a></li>
</ul>
</section>
<section id="search" role="search">
<h3>Search</h3>
<form method="get" action="#">
<fieldset>
<input type="text" id="searchbar" placeholder="I'm looking for…" />
<input type="submit" id="searchsubmit" value="Search" />
</fieldset>
</form>
</section>
</aside>
</div>
<div id="footer-container">
<footer>
<p id="back-top"><a href="#">Back to top</a></p>
</footer>
</div>
</body>
</html> | Jorka7a13/SoftUni_WebFundamentals | Web-Fundamentals-29-October-2014-Exam/Problem 04. Unresponsive to Responsive Site/index.html | HTML | mit | 4,673 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1013,
1028,
1026,
18804,
2171,
1027,
1000,
3193,
6442,
1000,
4180,
1027,
1000,
9381,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
module Serverspec
module Helper
module Configuration
def subject
build_configurations
super
end
# You can create a set of configurations provided to all specs in your spec_helper:
#
# RSpec.configure { |c| c.pre_command = "source ~/.zshrc" }
#
# Any configurations you provide with `let(:option_name)` in a spec will
# automatically be merged on top of the configurations.
#
# @example
#
# describe 'Gem' do
# let(:pre_command) { "source ~/.zshrc" }
#
# %w(pry awesome_print bundler).each do |p|
# describe package(p) do
# it { should be_installed.by('gem') }
# end
# end
# end
def build_configurations
Serverspec::Configuration.defaults.keys.each do |c|
value = self.respond_to?(c.to_sym) ?
self.send(c) : RSpec.configuration.send(c)
Serverspec::Configuration.send(:"#{c}=", value)
end
end
end
end
end
| netmarkjp/serverspec | lib/serverspec/helper/configuration.rb | Ruby | mit | 1,048 | [
30522,
11336,
14903,
5051,
2278,
11336,
2393,
2121,
11336,
9563,
13366,
3395,
3857,
1035,
22354,
3565,
2203,
1001,
2017,
2064,
3443,
1037,
2275,
1997,
22354,
3024,
2000,
2035,
28699,
2015,
1999,
2115,
28699,
1035,
2393,
2121,
1024,
1001,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#include <aws/machinelearning/model/RealtimeEndpointStatus.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace MachineLearning
{
namespace Model
{
namespace RealtimeEndpointStatusMapper
{
static const int NONE_HASH = HashingUtils::HashString("NONE");
static const int READY_HASH = HashingUtils::HashString("READY");
static const int UPDATING_HASH = HashingUtils::HashString("UPDATING");
static const int FAILED_HASH = HashingUtils::HashString("FAILED");
RealtimeEndpointStatus GetRealtimeEndpointStatusForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == NONE_HASH)
{
return RealtimeEndpointStatus::NONE;
}
else if (hashCode == READY_HASH)
{
return RealtimeEndpointStatus::READY;
}
else if (hashCode == UPDATING_HASH)
{
return RealtimeEndpointStatus::UPDATING;
}
else if (hashCode == FAILED_HASH)
{
return RealtimeEndpointStatus::FAILED;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<RealtimeEndpointStatus>(hashCode);
}
return RealtimeEndpointStatus::NOT_SET;
}
Aws::String GetNameForRealtimeEndpointStatus(RealtimeEndpointStatus enumValue)
{
switch(enumValue)
{
case RealtimeEndpointStatus::NONE:
return "NONE";
case RealtimeEndpointStatus::READY:
return "READY";
case RealtimeEndpointStatus::UPDATING:
return "UPDATING";
case RealtimeEndpointStatus::FAILED:
return "FAILED";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return "";
}
}
} // namespace RealtimeEndpointStatusMapper
} // namespace Model
} // namespace MachineLearning
} // namespace Aws
| ambasta/aws-sdk-cpp | aws-cpp-sdk-machinelearning/source/model/RealtimeEndpointStatus.cpp | C++ | apache-2.0 | 3,066 | [
30522,
1013,
1008,
1008,
9385,
2230,
1011,
2355,
9733,
1012,
4012,
1010,
4297,
1012,
2030,
2049,
18460,
1012,
2035,
2916,
9235,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require 'mathn'
require 'rational'
require 'date'
require 'parsedate'
# = Ruby Units
#
# Copyright 2006 by Kevin C. Olbrich, Ph.D.
#
# See http://rubyforge.org/ruby-units/
#
# http://www.sciwerks.org
#
# mailto://kevin.olbrich+ruby-units@gmail.com
#
# See README for detailed usage instructions and examples
#
# ==Unit Definition Format
#
# '<name>' => [%w{prefered_name synonyms}, conversion_to_base, :classification, %w{<base> <units> <in> <numerator>} , %w{<base> <units> <in> <denominator>} ],
#
# Prefixes (e.g., a :prefix classification) get special handling
# Note: The accuracy of unit conversions depends on the precision of the conversion factor.
# If you have more accurate estimates for particular conversion factors, please send them
# to me and I will incorporate them into the next release. It is also incumbent on the end-user
# to ensure that the accuracy of any conversions is sufficient for their intended application.
#
# While there are a large number of unit specified in the base package,
# there are also a large number of units that are not included.
# This package covers nearly all SI, Imperial, and units commonly used
# in the United States. If your favorite units are not listed here, send me an email
#
# To add / override a unit definition, add a code block like this..
#
# class Unit < Numeric
# UNIT_DEFINITIONS = {
# <name>' => [%w{prefered_name synonyms}, conversion_to_base, :classification, %w{<base> <units> <in> <numerator>} , %w{<base> <units> <in> <denominator>} ]
# }
# end
# Unit.setup
class Unit < Numeric
# pre-generate hashes from unit definitions for performance.
VERSION = '1.1.3'
@@USER_DEFINITIONS = {}
@@PREFIX_VALUES = {}
@@PREFIX_MAP = {}
@@UNIT_MAP = {}
@@UNIT_VALUES = {}
@@OUTPUT_MAP = {}
@@BASE_UNITS = ['<meter>','<kilogram>','<second>','<mole>', '<farad>', '<ampere>','<radian>','<kelvin>','<temp-K>','<byte>','<dollar>','<candela>','<each>','<steradian>','<decibel>']
UNITY = '<1>'
UNITY_ARRAY= [UNITY]
FEET_INCH_REGEX = /(\d+)\s*(?:'|ft|feet)\s*(\d+)\s*(?:"|in|inches)/
TIME_REGEX = /(\d+)*:(\d+)*:*(\d+)*[:,]*(\d+)*/
LBS_OZ_REGEX = /(\d+)\s*(?:#|lbs|pounds|pound-mass)+[\s,]*(\d+)\s*(?:oz|ounces)/
SCI_NUMBER = %r{([+-]?\d*[.]?\d+(?:[Ee][+-]?)?\d*)}
RATIONAL_NUMBER = /(\d+)\/(\d+)/
COMPLEX_NUMBER = /#{SCI_NUMBER}?#{SCI_NUMBER}i\b/
NUMBER_REGEX = /#{SCI_NUMBER}*\s*(.+)?/
UNIT_STRING_REGEX = /#{SCI_NUMBER}*\s*([^\/]*)\/*(.+)*/
TOP_REGEX = /([^ \*]+)(?:\^|\*\*)([\d-]+)/
BOTTOM_REGEX = /([^* ]+)(?:\^|\*\*)(\d+)/
UNCERTAIN_REGEX = /#{SCI_NUMBER}\s*\+\/-\s*#{SCI_NUMBER}\s(.+)/
COMPLEX_REGEX = /#{COMPLEX_NUMBER}\s?(.+)?/
RATIONAL_REGEX = /#{RATIONAL_NUMBER}\s?(.+)?/
KELVIN = ['<kelvin>']
FAHRENHEIT = ['<fahrenheit>']
RANKINE = ['<rankine>']
CELSIUS = ['<celsius>']
SIGNATURE_VECTOR = [:length, :time, :temperature, :mass, :current, :substance, :luminosity, :currency, :memory, :angle, :capacitance]
@@KINDS = {
-312058=>:resistance,
-312038=>:inductance,
-152040=>:magnetism,
-152038=>:magnetism,
-152058=>:potential,
-39=>:acceleration,
-38=>:radiation,
-20=>:frequency,
-19=>:speed,
-18=>:viscosity,
0=>:unitless,
1=>:length,
2=>:area,
3=>:volume,
20=>:time,
400=>:temperature,
7942=>:power,
7959=>:pressure,
7962=>:energy,
7979=>:viscosity,
7981=>:force,
7997=>:mass_concentration,
8000=>:mass,
159999=>:magnetism,
160000=>:current,
160020=>:charge,
312058=>:resistance,
3199980=>:activity,
3199997=>:molar_concentration,
3200000=>:substance,
63999998=>:illuminance,
64000000=>:luminous_power,
1280000000=>:currency,
25600000000=>:memory,
511999999980=>:angular_velocity,
512000000000=>:angle,
10240000000000=>:capacitance,
}
@@cached_units = {}
@@base_unit_cache = {}
def self.setup
@@ALL_UNIT_DEFINITIONS = UNIT_DEFINITIONS.merge!(@@USER_DEFINITIONS)
for unit in (@@ALL_UNIT_DEFINITIONS) do
key, value = unit
if value[2] == :prefix then
@@PREFIX_VALUES[key]=value[1]
for name in value[0] do
@@PREFIX_MAP[name]=key
end
else
@@UNIT_VALUES[key]={}
@@UNIT_VALUES[key][:scalar]=value[1]
@@UNIT_VALUES[key][:classification]=value[2]
@@UNIT_VALUES[key][:numerator]=value[3] if value[3]
@@UNIT_VALUES[key][:denominator]=value[4] if value[4]
for name in value[0] do
@@UNIT_MAP[name]=key
end
end
@@OUTPUT_MAP[key]=value[0][0]
end
@@PREFIX_REGEX = @@PREFIX_MAP.keys.sort_by {|prefix| prefix.length}.reverse.join('|')
@@UNIT_REGEX = @@UNIT_MAP.keys.sort_by {|unit| unit.length}.reverse.join('|')
@@UNIT_MATCH_REGEX = /(#{@@PREFIX_REGEX})*?(#{@@UNIT_REGEX})\b/
Unit.new(1)
end
include Comparable
attr_accessor :scalar, :classification, :numerator, :denominator, :signature, :base_scalar, :base_numerator, :base_denominator, :output, :unit_name
def to_yaml_properties
%w{@scalar @classification @numerator @denominator @signature @base_scalar}
end
# needed to make complex units play nice -- otherwise not detected as a complex_generic
def kind_of?(klass)
self.scalar.kind_of?(klass)
end
def copy(from)
@scalar = from.scalar
@classification = from.classification
@numerator = from.numerator
@denominator = from.denominator
@is_base = from.is_base?
@signature = from.signature
@base_scalar = from.base_scalar
@output = from.output rescue nil
@unit_name = from.unit_name rescue nil
end
# basically a copy of the basic to_yaml. Needed because otherwise it ends up coercing the object to a string
# before YAML'izing it.
def to_yaml( opts = {} )
YAML::quick_emit( object_id, opts ) do |out|
out.map( taguri, to_yaml_style ) do |map|
for m in to_yaml_properties do
map.add( m[1..-1], instance_variable_get( m ) )
end
end
end
end
# Create a new Unit object. Can be initialized using a string, or a hash
# Valid formats include:
# "5.6 kg*m/s^2"
# "5.6 kg*m*s^-2"
# "5.6 kilogram*meter*second^-2"
# "2.2 kPa"
# "37 degC"
# "1" -- creates a unitless constant with value 1
# "GPa" -- creates a unit with scalar 1 with units 'GPa'
# 6'4" -- recognized as 6 feet + 4 inches
# 8 lbs 8 oz -- recognized as 8 lbs + 8 ounces
#
def initialize(*options)
@scalar = nil
@base_scalar = nil
@classification = nil
@unit_name = nil
@signature = nil
@output = nil
if options.size == 2
begin
cached = @@cached_units[options[1]] * options[0]
copy(cached)
rescue
initialize("#{options[0]} #{(options[1].units rescue options[1])}")
end
return
end
if options.size == 3
begin
cached = @@cached_units["#{options[1]}/#{options[2]}"] * options[0]
copy(cached)
rescue
initialize("#{options[0]} #{options[1]}/#{options[2]}")
end
return
end
case options[0]
when Hash:
@scalar = options[0][:scalar] || 1
@classification = options[0][:classification]
@numerator = options[0][:numerator] || UNITY_ARRAY
@denominator = options[0][:denominator] || UNITY_ARRAY
@signature = options[0][:signature]
when Array:
initialize(*options[0])
return
when Numeric:
@scalar = options[0]
@numerator = @denominator = UNITY_ARRAY
when Time:
@scalar = options[0].to_f
@classification = :time
@numerator = ['<second>']
@denominator = UNITY_ARRAY
when DateTime:
@scalar = options[0].ajd
@classification = :time
@numerator = ['<day>']
@denominator = UNITY_ARRAY
when "": raise ArgumentError, "No Unit Specified"
when String: parse(options[0])
else
raise ArgumentError, "Invalid Unit Format"
end
self.update_base_scalar
raise ArgumentError, "Temperature out of range" if self.is_temperature? && self.base_scalar < 0
unary_unit = self.units || ""
opt_units = options[0].scan(NUMBER_REGEX)[0][1] if String === options[0]
unless @@cached_units.keys.include?(opt_units) || (opt_units =~ /(temp|deg(C|K|R|F))|(pounds|lbs[ ,]\d+ ounces|oz)|('\d+")|(ft|feet[ ,]\d+ in|inch|inches)|%|(#{TIME_REGEX})|i\s?(.+)?|±|\+\/-/)
@@cached_units[opt_units] = (self.scalar == 1 ? self : opt_units.unit) if opt_units && !opt_units.empty?
end
unless @@cached_units.keys.include?(unary_unit) || (unary_unit =~ /(temp|deg)(C|K|R|F)/) then
@@cached_units[unary_unit] = (self.scalar == 1 ? self : unary_unit.unit)
end
[@scalar, @classification, @numerator, @denominator, @base_scalar, @signature, @is_base].each {|x| x.freeze}
self
end
def kind
return @@KINDS[self.signature]
end
def self.cached
return @@cached_units
end
def self.clear_cache
@@cached_units = {}
@@base_unit_cache = {}
end
def self.base_unit_cache
return @@base_unit_cache
end
def self.parse(input)
first, second = input.scan(/(.+)\s(?:in|to|as)\s(.+)/i).first
second.nil? ? first.unit : first.unit.to(second)
end
def to_unit
self
end
alias :unit :to_unit
# Returns 'true' if the Unit is represented in base units
def is_base?
return @is_base if defined? @is_base
return @is_base=true if @signature == 400 && self.numerator.size == 1 && self.denominator == UNITY_ARRAY && self.units =~ /(deg|temp)K/
n = @numerator + @denominator
for x in n.compact do
return @is_base=false unless x == UNITY || (@@BASE_UNITS.include?((x)))
end
return @is_base = true
end
# convert to base SI units
# results of the conversion are cached so subsequent calls to this will be fast
def to_base
return self if self.is_base?
if self.units =~ /\A(deg|temp)(C|F|K|C)\Z/
@signature = 400
base = case self.units
when /temp/ : self.to('tempK')
when /deg/ : self.to('degK')
end
return base
end
cached = ((@@base_unit_cache[self.units] * self.scalar) rescue nil)
return cached if cached
num = []
den = []
q = 1
for unit in @numerator.compact do
if @@PREFIX_VALUES[unit]
q *= @@PREFIX_VALUES[unit]
else
q *= @@UNIT_VALUES[unit][:scalar] if @@UNIT_VALUES[unit]
num << @@UNIT_VALUES[unit][:numerator] if @@UNIT_VALUES[unit] && @@UNIT_VALUES[unit][:numerator]
den << @@UNIT_VALUES[unit][:denominator] if @@UNIT_VALUES[unit] && @@UNIT_VALUES[unit][:denominator]
end
end
for unit in @denominator.compact do
if @@PREFIX_VALUES[unit]
q /= @@PREFIX_VALUES[unit]
else
q /= @@UNIT_VALUES[unit][:scalar] if @@UNIT_VALUES[unit]
den << @@UNIT_VALUES[unit][:numerator] if @@UNIT_VALUES[unit] && @@UNIT_VALUES[unit][:numerator]
num << @@UNIT_VALUES[unit][:denominator] if @@UNIT_VALUES[unit] && @@UNIT_VALUES[unit][:denominator]
end
end
num = num.flatten.compact
den = den.flatten.compact
num = UNITY_ARRAY if num.empty?
base= Unit.new(Unit.eliminate_terms(q,num,den))
@@base_unit_cache[self.units]=base
return base * @scalar
end
# Generate human readable output.
# If the name of a unit is passed, the unit will first be converted to the target unit before output.
# some named conversions are available
#
# :ft - outputs in feet and inches (e.g., 6'4")
# :lbs - outputs in pounds and ounces (e.g, 8 lbs, 8 oz)
#
# You can also pass a standard format string (i.e., '%0.2f')
# or a strftime format string.
#
# output is cached so subsequent calls for the same format will be fast
#
def to_s(target_units=nil)
out = @output[target_units] rescue nil
if out
return out
else
case target_units
when :ft:
inches = self.to("in").scalar.to_int
out = "#{(inches / 12).truncate}\'#{(inches % 12).round}\""
when :lbs:
ounces = self.to("oz").scalar.to_int
out = "#{(ounces / 16).truncate} lbs, #{(ounces % 16).round} oz"
when String
begin #first try a standard format string
target_units =~ /(%[\w\d#+-.]*)*\s*(.+)*/
out = $2 ? self.to($2).to_s($1) : "#{($1 || '%g') % @scalar || 0} #{self.units}".strip
rescue #if that is malformed, try a time string
out = (Time.gm(0) + self).strftime(target_units)
end
else
out = case @scalar
when Rational :
"#{@scalar} #{self.units}"
else
"#{'%g' % @scalar} #{self.units}"
end.strip
end
@output = {target_units => out}
return out
end
end
# Normally pretty prints the unit, but if you really want to see the guts of it, pass ':dump'
def inspect(option=nil)
return super() if option == :dump
self.to_s
end
# true if unit is a 'temperature', false if a 'degree' or anything else
def is_temperature?
return true if self.signature == 400 && self.units =~ /temp/
end
# returns the 'degree' unit associated with a temperature unit
# '100 tempC'.unit.temperature_scale #=> 'degC'
def temperature_scale
return nil unless self.is_temperature?
self.units =~ /temp(C|F|R|K)/
"deg#{$1}"
end
# returns true if no associated units
# false, even if the units are "unitless" like 'radians, each, etc'
def unitless?
(@numerator == UNITY_ARRAY && @denominator == UNITY_ARRAY)
end
# Compare two Unit objects. Throws an exception if they are not of compatible types.
# Comparisons are done based on the value of the unit in base SI units.
def <=>(other)
case other
when 0: self.base_scalar <=> 0
when Unit:
raise ArgumentError, "Incompatible Units" unless self =~ other
self.base_scalar <=> other.base_scalar
else
x,y = coerce(other)
x <=> y
end
end
# check to see if units are compatible, but not the scalar part
# this check is done by comparing signatures for performance reasons
# if passed a string, it will create a unit object with the string and then do the comparison
# this permits a syntax like:
# unit =~ "mm"
# if you want to do a regexp on the unit string do this ...
# unit.units =~ /regexp/
def =~(other)
return true if self == 0 || other == 0
case other
when Unit : self.signature == other.signature
else
x,y = coerce(other)
x =~ y
end
end
alias :compatible? :=~
alias :compatible_with? :=~
# Compare two units. Returns true if quantities and units match
#
# Unit("100 cm") === Unit("100 cm") # => true
# Unit("100 cm") === Unit("1 m") # => false
def ===(other)
case other
when Unit: (self.scalar == other.scalar) && (self.units == other.units)
else
x,y = coerce(other)
x === y
end
end
alias :same? :===
alias :same_as? :===
# Add two units together. Result is same units as receiver and scalar and base_scalar are updated appropriately
# throws an exception if the units are not compatible.
# It is possible to add Time objects to units of time
def +(other)
if Unit === other
case
when self.zero? : other.dup
when self =~ other :
raise ArgumentError, "Cannot add two temperatures" if ([self, other].all? {|x| x.is_temperature?})
if [self, other].any? {|x| x.is_temperature?}
case self.is_temperature?
when true:
Unit.new(:scalar => (self.scalar + other.to(self.temperature_scale).scalar), :numerator => @numerator, :denominator=>@denominator, :signature => @signature)
else
Unit.new(:scalar => (other.scalar + self.to(other.temperature_scale).scalar), :numerator => other.numerator, :denominator=>other.denominator, :signature => other.signature)
end
else
@q ||= ((@@cached_units[self.units].scalar / @@cached_units[self.units].base_scalar) rescue (self.units.unit.to_base.scalar))
Unit.new(:scalar=>(self.base_scalar + other.base_scalar)*@q, :numerator=>@numerator, :denominator=>@denominator, :signature => @signature)
end
else
raise ArgumentError, "Incompatible Units ('#{self}' not compatible with '#{other}')"
end
elsif Time === other
other + self
else
x,y = coerce(other)
y + x
end
end
# Subtract two units. Result is same units as receiver and scalar and base_scalar are updated appropriately
# throws an exception if the units are not compatible.
def -(other)
if Unit === other
case
when self.zero? : -other.dup
when self =~ other :
case
when [self, other].all? {|x| x.is_temperature?} :
Unit.new(:scalar => (self.base_scalar - other.base_scalar), :numerator => KELVIN, :denominator => UNITY_ARRAY, :signature => @signature).to(self.temperature_scale)
when self.is_temperature? :
Unit.new(:scalar => (self.base_scalar - other.base_scalar), :numerator => ['<temp-K>'], :denominator => UNITY_ARRAY, :signature => @signature).to(self)
when other.is_temperature? :
raise ArgumentError, "Cannot subtract a temperature from a differential degree unit"
else
@q ||= ((@@cached_units[self.units].scalar / @@cached_units[self.units].base_scalar) rescue (self.units.unit.scalar/self.units.unit.to_base.scalar))
Unit.new(:scalar=>(self.base_scalar - other.base_scalar)*@q, :numerator=>@numerator, :denominator=>@denominator, :signature=>@signature)
end
else
raise ArgumentError, "Incompatible Units ('#{self}' not compatible with '#{other}')"
end
elsif Time === other
other - self
else
x,y = coerce(other)
y-x
end
end
# Multiply two units.
def *(other)
case other
when Unit
raise ArgumentError, "Cannot multiply by temperatures" if [other,self].any? {|x| x.is_temperature?}
opts = Unit.eliminate_terms(@scalar*other.scalar, @numerator + other.numerator ,@denominator + other.denominator)
opts.merge!(:signature => @signature + other.signature)
Unit.new(opts)
when Numeric
Unit.new(:scalar=>@scalar*other, :numerator=>@numerator, :denominator=>@denominator, :signature => @signature)
else
x,y = coerce(other)
x * y
end
end
# Divide two units.
# Throws an exception if divisor is 0
def /(other)
case other
when Unit
raise ZeroDivisionError if other.zero?
raise ArgumentError, "Cannot divide with temperatures" if [other,self].any? {|x| x.is_temperature?}
opts = Unit.eliminate_terms(@scalar/other.scalar, @numerator + other.denominator ,@denominator + other.numerator)
opts.merge!(:signature=> @signature - other.signature)
Unit.new(opts)
when Numeric
raise ZeroDivisionError if other.zero?
Unit.new(:scalar=>@scalar/other, :numerator=>@numerator, :denominator=>@denominator, :signature => @signature)
else
x,y = coerce(other)
y / x
end
end
# Exponentiate. Only takes integer powers.
# Note that anything raised to the power of 0 results in a Unit object with a scalar of 1, and no units.
# Throws an exception if exponent is not an integer.
# Ideally this routine should accept a float for the exponent
# It should then convert the float to a rational and raise the unit by the numerator and root it by the denominator
# but, sadly, floats can't be converted to rationals.
#
# For now, if a rational is passed in, it will be used, otherwise we are stuck with integers and certain floats < 1
def **(other)
raise ArgumentError, "Cannot raise a temperature to a power" if self.is_temperature?
if Numeric === other
return Unit("1") if other.zero?
return self if other == 1
return self.inverse if other == -1
end
case other
when Rational:
self.power(other.numerator).root(other.denominator)
when Integer:
self.power(other)
when Float:
return self**(other.to_i) if other == other.to_i
valid = (1..9).map {|x| 1/x}
raise ArgumentError, "Not a n-th root (1..9), use 1/n" unless valid.include? other.abs
self.root((1/other).to_int)
else
raise ArgumentError, "Invalid Exponent"
end
end
# returns the unit raised to the n-th power. Integers only
def power(n)
raise ArgumentError, "Cannot raise a temperature to a power" if self.is_temperature?
raise ArgumentError, "Can only use Integer exponenents" unless Integer === n
return self if n == 1
return Unit("1") if n == 0
return self.inverse if n == -1
if n > 0 then
(1..(n-1).to_i).inject(self) {|product, x| product * self}
else
(1..-(n-1).to_i).inject(self) {|product, x| product / self}
end
end
# Calculates the n-th root of a unit, where n = (1..9)
# if n < 0, returns 1/unit^(1/n)
def root(n)
raise ArgumentError, "Cannot take the root of a temperature" if self.is_temperature?
raise ArgumentError, "Exponent must an Integer" unless Integer === n
raise ArgumentError, "0th root undefined" if n == 0
return self if n == 1
return self.root(n.abs).inverse if n < 0
vec = self.unit_signature_vector
vec=vec.map {|x| x % n}
raise ArgumentError, "Illegal root" unless vec.max == 0
num = @numerator.dup
den = @denominator.dup
for item in @numerator.uniq do
x = num.find_all {|i| i==item}.size
r = ((x/n)*(n-1)).to_int
r.times {|x| num.delete_at(num.index(item))}
end
for item in @denominator.uniq do
x = den.find_all {|i| i==item}.size
r = ((x/n)*(n-1)).to_int
r.times {|x| den.delete_at(den.index(item))}
end
q = @scalar < 0 ? (-1)**Rational(1,n) * (@scalar.abs)**Rational(1,n) : @scalar**Rational(1,n)
Unit.new(:scalar=>q,:numerator=>num,:denominator=>den)
end
# returns inverse of Unit (1/unit)
def inverse
Unit("1") / self
end
# convert to a specified unit string or to the same units as another Unit
#
# unit >> "kg" will covert to kilograms
# unit1 >> unit2 converts to same units as unit2 object
#
# To convert a Unit object to match another Unit object, use:
# unit1 >>= unit2
# Throws an exception if the requested target units are incompatible with current Unit.
#
# Special handling for temperature conversions is supported. If the Unit object is converted
# from one temperature unit to another, the proper temperature offsets will be used.
# Supports Kelvin, Celcius, fahrenheit, and Rankine scales.
#
# Note that if temperature is part of a compound unit, the temperature will be treated as a differential
# and the units will be scaled appropriately.
def to(other)
return self if other.nil?
return self if TrueClass === other
return self if FalseClass === other
if (Unit === other && other.is_temperature?) || (String === other && other =~ /temp(K|C|R|F)/)
raise ArgumentError, "Receiver is not a temperature unit" unless self.signature == 400
start_unit = self.units
target_unit = other.units rescue other
unless @base_scalar
@base_scalar = case start_unit
when 'tempC' : @scalar + 273.15
when 'tempK' : @scalar
when 'tempF' : (@scalar+459.67)*(5.0/9.0)
when 'tempR' : @scalar*(5.0/9.0)
end
end
q= case target_unit
when 'tempC' : @base_scalar - 273.15
when 'tempK' : @base_scalar
when 'tempF' : @base_scalar * (9.0/5.0) - 459.67
when 'tempR' : @base_scalar * (9.0/5.0)
end
Unit.new("#{q} #{target_unit}")
else
case other
when Unit:
return self if other.units == self.units
target = other
when String: target = Unit.new(other)
else
raise ArgumentError, "Unknown target units"
end
raise ArgumentError, "Incompatible Units" unless self =~ target
one = @numerator.map {|x| @@PREFIX_VALUES[x] ? @@PREFIX_VALUES[x] : x}.map {|i| i.kind_of?(Numeric) ? i : @@UNIT_VALUES[i][:scalar] }.compact
two = @denominator.map {|x| @@PREFIX_VALUES[x] ? @@PREFIX_VALUES[x] : x}.map {|i| i.kind_of?(Numeric) ? i : @@UNIT_VALUES[i][:scalar] }.compact
v = one.inject(1) {|product,n| product*n} / two.inject(1) {|product,n| product*n}
one = target.numerator.map {|x| @@PREFIX_VALUES[x] ? @@PREFIX_VALUES[x] : x}.map {|x| x.kind_of?(Numeric) ? x : @@UNIT_VALUES[x][:scalar] }.compact
two = target.denominator.map {|x| @@PREFIX_VALUES[x] ? @@PREFIX_VALUES[x] : x}.map {|x| x.kind_of?(Numeric) ? x : @@UNIT_VALUES[x][:scalar] }.compact
y = one.inject(1) {|product,n| product*n} / two.inject(1) {|product,n| product*n}
q = @scalar * v/y
Unit.new(:scalar=>q, :numerator=>target.numerator, :denominator=>target.denominator, :signature => target.signature)
end
end
alias :>> :to
alias :convert_to :to
# converts the unit back to a float if it is unitless. Otherwise raises an exception
def to_f
return @scalar.to_f if self.unitless?
raise RuntimeError, "Can't convert to Float unless unitless. Use Unit#scalar"
end
# converts the unit back to a complex if it is unitless. Otherwise raises an exception
def to_c
return Complex(@scalar) if self.unitless?
raise RuntimeError, "Can't convert to Complex unless unitless. Use Unit#scalar"
end
# returns the 'unit' part of the Unit object without the scalar
def units
return "" if @numerator == UNITY_ARRAY && @denominator == UNITY_ARRAY
return @unit_name unless @unit_name.nil?
output_n = []
output_d =[]
num = @numerator.clone.compact
den = @denominator.clone.compact
if @numerator == UNITY_ARRAY
output_n << "1"
else
num.each_with_index do |token,index|
if token && @@PREFIX_VALUES[token] then
output_n << "#{@@OUTPUT_MAP[token]}#{@@OUTPUT_MAP[num[index+1]]}"
num[index+1]=nil
else
output_n << "#{@@OUTPUT_MAP[token]}" if token
end
end
end
if @denominator == UNITY_ARRAY
output_d = ['1']
else
den.each_with_index do |token,index|
if token && @@PREFIX_VALUES[token] then
output_d << "#{@@OUTPUT_MAP[token]}#{@@OUTPUT_MAP[den[index+1]]}"
den[index+1]=nil
else
output_d << "#{@@OUTPUT_MAP[token]}" if token
end
end
end
on = output_n.reject {|x| x.empty?}.map {|x| [x, output_n.find_all {|z| z==x}.size]}.uniq.map {|x| ("#{x[0]}".strip+ (x[1] > 1 ? "^#{x[1]}" : ''))}
od = output_d.reject {|x| x.empty?}.map {|x| [x, output_d.find_all {|z| z==x}.size]}.uniq.map {|x| ("#{x[0]}".strip+ (x[1] > 1 ? "^#{x[1]}" : ''))}
out = "#{on.join('*')}#{od == ['1'] ? '': '/'+od.join('*')}".strip
@unit_name = out unless self.kind == :temperature
return out
end
# negates the scalar of the Unit
def -@
return -@scalar if self.unitless?
self.dup * -1
end
# returns abs of scalar, without the units
def abs
return @scalar.abs
end
def ceil
return @scalar.ceil if self.unitless?
Unit.new(@scalar.ceil, @numerator, @denominator)
end
def floor
return @scalar.floor if self.unitless?
Unit.new(@scalar.floor, @numerator, @denominator)
end
# if unitless, returns an int, otherwise raises an error
def to_i
return @scalar.to_int if self.unitless?
raise RuntimeError, 'Cannot convert to Integer unless unitless'
end
alias :to_int :to_i
# Tries to make a Time object from current unit. Assumes the current unit hold the duration in seconds from the epoch.
def to_time
Time.at(self)
end
alias :time :to_time
def truncate
return @scalar.truncate if self.unitless?
Unit.new(@scalar.truncate, @numerator, @denominator)
end
# convert a duration to a DateTime. This will work so long as the duration is the duration from the zero date
# defined by DateTime
def to_datetime
DateTime.new0(self.to('d').scalar)
end
def to_date
Date.new0(self.to('d').scalar)
end
def round
return @scalar.round if self.unitless?
Unit.new(@scalar.round, @numerator, @denominator)
end
# true if scalar is zero
def zero?
return @scalar.zero?
end
# '5 min'.unit.ago
def ago
self.before
end
# '5 min'.before(time)
def before(time_point = ::Time.now)
raise ArgumentError, "Must specify a Time" unless time_point
if String === time_point
time_point.time - self rescue time_point.datetime - self
else
time_point - self rescue time_point.to_datetime - self
end
end
alias :before_now :before
# 'min'.since(time)
def since(time_point = ::Time.now)
case time_point
when Time: (Time.now - time_point).unit('s').to(self)
when DateTime, Date: (DateTime.now - time_point).unit('d').to(self)
when String:
(DateTime.now - time_point.time(:context=>:past)).unit('d').to(self)
else
raise ArgumentError, "Must specify a Time, DateTime, or String"
end
end
# 'min'.until(time)
def until(time_point = ::Time.now)
case time_point
when Time: (time_point - Time.now).unit('s').to(self)
when DateTime, Date: (time_point - DateTime.now).unit('d').to(self)
when String:
r = (time_point.time(:context=>:future) - DateTime.now)
Time === time_point.time ? r.unit('s').to(self) : r.unit('d').to(self)
else
raise ArgumentError, "Must specify a Time, DateTime, or String"
end
end
# '5 min'.from(time)
def from(time_point = ::Time.now)
raise ArgumentError, "Must specify a Time" unless time_point
if String === time_point
time_point.time + self rescue time_point.datetime + self
else
time_point + self rescue time_point.to_datetime + self
end
end
alias :after :from
alias :from_now :from
# returns next unit in a range. '1 mm'.unit.succ #=> '2 mm'.unit
# only works when the scalar is an integer
def succ
raise ArgumentError, "Non Integer Scalar" unless @scalar == @scalar.to_i
q = @scalar.to_i.succ
Unit.new(q, @numerator, @denominator)
end
# automatically coerce objects to units when possible
# if an object defines a 'to_unit' method, it will be coerced using that method
def coerce(other)
if other.respond_to? :to_unit
return [other.to_unit, self]
end
case other
when Unit : [other, self]
else
[Unit.new(other), self]
end
end
# Protected and Private Functions that should only be called from this class
protected
def update_base_scalar
return @base_scalar unless @base_scalar.nil?
if self.is_base?
@base_scalar = @scalar
@signature = unit_signature
else
base = self.to_base
@base_scalar = base.scalar
@signature = base.signature
end
end
# calculates the unit signature vector used by unit_signature
def unit_signature_vector
return self.to_base.unit_signature_vector unless self.is_base?
result = self
vector = Array.new(SIGNATURE_VECTOR.size,0)
for element in @numerator
if r=@@ALL_UNIT_DEFINITIONS[element]
n = SIGNATURE_VECTOR.index(r[2])
vector[n] = vector[n] + 1 if n
end
end
for element in @denominator
if r=@@ALL_UNIT_DEFINITIONS[element]
n = SIGNATURE_VECTOR.index(r[2])
vector[n] = vector[n] - 1 if n
end
end
vector
end
private
def initialize_copy(other)
@numerator = other.numerator.dup
@denominator = other.denominator.dup
end
# calculates the unit signature id for use in comparing compatible units and simplification
# the signature is based on a simple classification of units and is based on the following publication
#
# Novak, G.S., Jr. "Conversion of units of measurement", IEEE Transactions on Software Engineering,
# 21(8), Aug 1995, pp.651-661
# doi://10.1109/32.403789
# http://ieeexplore.ieee.org/Xplore/login.jsp?url=/iel1/32/9079/00403789.pdf?isnumber=9079&prod=JNL&arnumber=403789&arSt=651&ared=661&arAuthor=Novak%2C+G.S.%2C+Jr.
#
def unit_signature
return @signature unless @signature.nil?
vector = unit_signature_vector
vector.each_with_index {|item,index| vector[index] = item * 20**index}
@signature=vector.inject(0) {|sum,n| sum+n}
end
def self.eliminate_terms(q, n, d)
num = n.dup
den = d.dup
num.delete_if {|v| v == UNITY}
den.delete_if {|v| v == UNITY}
combined = Hash.new(0)
i = 0
loop do
break if i > num.size
if @@PREFIX_VALUES.has_key? num[i]
k = [num[i],num[i+1]]
i += 2
else
k = num[i]
i += 1
end
combined[k] += 1 unless k.nil? || k == UNITY
end
j = 0
loop do
break if j > den.size
if @@PREFIX_VALUES.has_key? den[j]
k = [den[j],den[j+1]]
j += 2
else
k = den[j]
j += 1
end
combined[k] -= 1 unless k.nil? || k == UNITY
end
num = []
den = []
for key, value in combined do
case
when value > 0 : value.times {num << key}
when value < 0 : value.abs.times {den << key}
end
end
num = UNITY_ARRAY if num.empty?
den = UNITY_ARRAY if den.empty?
{:scalar=>q, :numerator=>num.flatten.compact, :denominator=>den.flatten.compact}
end
# parse a string into a unit object.
# Typical formats like :
# "5.6 kg*m/s^2"
# "5.6 kg*m*s^-2"
# "5.6 kilogram*meter*second^-2"
# "2.2 kPa"
# "37 degC"
# "1" -- creates a unitless constant with value 1
# "GPa" -- creates a unit with scalar 1 with units 'GPa'
# 6'4" -- recognized as 6 feet + 4 inches
# 8 lbs 8 oz -- recognized as 8 lbs + 8 ounces
def parse(passed_unit_string="0")
unit_string = passed_unit_string.dup
if unit_string =~ /\$\s*(#{NUMBER_REGEX})/
unit_string = "#{$1} USD"
end
unit_string.gsub!(/%/,'percent')
unit_string.gsub!(/'/,'feet')
unit_string.gsub!(/"/,'inch')
unit_string.gsub!(/#/,'pound')
if defined?(Uncertain) && unit_string =~ /(\+\/-|±)/
value, uncertainty, unit_s = unit_string.scan(UNCERTAIN_REGEX)[0]
result = unit_s.unit * Uncertain.new(value.to_f,uncertainty.to_f)
copy(result)
return
end
if defined?(Complex) && unit_string =~ COMPLEX_NUMBER
real, imaginary, unit_s = unit_string.scan(COMPLEX_REGEX)[0]
result = Unit(unit_s || '1') * Complex(real.to_f,imaginary.to_f)
copy(result)
return
end
if defined?(Rational) && unit_string =~ RATIONAL_NUMBER
numerator, denominator, unit_s = unit_string.scan(RATIONAL_REGEX)[0]
result = Unit(unit_s || '1') * Rational(numerator.to_i,denominator.to_i)
copy(result)
return
end
unit_string =~ NUMBER_REGEX
unit = @@cached_units[$2]
mult = ($1.empty? ? 1.0 : $1.to_f) rescue 1.0
if unit
copy(unit)
@scalar *= mult
@base_scalar *= mult
return self
end
unit_string.gsub!(/[<>]/,"")
if unit_string =~ /:/
hours, minutes, seconds, microseconds = unit_string.scan(TIME_REGEX)[0]
raise ArgumentError, "Invalid Duration" if [hours, minutes, seconds, microseconds].all? {|x| x.nil?}
result = "#{hours || 0} h".unit +
"#{minutes || 0} minutes".unit +
"#{seconds || 0} seconds".unit +
"#{microseconds || 0} usec".unit
copy(result)
@classification = :time
return
end
# Special processing for unusual unit strings
# feet -- 6'5"
feet, inches = unit_string.scan(FEET_INCH_REGEX)[0]
if (feet && inches)
result = Unit.new("#{feet} ft") + Unit.new("#{inches} inches")
copy(result)
@classification = :length
return
end
# weight -- 8 lbs 12 oz
pounds, oz = unit_string.scan(LBS_OZ_REGEX)[0]
if (pounds && oz)
result = Unit.new("#{pounds} lbs") + Unit.new("#{oz} oz")
copy(result)
@classification = :mass
return
end
raise( ArgumentError, "'#{passed_unit_string}' Unit not recognized") if unit_string.count('/') > 1
raise( ArgumentError, "'#{passed_unit_string}' Unit not recognized") if unit_string.scan(/\s\d+\S*/).size > 0
@scalar, top, bottom = unit_string.scan(UNIT_STRING_REGEX)[0] #parse the string into parts
top.scan(TOP_REGEX).each do |item|
n = item[1].to_i
x = "#{item[0]} "
case
when n>=0 : top.gsub!(/#{item[0]}(\^|\*\*)#{n}/) {|s| x * n}
when n<0 : bottom = "#{bottom} #{x * -n}"; top.gsub!(/#{item[0]}(\^|\*\*)#{n}/,"")
end
end
bottom.gsub!(BOTTOM_REGEX) {|s| "#{$1} " * $2.to_i} if bottom
@scalar = @scalar.to_f unless @scalar.nil? || @scalar.empty?
@scalar = 1 unless @scalar.kind_of? Numeric
@numerator ||= UNITY_ARRAY
@denominator ||= UNITY_ARRAY
@numerator = top.scan(@@UNIT_MATCH_REGEX).delete_if {|x| x.empty?}.compact if top
@denominator = bottom.scan(@@UNIT_MATCH_REGEX).delete_if {|x| x.empty?}.compact if bottom
us = "#{(top || '' + bottom || '')}".to_s.gsub(@@UNIT_MATCH_REGEX,'').gsub(/[\d\*, "'_^\/\$]/,'')
raise( ArgumentError, "'#{passed_unit_string}' Unit not recognized") unless us.empty?
@numerator = @numerator.map do |item|
@@PREFIX_MAP[item[0]] ? [@@PREFIX_MAP[item[0]], @@UNIT_MAP[item[1]]] : [@@UNIT_MAP[item[1]]]
end.flatten.compact.delete_if {|x| x.empty?}
@denominator = @denominator.map do |item|
@@PREFIX_MAP[item[0]] ? [@@PREFIX_MAP[item[0]], @@UNIT_MAP[item[1]]] : [@@UNIT_MAP[item[1]]]
end.flatten.compact.delete_if {|x| x.empty?}
@numerator = UNITY_ARRAY if @numerator.empty?
@denominator = UNITY_ARRAY if @denominator.empty?
@numerator.each do |item|
unless @@PREFIX_MAP.value?(item)
@classification = @@UNIT_VALUES[item][:classification]
break
end
end
self
end
end
Unit.setup
| jwhitmire/ruby-units | lib/ruby_units/ruby-units.rb | Ruby | mit | 38,565 | [
30522,
5478,
1005,
8785,
2078,
1005,
5478,
1005,
11581,
1005,
5478,
1005,
3058,
1005,
5478,
1005,
11968,
6924,
3686,
1005,
1001,
1027,
10090,
3197,
1001,
1001,
9385,
2294,
2011,
4901,
1039,
1012,
19330,
23736,
2818,
1010,
6887,
1012,
1040,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Arenaria leucadia Phitos & Strid SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Caryophyllaceae/Arenaria/Arenaria leucadia/README.md | Markdown | apache-2.0 | 182 | [
30522,
1001,
5196,
4360,
3393,
18100,
9032,
13569,
13122,
1004,
2358,
14615,
2427,
1001,
1001,
1001,
1001,
3570,
3970,
1001,
1001,
1001,
1001,
2429,
2000,
2248,
3269,
3415,
5950,
1001,
1001,
1001,
1001,
2405,
1999,
19701,
1001,
1001,
1001,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php if (!defined('APPLICATION')) exit();
/*
Copyright 2008, 2009 Vanilla Forums Inc.
This file is part of Garden.
Garden 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.
Garden 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 Garden. If not, see <http://www.gnu.org/licenses/>.
Contact Vanilla Forums Inc. at support [at] vanillaforums [dot] com
*/
class UserModel extends Gdn_Model {
const DEFAULT_CONFIRM_EMAIL = 'You need to confirm your email address before you can continue. Please confirm your email address by clicking on the following link: {/entry/emailconfirm,exurl,domain}/{User.UserID,rawurlencode}/{EmailKey,rawurlencode}';
const USERID_KEY = 'user.{UserID}';
const USERNAME_KEY = 'user.{Name}.name';
const USERROLES_KEY = 'user.{UserID}.roles';
const USERPERMISSIONS_KEY = 'user.{UserID}.permissions.{PermissionsIncrement}';
const INC_PERMISSIONS_KEY = 'permissions.increment';
const REDIRECT_APPROVE = 'REDIRECT_APPROVE';
const USERNAME_REGEX_MIN = '^\/"\\\\#@\t\r\n';
const LOGIN_COOLDOWN_KEY = 'user.login.{Source}.cooldown';
const LOGIN_RATE_KEY = 'user.login.{Source}.rate';
const LOGIN_RATE = 1;
public $SessionColumns;
/**
* Class constructor. Defines the related database table name.
*/
public function __construct() {
parent::__construct('User');
}
protected function _AddEmailHeaderFooter($Message, $Data) {
$Header = T('EmailHeader', '');
if ($Header)
$Message = FormatString($Header, $Data)."\n".$Message;
$Footer = T('EmailFooter', '');
if ($Footer)
$Message .= "\n".FormatString($Footer, $Data);
return $Message;
}
/**
*
* @param Gdn_Controller $Controller
*/
public function AddPasswordStrength($Controller) {
$Controller->AddJsFile('password.js');
$Controller->AddDefinition('MinPassLength', C('Garden.Registration.MinPasswordLength'));
$Controller->AddDefinition('PasswordTranslations', T('Password Translations', 'Too Short,Contains Username,Very Weak,Weak,Ok,Good,Strong'));
}
public function Ban($UserID, $Options) {
$this->SetField($UserID, 'Banned', TRUE);
$LogID = FALSE;
if (GetValue('DeleteContent', $Options)) {
$Options['Log'] = 'Ban';
$LogID = $this->DeleteContent($UserID, $Options);
}
if ($LogID) {
$this->SaveAttribute($UserID, 'BanLogID', $LogID);
}
if (GetValue('AddActivity', $Options, TRUE)) {
switch (GetValue('Reason', $Options, '')) {
case '':
$Story = NULL;
break;
case 'Spam':
$Story = T('Banned for spamming.');
break;
case 'Abuse':
$Story = T('Banned for being abusive.');
break;
default:
$Story = $Options['Reason'];
break;
}
$Activity = array(
'ActivityType' => 'Ban',
'NotifyUserID' => ActivityModel::NOTIFY_MODS,
'ActivityUserID' => $UserID,
'RegardingUserID' => Gdn::Session()->UserID,
'HeadlineFormat' => T('HeadlineFormat.Ban', '{RegardingUserID,You} banned {ActivityUserID,you}.'),
'Story' => $Story,
'Data' => array('LogID' => $LogID));
$ActivityModel = new ActivityModel();
$ActivityModel->Save($Activity);
}
}
/**
* Checks the specified user's for the given permission. Returns a boolean
* value indicating if the action is permitted.
*
* @param mixed $User The user to check
* @param mixed $Permission The permission (or array of permissions) to check.
* @param int $JunctionID The JunctionID associated with $Permission (ie. A discussion category identifier).
* @return boolean
*/
public function CheckPermission($User, $Permission, $Options = array()) {
if (is_numeric($User)) {
$User = $this->GetID($User);
}
$User = (object)$User;
if ($User->Banned || $User->Deleted)
return FALSE;
if ($User->Admin)
return TRUE;
// Grab the permissions for the user.
if ($User->UserID == 0)
$Permissions = $this->DefinePermissions(0, FALSE);
elseif (is_array($User->Permissions))
$Permissions = $User->Permissions;
else {
$Permissions = $this->DefinePermissions($User->UserID, FALSE);
}
// TODO: Check for junction table permissions.
$Result = in_array($Permission, $Permissions) || array_key_exists($Permission, $Permissions);
return $Result;
}
/**
* Merge the old user into the new user.
*
* @param int $OldUserID
* @param int $NewUserID
*/
public function Merge($OldUserID, $NewUserID) {
$OldUser = $this->GetID($OldUserID, DATASET_TYPE_ARRAY);
$NewUser = $this->GetID($NewUserID, DATASET_TYPE_ARRAY);
if (!$OldUser || !$NewUser) {
throw new Gdn_UserException("Could not find one or both users to merge.");
}
$Map = array('UserID', 'Name', 'Email', 'CountVisits', 'CountDiscussions', 'CountComments');
$Result = array('MergeID' => NULL, 'Before' => array(
'OldUser' => ArrayTranslate($OldUser, $Map),
'NewUser' => ArrayTranslate($NewUser, $Map)));
// Start the merge.
$MergeID = $this->MergeStart($OldUserID, $NewUserID);
// Copy all discussions from the old user to the new user.
$this->MergeCopy($MergeID, 'Discussion', 'InsertUserID', $OldUserID, $NewUserID);
// Copy all the comments from the old user to the new user.
$this->MergeCopy($MergeID, 'Comment', 'InsertUserID', $OldUserID, $NewUserID);
// Copy all of the activities.
$this->MergeCopy($MergeID, 'Activity', 'NotifyUserID', $OldUserID, $NewUserID);
$this->MergeCopy($MergeID, 'Activity', 'InsertUserID', $OldUserID, $NewUserID);
$this->MergeCopy($MergeID, 'Activity', 'ActivityUserID', $OldUserID, $NewUserID);
// Copy all of the activity comments.
$this->MergeCopy($MergeID, 'ActivityComment', 'InsertUserID', $OldUserID, $NewUserID);
// Copy all conversations.
$this->MergeCopy($MergeID, 'Conversation', 'InsertUserID', $OldUserID, $NewUserID);
$this->MergeCopy($MergeID, 'ConversationMessage', 'InsertUserID', $OldUserID, $NewUserID, 'MessageID');
$this->MergeCopy($MergeID, 'UserConversation', 'UserID', $OldUserID, $NewUserID, 'ConversationID');
$this->MergeFinish($MergeID);
$OldUser = $this->GetID($OldUserID, DATASET_TYPE_ARRAY);
$NewUser = $this->GetID($NewUserID, DATASET_TYPE_ARRAY);
$Result['MergeID'] = $MergeID;
$Result['After'] = array(
'OldUser' => ArrayTranslate($OldUser, $Map),
'NewUser' => ArrayTranslate($NewUser, $Map));
return $Result;
}
protected function MergeCopy($MergeID, $Table, $Column, $OldUserID, $NewUserID, $PK = NULL) {
if (!$PK)
$PK = $Table.'ID';
// Insert the columns to the bak table.
$Sql = "insert ignore GDN_UserMergeItem(`MergeID`, `Table`, `Column`, `RecordID`, `OldUserID`, `NewUserID`)
select :MergeID, :Table, :Column, `$PK`, :OldUserID, :NewUserID
from `GDN_$Table` t
where t.`$Column` = :OldUserID2";
Gdn::SQL()->Database->Query($Sql,
array(':MergeID' => $MergeID, ':Table' => $Table, ':Column' => $Column,
':OldUserID' => $OldUserID, ':NewUserID' => $NewUserID, ':OldUserID2' => $OldUserID));
Gdn::SQL()->Options('Ignore', TRUE)->Put(
$Table,
array($Column => $NewUserID),
array($Column => $OldUserID));
}
protected function MergeStart($OldUserID, $NewUserID) {
$Model = new Gdn_Model('UserMerge');
// Grab the users.
$OldUser = $this->GetID($OldUserID, DATASET_TYPE_ARRAY);
$NewUser = $this->GetID($NewUserID, DATASET_TYPE_ARRAY);
// First see if there is a record with the same merge.
$Row = $Model->GetWhere(array('OldUserID' => $OldUserID, 'NewUserID' => $NewUserID))->FirstRow(DATASET_TYPE_ARRAY);
if ($Row) {
$MergeID = $Row['MergeID'];
// Save this merge in the log.
if ($Row['Attributes'])
$Attributes = unserialize($Row['Attributes']);
else
$Attributes = array();
$Attributes['Log'][] = array('UserID' => Gdn::Session()->UserID, 'Date' => Gdn_Format::ToDateTime());
$Row = array('MergeID' => $MergeID, 'Attributes' => $Attributes);
} else {
$Row = array(
'OldUserID' => $OldUserID,
'NewUserID' => $NewUserID);
}
$UserSet = array();
$OldUserSet = array();
if (DateCompare($OldUser['DateFirstVisit'], $NewUser['DateFirstVisit']) < 0)
$UserSet['DateFirstVisit'] = $OldUser['DateFirstVisit'];
if (!isset($Row['Attributes']['User']['CountVisits'])) {
$UserSet['CountVisits'] = $OldUser['CountVisits'] + $NewUser['CountVisits'];
$OldUserSet['CountVisits'] = 0;
}
if (!empty($UserSet)) {
// Save the user information on the merge record.
foreach ($UserSet as $Key => $Value) {
// Only save changed values that aren't already there from a previous merge.
if ($NewUser[$Key] != $Value && !isset($Row['Attributes']['User'][$Key])) {
$Row['Attributes']['User'][$Key] = $NewUser[$Key];
}
}
}
$MergeID = $Model->Save($Row);
if (GetValue('MergeID', $Row))
$MergeID = $Row['MergeID'];
if (!$MergeID) {
throw new Gdn_UserException($Model->Validation->ResultsText());
}
// Update the user with the new user-level data.
$this->SetField($NewUserID, $UserSet);
if (!empty($OldUserSet)) {
$this->SetField($OldUserID, $OldUserSet);
}
return $MergeID;
}
protected function MergeFinish($MergeID) {
$Row = Gdn::SQL()->GetWhere('UserMerge', array('MergeID' => $MergeID))->FirstRow(DATASET_TYPE_ARRAY);
if (isset($Row['Attributes']) && !empty($Row['Attributes'])) {
Trace(unserialize($Row['Attributes']), 'Merge Attributes');
}
$UserIDs = array(
$Row['OldUserID'],
$Row['NewUserID']);
foreach ($UserIDs as $UserID) {
$this->Counts('countdiscussions', $UserID);
$this->Counts('countcomments', $UserID);
}
}
public function Counts($Column, $UserID = null) {
if ($UserID) {
$Where = array('UserID' => $UserID);
} else
$Where = NULL;
switch (strtolower($Column)) {
case 'countdiscussions':
Gdn::Database()->Query(DBAModel::GetCountSQL('count', 'User', 'Discussion', 'CountDiscussions', 'DiscussionID', 'UserID', 'InsertUserID', $Where));
break;
case 'countcomments':
Gdn::Database()->Query(DBAModel::GetCountSQL('count', 'User', 'Comment', 'CountComments', 'CommentID', 'UserID', 'InsertUserID', $Where));
break;
}
if ($UserID) {
$this->ClearCache($UserID);
}
}
/**
* Whether or not the application requires email confirmation.
*
* @return bool
*/
public static function RequireConfirmEmail() {
return C('Garden.Registration.ConfirmEmail') && !self::NoEmail();
}
/**
* Whether or not users have email addresses.
* @return bool
*/
public static function NoEmail() {
return C('Garden.Registration.NoEmail');
}
/**
* Unban a user.
* @since 2.1
* @param int $UserID
* @param array $Options
*/
public function UnBan($UserID, $Options = array()) {
$User = $this->GetID($UserID, DATASET_TYPE_ARRAY);
if (!$User)
throw NotFoundException();
if (!$User['Banned'])
throw new Gdn_UserException(T("The user isn't banned."));
// Unban the user.
$this->SetField($UserID, 'Banned', FALSE);
// Restore the user's content.
if (GetValue('RestoreContent', $Options)) {
$BanLogID = $this->GetAttribute($UserID, 'BanLogID');
if ($BanLogID) {
$LogModel = new LogModel();
try {
$LogModel->Restore($BanLogID);
} catch (Exception $Ex) {
if ($Ex->getCode() != 404)
throw $Ex;
}
$this->SaveAttribute($UserID, 'BanLogID', NULL);
}
}
// Add an activity for the unbanning.
if (GetValue('AddActivity', $Options, TRUE)) {
$ActivityModel = new ActivityModel();
$Story = GetValue('Story', $Options, NULL);
// Notify the moderators of the unban.
$Activity = array(
'ActivityType' => 'Ban',
'NotifyUserID' => ActivityModel::NOTIFY_MODS,
'ActivityUserID' => $UserID,
'RegardingUserID' => Gdn::Session()->UserID,
'HeadlineFormat' => T('HeadlineFormat.Unban', '{RegardingUserID,You} unbanned {ActivityUserID,you}.'),
'Story' => $Story);
$ActivityModel->Queue($Activity);
// Notify the user of the unban.
$Activity['NotifyUserID'] = $UserID;
$Activity['Emailed'] = ActivityModel::SENT_PENDING;
$Activity['HeadlineFormat'] = T('HeadlineFormat.Unban.Notification', "You've been unbanned.");
$ActivityModel->Queue($Activity, FALSE, array('Force' => TRUE));
$ActivityModel->SaveQueue();
}
}
public function ConfirmEmail($User, $EmailKey) {
$Attributes = GetValue('Attributes', $User);
$StoredEmailKey = GetValue('EmailKey', $Attributes);
$UserID = GetValue('UserID', $User);
if (!$StoredEmailKey || $EmailKey != $StoredEmailKey) {
$this->Validation->AddValidationResult('EmailKey', '@'.T('Couldn\'t confirm email.',
'We couldn\'t confirm your email. Check the link in the email we sent you or try sending another confirmation email.'));
return FALSE;
}
// Update the user's roles.
$DefaultRoles = C('Garden.Registration.DefaultRoles', array());
$ConfirmRoleID = C('Garden.Registration.ConfirmEmailRole');
$Roles = GetValue('ConfirmedEmailRoles', $Attributes, $DefaultRoles);
if (in_array($ConfirmRoleID, $Roles)) {
// throw new Exception('Foo!!!');
// The user is reconfirming to the confirm email role. At least set to the default roles.
$Roles = $DefaultRoles;
}
$this->EventArguments['ConfirmUserID'] = $UserID;
$this->EventArguments['ConfirmUserRoles'] = &$Roles;
$this->FireEvent('BeforeConfirmEmail');
$this->SaveRoles($UserID, $Roles, FALSE);
// Remove the email confirmation attributes.
// unset($Attributes['EmailKey'], $Attributes['ConfirmedEmailRoles']);
$this->SaveAttribute($UserID, array('EmailKey' => NULL, 'ConfirmedEmailRoles' => NULL));
return TRUE;
}
public function SSO($String) {
if (!$String)
return;
$Parts = explode(' ', $String);
$String = $Parts[0];
$Data = json_decode(base64_decode($String), TRUE);
Trace($Data, 'RAW SSO Data');
$Errors = 0;
if (!isset($Parts[1])) {
Trace('Missing SSO signature', TRACE_ERROR);
$Errors++;
}
if (!isset($Parts[2])) {
Trace('Missing SSO timestamp', TRACE_ERROR);
$Errors++;
}
if ($Errors)
return;
$Signature = $Parts[1];
$Timestamp = $Parts[2];
$HashMethod = GetValue(3, $Parts, 'hmacsha1');
$ClientID = GetValue('client_id', $Data);
if (!$ClientID) {
Trace('Missing SSO client_id', TRACE_ERROR);
return;
}
$Provider = Gdn_AuthenticationProviderModel::GetProviderByKey($ClientID);
if (!$Provider) {
Trace("Unknown SSO Provider: $ClientID", TRACE_ERROR);
return;
}
$Secret = $Provider['AssociationSecret'];
// Check the signature.
switch ($HashMethod) {
case 'hmacsha1':
$CalcSignature = hash_hmac('sha1', "$String $Timestamp", $Secret);
break;
default:
Trace("Invalid SSO hash method $HashMethod.", TRACE_ERROR);
return;
}
if ($CalcSignature != $Signature) {
Trace("Invalid SSO signature.", TRACE_ERROR);
return;
}
$UniqueID = $Data['uniqueid'];
$User = ArrayTranslate($Data, array(
'name' => 'Name',
'email' => 'Email',
'photourl' => 'Photo',
'uniqueid' => NULL,
'client_id' => NULL), TRUE);
Trace($User, 'SSO User');
$UserID = Gdn::UserModel()->Connect($UniqueID, $ClientID, $User);
return $UserID;
}
/**
*
* @param array $CurrentUser
* @param array $NewUser
* @since 2.1
*/
public function SynchUser($CurrentUser, $NewUser) {
if (is_numeric($CurrentUser)) {
$CurrentUser = $this->GetID($CurrentUser, DATASET_TYPE_ARRAY);
}
// Don't synch the user photo if they've uploaded one already.
$Photo = GetValue('Photo', $NewUser);
$CurrentPhoto = GetValue('Photo', $CurrentUser);
if (FALSE
|| ($CurrentPhoto && !StringBeginsWith($CurrentPhoto, 'http'))
|| !is_string($Photo)
|| ($Photo && !StringBeginsWith($Photo, 'http'))
|| strpos($Photo, '.gravatar.') !== FALSE
|| StringBeginsWith($Photo, Url('/', TRUE))) {
unset($NewUser['Photo']);
Trace('Not setting photo.');
}
if (C('Garden.SSO.SynchRoles')) {
// Translate the role names to IDs.
$Roles = GetValue('Roles', $NewUser, '');
if (is_string($Roles))
$Roles = explode(',', $Roles);
else
$Roles = array();
$Roles = array_map('trim', $Roles);
$Roles = array_map('strtolower', $Roles);
$AllRoles = RoleModel::Roles();
$RoleIDs = array();
foreach ($AllRoles as $RoleID => $Role) {
$Name = strtolower($Role['Name']);
if (in_array($Name, $Roles)) {
$RoleIDs[] = $RoleID;
}
}
if (empty($RoleIDs)) {
$RoleIDs = $this->NewUserRoleIDs();
}
$NewUser['RoleID'] = $RoleIDs;
} else {
unset($NewUser['Roles']);
unset($NewUser['RoleID']);
}
// Save the user information.
$NewUser['UserID'] = $CurrentUser['UserID'];
Trace($NewUser);
$Result = $this->Save($NewUser, array('NoConfirmEmail' => TRUE, 'FixUnique' => TRUE, 'SaveRoles' => isset($NewUser['RoleID'])));
if (!$Result)
Trace($this->Validation->ResultsText());
}
/** Connect a user with a foreign authentication system.
*
* @param string $UniqueID The user's unique key in the other authentication system.
* @param string $ProviderKey The key of the system providing the authentication.
* @param array $UserData Data to go in the user table.
* @return int The new/existing user ID.
*/
public function Connect($UniqueID, $ProviderKey, $UserData, $Options = array()) {
Trace('UserModel->Connect()');
$UserID = FALSE;
if (!isset($UserData['UserID'])) {
// Check to see if the user already exists.
$Auth = $this->GetAuthentication($UniqueID, $ProviderKey);
$UserID = GetValue('UserID', $Auth);
if ($UserID)
$UserData['UserID'] = $UserID;
}
$UserInserted = FALSE;
if ($UserID) {
// Save the user.
$this->SynchUser($UserID, $UserData);
return $UserID;
} else {
// The user hasn't already been connected. We want to see if we can't find the user based on some critera.
// Check to auto-connect based on email address.
if (C('Garden.SSO.AutoConnect', C('Garden.Registration.AutoConnect')) && isset($UserData['Email'])) {
$User = $this->GetByEmail($UserData['Email']);
Trace($User, "Autoconnect User");
if ($User) {
$User = (array)$User;
// Save the user.
$this->SynchUser($User, $UserData);
$UserID = $User['UserID'];
}
}
if (!$UserID) {
// Create a new user.
// $UserID = $this->InsertForBasic($UserData, FALSE, array('ValidateEmail' => FALSE, 'NoConfirmEmail' => TRUE));
$UserData['Password'] = md5(microtime());
$UserData['HashMethod'] = 'Random';
TouchValue('CheckCaptcha', $Options, FALSE);
TouchValue('NoConfirmEmail', $Options, TRUE);
TouchValue('NoActivity', $Options, TRUE);
Trace($UserData, 'Registering User');
$UserID = $this->Register($UserData, $Options);
$UserInserted = TRUE;
}
if ($UserID) {
// Save the authentication.
$this->SaveAuthentication(array(
'UniqueID' => $UniqueID,
'Provider' => $ProviderKey,
'UserID' => $UserID
));
if ($UserInserted && C('Garden.Registration.SendConnectEmail', TRUE)) {
$Provider = $this->SQL->GetWhere('UserAuthenticationProvider', array('AuthenticationKey' => $ProviderKey))->FirstRow(DATASET_TYPE_ARRAY);
}
}
}
return $UserID;
}
public function FilterForm($Data, $Register = FALSE) {
$Data = parent::FilterForm($Data);
$Data = array_diff_key($Data,
array('Admin' => 0, 'Deleted' => 0, 'CountVisits' => 0, 'CountInvitations' => 0, 'CountNotifications' => 0, 'Preferences' => 0,
'Permissions' => 0, 'LastIPAddress' => 0, 'AllIPAddresses' => 0, 'DateFirstVisit' => 0, 'DateLastActive' => 0, 'CountDiscussions' => 0, 'CountComments' => 0,
'Score' => 0));
if (!Gdn::Session()->CheckPermission('Garden.Moderation.Manage')) {
$Data = array_diff_key($Data, array('Banned' => 0, 'Verified' => 0));
}
if (!Gdn::Session()->CheckPermission('Garden.Moderation.Manage')) {
unset($Data['RankID']);
}
if (!$Register && !Gdn::Session()->CheckPermission('Garden.Users.Edit') && !C("Garden.Profile.EditUsernames")) {
unset($Data['Name']);
}
return $Data;
}
/**
* A convenience method to be called when inserting users (because users
* are inserted in various methods depending on registration setups).
*/
protected function _Insert($Fields, $Options = array()) {
$this->EventArguments['InsertFields'] =& $Fields;
$this->FireEvent('BeforeInsertUser');
if (!val('Setup', $Options)) {
unset($Fields['Admin']);
}
// Massage the roles for email confirmation.
if (self::RequireConfirmEmail() && !GetValue('NoConfirmEmail', $Options)) {
$ConfirmRoleID = C('Garden.Registration.ConfirmEmailRole');
if ($ConfirmRoleID) {
TouchValue('Attributes', $Fields, array());
$ConfirmationCode = RandomString(8);
$Fields['Attributes']['EmailKey'] = $ConfirmationCode;
if (isset($Fields['Roles'])) {
$Fields['Attributes']['ConfirmedEmailRoles'] = $Fields['Roles'];
}
$Fields['Roles'] = array($ConfirmRoleID);
}
}
// Make sure to encrypt the password for saving...
if (array_key_exists('Password', $Fields) && !GetValue('HashMethod', $Fields)) {
$PasswordHash = new Gdn_PasswordHash();
$Fields['Password'] = $PasswordHash->HashPassword($Fields['Password']);
$Fields['HashMethod'] = 'Vanilla';
}
// Certain configurations can allow blank email addresses.
if (GetValue('Email', $Fields, NULL) === NULL)
$Fields['Email'] = '';
$Roles = GetValue('Roles', $Fields);
unset($Fields['Roles']);
if (array_key_exists('Attributes', $Fields) && !is_string($Fields['Attributes']))
$Fields['Attributes'] = serialize($Fields['Attributes']);
$UserID = $this->SQL->Insert($this->Name, $Fields);
if (is_array($Roles)) {
$this->SaveRoles($UserID, $Roles, FALSE);
}
// Approval registration requires an email confirmation.
if ($UserID && isset($ConfirmationCode) && strtolower(C('Garden.Registration.Method')) == 'approval') {
// Send the confirmation email.
$this->SendEmailConfirmationEmail($UserID);
}
// Fire an event for user inserts
$this->EventArguments['InsertUserID'] = $UserID;
$this->EventArguments['InsertFields'] = $Fields;
$this->FireEvent('AfterInsertUser');
return $UserID;
}
/**
* Add user data to a result set.
*
* @param object $Data Results we need to associate user data with.
* @param array $Columns Database columns containing UserIDs to get data for.
* @param array $Options Optionally pass list of user data to collect with key 'Join'.
*/
public function JoinUsers(&$Data, $Columns, $Options = array()) {
// Grab all of the user fields that need to be joined.
$UserIDs = array();
foreach ($Data as $Row) {
foreach ($Columns as $ColumnName) {
$ID = GetValue($ColumnName, $Row);
if (is_numeric($ID))
$UserIDs[$ID] = 1;
}
}
// Get the users.
$Users = $this->GetIDs(array_keys($UserIDs));
// Get column name prefix (ex: 'Insert' from 'InsertUserID')
$Prefixes = array();
foreach ($Columns as $ColumnName) {
$Prefixes[] = StringEndsWith($ColumnName, 'UserID', TRUE, TRUE);
}
// Join the user data using prefixes (ex: 'Name' for 'InsertUserID' becomes 'InsertName')
$Join = GetValue('Join', $Options, array('Name', 'Email', 'Photo'));
$UserPhotoDefaultUrl = function_exists('UserPhotoDefaultUrl');
foreach ($Data as &$Row) {
foreach ($Prefixes as $Px) {
$ID = GetValue($Px.'UserID', $Row);
if (is_numeric($ID)) {
$User = GetValue($ID, $Users, FALSE);
foreach ($Join as $Column) {
$Value = $User[$Column];
if ($Column == 'Photo') {
if (!$Value) {
if ($UserPhotoDefaultUrl)
$Value = UserPhotoDefaultUrl($User);
} elseif (!IsUrl($Value)) {
$Value = Gdn_Upload::Url(ChangeBasename($Value, 'n%s'));
}
}
SetValue($Px.$Column, $Row, $Value);
}
} else {
foreach ($Join as $Column) {
SetValue($Px.$Column, $Row, NULL);
}
}
}
}
}
/**
* $SafeData makes sure that the query does not return any sensitive
* information about the user (password, attributes, preferences, etc).
*/
public function UserQuery($SafeData = FALSE) {
if ($SafeData) {
$this->SQL->Select('u.UserID, u.Name, u.Photo, u.About, u.Gender, u.CountVisits, u.InviteUserID, u.DateFirstVisit, u.DateLastActive, u.DateInserted, u.DateUpdated, u.Score, u.Admin, u.Deleted, u.CountDiscussions, u.CountComments');
} else {
$this->SQL->Select('u.*');
}
$this->SQL->From('User u');
// $this->SQL->Select('i.Name', '', 'InviteName')
// ->From('User u')
// ->Join('User as i', 'u.InviteUserID = i.UserID', 'left');
}
public function DefinePermissions($UserID, $Serialize = TRUE) {
if (Gdn::Cache()->ActiveEnabled()) {
$PermissionsIncrement = $this->GetPermissionsIncrement();
$UserPermissionsKey = FormatString(self::USERPERMISSIONS_KEY, array(
'UserID' => $UserID,
'PermissionsIncrement' => $PermissionsIncrement
));
$CachePermissions = Gdn::Cache()->Get($UserPermissionsKey);
if ($CachePermissions !== Gdn_Cache::CACHEOP_FAILURE)
return $CachePermissions;
}
$Data = Gdn::PermissionModel()->CachePermissions($UserID);
$Permissions = array();
foreach($Data as $i => $Row) {
$JunctionTable = $Row['JunctionTable'];
$JunctionColumn = $Row['JunctionColumn'];
$JunctionID = $Row['JunctionID'];
unset($Row['JunctionColumn'], $Row['JunctionColumn'], $Row['JunctionID'], $Row['RoleID'], $Row['PermissionID']);
foreach($Row as $PermissionName => $Value) {
if($Value == 0)
continue;
if(is_numeric($JunctionID) && $JunctionID !== NULL) {
if (!array_key_exists($PermissionName, $Permissions))
$Permissions[$PermissionName] = array();
if (!is_array($Permissions[$PermissionName]))
$Permissions[$PermissionName] = array();
$Permissions[$PermissionName][] = $JunctionID;
} else {
$Permissions[] = $PermissionName;
}
}
}
// Throw a fatal error if the user has no permissions
// if (count($Permissions) == 0)
// trigger_error(ErrorMessage('The requested user ('.$this->UserID.') has no permissions.', 'Session', 'Start'), E_USER_ERROR);
$PermissionsSerialized = NULL;
if (Gdn::Cache()->ActiveEnabled()) {
Gdn::Cache()->Store($UserPermissionsKey, $Permissions);
} else {
// Save the permissions to the user table
$PermissionsSerialized = Gdn_Format::Serialize($Permissions);
if ($UserID > 0)
$this->SQL->Put('User', array('Permissions' => $PermissionsSerialized), array('UserID' => $UserID));
}
if ($Serialize && is_null($PermissionsSerialized))
$PermissionsSerialized = Gdn_Format::Serialize($Permissions);
return $Serialize ? $PermissionsSerialized : $Permissions;
}
/**
* Default Gdn_Model::Get() behavior.
*
* Prior to 2.0.18 it incorrectly behaved like GetID.
* This method can be deleted entirely once it's been deprecated long enough.
*
* @since 2.0.0
* @return object DataSet
*/
public function Get($OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $Offset = FALSE) {
if (is_numeric($OrderFields)) {
// They're using the old version that was a misnamed GetID()
Deprecated('UserModel->Get()', 'UserModel->GetID()');
$Result = $this->GetID($OrderFields);
}
else {
$Result = parent::Get($OrderFields, $OrderDirection, $Limit, $Offset);
}
return $Result;
}
public function GetByUsername($Username) {
if ($Username == '')
return FALSE;
// Check page cache, then memcached
$User = $this->GetUserFromCache($Username, 'name');
if ($User === Gdn_Cache::CACHEOP_FAILURE) {
$this->UserQuery();
$User = $this->SQL->Where('u.Name', $Username)->Get()->FirstRow(DATASET_TYPE_ARRAY);
if ($User) {
// If success, build more data, then cache user
$this->SetCalculatedFields($User);
$this->UserCache($User);
}
}
// By default, FirstRow() gives stdClass
if ($User !== FALSE)
$User = (object)$User;
return $User;
}
public function GetByEmail($Email) {
$this->UserQuery();
$User = $this->SQL->Where('u.Email', $Email)->Get()->FirstRow();
$this->SetCalculatedFields($User);
return $User;
}
public function GetByRole($Role) {
$RoleID = $Role; // Optimistic
if (is_string($Role)) {
$RoleModel = new RoleModel();
$Roles = $RoleModel->GetArray();
$RolesByName = array_flip($Roles);
$RoleID = GetValue($Role, $RolesByName, NULL);
// No such role
if (is_null($RoleID)) return new Gdn_DataSet();
}
return $this->SQL->Select('u.*')
->From('User u')
->Join('UserRole ur', 'u.UserID = ur.UserID')
->Where('ur.RoleID', $RoleID, TRUE, FALSE)
// ->GroupBy('UserID')
->OrderBy('DateInserted', 'desc')
->Get();
}
public function GetActiveUsers($Limit = 5) {
$UserIDs = $this->SQL
->Select('UserID')
->From('User')
->OrderBy('DateLastActive', 'desc')
->Limit($Limit, 0)
->Get();
$UserIDs = ConsolidateArrayValuesByKey($UserIDs, 'UserID');
$Data = $this->SQL->GetWhere('User', array('UserID' => $UserIDs), 'DateLastActive', 'desc');
return $Data;
}
public function GetApplicantCount() {
$ApplicantRoleID = (int)C('Garden.Registration.ApplicantRoleID', 0);
if ($ApplicantRoleID == 0)
return 0;
$Result = $this->SQL->Select('u.UserID', 'count', 'ApplicantCount')
->From('User u')
->Join('UserRole ur', 'u.UserID = ur.UserID')
->Where('ur.RoleID', $ApplicantRoleID, TRUE, FALSE)
->Get()->Value('ApplicantCount', 0);
return $Result;
}
/**
* Returns all users in the applicant role
*/
public function GetApplicants() {
$ApplicantRoleID = (int)C('Garden.Registration.ApplicantRoleID', 0);
if ($ApplicantRoleID == 0)
return new Gdn_DataSet();
return $this->SQL->Select('u.*')
->From('User u')
->Join('UserRole ur', 'u.UserID = ur.UserID')
->Where('ur.RoleID', $ApplicantRoleID, TRUE, FALSE)
// ->GroupBy('UserID')
->OrderBy('DateInserted', 'desc')
->Get();
}
/**
* Get the a user authentication row.
*
* @param string $UniqueID The unique ID of the user in the foreign authentication scheme.
* @param string $Provider The key of the provider.
* @return array|false
*/
public function GetAuthentication($UniqueID, $Provider) {
return $this->SQL->GetWhere('UserAuthentication',
array('ForeignUserKey' => $UniqueID, 'ProviderKey' => $Provider))->FirstRow(DATASET_TYPE_ARRAY);
}
public function GetCountLike($Like = FALSE) {
$ApplicantRoleID = (int)C('Garden.Registration.ApplicantRoleID', 0);
$this->SQL
->Select('u.UserID', 'count', 'UserCount')
->From('User u')
->Join('UserRole ur', "u.UserID = ur.UserID and ur.RoleID = $ApplicantRoleID", 'left');
if (is_array($Like)){
$this->SQL
->BeginWhereGroup()
->OrLike($Like, '', 'right')
->EndWhereGroup();
}
$this->SQL
->Where('u.Deleted', 0)
->Where('ur.RoleID is null');
$Data = $this->SQL->Get()->FirstRow();
return $Data === FALSE ? 0 : $Data->UserCount;
}
public function GetCountWhere($Where = FALSE) {
$this->SQL
->Select('u.UserID', 'count', 'UserCount')
->From('User u')
->Join('UserRole ur', 'u.UserID = ur.UserID and ur.RoleID = '.(int)C('Garden.Registration.ApplicantRoleID', 0), 'left');
if (is_array($Where))
$this->SQL->Where($Where);
$Data = $this->SQL
->Where('u.Deleted', 0)
->Where('ur.RoleID is null')
->Get()
->FirstRow();
return $Data === FALSE ? 0 : $Data->UserCount;
}
public function GetID($ID, $DatasetType = DATASET_TYPE_OBJECT) {
if (!$ID)
return FALSE;
// Check page cache, then memcached
$User = $this->GetUserFromCache($ID, 'userid');
// If not, query DB
if ($User === Gdn_Cache::CACHEOP_FAILURE) {
$User = parent::GetID($ID, DATASET_TYPE_ARRAY);
if ($User) {
// If success, build more data, then cache user
$this->SetCalculatedFields($User);
$this->UserCache($User);
}
}
// Allow FALSE returns
if ($User === FALSE || is_null($User))
return FALSE;
if (is_array($User) && $DatasetType == DATASET_TYPE_OBJECT)
$User = (object)$User;
if (is_object($User) && $DatasetType == DATASET_TYPE_ARRAY)
$User = (array)$User;
$this->EventArguments['LoadedUser'] = &$User;
$this->FireEvent('AfterGetID');
return $User;
}
public function GetIDs($IDs, $SkipCacheQuery = FALSE) {
$DatabaseIDs = $IDs;
$Data = array();
if (!$SkipCacheQuery) {
$Keys = array();
// Make keys for cache query
foreach ($IDs as $UserID) {
if (!$UserID) continue;
$Keys[] = FormatString(self::USERID_KEY, array('UserID' => $UserID));
}
// Query cache layer
$CacheData = Gdn::Cache()->Get($Keys);
if (!is_array($CacheData))
$CacheData = array();
foreach ($CacheData as $RealKey => $User) {
$ResultUserID = GetValue('UserID', $User);
$Data[$ResultUserID] = $User;
}
//echo "from cache:\n";
//print_r($Data);
$DatabaseIDs = array_diff($DatabaseIDs, array_keys($Data));
unset($CacheData);
}
// Clean out bogus blank entries
$DatabaseIDs = array_diff($DatabaseIDs, array(NULL, ''));
// If we are missing any users from cache query, fill em up here
if (sizeof($DatabaseIDs)) {
$DatabaseData = $this->SQL->WhereIn('UserID', $DatabaseIDs)->GetWhere('User')->Result(DATASET_TYPE_ARRAY);
$DatabaseData = Gdn_DataSet::Index($DatabaseData, 'UserID');
//echo "from DB:\n";
//print_r($DatabaseData);
foreach ($DatabaseData as $DatabaseUserID => $DatabaseUser) {
$Data[$DatabaseUserID] = $DatabaseUser;
$this->SetCalculatedFields($DatabaseUser);
$Result = $this->UserCache($DatabaseUser);
}
}
$this->EventArguments['RequestedIDs'] = $IDs;
$this->EventArguments['LoadedUsers'] = &$Data;
$this->FireEvent('AfterGetIDs');
return $Data;
}
public function GetLike($Like = FALSE, $OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $Offset = FALSE) {
$ApplicantRoleID = (int)C('Garden.Registration.ApplicantRoleID', 0);
$this->UserQuery();
$this->SQL
->Join('UserRole ur', "u.UserID = ur.UserID and ur.RoleID = $ApplicantRoleID", 'left');
if (is_array($Like)) {
$this->SQL
->BeginWhereGroup()
->OrLike($Like, '', 'right')
->EndWhereGroup();
}
return $this->SQL
->Where('u.Deleted', 0)
->Where('ur.RoleID is null')
->OrderBy($OrderFields, $OrderDirection)
->Limit($Limit, $Offset)
->Get();
}
/**
* Retries UserMeta information for a UserID / Key pair
*
* This method takes a $UserID or array of $UserIDs, and a $Key. It converts the
* $Key to fully qualified format and then queries for the associated value(s). $Key
* can contain SQL wildcards, in which case multiple results can be returned.
*
* If $UserID is an array, the return value will be a multi dimensional array with the first
* axis containing UserIDs and the second containing fully qualified UserMetaKeys, associated with
* their values.
*
* If $UserID is a scalar, the return value will be a single dimensional array of $UserMetaKey => $Value
* pairs.
*
* @param $UserID integer UserID or array of UserIDs.
* @param $Key string relative user meta key.
* @return array results or $Default
*/
public static function GetMeta($UserID, $Key, $Prefix = '', $Default = '') {
$Sql = Gdn::SQL()
->Select('*')
->From('UserMeta u');
if (is_array($UserID))
$Sql->WhereIn('u.UserID', $UserID);
else
$Sql->Where('u.UserID', $UserID);
if (strpos($Key, '%') !== FALSE)
$Sql->Like('u.Name', $Key, 'none');
else
$Sql->Where('u.Name', $Key);
$Data = $Sql->Get()->ResultArray();
if (is_array($UserID))
$Result = array_fill_keys($UserID, array());
else {
if (strpos($Key, '%') === FALSE)
$Result = array(StringBeginsWith($Key, $Prefix, FALSE, TRUE) => $Default);
else
$Result = array();
}
foreach ($Data as $Row) {
$Name = StringBeginsWith($Row['Name'], $Prefix, FALSE, TRUE);
if (is_array($UserID)) {
$Result[$Row['UserID']][$Name] = $Row['Value'];
} else {
$Result[$Name] = $Row['Value'];
}
}
return $Result;
}
public function GetRoles($UserID) {
$UserRolesKey = FormatString(self::USERROLES_KEY, array('UserID' => $UserID));
$RolesDataArray = Gdn::Cache()->Get($UserRolesKey);
if ($RolesDataArray === Gdn_Cache::CACHEOP_FAILURE) {
$RolesDataArray = $this->SQL->GetWhere('UserRole', array('UserID' => $UserID))->ResultArray();
$RolesDataArray = ConsolidateArrayValuesByKey($RolesDataArray, 'RoleID');
}
$Result = array();
foreach ($RolesDataArray as $RoleID) {
$Result[] = RoleModel::Roles($RoleID, TRUE);
}
return new Gdn_DataSet($Result);
}
public function GetSession($UserID, $Refresh = FALSE) {
// Ask for the user. This will check cache first.
$User = $this->GetID($UserID, DATASET_TYPE_OBJECT);
// TIM: Removed on Jul 14, 2011 for PennyArcade
//
//$this->FireEvent('SessionQuery');
//if (is_array($this->SessionColumns)) {
// $this->SQL->Select($this->SessionColumns);
//}
//$User = $this->SQL
// ->Get()
// ->FirstRow();
if ($User && ($User->Permissions == '' || Gdn::Cache()->ActiveEnabled()))
$User->Permissions = $this->DefinePermissions($UserID);
// Remove secret info from session
unset($User->Password, $User->HashMethod);
return $User;
}
/**
* Retrieve a summary of "safe" user information for external API calls.
*/
public function GetSummary($OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $Offset = FALSE) {
$this->UserQuery(TRUE);
return $this->SQL
->Where('u.Deleted', 0)
->OrderBy($OrderFields, $OrderDirection)
->Limit($Limit, $Offset)
->Get();
}
/**
* Retrieves a "system user" id that can be used to perform non-real-person tasks.
*/
public function GetSystemUserID() {
$SystemUserID = C('Garden.SystemUserID');
if ($SystemUserID)
return $SystemUserID;
$SystemUser = array(
'Name' => T('System'),
'Photo' => Asset('/applications/dashboard/design/images/usericon.png', TRUE),
'Password' => RandomString('20'),
'HashMethod' => 'Random',
'Email' => 'system@domain.com',
'DateInserted' => Gdn_Format::ToDateTime(),
'Admin' => '2'
);
$this->EventArguments['SystemUser'] = &$SystemUser;
$this->FireEvent('BeforeSystemUser');
$SystemUserID = $this->SQL->Insert($this->Name, $SystemUser);
SaveToConfig('Garden.SystemUserID', $SystemUserID);
return $SystemUserID;
}
/**
* Add points to a user's total.
*
* @since 2.1.0
* @access public
*/
public static function GivePoints($UserID, $Points, $Source = 'Other', $Timestamp = FALSE) {
if (!$Timestamp)
$Timestamp = time();
// Increment source points for the user.
self::_GivePoints($UserID, $Points, 'a', $Source);
// Increment total points for the user.
self::_GivePoints($UserID, $Points, 'w', 'Total', $Timestamp);
self::_GivePoints($UserID, $Points, 'm', 'Total', $Timestamp);
self::_GivePoints($UserID, $Points, 'a', 'Total', $Timestamp);
// Increment global daily points.
self::_GivePoints(0, $Points, 'd', 'Total', $Timestamp);
// Grab the user's total points.
$Points = Gdn::SQL()->GetWhere('UserPoints', array('UserID' => $UserID, 'SlotType' => 'a', 'Source' => 'Total'))->Value('Points');
// Gdn::Controller()->InformMessage('Points: '.$Points);
Gdn::UserModel()->SetField($UserID, 'Points', $Points);
// Fire a give points event.
Gdn::UserModel()->EventArguments['UserID'] = $UserID;
Gdn::UserModel()->EventArguments['Points'] = $Points;
Gdn::UserModel()->FireEvent('GivePoints');
}
/**
* Add points to a user's total in a specific timeslot.
*
* @since 2.1.0
* @access protected
* @see self::GivePoints
*/
protected static function _GivePoints($UserID, $Points, $SlotType, $Source = 'Total', $Timestamp = FALSE) {
$TimeSlot = gmdate('Y-m-d', Gdn_Statistics::TimeSlotStamp($SlotType, $Timestamp));
$Px = Gdn::Database()->DatabasePrefix;
$Sql = "insert {$Px}UserPoints (UserID, SlotType, TimeSlot, Source, Points)
values (:UserID, :SlotType, :TimeSlot, :Source, :Points)
on duplicate key update Points = Points + :Points1";
Gdn::Database()->Query($Sql, array(
':UserID' => $UserID,
':Points' => $Points,
':SlotType' => $SlotType,
':Source' => $Source,
':TimeSlot' => $TimeSlot,
':Points1' => $Points));
}
public function Register($FormPostValues, $Options = array()) {
$Valid = TRUE;
$FormPostValues['LastIPAddress'] = Gdn::Request()->IpAddress();
// Throw an error if the registering user has an active session
if (Gdn::Session()->IsValid())
$this->Validation->AddValidationResult('Name', 'You are already registered.');
// Check for banning first.
$Valid = BanModel::CheckUser($FormPostValues, NULL, TRUE);
if (!$Valid) {
$this->Validation->AddValidationResult('UserID', 'Sorry, permission denied.');
}
// Throw an event to allow plugins to block the registration.
unset($this->EventArguments['User']);
$this->EventArguments['User'] = $FormPostValues;
$this->EventArguments['Valid'] =& $Valid;
$this->FireEvent('BeforeRegister');
if (!$Valid)
return FALSE; // plugin blocked registration
switch (strtolower(C('Garden.Registration.Method'))) {
case 'captcha':
$UserID = $this->InsertForBasic($FormPostValues, GetValue('CheckCaptcha', $Options, TRUE), $Options);
break;
case 'approval':
$UserID = $this->InsertForApproval($FormPostValues, $Options);
break;
case 'invitation':
$UserID = $this->InsertForInvite($FormPostValues, $Options);
break;
case 'closed':
$UserID = FALSE;
$this->Validation->AddValidationResult('Registration', 'Registration is closed.');
break;
case 'basic':
default:
$UserID = $this->InsertForBasic($FormPostValues, GetValue('CheckCaptcha', $Options, FALSE), $Options);
break;
}
if ($UserID) {
$this->EventArguments['UserID'] = $UserID;
$this->FireEvent('AfterRegister');
}
return $UserID;
}
public function RemovePicture($UserID) {
// Grab the current photo.
$User = $this->GetID($UserID, DATASET_TYPE_ARRAY);
if ($Photo = $User['Photo']) {
$ProfilePhoto = ChangeBasename($Photo, 'p%s');
$Upload = new Gdn_Upload();
$Upload->Delete($ProfilePhoto);
$this->SetField($UserID, 'Photo', NULL);
}
}
public function ProfileCount($User, $Column) {
if (is_numeric($User))
$User = $this->SQL->GetWhere('User', array('UserID' => $User))->FirstRow(DATASET_TYPE_ARRAY);
elseif (is_string($User))
$User = $this->SQL->GetWhere('User', array('Name' => $User))->FirstRow(DATASET_TYPE_ARRAY);
elseif (is_object($User))
$User = (array)$User;
if (!$User)
return FALSE;
if (array_key_exists($Column, $User) && $User[$Column] === NULL) {
$UserID = $User['UserID'];
switch ($Column) {
case 'CountComments':
$Count = $this->SQL->GetCount('Comment', array('InsertUserID' => $UserID));
$this->SetField($UserID, 'CountComments', $Count);
break;
case 'CountDiscussions':
$Count = $this->SQL->GetCount('Discussion', array('InsertUserID' => $UserID));
$this->SetField($UserID, 'CountDiscussions', $Count);
break;
case 'CountBookmarks':
$Count = $this->SQL->GetCount('UserDiscussion', array('UserID' => $UserID, 'Bookmarked' => '1'));
$this->SetField($UserID, 'CountBookmarks', $Count);
break;
default:
$Count = FALSE;
break;
}
return $Count;
} elseif ($User[$Column]) {
return $User[$Column];
} else {
return FALSE;
}
}
/**
* Generic save procedure.
*/
public function Save($FormPostValues, $Settings = FALSE) {
// See if the user's related roles should be saved or not.
$SaveRoles = GetValue('SaveRoles', $Settings);
// Define the primary key in this model's table.
$this->DefineSchema();
// Custom Rule: This will make sure that at least one role was selected if saving roles for this user.
if ($SaveRoles) {
$this->Validation->AddRule('OneOrMoreArrayItemRequired', 'function:ValidateOneOrMoreArrayItemRequired');
// $this->Validation->AddValidationField('RoleID', $FormPostValues);
$this->Validation->ApplyRule('RoleID', 'OneOrMoreArrayItemRequired');
}
// Make sure that the checkbox val for email is saved as the appropriate enum
if (array_key_exists('ShowEmail', $FormPostValues))
$FormPostValues['ShowEmail'] = ForceBool($FormPostValues['ShowEmail'], '0', '1', '0');
if (array_key_exists('Banned', $FormPostValues))
$FormPostValues['Banned'] = ForceBool($FormPostValues['Banned'], '0', '1', '0');
if (array_key_exists('Confirmed', $FormPostValues))
$FormPostValues['Confirmed'] = ForceBool($FormPostValues['Confirmed'], '0', '1', '0');
unset($FormPostValues['Admin']);
// Validate the form posted values
$UserID = GetValue('UserID', $FormPostValues);
$Insert = $UserID > 0 ? FALSE : TRUE;
if ($Insert) {
$this->AddInsertFields($FormPostValues);
} else {
$this->AddUpdateFields($FormPostValues);
}
$this->EventArguments['FormPostValues'] = $FormPostValues;
$this->FireEvent('BeforeSaveValidation');
$RecordRoleChange = TRUE;
if ($UserID && GetValue('FixUnique', $Settings)) {
$UniqueValid = $this->ValidateUniqueFields(GetValue('Name', $FormPostValues), GetValue('Email', $FormPostValues), $UserID, TRUE);
if (!$UniqueValid['Name'])
unset($FormPostValues['Name']);
if (!$UniqueValid['Email'])
unset($FormPostValues['Email']);
$UniqueValid = TRUE;
} else {
$UniqueValid = $this->ValidateUniqueFields(GetValue('Name', $FormPostValues), GetValue('Email', $FormPostValues), $UserID);
}
// Add & apply any extra validation rules:
if (array_key_exists('Email', $FormPostValues) && GetValue('ValidateEmail', $Settings, TRUE))
$this->Validation->ApplyRule('Email', 'Email');
if ($this->Validate($FormPostValues, $Insert) && $UniqueValid) {
$Fields = $this->Validation->ValidationFields(); // All fields on the form that need to be validated (including non-schema field rules defined above)
$RoleIDs = GetValue('RoleID', $Fields, 0);
$Username = GetValue('Name', $Fields);
$Email = GetValue('Email', $Fields);
$Fields = $this->Validation->SchemaValidationFields(); // Only fields that are present in the schema
// Remove the primary key from the fields collection before saving
$Fields = RemoveKeyFromArray($Fields, $this->PrimaryKey);
if (in_array('AllIPAddresses', $Fields) && is_array($Fields)) {
$Fields['AllIPAddresses'] = implode(',', $Fields['AllIPAddresses']);
}
if (!$Insert && array_key_exists('Password', $Fields)) {
// Encrypt the password for saving only if it won't be hashed in _Insert()
$PasswordHash = new Gdn_PasswordHash();
$Fields['Password'] = $PasswordHash->HashPassword($Fields['Password']);
$Fields['HashMethod'] = 'Vanilla';
}
// Check for email confirmation.
if (self::RequireConfirmEmail() && !GetValue('NoConfirmEmail', $Settings)) {
if (isset($Fields['Email']) && $UserID == Gdn::Session()->UserID && $Fields['Email'] != Gdn::Session()->User->Email && !Gdn::Session()->CheckPermission('Garden.Users.Edit')) {
$User = Gdn::Session()->User;
$Attributes = Gdn::Session()->User->Attributes;
$ConfirmEmailRoleID = C('Garden.Registration.ConfirmEmailRole');
if (RoleModel::Roles($ConfirmEmailRoleID)) {
// The confirm email role is set and it exists so go ahead with the email confirmation.
$EmailKey = TouchValue('EmailKey', $Attributes, RandomString(8));
if (isset($Attributes['ConfirmedEmailRoles']) && !in_array($ConfirmEmailRoleID, $Attributes['ConfirmedEmailRoles']))
$ConfirmedEmailRoles = $Attributes['ConfirmedEmailRoles'];
elseif ($RoleIDs)
$ConfirmedEmailRoles = $RoleIDs;
else
$ConfirmedEmailRoles = ConsolidateArrayValuesByKey($this->GetRoles($UserID), 'RoleID');
$Attributes['ConfirmedEmailRoles'] = $ConfirmedEmailRoles;
$RoleIDs = (array)C('Garden.Registration.ConfirmEmailRole');
$SaveRoles = TRUE;
$Fields['Attributes'] = serialize($Attributes);
}
}
}
$this->EventArguments['Fields'] = $Fields;
$this->FireEvent('BeforeSave');
// Check the validation results again in case something was added during the BeforeSave event.
if (count($this->Validation->Results()) == 0) {
// If the primary key exists in the validated fields and it is a
// numeric value greater than zero, update the related database row.
if ($UserID > 0) {
// If they are changing the username & email, make sure they aren't
// already being used (by someone other than this user)
if (ArrayValue('Name', $Fields, '') != '' || ArrayValue('Email', $Fields, '') != '') {
if (!$this->ValidateUniqueFields($Username, $Email, $UserID))
return FALSE;
}
if (array_key_exists('Attributes', $Fields) && !is_string($Fields['Attributes'])) {
$Fields['Attributes'] = serialize($Fields['Attributes']);
}
$this->SQL->Put($this->Name, $Fields, array($this->PrimaryKey => $UserID));
// Record activity if the person changed his/her photo.
$Photo = ArrayValue('Photo', $FormPostValues);
if ($Photo !== FALSE) {
if (GetValue('CheckExisting', $Settings)) {
$User = $this->GetID($UserID);
$OldPhoto = GetValue('Photo', $User);
}
if (isset($OldPhoto) && $OldPhoto != $Photo) {
if (strpos($Photo, '//'))
$PhotoUrl = $Photo;
else
$PhotoUrl = Gdn_Upload::Url(ChangeBasename($Photo, 'n%s'));
$ActivityModel = new ActivityModel();
if ($UserID == Gdn::Session()->UserID) {
$HeadlineFormat = T('HeadlineFormat.PictureChange', '{RegardingUserID,You} changed {ActivityUserID,your} profile picture.');
} else {
$HeadlineFormat = T('HeadlineFormat.PictureChange.ForUser', '{RegardingUserID,You} changed the profile picture for {ActivityUserID,user}.');
}
$ActivityModel->Save(array(
'ActivityUserID' => $UserID,
'RegardingUserID' => Gdn::Session()->UserID,
'ActivityType' => 'PictureChange',
'HeadlineFormat' => $HeadlineFormat,
'Story' => Img($PhotoUrl, array('alt' => T('Thumbnail')))
));
}
}
} else {
$RecordRoleChange = FALSE;
if (!$this->ValidateUniqueFields($Username, $Email))
return FALSE;
// Define the other required fields:
$Fields['Email'] = $Email;
$Fields['Roles'] = $RoleIDs;
// Make sure that the user is assigned to one or more roles:
$SaveRoles = FALSE;
// And insert the new user.
$UserID = $this->_Insert($Fields, $Settings);
if ($UserID) {
// Report that the user was created.
$ActivityModel = new ActivityModel();
$ActivityModel->Save(array(
'ActivityType' => 'Registration',
'ActivityUserID' => $UserID,
'HeadlineFormat' => T('HeadlineFormat.Registration', '{ActivityUserID,You} joined.'),
'Story' => T('Welcome Aboard!')),
FALSE,
array('GroupBy' => 'ActivityTypeID'));
// Report the creation for mods.
$ActivityModel->Save(array(
'ActivityType' => 'Registration',
'ActivityUserID' => Gdn::Session()->UserID,
'RegardingUserID' => $UserID,
'NotifyUserID' => ActivityModel::NOTIFY_MODS,
'HeadlineFormat' => T('HeadlineFormat.AddUser', '{ActivityUserID,user} added an account for {RegardingUserID,user}.')));
}
}
// Now update the role settings if necessary.
if ($SaveRoles) {
// If no RoleIDs were provided, use the system defaults
if (!is_array($RoleIDs))
$RoleIDs = Gdn::Config('Garden.Registration.DefaultRoles');
$this->SaveRoles($UserID, $RoleIDs, $RecordRoleChange);
}
// Send the confirmation email.
if (isset($EmailKey)) {
$this->SendEmailConfirmationEmail((array)Gdn::Session()->User);
}
$this->EventArguments['UserID'] = $UserID;
$this->FireEvent('AfterSave');
} else {
$UserID = FALSE;
}
} else {
// decho($this->Validation->ResultsText());
$UserID = FALSE;
}
// Clear cached user data
if (!$Insert && $UserID) {
$this->ClearCache($UserID, array('user'));
}
return $UserID;
}
/**
* Create an admin user account
*/
public function SaveAdminUser($FormPostValues) {
$UserID = 0;
// Add & apply any extra validation rules:
$Name = GetValue('Name', $FormPostValues, '');
$FormPostValues['Email'] = GetValue('Email', $FormPostValues, strtolower($Name.'@'.Gdn_Url::Host()));
$FormPostValues['ShowEmail'] = '0';
$FormPostValues['TermsOfService'] = '1';
$FormPostValues['DateOfBirth'] = '1975-09-16';
$FormPostValues['DateLastActive'] = Gdn_Format::ToDateTime();
$FormPostValues['DateUpdated'] = Gdn_Format::ToDateTime();
$FormPostValues['Gender'] = 'u';
$FormPostValues['Admin'] = '1';
$this->AddInsertFields($FormPostValues);
if ($this->Validate($FormPostValues, TRUE) === TRUE) {
$Fields = $this->Validation->ValidationFields(); // All fields on the form that need to be validated (including non-schema field rules defined above)
$Username = GetValue('Name', $Fields);
$Email = GetValue('Email', $Fields);
$Fields = $this->Validation->SchemaValidationFields(); // Only fields that are present in the schema
// Insert the new user
$UserID = $this->_Insert($Fields, array('NoConfirmEmail' => TRUE, 'Setup' => TRUE));
if ($UserID) {
$ActivityModel = new ActivityModel();
$ActivityModel->Save(array(
'ActivityUserID' => $UserID,
'ActivityType' => 'Registration',
'HeadlineFormat' => T('HeadlineFormat.Registration', '{ActivityUserID,You} joined.'),
'Story' => T('Welcome Aboard!')
),
FALSE,
array('GroupBy' => 'ActivityTypeID'));
}
$this->SaveRoles($UserID, array(16), FALSE);
}
return $UserID;
}
public function SaveRoles($UserID, $RoleIDs, $RecordActivity = TRUE) {
if (is_string($RoleIDs) && !is_numeric($RoleIDs)) {
// The $RoleIDs are a comma delimited list of role names.
$RoleNames = array_map('trim', explode(',', $RoleIDs));
$RoleIDs = $this->SQL
->Select('r.RoleID')
->From('Role r')
->WhereIn('r.Name', $RoleNames)
->Get()->ResultArray();
$RoleIDs = ConsolidateArrayValuesByKey($RoleIDs, 'RoleID');
}
if (!is_array($RoleIDs))
$RoleIDs = array($RoleIDs);
// Get the current roles.
$OldRoleIDs = array();
$OldRoleData = $this->SQL
->Select('ur.RoleID, r.Name')
->From('Role r')
->Join('UserRole ur', 'r.RoleID = ur.RoleID')
->Where('ur.UserID', $UserID)
->Get()
->ResultArray();
if ($OldRoleData !== FALSE) {
$OldRoleIDs = ConsolidateArrayValuesByKey($OldRoleData, 'RoleID');
}
// 1a) Figure out which roles to delete.
$DeleteRoleIDs = array_diff($OldRoleIDs, $RoleIDs);
// 1b) Remove old role associations for this user.
if(count($DeleteRoleIDs) > 0)
$this->SQL->WhereIn('RoleID', $DeleteRoleIDs)->Delete('UserRole', array('UserID' => $UserID));
// 2a) Figure out which roles to insert.
$InsertRoleIDs = array_diff($RoleIDs, $OldRoleIDs);
// 2b) Insert the new role associations for this user.
foreach($InsertRoleIDs as $InsertRoleID) {
if (is_numeric($InsertRoleID))
$this->SQL->Insert('UserRole', array('UserID' => $UserID, 'RoleID' => $InsertRoleID));
}
$this->ClearCache($UserID, array('roles', 'permissions'));
if ($RecordActivity && (count($DeleteRoleIDs) > 0 || count($InsertRoleIDs) > 0)) {
$User = $this->GetID($UserID);
$Session = Gdn::Session();
$OldRoles = FALSE;
if ($OldRoleData !== FALSE)
$OldRoles = ConsolidateArrayValuesByKey($OldRoleData, 'Name');
$NewRoles = FALSE;
$NewRoleData = $this->SQL
->Select('r.RoleID, r.Name')
->From('Role r')
->Join('UserRole ur', 'r.RoleID = ur.RoleID')
->Where('ur.UserID', $UserID)
->Get()
->ResultArray();
if ($NewRoleData !== FALSE)
$NewRoles = ConsolidateArrayValuesByKey($NewRoleData, 'Name');
$RemovedRoles = array_diff($OldRoles, $NewRoles);
$NewRoles = array_diff($NewRoles, $OldRoles);
$RemovedCount = count($RemovedRoles);
$NewCount = count($NewRoles);
$Story = '';
if ($RemovedCount > 0 && $NewCount > 0) {
$Story = sprintf(T('%1$s was removed from the %2$s %3$s and added to the %4$s %5$s.'),
$User->Name,
implode(', ', $RemovedRoles),
Plural($RemovedCount, 'role', 'roles'),
implode(', ', $NewRoles),
Plural($NewCount, 'role', 'roles')
);
} else if ($RemovedCount > 0) {
$Story = sprintf(T('%1$s was removed from the %2$s %3$s.'),
$User->Name,
implode(', ', $RemovedRoles),
Plural($RemovedCount, 'role', 'roles')
);
} else if ($NewCount > 0) {
$Story = sprintf(T('%1$s was added to the %2$s %3$s.'),
$User->Name,
implode(', ', $NewRoles),
Plural($NewCount, 'role', 'roles')
);
}
}
}
public function Search($Keywords, $OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $Offset = FALSE) {
if (C('Garden.Registration.Method') == 'Approval')
$ApplicantRoleID = (int)C('Garden.Registration.ApplicantRoleID', 0);
else
$ApplicantRoleID = 0;
if (is_array($Keywords)) {
$Where = $Keywords;
$Keywords = $Where['Keywords'];
unset($Where['Keywords']);
}
// Check for an IP address.
if (preg_match('`\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}`', $Keywords)) {
$IPAddress = $Keywords;
} elseif (strtolower($Keywords) == 'banned') {
$this->SQL->Where('u.Banned >', 0);
} elseif (preg_match('/^\d+$/', $Keywords)) {
$UserID = $Keywords;
} else {
// Check to see if the search exactly matches a role name.
$RoleID = $this->SQL->GetWhere('Role', array('Name' => $Keywords))->Value('RoleID');
}
$this->UserQuery();
if ($ApplicantRoleID != 0) {
$this->SQL
->Join('UserRole ur', "u.UserID = ur.UserID and ur.RoleID = $ApplicantRoleID", 'left');
}
if (isset($Where))
$this->SQL->Where($Where);
if (isset($RoleID) && $RoleID) {
$this->SQL->Join('UserRole ur2', "u.UserID = ur2.UserID and ur2.RoleID = $RoleID");
} elseif (isset($IPAddress)) {
$this->SQL
->BeginWhereGroup()
->OrWhere('u.InsertIPAddress', $IPAddress)
->OrWhere('u.LastIPAddress', $IPAddress)
->EndWhereGroup();
} elseif (isset($UserID)) {
$this->SQL->Where('u.UserID', $UserID);
} else {
// Search on the user table.
$Like = trim($Keywords) == '' ? FALSE : array('u.Name' => $Keywords, 'u.Email' => $Keywords);
if (is_array($Like)) {
$this->SQL
->BeginWhereGroup()
->OrLike($Like, '', 'right')
->EndWhereGroup();
}
}
if ($ApplicantRoleID != 0)
$this->SQL->Where('ur.RoleID is null');
$Data = $this->SQL
->Where('u.Deleted', 0)
->OrderBy($OrderFields, $OrderDirection)
->Limit($Limit, $Offset)
->Get();
$Result =& $Data->Result();
foreach ($Result as &$Row) {
if ($Row->Photo && strpos($Row->Photo, '//') === FALSE) {
$Row->Photo = Gdn_Upload::Url($Row->Photo);
}
$Row->Attributes = @unserialize($Row->Preferences);
$Row->Preferences = @unserialize($Row->Preferences);
}
return $Data;
}
public function SearchCount($Keywords = FALSE) {
if (C('Garden.Registration.Method') == 'Approval')
$ApplicantRoleID = (int)C('Garden.Registration.ApplicantRoleID', 0);
else
$ApplicantRoleID = 0;
if (is_array($Keywords)) {
$Where = $Keywords;
$Keywords = $Where['Keywords'];
unset($Where['Keywords']);
}
// Check to see if the search exactly matches a role name.
$RoleID = FALSE;
if (strtolower($Keywords) == 'banned') {
$this->SQL->Where('u.Banned >', 0);
} elseif (isset($UserID)) {
$this->SQL->Where('u.UserID', $UserID);
} else {
$RoleID = $this->SQL->GetWhere('Role', array('Name' => $Keywords))->Value('RoleID');
}
if (isset($Where))
$this->SQL->Where($Where);
$this->SQL
->Select('u.UserID', 'count', 'UserCount')
->From('User u');
if ($ApplicantRoleID != 0)
$this->SQL->Join('UserRole ur', "u.UserID = ur.UserID and ur.RoleID = $ApplicantRoleID", 'left');
if ($RoleID) {
$this->SQL->Join('UserRole ur2', "u.UserID = ur2.UserID and ur2.RoleID = $RoleID");
} elseif (isset($UserID)) {
$this->SQL->Where('u.UserID', $UserID);
} else {
// Search on the user table.
$Like = trim($Keywords) == '' ? FALSE : array('u.Name' => $Keywords, 'u.Email' => $Keywords);
if (is_array($Like)) {
$this->SQL
->BeginWhereGroup()
->OrLike($Like, '', 'right')
->EndWhereGroup();
}
}
$this->SQL
->Where('u.Deleted', 0);
if ($ApplicantRoleID != 0)
$this->SQL->Where('ur.RoleID is null');
$Data = $this->SQL->Get()->FirstRow();
return $Data === FALSE ? 0 : $Data->UserCount;
}
public static function SigninLabelCode() {
return UserModel::NoEmail() ? 'Username' : 'Email/Username';
}
/**
* To be used for invitation registration
*/
public function InsertForInvite($FormPostValues, $Options = array()) {
$RoleIDs = Gdn::Config('Garden.Registration.DefaultRoles');
if (!is_array($RoleIDs) || count($RoleIDs) == 0)
throw new Exception(T('The default role has not been configured.'), 400);
// Define the primary key in this model's table.
$this->DefineSchema();
// Add & apply any extra validation rules:
$this->Validation->ApplyRule('Email', 'Email');
// Make sure that the checkbox val for email is saved as the appropriate enum
// TODO: DO I REALLY NEED THIS???
if (array_key_exists('ShowEmail', $FormPostValues))
$FormPostValues['ShowEmail'] = ForceBool($FormPostValues['ShowEmail'], '0', '1', '0');
if (array_key_exists('Banned', $FormPostValues))
$FormPostValues['Banned'] = ForceBool($FormPostValues['Banned'], '0', '1', '0');
$this->AddInsertFields($FormPostValues);
// Make sure that the user has a valid invitation code, and also grab
// the user's email from the invitation:
$InviteUserID = 0;
$InviteUsername = '';
$InvitationCode = ArrayValue('InvitationCode', $FormPostValues, '');
$this->SQL->Select('i.InvitationID, i.InsertUserID, i.Email')
->Select('s.Name', '', 'SenderName')
->From('Invitation i')
->Join('User s', 'i.InsertUserID = s.UserID', 'left')
->Where('Code', $InvitationCode)
->Where('AcceptedUserID is null'); // Do not let them use the same invitation code twice!
$InviteExpiration = Gdn::Config('Garden.Registration.InviteExpiration');
if ($InviteExpiration != 'FALSE' && $InviteExpiration !== FALSE)
$this->SQL->Where('i.DateInserted >=', Gdn_Format::ToDateTime(strtotime($InviteExpiration)));
$Invitation = $this->SQL->Get()->FirstRow();
if ($Invitation !== FALSE) {
$InviteUserID = $Invitation->InsertUserID;
$InviteUsername = $Invitation->SenderName;
$FormPostValues['Email'] = $Invitation->Email;
}
if ($InviteUserID <= 0) {
$this->Validation->AddValidationResult('InvitationCode', 'ErrorBadInvitationCode');
return FALSE;
}
if ($this->Validate($FormPostValues, TRUE) === TRUE) {
// Check for spam.
$Spam = SpamModel::IsSpam('Registration', $FormPostValues);
if ($Spam) {
$this->Validation->AddValidationResult('Spam', 'You are not allowed to register at this time.');
return;
}
$Fields = $this->Validation->ValidationFields(); // All fields on the form that need to be validated (including non-schema field rules defined above)
$Username = ArrayValue('Name', $Fields);
$Email = ArrayValue('Email', $Fields);
$Fields = $this->Validation->SchemaValidationFields(); // Only fields that are present in the schema
$Fields = RemoveKeyFromArray($Fields, $this->PrimaryKey);
// Make sure the username & email aren't already being used
if (!$this->ValidateUniqueFields($Username, $Email))
return FALSE;
// Define the other required fields:
if ($InviteUserID > 0)
$Fields['InviteUserID'] = $InviteUserID;
// And insert the new user.
if (!isset($Options['NoConfirmEmail']))
$Options['NoConfirmEmail'] = TRUE;
$Fields['Roles'] = $RoleIDs;
$UserID = $this->_Insert($Fields, $Options);
// Associate the new user id with the invitation (so it cannot be used again)
$this->SQL
->Update('Invitation')
->Set('AcceptedUserID', $UserID)
->Where('InvitationID', $Invitation->InvitationID)
->Put();
// Report that the user was created.
$ActivityModel = new ActivityModel();
$ActivityModel->Save(array(
'ActivityUserID' => $UserID,
'ActivityType' => 'Registration',
'HeadlineFormat' => T('HeadlineFormat.Registration', '{ActivityUserID,You} joined.'),
'Story' => T('Welcome Aboard!')
),
FALSE,
array('GroupBy' => 'ActivityTypeID'));
} else {
$UserID = FALSE;
}
return $UserID;
}
/**
* To be used for approval registration
*/
public function InsertForApproval($FormPostValues, $Options = array()) {
$RoleIDs = C('Garden.Registration.ApplicantRoleID');
if (!$RoleIDs) {
throw new Exception(T('The default role has not been configured.'), 400);
}
// Define the primary key in this model's table.
$this->DefineSchema();
// Add & apply any extra validation rules:
$this->Validation->ApplyRule('Email', 'Email');
// Make sure that the checkbox val for email is saved as the appropriate enum
if (array_key_exists('ShowEmail', $FormPostValues))
$FormPostValues['ShowEmail'] = ForceBool($FormPostValues['ShowEmail'], '0', '1', '0');
if (array_key_exists('Banned', $FormPostValues))
$FormPostValues['Banned'] = ForceBool($FormPostValues['Banned'], '0', '1', '0');
$this->AddInsertFields($FormPostValues);
if ($this->Validate($FormPostValues, TRUE)) {
// Check for spam.
$Spam = SpamModel::IsSpam('Registration', $FormPostValues);
if ($Spam) {
$this->Validation->AddValidationResult('Spam', 'You are not allowed to register at this time.');
return;
}
$Fields = $this->Validation->ValidationFields(); // All fields on the form that need to be validated (including non-schema field rules defined above)
$Username = ArrayValue('Name', $Fields);
$Email = ArrayValue('Email', $Fields);
$Fields = $this->Validation->SchemaValidationFields(); // Only fields that are present in the schema
$Fields = RemoveKeyFromArray($Fields, $this->PrimaryKey);
if (!$this->ValidateUniqueFields($Username, $Email))
return FALSE;
// Define the other required fields:
$Fields['Email'] = $Email;
$Fields['Roles'] = (array)$RoleIDs;
// And insert the new user
$UserID = $this->_Insert($Fields, $Options);
} else {
$UserID = FALSE;
}
return $UserID;
}
/**
* To be used for basic registration, and captcha registration
*/
public function InsertForBasic($FormPostValues, $CheckCaptcha = TRUE, $Options = array()) {
$RoleIDs = Gdn::Config('Garden.Registration.DefaultRoles');
if (!is_array($RoleIDs) || count($RoleIDs) == 0)
throw new Exception(T('The default role has not been configured.'), 400);
if (GetValue('SaveRoles', $Options)) {
$RoleIDs = GetValue('RoleID', $FormPostValues);
}
$UserID = FALSE;
// Define the primary key in this model's table.
$this->DefineSchema();
// Add & apply any extra validation rules.
if (GetValue('ValidateEmail', $Options, TRUE))
$this->Validation->ApplyRule('Email', 'Email');
// TODO: DO I NEED THIS?!
// Make sure that the checkbox val for email is saved as the appropriate enum
if (array_key_exists('ShowEmail', $FormPostValues))
$FormPostValues['ShowEmail'] = ForceBool($FormPostValues['ShowEmail'], '0', '1', '0');
if (array_key_exists('Banned', $FormPostValues))
$FormPostValues['Banned'] = ForceBool($FormPostValues['Banned'], '0', '1', '0');
$this->AddInsertFields($FormPostValues);
if ($this->Validate($FormPostValues, TRUE) === TRUE) {
$Fields = $this->Validation->ValidationFields(); // All fields on the form that need to be validated (including non-schema field rules defined above)
$Username = ArrayValue('Name', $Fields);
$Email = ArrayValue('Email', $Fields);
$Fields = $this->Validation->SchemaValidationFields(); // Only fields that are present in the schema
$Fields['Roles'] = $RoleIDs;
$Fields = RemoveKeyFromArray($Fields, $this->PrimaryKey);
// If in Captcha registration mode, check the captcha value
if ($CheckCaptcha && Gdn::Config('Garden.Registration.Method') == 'Captcha') {
$CaptchaPublicKey = ArrayValue('Garden.Registration.CaptchaPublicKey', $FormPostValues, '');
$CaptchaValid = ValidateCaptcha($CaptchaPublicKey);
if ($CaptchaValid !== TRUE) {
$this->Validation->AddValidationResult('Garden.Registration.CaptchaPublicKey', 'The reCAPTCHA value was not entered correctly. Please try again.');
return FALSE;
}
}
if (!$this->ValidateUniqueFields($Username, $Email))
return FALSE;
// Check for spam.
if (GetValue('ValidateSpam', $Options, TRUE)) {
$ValidateSpam = $this->ValidateSpamRegistration($FormPostValues);
if ($ValidateSpam !== TRUE)
return $ValidateSpam;
}
// Define the other required fields:
$Fields['Email'] = $Email;
// And insert the new user
$UserID = $this->_Insert($Fields, $Options);
if ($UserID && !GetValue('NoActivity', $Options)) {
$ActivityModel = new ActivityModel();
$ActivityModel->Save(array(
'ActivityUserID' => $UserID,
'ActivityType' => 'Registration',
'HeadlineFormat' => T('HeadlineFormat.Registration', '{ActivityUserID,You} joined.'),
'Story' => T('Welcome Aboard!')
),
FALSE,
array('GroupBy' => 'ActivityTypeID'));
}
}
return $UserID;
}
// parent override
public function AddInsertFields(&$Fields) {
$this->DefineSchema();
// Set the hour offset based on the client's clock.
$ClientHour = ArrayValue('ClientHour', $Fields, '');
if (is_numeric($ClientHour) && $ClientHour >= 0 && $ClientHour < 24) {
$HourOffset = $ClientHour - date('G', time());
$Fields['HourOffset'] = $HourOffset;
}
// Set some required dates.
$Now = Gdn_Format::ToDateTime();
$Fields[$this->DateInserted] = $Now;
$Fields['DateFirstVisit'] = $Now;
$Fields['DateLastActive'] = $Now;
$Fields['InsertIPAddress'] = Gdn::Request()->IpAddress();
$Fields['LastIPAddress'] = Gdn::Request()->IpAddress();
}
/**
* Updates visit level information such as date last active and the user's ip address.
*
* @param int $UserID
* @param string|int|float $ClientHour
*/
function UpdateVisit($UserID, $ClientHour = FALSE) {
$UserID = (int) $UserID;
if (!$UserID) {
throw new Exception('A valid User ID is required.');
}
$User = Gdn::UserModel()->GetID($UserID, DATASET_TYPE_ARRAY);
$Fields = array();
if (Gdn_Format::ToTimestamp($User['DateLastActive']) < strtotime('5 minutes ago')) {
// We only update the last active date once every 5 minutes to cut down on DB activity.
$Fields['DateLastActive'] = Gdn_Format::ToDateTime();
}
// Update session level information if necessary.
if ($UserID == Gdn::Session()->UserID) {
$IP = Gdn::Request()->IpAddress();
$Fields['LastIPAddress'] = $IP;
if (Gdn::Session()->NewVisit()) {
$Fields['CountVisits'] = GetValue('CountVisits', $User, 0) + 1;
}
}
// Generate the AllIPs field.
$AllIPs = GetValue('AllIPAddresses', $User, array());
if (is_string($AllIPs)) {
$AllIPs = explode(',', $AllIPs);
SetValue('AllIPAddresses', $User, $AllIPs);
}
if (!is_array($AllIPs))
$AllIPs = array();
if ($IP = GetValue('InsertIPAddress', $User))
$AllIPs[] = ForceIPv4($IP);
if ($IP = GetValue('LastIPAddress', $User))
$AllIPs[] = $IP;
$AllIPs = array_unique($AllIPs);
sort($AllIPs);
$Fields['AllIPAddresses'] = $AllIPs;
// Set the hour offset based on the client's clock.
if (is_numeric($ClientHour) && $ClientHour >= 0 && $ClientHour < 24) {
$HourOffset = $ClientHour - date('G', time());
$Fields['HourOffset'] = $HourOffset;
}
// See if the fields have changed.
$Set = array();
foreach ($Fields as $Name => $Value) {
if (GetValue($Name, $User) != $Value) {
$Set[$Name] = $Value;
}
}
if (!empty($Set)) {
$this->EventArguments['Fields'] =& $Set;
$this->FireEvent('UpdateVisit');
$this->SetField($UserID, $Set);
}
if ($User['LastIPAddress'] != $Fields['LastIPAddress']) {
$User = $this->GetID($UserID, DATASET_TYPE_ARRAY);
if (!BanModel::CheckUser($User, NULL, TRUE, $Bans)) {
$BanModel = new BanModel();
$Ban = array_pop($Bans);
$BanModel->SaveUser($User, TRUE, $Ban);
$BanModel->SetCounts($Ban);
}
}
}
/**
* @param unknown_type $FormPostValues
* @param unknown_type $Insert
* @return unknown
* @todo add doc
*/
public function Validate($FormPostValues, $Insert = FALSE) {
$this->DefineSchema();
if (self::NoEmail()) {
// Remove the email requirement.
$this->Validation->UnapplyRule('Email', 'Required');
}
if (!$Insert && !isset($FormPostValues['Name'])) {
$this->Validation->UnapplyRule('Name');
}
return $this->Validation->Validate($FormPostValues, $Insert);
}
/**
* Validate User Credential
*
* Fetches a user row by email (or name) and compare the password.
*
* If the password was not stored as a blowfish hash,
* the password will be saved again.
*
* Return the user's id, admin status and attributes.
*
* @param string $Email
* @param string $Password
* @return object
*/
public function ValidateCredentials($Email = '', $ID = 0, $Password) {
$this->EventArguments['Credentials'] = array('Email'=>$Email, 'ID'=>$ID, 'Password'=>$Password);
$this->FireEvent('BeforeValidateCredentials');
if (!$Email && !$ID)
throw new Exception('The email or id is required');
try {
$this->SQL->Select('UserID, Name, Attributes, Admin, Password, HashMethod, Deleted, Banned')
->From('User');
if ($ID) {
$this->SQL->Where('UserID', $ID);
} else {
if (strpos($Email, '@') > 0) {
$this->SQL->Where('Email', $Email);
} else {
$this->SQL->Where('Name', $Email);
}
}
$DataSet = $this->SQL->Get();
} catch(Exception $Ex) {
$this->SQL->Reset();
// Try getting the user information without the new fields.
$this->SQL->Select('UserID, Name, Attributes, Admin, Password')
->From('User');
if ($ID) {
$this->SQL->Where('UserID', $ID);
} else {
if (strpos($Email, '@') > 0) {
$this->SQL->Where('Email', $Email);
} else {
$this->SQL->Where('Name', $Email);
}
}
$DataSet = $this->SQL->Get();
}
if ($DataSet->NumRows() < 1)
return FALSE;
$UserData = $DataSet->FirstRow();
// Check for a deleted user.
if(GetValue('Deleted', $UserData))
return FALSE;
$PasswordHash = new Gdn_PasswordHash();
$HashMethod = GetValue('HashMethod', $UserData);
if(!$PasswordHash->CheckPassword($Password, $UserData->Password, $HashMethod, $UserData->Name))
return FALSE;
if ($PasswordHash->Weak || ($HashMethod && strcasecmp($HashMethod, 'Vanilla') != 0)) {
$Pw = $PasswordHash->HashPassword($Password);
$this->SQL->Update('User')
->Set('Password', $Pw)
->Set('HashMethod', 'Vanilla')
->Where('UserID', $UserData->UserID)
->Put();
}
$UserData->Attributes = Gdn_Format::Unserialize($UserData->Attributes);
return $UserData;
}
/**
*
* @param array $User
* @return bool|string
* @since 2.1
*/
public function ValidateSpamRegistration($User) {
$DiscoveryText = GetValue('DiscoveryText', $User);
$Log = ValidateRequired($DiscoveryText);
$Spam = SpamModel::IsSpam('Registration', $User, array('Log' => $Log));
if ($Spam) {
if ($Log) {
// The user entered discovery text.
return self::REDIRECT_APPROVE;
} else {
$this->Validation->AddValidationResult('DiscoveryText', 'Tell us why you want to join!');
return FALSE;
}
}
return TRUE;
}
/**
* Checks to see if $Username and $Email are already in use by another member.
*/
public function ValidateUniqueFields($Username, $Email, $UserID = '', $Return = FALSE) {
$Valid = TRUE;
$Where = array();
if (is_numeric($UserID))
$Where['UserID <> '] = $UserID;
$Result = array('Name' => TRUE, 'Email' => TRUE);
// Make sure the username & email aren't already being used
if (C('Garden.Registration.NameUnique', TRUE) && $Username) {
$Where['Name'] = $Username;
$TestData = $this->GetWhere($Where);
if ($TestData->NumRows() > 0) {
$Result['Name'] = FALSE;
$Valid = FALSE;
}
unset($Where['Name']);
}
if (C('Garden.Registration.EmailUnique', TRUE) && $Email) {
$Where['Email'] = $Email;
$TestData = $this->GetWhere($Where);
if ($TestData->NumRows() > 0) {
$Result['Email'] = FALSE;
$Valid = FALSE;
}
}
if ($Return) {
return $Result;
} else {
if (!$Result['Name'])
$this->Validation->AddValidationResult('Name', 'The name you entered is already in use by another member.');
if (!$Result['Email'])
$this->Validation->AddValidationResult('Email', 'The email you entered is in use by another member.');
return $Valid;
}
}
/**
* Approve a membership applicant.
*/
public function Approve($UserID, $Email) {
$ApplicantRoleID = C('Garden.Registration.ApplicantRoleID', 0);
// Make sure the $UserID is an applicant
$RoleData = $this->GetRoles($UserID);
if ($RoleData->NumRows() == 0) {
throw new Exception(T('ErrorRecordNotFound'));
} else {
$AppRoles = $RoleData->Result(DATASET_TYPE_ARRAY);
$ApplicantFound = FALSE;
foreach ($AppRoles as $AppRole)
if (GetValue('RoleID', $AppRole) == $ApplicantRoleID) $ApplicantFound = TRUE;
}
if ($ApplicantFound) {
// Retrieve the default role(s) for new users
$RoleIDs = C('Garden.Registration.DefaultRoles', array(8));
// Wipe out old & insert new roles for this user
$this->SaveRoles($UserID, $RoleIDs, FALSE);
// Send out a notification to the user
$User = $this->GetID($UserID);
if ($User) {
$Email->Subject(sprintf(T('[%1$s] Membership Approved'), C('Garden.Title')));
$Email->Message(sprintf(T('EmailMembershipApproved'), $User->Name, ExternalUrl(SignInUrl())));
$Email->To($User->Email);
//$Email->From(C('Garden.SupportEmail'), C('Garden.SupportName'));
$Email->Send();
// Report that the user was approved.
$ActivityModel = new ActivityModel();
$ActivityModel->Save(array(
'ActivityUserID' => $UserID,
'ActivityType' => 'Registration',
'HeadlineFormat' => T('HeadlineFormat.Registration', '{ActivityUserID,You} joined.'),
'Story' => T('Welcome Aboard!')
),
FALSE,
array('GroupBy' => 'ActivityTypeID'));
// Report the approval for moderators.
$ActivityModel->Save(array(
'ActivityType' => 'Registration',
'ActivityUserID' => Gdn::Session()->UserID,
'RegardingUserID' => $UserID,
'NotifyUserID' => ActivityModel::NOTIFY_MODS,
'HeadlineFormat' => T('HeadlineFormat.RegistrationApproval', '{ActivityUserID,user} approved the applications for {RegardingUserID,user}.')),
FALSE,
array('GroupBy' => array('ActivityTypeID', 'ActivityUserID')));
Gdn::UserModel()->SaveAttribute($UserID, 'ApprovedByUserID', Gdn::Session()->UserID);
}
}
return TRUE;
}
/**
* Delete a single user.
*
* @param int $UserID
* @param array $Options See DeleteContent(), GetDelete()
*/
public function Delete($UserID, $Options = array()) {
if ($UserID == $this->GetSystemUserID()) {
$this->Validation->AddValidationResult('', 'You cannot delete the system user.');
return FALSE;
}
$Content = array();
// Remove shared authentications.
$this->GetDelete('UserAuthentication', array('UserID' => $UserID), $Content);
// Remove role associations.
$this->GetDelete('UserRole', array('UserID' => $UserID), $Content);
$this->DeleteContent($UserID, $Options, $Content);
// Remove the user's information
$this->SQL->Update('User')
->Set(array(
'Name' => T('[Deleted User]'),
'Photo' => null,
'Password' => RandomString('10'),
'About' => '',
'Email' => 'user_'.$UserID.'@deleted.email',
'ShowEmail' => '0',
'Gender' => 'u',
'CountVisits' => 0,
'CountInvitations' => 0,
'CountNotifications' => 0,
'InviteUserID' => null,
'DiscoveryText' => '',
'Preferences' => null,
'Permissions' => null,
'Attributes' => Gdn_Format::Serialize(array('State' => 'Deleted')),
'DateSetInvitations' => null,
'DateOfBirth' => null,
'DateUpdated' => Gdn_Format::ToDateTime(),
'HourOffset' => '0',
'Score' => null,
'Admin' => 0,
'Deleted' => 1
))
->Where('UserID', $UserID)
->Put();
// Remove user's cache rows
$this->ClearCache($UserID);
return TRUE;
}
public function DeleteContent($UserID, $Options = array(), $Content = array()) {
$Log = GetValue('Log', $Options);
if ($Log === TRUE)
$Log = 'Delete';
$Result = FALSE;
// Fire an event so applications can remove their associated user data.
$this->EventArguments['UserID'] = $UserID;
$this->EventArguments['Options'] = $Options;
$this->EventArguments['Content'] =& $Content;
$this->FireEvent('BeforeDeleteUser');
$User = $this->GetID($UserID, DATASET_TYPE_ARRAY);
if (!$Log)
$Content = NULL;
// Remove photos
/*$PhotoData = $this->SQL->Select()->From('Photo')->Where('InsertUserID', $UserID)->Get();
foreach ($PhotoData->Result() as $Photo) {
@unlink(PATH_UPLOADS.DS.$Photo->Name);
}
$this->SQL->Delete('Photo', array('InsertUserID' => $UserID));
*/
// Remove invitations
$this->GetDelete('Invitation', array('InsertUserID' => $UserID), $Content);
$this->GetDelete('Invitation', array('AcceptedUserID' => $UserID), $Content);
// Remove activities
$this->GetDelete('Activity', array('InsertUserID' => $UserID), $Content);
// Remove activity comments.
$this->GetDelete('ActivityComment', array('InsertUserID' => $UserID), $Content);
// Remove comments in moderation queue
$this->GetDelete('Log', array('RecordUserID' => $UserID, 'Operation' => 'Pending'), $Content);
// Clear out information on the user.
$this->SetField($UserID, array(
'About' => NULL,
'Title' => NULL,
'Location' => NULL));
if ($Log) {
$User['_Data'] = $Content;
unset($Content); // in case data gets copied
$Result = LogModel::Insert($Log, 'User', $User, GetValue('LogOptions', $Options, array()));
}
return $Result;
}
public function Decline($UserID) {
$ApplicantRoleID = C('Garden.Registration.ApplicantRoleID', 0);
// Make sure the user is an applicant
$RoleData = $this->GetRoles($UserID);
if ($RoleData->NumRows() == 0) {
throw new Exception(T('ErrorRecordNotFound'));
} else {
$AppRoles = $RoleData->Result(DATASET_TYPE_ARRAY);
$ApplicantFound = FALSE;
foreach ($AppRoles as $AppRole)
if (GetValue('RoleID', $AppRole) == $ApplicantRoleID) $ApplicantFound = TRUE;
}
if ($ApplicantFound) {
$this->Delete($UserID);
}
return TRUE;
}
public function GetInvitationCount($UserID) {
// If this user is master admin, they should have unlimited invites.
if ($this->SQL
->Select('UserID')
->From('User')
->Where('UserID', $UserID)
->Where('Admin', '1')
->Get()
->NumRows() > 0
) return -1;
// Get the Registration.InviteRoles settings:
$InviteRoles = Gdn::Config('Garden.Registration.InviteRoles', array());
if (!is_array($InviteRoles) || count($InviteRoles) == 0)
return 0;
// Build an array of roles that can send invitations
$CanInviteRoles = array();
foreach ($InviteRoles as $RoleID => $Invites) {
if ($Invites > 0 || $Invites == -1)
$CanInviteRoles[] = $RoleID;
}
if (count($CanInviteRoles) == 0)
return 0;
// See which matching roles the user has
$UserRoleData = $this->SQL->Select('RoleID')
->From('UserRole')
->Where('UserID', $UserID)
->WhereIn('RoleID', $CanInviteRoles)
->Get();
if ($UserRoleData->NumRows() == 0)
return 0;
// Define the maximum number of invites the user is allowed to send
$InviteCount = 0;
foreach ($UserRoleData->Result() as $UserRole) {
$Count = $InviteRoles[$UserRole->RoleID];
if ($Count == -1) {
$InviteCount = -1;
} else if ($InviteCount != -1 && $Count > $InviteCount) {
$InviteCount = $Count;
}
}
// If the user has unlimited invitations, return that value
if ($InviteCount == -1)
return -1;
// Get the user's current invitation settings from their profile
$User = $this->SQL->Select('CountInvitations, DateSetInvitations')
->From('User')
->Where('UserID', $UserID)
->Get()
->FirstRow();
// If CountInvitations is null (ie. never been set before) or it is a new month since the DateSetInvitations
if ($User->CountInvitations == '' || is_null($User->DateSetInvitations) || Gdn_Format::Date($User->DateSetInvitations, 'n Y') != Gdn_Format::Date('', 'n Y')) {
// Reset CountInvitations and DateSetInvitations
$this->SQL->Put(
$this->Name,
array(
'CountInvitations' => $InviteCount,
'DateSetInvitations' => Gdn_Format::Date('', 'Y-m-01') // The first day of this month
),
array('UserID' => $UserID)
);
return $InviteCount;
} else {
// Otherwise return CountInvitations
return $User->CountInvitations;
}
}
/**
* Get rows from a table then delete them.
*
* @param string $Table The name of the table.
* @param array $Where The where condition for the delete.
* @param array $Data The data to put the result.
* @since 2.1
*/
public function GetDelete($Table, $Where, &$Data) {
if (is_array($Data)) {
// Grab the records.
$Result = $this->SQL->GetWhere($Table, $Where)->ResultArray();
if (empty($Result))
return;
// Put the records in the result array.
if (isset($Data[$Table])) {
$Data[$Table] = array_merge($Data[$Table], $Result);
} else {
$Data[$Table] = $Result;
}
}
$this->SQL->Delete($Table, $Where);
}
/**
* Reduces the user's CountInvitations value by the specified amount.
*
* @param int The unique id of the user being affected.
* @param int The number to reduce CountInvitations by.
*/
public function ReduceInviteCount($UserID, $ReduceBy = 1) {
$CurrentCount = $this->GetInvitationCount($UserID);
// Do not reduce if the user has unlimited invitations
if ($CurrentCount == -1)
return TRUE;
// Do not reduce the count below zero.
if ($ReduceBy > $CurrentCount)
$ReduceBy = $CurrentCount;
$this->SQL->Update($this->Name)
->Set('CountInvitations', 'CountInvitations - '.$ReduceBy, FALSE)
->Where('UserID', $UserID)
->Put();
}
/**
* Increases the user's CountInvitations value by the specified amount.
*
* @param int The unique id of the user being affected.
* @param int The number to increase CountInvitations by.
*/
public function IncreaseInviteCount($UserID, $IncreaseBy = 1) {
$CurrentCount = $this->GetInvitationCount($UserID);
// Do not alter if the user has unlimited invitations
if ($CurrentCount == -1)
return TRUE;
$this->SQL->Update($this->Name)
->Set('CountInvitations', 'CountInvitations + '.$IncreaseBy, FALSE)
->Where('UserID', $UserID)
->Put();
}
/**
* Saves the user's About field.
*
* @param int The UserID to save.
* @param string The about message being saved.
*/
public function SaveAbout($UserID, $About) {
$About = substr($About, 0, 1000);
$this->SetField($UserID, 'About', $About);
}
/**
* Saves a name/value to the user's specified $Column.
*
* This method throws exceptions when errors are encountered. Use try ...
* catch blocks to capture these exceptions.
*
* @param string The name of the serialized column to save to. At the time of this writing there are three serialized columns on the user table: Permissions, Preferences, and Attributes.
* @param int The UserID to save.
* @param mixed The name of the value being saved, or an associative array of name => value pairs to be saved. If this is an associative array, the $Value argument will be ignored.
* @param mixed The value being saved.
*/
public function SaveToSerializedColumn($Column, $UserID, $Name, $Value = '') {
// Load the existing values
$UserData = $this->GetID($UserID, DATASET_TYPE_OBJECT);
if (!$UserData)
throw new Exception(sprintf('User %s not found.', $UserID));
$Values = GetValue($Column, $UserData);
if (!is_array($Values) && !is_object($Values))
$Values = @unserialize($UserData->$Column);
// Throw an exception if the field was not empty but is also not an object or array
if (is_string($Values) && $Values != '')
throw new Exception(sprintf(T('Serialized column "%s" failed to be unserialized.'),$Column));
if (!is_array($Values))
$Values = array();
// Hook for plugins
$this->EventArguments['CurrentValues'] = &$Values;
$this->EventArguments['Column'] = &$Column;
$this->EventArguments['UserID'] = &$UserID;
$this->EventArguments['Name'] = &$Name;
$this->EventArguments['Value'] = &$Value;
$this->FireEvent('BeforeSaveSerialized');
// Assign the new value(s)
if (!is_array($Name))
$Name = array($Name => $Value);
$RawValues = array_merge($Values, $Name);
$Values = array();
foreach ($RawValues as $Key => $RawValue)
if (!is_null($RawValue))
$Values[$Key] = $RawValue;
$Values = Gdn_Format::Serialize($Values);
// Save the values back to the db
$SaveResult = $this->SQL->Put('User', array($Column => $Values), array('UserID' => $UserID));
$this->ClearCache($UserID, array('user'));
return $SaveResult;
}
/**
* Saves a user preference to the database.
*
* This is a convenience method that uses $this->SaveToSerializedColumn().
*
* @param int The UserID to save.
* @param mixed The name of the preference being saved, or an associative array of name => value pairs to be saved. If this is an associative array, the $Value argument will be ignored.
* @param mixed The value being saved.
*/
public function SavePreference($UserID, $Preference, $Value = '') {
// Make sure that changes to the current user become effective immediately.
$Session = Gdn::Session();
if ($UserID == $Session->UserID)
$Session->SetPreference($Preference, $Value, FALSE);
return $this->SaveToSerializedColumn('Preferences', $UserID, $Preference, $Value);
}
/**
* Saves a user attribute to the database.
*
* This is a convenience method that uses $this->SaveToSerializedColumn().
*
* @param int The UserID to save.
* @param mixed The name of the attribute being saved, or an associative array of name => value pairs to be saved. If this is an associative array, the $Value argument will be ignored.
* @param mixed The value being saved.
*/
public function SaveAttribute($UserID, $Attribute, $Value = '') {
// Make sure that changes to the current user become effective immediately.
$Session = Gdn::Session();
if ($UserID == $Session->UserID)
$Session->SetAttribute($Attribute, $Value);
return $this->SaveToSerializedColumn('Attributes', $UserID, $Attribute, $Value);
}
public function SaveAuthentication($Data) {
$Cn = $this->Database->Connection();
$Px = $this->Database->DatabasePrefix;
$UID = $Cn->quote($Data['UniqueID']);
$Provider = $Cn->quote($Data['Provider']);
$UserID = $Cn->quote($Data['UserID']);
$Sql = "insert {$Px}UserAuthentication (ForeignUserKey, ProviderKey, UserID) values ($UID, $Provider, $UserID) on duplicate key update UserID = $UserID";
$Result = $this->Database->Query($Sql);
return $Result;
}
public function SetCalculatedFields(&$User) {
if ($v = GetValue('Attributes', $User))
if (is_string($v))
SetValue('Attributes', $User, @unserialize($v));
if ($v = GetValue('Permissions', $User))
SetValue('Permissions', $User, @unserialize($v));
if ($v = GetValue('Preferences', $User))
SetValue('Preferences', $User, @unserialize($v));
if ($v = GetValue('Photo', $User)) {
if (!IsUrl($v)) {
$PhotoUrl = Gdn_Upload::Url(ChangeBasename($v, 'n%s'));
} else {
$PhotoUrl = $v;
}
SetValue('PhotoUrl', $User, $PhotoUrl);
}
if ($v = GetValue('AllIPAddresses', $User)) {
$IPAddresses = explode(',', $v);
foreach ($IPAddresses as $i => $IPAddress) {
$IPAddresses[$i] = ForceIPv4($IPAddress);
}
SetValue('AllIPAddresses', $User, $IPAddresses);
}
TouchValue('_CssClass', $User, '');
if ($v = GetValue('Banned', $User)) {
SetValue('_CssClass', $User, 'Banned');
}
$this->EventArguments['User'] =& $User;
$this->FireEvent('SetCalculatedFields');
}
public static function SetMeta($UserID, $Meta, $Prefix = '') {
$Deletes = array();
$Px = Gdn::Database()->DatabasePrefix;
$Sql = "insert {$Px}UserMeta (UserID, Name, Value) values(:UserID, :Name, :Value) on duplicate key update Value = :Value1";
foreach ($Meta as $Name => $Value) {
$Name = $Prefix.$Name;
if ($Value === NULL)
$Deletes[] = $Name;
else
Gdn::Database()->Query($Sql, array(':UserID' => $UserID, ':Name' => $Name, ':Value' => $Value, ':Value1' => $Value));
}
if (count($Deletes))
Gdn::SQL()->WhereIn('Name', $Deletes)->Where('UserID',$UserID)->Delete('UserMeta');
}
public function SetTransientKey($UserID, $ExplicitKey = '') {
$Key = $ExplicitKey == '' ? RandomString(12) : $ExplicitKey;
$this->SaveAttribute($UserID, 'TransientKey', $Key);
return $Key;
}
public function GetAttribute($UserID, $Attribute, $DefaultValue = FALSE) {
//
// $Result = $DefaultValue;
// if ($Data !== FALSE) {
// $Attributes = Gdn_Format::Unserialize($Data->Attributes);
// if (is_array($Attributes))
// $Result = ArrayValue($Attribute, $Attributes, $DefaultValue);
//
// }
$User = $this->GetID($UserID, DATASET_TYPE_ARRAY);
$Result = GetValue($Attribute, $User['Attributes'], $DefaultValue);
return $Result;
}
public function SendEmailConfirmationEmail($User = NULL) {
if (!$User)
$User = Gdn::Session()->User;
elseif (is_numeric($User))
$User = $this->GetID($User);
elseif (is_string($User)) {
$User = $this->GetByEmail($User);
}
if (!$User)
throw NotFoundException('User');
$User = (array)$User;
if (is_string($User['Attributes']))
$User['Attributes'] = @unserialize($User['Attributes']);
// Make sure the user needs email confirmation.
$Roles = $this->GetRoles($User['UserID']);
$Roles = ConsolidateArrayValuesByKey($Roles, 'RoleID');
if (!in_array(C('Garden.Registration.ConfirmEmailRole'), $Roles)) {
$this->Validation->AddValidationResult('Role', 'Your email doesn\'t need confirmation.');
// Remove the email key.
if (isset($User['Attributes']['EmailKey'])) {
unset($User['Attributes']['EmailKey']);
$this->SaveAttribute($User['UserID'], $User['Attribute']);
}
return;
}
// Make sure there is a confirmation code.
$Code = GetValueR('Attributes.EmailKey', $User);
if (!$Code) {
$Code = RandomString(8);
$Attributes = $User['Attributes'];
if (!is_array($Attributes))
$Attributes = array('EmailKey' => $Code);
else
$Attributes['EmailKey'] = $Code;
$this->SaveAttribute($User['UserID'], $Attributes);
}
$AppTitle = Gdn::Config('Garden.Title');
$Email = new Gdn_Email();
$Email->Subject(sprintf(T('[%s] Confirm Your Email Address'), $AppTitle));
$Email->To($User['Email']);
$EmailFormat = T('EmailConfirmEmail', self::DEFAULT_CONFIRM_EMAIL);
$Data = array();
$Data['EmailKey'] = $Code;
$Data['User'] = ArrayTranslate((array)$User, array('UserID', 'Name', 'Email'));
$Data['Title'] = $AppTitle;
$Message = FormatString($EmailFormat, $Data);
$Message = $this->_AddEmailHeaderFooter($Message, $Data);
$Email->Message($Message);
$Email->Send();
}
public function SendWelcomeEmail($UserID, $Password, $RegisterType = 'Add', $AdditionalData = NULL) {
$Session = Gdn::Session();
$Sender = $this->GetID($Session->UserID);
$User = $this->GetID($UserID);
if (!ValidateEmail($User->Email))
return;
$AppTitle = Gdn::Config('Garden.Title');
$Email = new Gdn_Email();
$Email->Subject(sprintf(T('[%s] Welcome Aboard!'), $AppTitle));
$Email->To($User->Email);
$Data = array();
$Data['User'] = ArrayTranslate((array)$User, array('UserID', 'Name', 'Email'));
$Data['Sender'] = ArrayTranslate((array)$Sender, array('Name', 'Email'));
$Data['Title'] = $AppTitle;
if (is_array($AdditionalData))
$Data = array_merge($Data, $AdditionalData);
$Data['EmailKey'] = GetValueR('Attributes.EmailKey', $User);
// Check for the new email format.
if (($EmailFormat = T("EmailWelcome{$RegisterType}", '#')) != '#') {
$Message = FormatString($EmailFormat, $Data);
} else {
$Message = sprintf(
T('EmailWelcome'),
$User->Name,
$Sender->Name,
$AppTitle,
ExternalUrl('/'),
$Password,
$User->Email
);
}
// Add the email confirmation key.
if ($Data['EmailKey']) {
$Message .= "\n\n".FormatString(T('EmailConfirmEmail', self::DEFAULT_CONFIRM_EMAIL), $Data);
}
$Message = $this->_AddEmailHeaderFooter($Message, $Data);
$Email->Message($Message);
$Email->Send();
}
public function SendPasswordEmail($UserID, $Password) {
$Session = Gdn::Session();
$Sender = $this->GetID($Session->UserID);
$User = $this->GetID($UserID);
$AppTitle = Gdn::Config('Garden.Title');
$Email = new Gdn_Email();
$Email->Subject(sprintf(T('[%s] Password Reset'), $AppTitle));
$Email->To($User->Email);
$Data = array();
$Data['User'] = ArrayTranslate((array)$User, array('Name', 'Email'));
$Data['Sender'] = ArrayTranslate((array)$Sender, array('Name', 'Email'));
$Data['Title'] = $AppTitle;
$EmailFormat = T('EmailPassword');
if (strpos($EmailFormat, '{') !== FALSE) {
$Message = FormatString($EmailFormat, $Data);
} else {
$Message = sprintf(
$EmailFormat,
$User->Name,
$Sender->Name,
$AppTitle,
ExternalUrl('/'),
$Password,
$User->Email
);
}
$Message = $this->_AddEmailHeaderFooter($Message, $Data);
$Email->Message($Message);
$Email->Send();
}
/**
* Synchronizes the user based on a given UserKey.
*
* @param string $UserKey A string that uniquely identifies this user.
* @param array $Data Information to put in the user table.
* @return int The ID of the user.
*/
public function Synchronize($UserKey, $Data) {
$UserID = 0;
$Attributes = ArrayValue('Attributes', $Data);
if (is_string($Attributes))
$Attributes = @unserialize($Attributes);
if (!is_array($Attributes))
$Attributes = array();
// If the user didnt log in, they won't have a UserID yet. That means they want a new
// account. So create one for them.
if (!isset($Data['UserID']) || $Data['UserID'] <= 0) {
// Prepare the user data.
$UserData['Name'] = $Data['Name'];
$UserData['Password'] = RandomString(16);
$UserData['Email'] = ArrayValue('Email', $Data, 'no@email.com');
$UserData['Gender'] = strtolower(substr(ArrayValue('Gender', $Data, 'u'), 0, 1));
$UserData['HourOffset'] = ArrayValue('HourOffset', $Data, 0);
$UserData['DateOfBirth'] = ArrayValue('DateOfBirth', $Data, '');
$UserData['CountNotifications'] = 0;
$UserData['Attributes'] = $Attributes;
$UserData['InsertIPAddress'] = Gdn::Request()->IpAddress();
if ($UserData['DateOfBirth'] == '')
$UserData['DateOfBirth'] = '1975-09-16';
// Make sure there isn't another user with this username.
if ($this->ValidateUniqueFields($UserData['Name'], $UserData['Email'])) {
if (!BanModel::CheckUser($UserData, $this->Validation, TRUE))
throw PermissionException('Banned');
// Insert the new user.
$this->AddInsertFields($UserData);
$UserID = $this->_Insert($UserData);
}
if ($UserID) {
$NewUserRoleIDs = $this->NewUserRoleIDs();
// Save the roles.
$Roles = GetValue('Roles', $Data, FALSE);
if (empty($Roles))
$Roles = $NewUserRoleIDs;
$this->SaveRoles($UserID, $Roles, FALSE);
}
} else {
$UserID = $Data['UserID'];
}
// Synchronize the transientkey from the external user data source if it is present (eg. WordPress' wpnonce).
if (array_key_exists('TransientKey', $Attributes) && $Attributes['TransientKey'] != '' && $UserID > 0)
$this->SetTransientKey($UserID, $Attributes['TransientKey']);
return $UserID;
}
public function NewUserRoleIDs() {
// Registration method
$RegistrationMethod = C('Garden.Registration.Method', 'Captcha');
$DefaultRoleID = C('Garden.Registration.DefaultRoles');
switch ($RegistrationMethod) {
case 'Approval':
$RoleID = C('Garden.Registration.ApplicantRoleID', $DefaultRoleID);
break;
case 'Invitation':
throw new Gdn_UserException(T('This forum is currently set to invitation only mode.'));
break;
case 'Basic':
case 'Captcha':
default:
$RoleID = $DefaultRoleID;
break;
}
if (empty($RoleID))
Trace("You don't have any default roles defined.", TRACE_WARNING);
return $RoleID;
}
public function PasswordRequest($Email) {
if (!$Email) {
return FALSE;
}
$Users = $this->GetWhere(array('Email' => $Email))->ResultObject();
if (count($Users) == 0) {
// Check for the username.
$Users = $this->GetWhere(array('Name' => $Email))->ResultObject();
}
$this->EventArguments['Users'] =& $Users;
$this->EventArguments['Email'] = $Email;
$this->FireEvent('BeforePasswordRequest');
if (count($Users) == 0) {
$this->Validation->AddValidationResult('Name', "Couldn't find an account associated with that email/username.");
return FALSE;
}
$Email = new Gdn_Email();
$NoEmail = TRUE;
foreach ($Users as $User) {
if (!$User->Email) {
continue;
}
$Email = new Gdn_Email(); // Instantiate in loop to clear previous settings
$PasswordResetKey = BetterRandomString(20, 'Aa0');
$PasswordResetExpires = strtotime('+1 hour');
$this->SaveAttribute($User->UserID, 'PasswordResetKey', $PasswordResetKey);
$this->SaveAttribute($User->UserID, 'PasswordResetExpires', $PasswordResetExpires);
$AppTitle = C('Garden.Title');
$Email->Subject(sprintf(T('[%s] Password Reset Request'), $AppTitle));
$Email->To($User->Email);
$Email->Message(
sprintf(
T('PasswordRequest'),
$User->Name,
$AppTitle,
ExternalUrl('/entry/passwordreset/'.$User->UserID.'/'.$PasswordResetKey)
)
);
$Email->Send();
$NoEmail = FALSE;
}
if ($NoEmail) {
$this->Validation->AddValidationResult('Name', 'There is no email address associated with that account.');
return FALSE;
}
return TRUE;
}
public function PasswordReset($UserID, $Password) {
// Encrypt the password before saving
$PasswordHash = new Gdn_PasswordHash();
$Password = $PasswordHash->HashPassword($Password);
$this->SQL->Update('User')->Set('Password', $Password)->Set('HashMethod', 'Vanilla')->Where('UserID', $UserID)->Put();
$this->SaveAttribute($UserID, 'PasswordResetKey', '');
$this->SaveAttribute($UserID, 'PasswordResetExpires', '');
$this->EventArguments['UserID'] = $UserID;
$this->FireEvent('AfterPasswordReset');
return $this->GetID($UserID);
}
/**
* Check and apply login rate limiting
*
* @param array $User
* @param boolean $PasswordOK
*/
public static function RateLimit($User, $PasswordOK) {
if (!Gdn::Cache()->ActiveEnabled()) return FALSE;
// $CoolingDown = FALSE;
//
// // 1. Check if we're in userid cooldown
// $UserCooldownKey = FormatString(self::LOGIN_COOLDOWN_KEY, array('Source' => $User['UserID']));
// if (!$CoolingDown) {
// $InUserCooldown = Gdn::Cache()->Get($UserCooldownKey);
// if ($InUserCooldown) {
// $CoolingDown = $InUserCooldown;
// $CooldownError = T('LoginUserCooldown', "Your account is temporarily locked due to failed login attempts. Try again in %s.");
// }
// }
//
// // 2. Check if we're in source IP cooldown
// $SourceCooldownKey = FormatString(self::LOGIN_COOLDOWN_KEY, array('Source' => Gdn::Request()->IpAddress()));
// if (!$CoolingDown) {
// $InSourceCooldown = Gdn::Cache()->Get($SourceCooldownKey);
// if ($InSourceCooldown) {
// $CoolingDown = $InUserCooldown;
// $CooldownError = T('LoginSourceCooldown', "Your IP is temporarily blocked due to failed login attempts. Try again in %s.");
// }
// }
//
// // Block cooled down people
// if ($CoolingDown) {
// $Timespan = $InUserCooldown;
// $Timespan -= 3600 * ($Hours = (int) floor($Timespan / 3600));
// $Timespan -= 60 * ($Minutes = (int) floor($Timespan / 60));
// $Seconds = $Timespan;
//
// $TimeFormat = array();
// if ($Hours) $TimeFormat[] = "{$Hours} ".Plural($Hours, 'hour', 'hours');
// if ($Minutes) $TimeFormat[] = "{$Minutes} ".Plural($Minutes, 'minute', 'minutes');
// if ($Seconds) $TimeFormat[] = "{$Seconds} ".Plural($Seconds, 'second', 'seconds');
// $TimeFormat = implode(', ', $TimeFormat);
// throw new Exception(sprintf($CooldownError, $TimeFormat));
// }
//
// // Logged in OK
// if ($PasswordOK) {
// Gdn::Cache()->Remove($UserCooldownKey);
// Gdn::Cache()->Remove($SourceCooldownKey);
// }
// Rate limiting
$UserRateKey = FormatString(self::LOGIN_RATE_KEY, array('Source' => $User->UserID));
$UserRate = (int)Gdn::Cache()->Get($UserRateKey);
$UserRate += 1;
Gdn::Cache()->Store($UserRateKey, 1, array(
Gdn_Cache::FEATURE_EXPIRY => self::LOGIN_RATE
));
$SourceRateKey = FormatString(self::LOGIN_RATE_KEY, array('Source' => Gdn::Request()->IpAddress()));
$SourceRate = (int)Gdn::Cache()->Get($SourceRateKey);
$SourceRate += 1;
Gdn::Cache()->Store($SourceRateKey, 1, array(
Gdn_Cache::FEATURE_EXPIRY => self::LOGIN_RATE
));
// Put user into cooldown mode
if ($UserRate > 1)
throw new Gdn_UserException(T('LoginUserCooldown', "You are trying to log in too often. Slow down!."));
if ($SourceRate > 1)
throw new Gdn_UserException(T('LoginSourceCooldown', "Your IP is trying to log in too often. Slow down!"));
return TRUE;
}
public function SetField($RowID, $Property, $Value = FALSE) {
if (!is_array($Property))
$Property = array($Property => $Value);
// Convert IP addresses to long.
if (isset($Property['AllIPAddresses'])) {
if (is_array($Property['AllIPAddresses'])) {
$IPs = array_map('ForceIPv4', $Property['AllIPAddresses']);
$IPs = array_unique($IPs);
$Property['AllIPAddresses'] = implode(',', $IPs);
}
}
$this->DefineSchema();
$Set = array_intersect_key($Property, $this->Schema->Fields());
self::SerializeRow($Set);
$this->SQL
->Update($this->Name)
->Set($Set)
->Where('UserID', $RowID)
->Put();
if (in_array($Property, array('Permissions')))
$this->ClearCache ($RowID, array('permissions'));
else
$this->UpdateUserCache($RowID, $Property, $Value);
if (!is_array($Property))
$Property = array($Property => $Value);
$this->EventArguments['UserID'] = $RowID;
$this->EventArguments['Fields'] = $Property;
$this->FireEvent('AfterSetField');
return $Value;
}
/**
* Get a user from the cache by name or ID
*
* @param type $UserToken either a userid or a username
* @param string $TokenType either 'userid' or 'name'
* @return type user array or FALSE
*/
public function GetUserFromCache($UserToken, $TokenType) {
if ($TokenType == 'name') {
$UserNameKey = FormatString(self::USERNAME_KEY, array('Name' => md5($UserToken)));
$UserID = Gdn::Cache()->Get($UserNameKey);
if ($UserID === Gdn_Cache::CACHEOP_FAILURE) return FALSE;
$UserToken = $UserID; $TokenType = 'userid';
} else {
$UserID = $UserToken;
}
if ($TokenType != 'userid') return FALSE;
// Get from memcached
$UserKey = FormatString(self::USERID_KEY, array('UserID' => $UserToken));
$User = Gdn::Cache()->Get($UserKey);
return $User;
}
public function UpdateUserCache($UserID, $Field, $Value = NULL) {
$User = $this->GetID($UserID, DATASET_TYPE_ARRAY);
if (!is_array($Field))
$Field = array($Field => $Value);
foreach ($Field as $f => $v) {
$User[$f] = $v;
}
$this->UserCache($User);
}
/**
* Cache user object
*
* @param type $User
* @return type
*/
public function UserCache($User) {
$UserID = GetValue('UserID', $User, NULL);
if (is_null($UserID) || !$UserID) return FALSE;
$Cached = TRUE;
$UserKey = FormatString(self::USERID_KEY, array('UserID' => $UserID));
$Cached = $Cached & Gdn::Cache()->Store($UserKey, $User, array(
Gdn_Cache::FEATURE_EXPIRY => 3600
));
$UserNameKey = FormatString(self::USERNAME_KEY, array('Name' => md5(GetValue('Name', $User))));
$Cached = $Cached & Gdn::Cache()->Store($UserNameKey, $UserID, array(
Gdn_Cache::FEATURE_EXPIRY => 3600
));
return $Cached;
}
/**
* Cache user's roles
*
* @param type $UserID
* @param type $RoleIDs
* @return type
*/
public function UserCacheRoles($UserID, $RoleIDs) {
if (is_null($UserID) || !$UserID) return FALSE;
$Cached = TRUE;
$UserRolesKey = FormatString(self::USERROLES_KEY, array('UserID' => $UserID));
$Cached = $Cached & Gdn::Cache()->Store($UserRolesKey, $RoleIDs);
return $Cached;
}
/**
* Delete cached data for user
*
* @param type $UserID
* @return type
*/
public function ClearCache($UserID, $CacheTypesToClear = NULL) {
if (is_null($UserID) || !$UserID) return FALSE;
if (is_null($CacheTypesToClear))
$CacheTypesToClear = array('user', 'roles', 'permissions');
if (in_array('user', $CacheTypesToClear)) {
$UserKey = FormatString(self::USERID_KEY, array('UserID' => $UserID));
Gdn::Cache()->Remove($UserKey);
}
if (in_array('roles', $CacheTypesToClear)) {
$UserRolesKey = FormatString(self::USERROLES_KEY, array('UserID' => $UserID));
Gdn::Cache()->Remove($UserRolesKey);
}
if (in_array('permissions', $CacheTypesToClear)) {
Gdn::SQL()->Put('User', array('Permissions' => ''), array('UserID' => $UserID));
$PermissionsIncrement = $this->GetPermissionsIncrement();
$UserPermissionsKey = FormatString(self::USERPERMISSIONS_KEY, array('UserID' => $UserID, 'PermissionsIncrement' => $PermissionsIncrement));
Gdn::Cache()->Remove($UserPermissionsKey);
}
return TRUE;
}
public function ClearPermissions() {
if (!Gdn::Cache()->ActiveEnabled())
$this->SQL->Put('User', array('Permissions' => ''), array('Permissions <>' => ''));
$PermissionsIncrementKey = self::INC_PERMISSIONS_KEY;
$PermissionsIncrement = $this->GetPermissionsIncrement();
if ($PermissionsIncrement == 0)
Gdn::Cache()->Store($PermissionsIncrementKey, 1);
else
Gdn::Cache()->Increment($PermissionsIncrementKey);
}
public function GetPermissionsIncrement() {
$PermissionsIncrementKey = self::INC_PERMISSIONS_KEY;
$PermissionsKeyValue = Gdn::Cache()->Get($PermissionsIncrementKey);
if (!$PermissionsKeyValue) {
$Stored = Gdn::Cache()->Store($PermissionsIncrementKey, 1);
return $Stored ? 1 : FALSE;
}
return $PermissionsKeyValue;;
}
}
| sorrowgrave/NothingToSeeHere | vanilla/applications/dashboard/models/class.usermodel.php | PHP | mit | 128,052 | [
30522,
1026,
1029,
25718,
2065,
1006,
999,
4225,
1006,
1005,
4646,
1005,
1007,
1007,
6164,
1006,
1007,
1025,
1013,
1008,
9385,
2263,
1010,
2268,
21161,
21415,
4297,
1012,
2023,
5371,
2003,
2112,
1997,
3871,
1012,
3871,
2003,
2489,
4007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/******************************************************************************
*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* GPL LICENSE SUMMARY
*
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* 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,
* USA
*
* The full GNU General Public License is included in this distribution
* in the file called COPYING.
*
* Contact Information:
* Intel Linux Wireless <ilw@linux.intel.com>
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*
* BSD LICENSE
*
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * 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.
* * Neither the name Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "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 COPYRIGHT
* OWNER 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.
*
*****************************************************************************/
#ifndef __fw_api_scan_h__
#define __fw_api_scan_h__
#include "fw-api.h"
/* Scan Commands, Responses, Notifications */
/* Masks for iwl_scan_channel.type flags */
#define SCAN_CHANNEL_TYPE_ACTIVE BIT(0)
#define SCAN_CHANNEL_NARROW_BAND BIT(22)
/* Max number of IEs for direct SSID scans in a command */
#define PROBE_OPTION_MAX 20
/**
* struct iwl_scan_channel - entry in REPLY_SCAN_CMD channel table
* @channel: band is selected by iwl_scan_cmd "flags" field
* @tx_gain: gain for analog radio
* @dsp_atten: gain for DSP
* @active_dwell: dwell time for active scan in TU, typically 5-50
* @passive_dwell: dwell time for passive scan in TU, typically 20-500
* @type: type is broken down to these bits:
* bit 0: 0 = passive, 1 = active
* bits 1-20: SSID direct bit map. If any of these bits is set then
* the corresponding SSID IE is transmitted in probe request
* (bit i adds IE in position i to the probe request)
* bit 22: channel width, 0 = regular, 1 = TGj narrow channel
*
* @iteration_count:
* @iteration_interval:
* This struct is used once for each channel in the scan list.
* Each channel can independently select:
* 1) SSID for directed active scans
* 2) Txpower setting (for rate specified within Tx command)
* 3) How long to stay on-channel (behavior may be modified by quiet_time,
* quiet_plcp_th, good_CRC_th)
*
* To avoid uCode errors, make sure the following are true (see comments
* under struct iwl_scan_cmd about max_out_time and quiet_time):
* 1) If using passive_dwell (i.e. passive_dwell != 0):
* active_dwell <= passive_dwell (< max_out_time if max_out_time != 0)
* 2) quiet_time <= active_dwell
* 3) If restricting off-channel time (i.e. max_out_time !=0):
* passive_dwell < max_out_time
* active_dwell < max_out_time
*/
struct iwl_scan_channel {
__le32 type;
__le16 channel;
__le16 iteration_count;
__le32 iteration_interval;
__le16 active_dwell;
__le16 passive_dwell;
} __packed; /* SCAN_CHANNEL_CONTROL_API_S_VER_1 */
/**
* struct iwl_ssid_ie - directed scan network information element
*
* Up to 20 of these may appear in REPLY_SCAN_CMD,
* selected by "type" bit field in struct iwl_scan_channel;
* each channel may select different ssids from among the 20 entries.
* SSID IEs get transmitted in reverse order of entry.
*/
struct iwl_ssid_ie {
u8 id;
u8 len;
u8 ssid[IEEE80211_MAX_SSID_LEN];
} __packed; /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
/**
* iwl_scan_flags - masks for scan command flags
*@SCAN_FLAGS_PERIODIC_SCAN:
*@SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX:
*@SCAN_FLAGS_DELAYED_SCAN_LOWBAND:
*@SCAN_FLAGS_DELAYED_SCAN_HIGHBAND:
*@SCAN_FLAGS_FRAGMENTED_SCAN:
*@SCAN_FLAGS_PASSIVE2ACTIVE: use active scan on channels that was active
* in the past hour, even if they are marked as passive.
*/
enum iwl_scan_flags {
SCAN_FLAGS_PERIODIC_SCAN = BIT(0),
SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX = BIT(1),
SCAN_FLAGS_DELAYED_SCAN_LOWBAND = BIT(2),
SCAN_FLAGS_DELAYED_SCAN_HIGHBAND = BIT(3),
SCAN_FLAGS_FRAGMENTED_SCAN = BIT(4),
SCAN_FLAGS_PASSIVE2ACTIVE = BIT(5),
};
/**
* enum iwl_scan_type - Scan types for scan command
* @SCAN_TYPE_FORCED:
* @SCAN_TYPE_BACKGROUND:
* @SCAN_TYPE_OS:
* @SCAN_TYPE_ROAMING:
* @SCAN_TYPE_ACTION:
* @SCAN_TYPE_DISCOVERY:
* @SCAN_TYPE_DISCOVERY_FORCED:
*/
enum iwl_scan_type {
SCAN_TYPE_FORCED = 0,
SCAN_TYPE_BACKGROUND = 1,
SCAN_TYPE_OS = 2,
SCAN_TYPE_ROAMING = 3,
SCAN_TYPE_ACTION = 4,
SCAN_TYPE_DISCOVERY = 5,
SCAN_TYPE_DISCOVERY_FORCED = 6,
}; /* SCAN_ACTIVITY_TYPE_E_VER_1 */
/* Maximal number of channels to scan */
#define MAX_NUM_SCAN_CHANNELS 0x24
/**
* struct iwl_scan_cmd - scan request command
* ( SCAN_REQUEST_CMD = 0x80 )
* @len: command length in bytes
* @scan_flags: scan flags from SCAN_FLAGS_*
* @channel_count: num of channels in channel list (1 - MAX_NUM_SCAN_CHANNELS)
* @quiet_time: in msecs, dwell this time for active scan on quiet channels
* @quiet_plcp_th: quiet PLCP threshold (channel is quiet if less than
* this number of packets were received (typically 1)
* @passive2active: is auto switching from passive to active during scan allowed
* @rxchain_sel_flags: RXON_RX_CHAIN_*
* @max_out_time: in usecs, max out of serving channel time
* @suspend_time: how long to pause scan when returning to service channel:
* bits 0-19: beacon interal in usecs (suspend before executing)
* bits 20-23: reserved
* bits 24-31: number of beacons (suspend between channels)
* @rxon_flags: RXON_FLG_*
* @filter_flags: RXON_FILTER_*
* @tx_cmd: for active scans (zero for passive), w/o payload,
* no RS so specify TX rate
* @direct_scan: direct scan SSIDs
* @type: one of SCAN_TYPE_*
* @repeats: how many time to repeat the scan
*/
struct iwl_scan_cmd {
__le16 len;
u8 scan_flags;
u8 channel_count;
__le16 quiet_time;
__le16 quiet_plcp_th;
__le16 passive2active;
__le16 rxchain_sel_flags;
__le32 max_out_time;
__le32 suspend_time;
/* RX_ON_FLAGS_API_S_VER_1 */
__le32 rxon_flags;
__le32 filter_flags;
struct iwl_tx_cmd tx_cmd;
struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
__le32 type;
__le32 repeats;
/*
* Probe request frame, followed by channel list.
*
* Size of probe request frame is specified by byte count in tx_cmd.
* Channel list follows immediately after probe request frame.
* Number of channels in list is specified by channel_count.
* Each channel in list is of type:
*
* struct iwl_scan_channel channels[0];
*
* NOTE: Only one band of channels can be scanned per pass. You
* must not mix 2.4GHz channels and 5.2GHz channels, and you must wait
* for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION)
* before requesting another scan.
*/
u8 data[0];
} __packed; /* SCAN_REQUEST_FIXED_PART_API_S_VER_5 */
/* Response to scan request contains only status with one of these values */
#define SCAN_RESPONSE_OK 0x1
#define SCAN_RESPONSE_ERROR 0x2
/*
* SCAN_ABORT_CMD = 0x81
* When scan abort is requested, the command has no fields except the common
* header. The response contains only a status with one of these values.
*/
#define SCAN_ABORT_POSSIBLE 0x1
#define SCAN_ABORT_IGNORED 0x2 /* no pending scans */
/* TODO: complete documentation */
#define SCAN_OWNER_STATUS 0x1
#define MEASURE_OWNER_STATUS 0x2
/**
* struct iwl_scan_start_notif - notifies start of scan in the device
* ( SCAN_START_NOTIFICATION = 0x82 )
* @tsf_low: TSF timer (lower half) in usecs
* @tsf_high: TSF timer (higher half) in usecs
* @beacon_timer: structured as follows:
* bits 0:19 - beacon interval in usecs
* bits 20:23 - reserved (0)
* bits 24:31 - number of beacons
* @channel: which channel is scanned
* @band: 0 for 5.2 GHz, 1 for 2.4 GHz
* @status: one of *_OWNER_STATUS
*/
struct iwl_scan_start_notif {
__le32 tsf_low;
__le32 tsf_high;
__le32 beacon_timer;
u8 channel;
u8 band;
u8 reserved[2];
__le32 status;
} __packed; /* SCAN_START_NTF_API_S_VER_1 */
/* scan results probe_status first bit indicates success */
#define SCAN_PROBE_STATUS_OK 0
#define SCAN_PROBE_STATUS_TX_FAILED BIT(0)
/* error statuses combined with TX_FAILED */
#define SCAN_PROBE_STATUS_FAIL_TTL BIT(1)
#define SCAN_PROBE_STATUS_FAIL_BT BIT(2)
/* How many statistics are gathered for each channel */
#define SCAN_RESULTS_STATISTICS 1
/**
* enum iwl_scan_complete_status - status codes for scan complete notifications
* @SCAN_COMP_STATUS_OK: scan completed successfully
* @SCAN_COMP_STATUS_ABORT: scan was aborted by user
* @SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed
* @SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready
* @SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed
* @SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed
* @SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan command
* @SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort
* @SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax
* @SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was successful
* (not an error!)
* @SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the driver
* asked for
* @SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events
*/
enum iwl_scan_complete_status {
SCAN_COMP_STATUS_OK = 0x1,
SCAN_COMP_STATUS_ABORT = 0x2,
SCAN_COMP_STATUS_ERR_SLEEP = 0x3,
SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT = 0x4,
SCAN_COMP_STATUS_ERR_PROBE = 0x5,
SCAN_COMP_STATUS_ERR_WAKEUP = 0x6,
SCAN_COMP_STATUS_ERR_ANTENNAS = 0x7,
SCAN_COMP_STATUS_ERR_INTERNAL = 0x8,
SCAN_COMP_STATUS_ERR_COEX = 0x9,
SCAN_COMP_STATUS_P2P_ACTION_OK = 0xA,
SCAN_COMP_STATUS_ITERATION_END = 0x0B,
SCAN_COMP_STATUS_ERR_ALLOC_TE = 0x0C,
};
/**
* struct iwl_scan_results_notif - scan results for one channel
* ( SCAN_RESULTS_NOTIFICATION = 0x83 )
* @channel: which channel the results are from
* @band: 0 for 5.2 GHz, 1 for 2.4 GHz
* @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
* @num_probe_not_sent: # of request that weren't sent due to not enough time
* @duration: duration spent in channel, in usecs
* @statistics: statistics gathered for this channel
*/
struct iwl_scan_results_notif {
u8 channel;
u8 band;
u8 probe_status;
u8 num_probe_not_sent;
__le32 duration;
__le32 statistics[SCAN_RESULTS_STATISTICS];
} __packed; /* SCAN_RESULT_NTF_API_S_VER_2 */
/**
* struct iwl_scan_complete_notif - notifies end of scanning (all channels)
* ( SCAN_COMPLETE_NOTIFICATION = 0x84 )
* @scanned_channels: number of channels scanned (and number of valid results)
* @status: one of SCAN_COMP_STATUS_*
* @bt_status: BT on/off status
* @last_channel: last channel that was scanned
* @tsf_low: TSF timer (lower half) in usecs
* @tsf_high: TSF timer (higher half) in usecs
* @results: all scan results, only "scanned_channels" of them are valid
*/
struct iwl_scan_complete_notif {
u8 scanned_channels;
u8 status;
u8 bt_status;
u8 last_channel;
__le32 tsf_low;
__le32 tsf_high;
struct iwl_scan_results_notif results[MAX_NUM_SCAN_CHANNELS];
} __packed; /* SCAN_COMPLETE_NTF_API_S_VER_2 */
/* scan offload */
#define IWL_MAX_SCAN_CHANNELS 40
#define IWL_SCAN_MAX_BLACKLIST_LEN 64
#define IWL_SCAN_SHORT_BLACKLIST_LEN 16
#define IWL_SCAN_MAX_PROFILES 11
#define SCAN_OFFLOAD_PROBE_REQ_SIZE 512
/* Default watchdog (in MS) for scheduled scan iteration */
#define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000)
#define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1)
#define CAN_ABORT_STATUS 1
#define IWL_FULL_SCAN_MULTIPLIER 5
#define IWL_FAST_SCHED_SCAN_ITERATIONS 3
enum scan_framework_client {
SCAN_CLIENT_SCHED_SCAN = BIT(0),
SCAN_CLIENT_NETDETECT = BIT(1),
SCAN_CLIENT_ASSET_TRACKING = BIT(2),
};
/**
* struct iwl_scan_offload_cmd - SCAN_REQUEST_FIXED_PART_API_S_VER_6
* @scan_flags: see enum iwl_scan_flags
* @channel_count: channels in channel list
* @quiet_time: dwell time, in milisiconds, on quiet channel
* @quiet_plcp_th: quiet channel num of packets threshold
* @good_CRC_th: passive to active promotion threshold
* @rx_chain: RXON rx chain.
* @max_out_time: max uSec to be out of assoceated channel
* @suspend_time: pause scan this long when returning to service channel
* @flags: RXON flags
* @filter_flags: RXONfilter
* @tx_cmd: tx command for active scan; for 2GHz and for 5GHz.
* @direct_scan: list of SSIDs for directed active scan
* @scan_type: see enum iwl_scan_type.
* @rep_count: repetition count for each scheduled scan iteration.
*/
struct iwl_scan_offload_cmd {
__le16 len;
u8 scan_flags;
u8 channel_count;
__le16 quiet_time;
__le16 quiet_plcp_th;
__le16 good_CRC_th;
__le16 rx_chain;
__le32 max_out_time;
__le32 suspend_time;
/* RX_ON_FLAGS_API_S_VER_1 */
__le32 flags;
__le32 filter_flags;
struct iwl_tx_cmd tx_cmd[2];
/* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
__le32 scan_type;
__le32 rep_count;
} __packed;
enum iwl_scan_offload_channel_flags {
IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE = BIT(0),
IWL_SCAN_OFFLOAD_CHANNEL_NARROW = BIT(22),
IWL_SCAN_OFFLOAD_CHANNEL_FULL = BIT(24),
IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL = BIT(25),
};
/**
* iwl_scan_channel_cfg - SCAN_CHANNEL_CFG_S
* @type: bitmap - see enum iwl_scan_offload_channel_flags.
* 0: passive (0) or active (1) scan.
* 1-20: directed scan to i'th ssid.
* 22: channel width configuation - 1 for narrow.
* 24: full scan.
* 25: partial scan.
* @channel_number: channel number 1-13 etc.
* @iter_count: repetition count for the channel.
* @iter_interval: interval between two innteration on one channel.
* @dwell_time: entry 0 - active scan, entry 1 - passive scan.
*/
struct iwl_scan_channel_cfg {
__le32 type[IWL_MAX_SCAN_CHANNELS];
__le16 channel_number[IWL_MAX_SCAN_CHANNELS];
__le16 iter_count[IWL_MAX_SCAN_CHANNELS];
__le32 iter_interval[IWL_MAX_SCAN_CHANNELS];
u8 dwell_time[IWL_MAX_SCAN_CHANNELS][2];
} __packed;
/**
* iwl_scan_offload_cfg - SCAN_OFFLOAD_CONFIG_API_S
* @scan_cmd: scan command fixed part
* @channel_cfg: scan channel configuration
* @data: probe request frames (one per band)
*/
struct iwl_scan_offload_cfg {
struct iwl_scan_offload_cmd scan_cmd;
struct iwl_scan_channel_cfg channel_cfg;
u8 data[0];
} __packed;
/**
* iwl_scan_offload_blacklist - SCAN_OFFLOAD_BLACKLIST_S
* @ssid: MAC address to filter out
* @reported_rssi: AP rssi reported to the host
* @client_bitmap: clients ignore this entry - enum scan_framework_client
*/
struct iwl_scan_offload_blacklist {
u8 ssid[ETH_ALEN];
u8 reported_rssi;
u8 client_bitmap;
} __packed;
enum iwl_scan_offload_network_type {
IWL_NETWORK_TYPE_BSS = 1,
IWL_NETWORK_TYPE_IBSS = 2,
IWL_NETWORK_TYPE_ANY = 3,
};
enum iwl_scan_offload_band_selection {
IWL_SCAN_OFFLOAD_SELECT_2_4 = 0x4,
IWL_SCAN_OFFLOAD_SELECT_5_2 = 0x8,
IWL_SCAN_OFFLOAD_SELECT_ANY = 0xc,
};
/**
* iwl_scan_offload_profile - SCAN_OFFLOAD_PROFILE_S
* @ssid_index: index to ssid list in fixed part
* @unicast_cipher: encryption olgorithm to match - bitmap
* @aut_alg: authentication olgorithm to match - bitmap
* @network_type: enum iwl_scan_offload_network_type
* @band_selection: enum iwl_scan_offload_band_selection
* @client_bitmap: clients waiting for match - enum scan_framework_client
*/
struct iwl_scan_offload_profile {
u8 ssid_index;
u8 unicast_cipher;
u8 auth_alg;
u8 network_type;
u8 band_selection;
u8 client_bitmap;
u8 reserved[2];
} __packed;
/**
* iwl_scan_offload_profile_cfg - SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1
* @blaclist: AP list to filter off from scan results
* @profiles: profiles to search for match
* @blacklist_len: length of blacklist
* @num_profiles: num of profiles in the list
* @match_notify: clients waiting for match found notification
* @pass_match: clients waiting for the results
* @active_clients: active clients bitmap - enum scan_framework_client
* @any_beacon_notify: clients waiting for match notification without match
*/
struct iwl_scan_offload_profile_cfg {
struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES];
u8 blacklist_len;
u8 num_profiles;
u8 match_notify;
u8 pass_match;
u8 active_clients;
u8 any_beacon_notify;
u8 reserved[2];
} __packed;
/**
* iwl_scan_offload_schedule - schedule of scan offload
* @delay: delay between iterations, in seconds.
* @iterations: num of scan iterations
* @full_scan_mul: number of partial scans before each full scan
*/
struct iwl_scan_offload_schedule {
u16 delay;
u8 iterations;
u8 full_scan_mul;
} __packed;
/*
* iwl_scan_offload_flags
*
* IWL_SCAN_OFFLOAD_FLAG_PASS_ALL: pass all results - no filtering.
* IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL: add cached channels to partial scan.
* IWL_SCAN_OFFLOAD_FLAG_ENERGY_SCAN: use energy based scan before partial scan
* on A band.
*/
enum iwl_scan_offload_flags {
IWL_SCAN_OFFLOAD_FLAG_PASS_ALL = BIT(0),
IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL = BIT(2),
IWL_SCAN_OFFLOAD_FLAG_ENERGY_SCAN = BIT(3),
};
/**
* iwl_scan_offload_req - scan offload request command
* @flags: bitmap - enum iwl_scan_offload_flags.
* @watchdog: maximum scan duration in TU.
* @delay: delay in seconds before first iteration.
* @schedule_line: scan offload schedule, for fast and regular scan.
*/
struct iwl_scan_offload_req {
__le16 flags;
__le16 watchdog;
__le16 delay;
__le16 reserved;
struct iwl_scan_offload_schedule schedule_line[2];
} __packed;
enum iwl_scan_offload_compleate_status {
IWL_SCAN_OFFLOAD_COMPLETED = 1,
IWL_SCAN_OFFLOAD_ABORTED = 2,
};
/**
* iwl_scan_offload_complete - SCAN_OFFLOAD_COMPLETE_NTF_API_S_VER_1
* @last_schedule_line: last schedule line executed (fast or regular)
* @last_schedule_iteration: last scan iteration executed before scan abort
* @status: enum iwl_scan_offload_compleate_status
*/
struct iwl_scan_offload_complete {
u8 last_schedule_line;
u8 last_schedule_iteration;
u8 status;
u8 reserved;
} __packed;
/**
* iwl_sched_scan_results - SCAN_OFFLOAD_MATCH_FOUND_NTF_API_S_VER_1
* @ssid_bitmap: SSIDs indexes found in this iteration
* @client_bitmap: clients that are active and wait for this notification
*/
struct iwl_sched_scan_results {
__le16 ssid_bitmap;
u8 client_bitmap;
u8 reserved;
};
#endif
| iwinoto/v4l-media_build-devel | media/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h | C | gpl-2.0 | 20,156 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
30524,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Martin Jansen <mj@php.net> |
// | Tomas V.V.Cox <cox@idecnet.com> |
// | Jan Lehnardt <jan@php.net> |
// | Kai Schrder <k.schroeder@php.net> |
// | Craig Constantine <cconstantine@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: Ping.php,v 1.50 2009/01/27 20:14:00 cconstantine Exp $
require_once "PEAR.php";
require_once "OS/Guess.php";
define('NET_PING_FAILED_MSG', 'execution of ping failed' );
define('NET_PING_HOST_NOT_FOUND_MSG', 'unknown host' );
define('NET_PING_INVALID_ARGUMENTS_MSG', 'invalid argument array' );
define('NET_PING_CANT_LOCATE_PING_BINARY_MSG', 'unable to locate the ping binary');
define('NET_PING_RESULT_UNSUPPORTED_BACKEND_MSG', 'Backend not Supported' );
define('NET_PING_FAILED', 0);
define('NET_PING_HOST_NOT_FOUND', 1);
define('NET_PING_INVALID_ARGUMENTS', 2);
define('NET_PING_CANT_LOCATE_PING_BINARY', 3);
define('NET_PING_RESULT_UNSUPPORTED_BACKEND', 4);
/**
* Wrapper class for ping calls
*
* Usage:
*
* <?php
* require_once "Net/Ping.php";
* $ping = Net_Ping::factory();
* if(PEAR::isError($ping)) {
* echo $ping->getMessage();
* } else {
* $ping->setArgs(array('count' => 2));
* var_dump($ping->ping('example.com'));
* }
* ?>
*
* @author Jan Lehnardt <jan@php.net>
* @version $Revision: 1.50 $
* @package Net
* @access public
*/
class Net_Ping
{
/**
* Location where the ping program is stored
*
* @var string
* @access private
*/
var $_ping_path = "";
/**
* Array with the result from the ping execution
*
* @var array
* @access private
*/
var $_result = array();
/**
* OS_Guess instance
*
* @var object
* @access private
*/
var $_OS_Guess = "";
/**
* OS_Guess->getSysname result
*
* @var string
* @access private
*/
var $_sysname = "";
/**
* Ping command arguments
*
* @var array
* @access private
*/
var $_args = array();
/**
* Indicates if an empty array was given to setArgs
*
* @var boolean
* @access private
*/
var $_noArgs = true;
/**
* Contains the argument->option relation
*
* @var array
* @access private
*/
var $_argRelation = array();
/**
* Constructor for the Class
*
* @access private
*/
function Net_Ping($ping_path, $sysname)
{
$this->_ping_path = $ping_path;
$this->_sysname = $sysname;
$this->_initArgRelation();
} /* function Net_Ping() */
/**
* Factory for Net_Ping
*
* @access public
*/
function factory()
{
$ping_path = '';
$sysname = Net_Ping::_setSystemName();
if (($ping_path = Net_Ping::_setPingPath($sysname)) == NET_PING_CANT_LOCATE_PING_BINARY) {
return PEAR::raiseError(NET_PING_CANT_LOCATE_PING_BINARY_MSG, NET_PING_CANT_LOCATE_PING_BINARY);
} else {
return new Net_Ping($ping_path, $sysname);
}
} /* function factory() */
/**
* Resolve the system name
*
* @access private
*/
function _setSystemName()
{
$OS_Guess = new OS_Guess;
$sysname = $OS_Guess->getSysname();
// Refine the sysname for different Linux bundles/vendors. (This
// should go away if OS_Guess was ever extended to give vendor
// and vendor-version guesses.)
//
// Bear in mind that $sysname is eventually used to craft a
// method name to figure out which backend gets used to parse
// the ping output. Elsewhere, we'll set $sysname back before
// that.
if ('linux' == $sysname) {
if ( file_exists('/etc/lsb-release')
&& false !== ($release=@file_get_contents('/etc/lsb-release'))
&& preg_match('/gutsy/i', $release)
) {
$sysname = 'linuxredhat9';
}
else if ( file_exists('/etc/debian_version') ) {
$sysname = 'linuxdebian';
}else if (file_exists('/etc/redhat-release')
&& false !== ($release= @file_get_contents('/etc/redhat-release'))
)
{
if (preg_match('/release 8/i', $release)) {
$sysname = 'linuxredhat8';
}elseif (preg_match('/release 9/i', $release)) {
$sysname = 'linuxredhat9';
}
}
}
return $sysname;
} /* function _setSystemName */
/**
* Set the arguments array
*
* @param array $args Hash with options
* @return mixed true or PEAR_error
* @access public
*/
function setArgs($args)
{
if (!is_array($args)) {
return PEAR::raiseError(NET_PING_INVALID_ARGUMENTS_MSG, NET_PING_INVALID_ARGUMENTS);
}
$this->_setNoArgs($args);
$this->_args = $args;
return true;
} /* function setArgs() */
/**
* Set the noArgs flag
*
* @param array $args Hash with options
* @return void
* @access private
*/
function _setNoArgs($args)
{
if (0 == count($args)) {
$this->_noArgs = true;
} else {
$this->_noArgs = false;
}
} /* function _setNoArgs() */
/**
* Sets the system's path to the ping binary
*
* @access private
*/
function _setPingPath($sysname)
{
$status = '';
$output = array();
$ping_path = '';
if ("windows" == $sysname) {
return "ping";
} else {
$ping_path = exec("which ping", $output, $status);
if (0 != $status) {
return NET_PING_CANT_LOCATE_PING_BINARY;
} else {
// be certain "which" did what we expect. (ref bug #12791)
if ( is_executable($ping_path) ) {
return $ping_path;
}
else {
return NET_PING_CANT_LOCATE_PING_BINARY;
}
}
}
} /* function _setPingPath() */
/**
* Creates the argument list according to platform differences
*
* @return string Argument line
* @access private
*/
function _createArgList()
{
$retval = array();
$timeout = "";
$iface = "";
$ttl = "";
$count = "";
$quiet = "";
$size = "";
$seq = "";
$deadline = "";
foreach($this->_args AS $option => $value) {
if(!empty($option) && isset($this->_argRelation[$this->_sysname][$option]) && NULL != $this->_argRelation[$this->_sysname][$option]) {
${$option} = $this->_argRelation[$this->_sysname][$option]." ".$value." ";
}
}
switch($this->_sysname) {
case "sunos":
if ($size || $count || $iface) {
/* $size and $count must be _both_ defined */
$seq = " -s ";
if ($size == "") {
$size = " 56 ";
}
if ($count == "") {
$count = " 5 ";
}
}
$retval['pre'] = $iface.$seq.$ttl;
$retval['post'] = $size.$count;
break;
case "freebsd":
$retval['pre'] = $quiet.$count.$ttl.$timeout;
$retval['post'] = "";
break;
case "darwin":
$retval['pre'] = $count.$timeout.$size;
$retval['post'] = "";
break;
case "netbsd":
$retval['pre'] = $quiet.$count.$iface.$size.$ttl.$timeout;
$retval['post'] = "";
break;
case "openbsd":
$retval['pre'] = $quiet.$count.$iface.$size.$ttl.$timeout;
$retval['post'] = "";
break;
case "linux":
$retval['pre'] = $quiet.$deadline.$count.$ttl.$size.$timeout;
$retval['post'] = "";
break;
case "linuxdebian":
$retval['pre'] = $quiet.$count.$ttl.$size.$timeout;
$retval['post'] = "";
$this->_sysname = 'linux'; // undo linux vendor refinement hack
break;
case "linuxredhat8":
$retval['pre'] = $iface.$ttl.$count.$quiet.$size.$deadline;
$retval['post'] = "";
$this->_sysname = 'linux'; // undo linux vendor refinement hack
break;
case "linuxredhat9":
$retval['pre'] = $timeout.$iface.$ttl.$count.$quiet.$size.$deadline;
$retval['post'] = "";
$this->_sysname = 'linux'; // undo linux vendor refinement hack
break;
case "windows":
$retval['pre'] = $count.$ttl.$timeout;
$retval['post'] = "";
break;
case "hpux":
$retval['pre'] = $ttl;
$retval['post'] = $size.$count;
break;
case "aix":
$retval['pre'] = $count.$timeout.$ttl.$size;
$retval['post'] = "";
break;
default:
$retval['pre'] = "";
$retval['post'] = "";
break;
}
return($retval);
} /* function _createArgList() */
/**
* Execute ping
*
* @param string $host hostname
* @return mixed String on error or array with the result
* @access public
*/
function ping($host)
{
if($this->_noArgs) {
$this->setArgs(array('count' => 3));
}
$argList = $this->_createArgList();
$cmd = $this->_ping_path." ".$argList['pre']." ".$host." ".$argList['post'];
// since we return a new instance of Net_Ping_Result (on
// success), users may call the ping() method repeatedly to
// perform unrelated ping tests Make sure we don't have raw data
// from a previous call laying in the _result array.
$this->_result = array();
exec($cmd, $this->_result);
if (!is_array($this->_result)) {
return PEAR::raiseError(NET_PING_FAILED_MSG, NET_PING_FAILED);
}
if (count($this->_result) == 0) {
return PEAR::raiseError(NET_PING_HOST_NOT_FOUND_MSG, NET_PING_HOST_NOT_FOUND);
}
else {
// Here we pass $this->_sysname to the factory(), but it is
// not actually used by the class. It's only maintained in
// the Net_Ping_Result class because the
// Net_Ping_Result::getSysName() method needs to be retained
// for backwards compatibility.
return Net_Ping_Result::factory($this->_result, $this->_sysname);
}
} /* function ping() */
/**
* Check if a host is up by pinging it
*
* @param string $host The host to test
* @param bool $severely If some of the packages did reach the host
* and severely is false the function will return true
* @return bool True on success or false otherwise
*
*/
function checkHost($host, $severely = true)
{
$matches = array();
$this->setArgs(array("count" => 10,
"size" => 32,
"quiet" => null,
"deadline" => 10
)
);
$res = $this->ping($host);
if (PEAR::isError($res)) {
return false;
}
if ($res->_received == 0) {
return false;
}
if ($res->_received != $res->_transmitted && $severely) {
return false;
}
return true;
} /* function checkHost() */
/**
* Output errors with PHP trigger_error(). You can silence the errors
* with prefixing a "@" sign to the function call: @Net_Ping::ping(..);
*
* @param mixed $error a PEAR error or a string with the error message
* @return bool false
* @access private
* @author Kai Schrder <k.schroeder@php.net>
*/
function _raiseError($error)
{
if (PEAR::isError($error)) {
$error = $error->getMessage();
}
trigger_error($error, E_USER_WARNING);
return false;
} /* function _raiseError() */
/**
* Creates the argument list according to platform differences
*
* @return string Argument line
* @access private
*/
function _initArgRelation()
{
$this->_argRelation["sunos"] = array(
"timeout" => NULL,
"ttl" => "-t",
"count" => " ",
"quiet" => "-q",
"size" => " ",
"iface" => "-i"
);
$this->_argRelation["freebsd"] = array (
"timeout" => "-t",
"ttl" => "-m",
"count" => "-c",
"quiet" => "-q",
"size" => NULL,
"iface" => NULL
);
$this->_argRelation["netbsd"] = array (
"timeout" => "-w",
"iface" => "-I",
"ttl" => "-T",
"count" => "-c",
"quiet" => "-q",
"size" => "-s"
);
$this->_argRelation["openbsd"] = array (
"timeout" => "-w",
"iface" => "-I",
"ttl" => "-t",
"count" => "-c",
"quiet" => "-q",
"size" => "-s"
);
$this->_argRelation["darwin"] = array (
"timeout" => "-t",
"iface" => NULL,
"ttl" => NULL,
"count" => "-c",
"quiet" => "-q",
"size" => NULL
);
$this->_argRelation["linux"] = array (
"timeout" => "-W",
"iface" => NULL,
"ttl" => "-t",
"count" => "-c",
"quiet" => "-q",
"size" => "-s",
"deadline" => "-w"
);
$this->_argRelation["linuxdebian"] = array (
"timeout" => "-W",
"iface" => NULL,
"ttl" => "-t",
"count" => "-c",
"quiet" => "-q",
"size" => "-s",
"deadline" => "-w",
);
$this->_argRelation["linuxredhat8"] = array (
"timeout" => NULL,
"iface" => "-I",
"ttl" => "-t",
"count" => "-c",
"quiet" => "-q",
"size" => "-s",
"deadline" => "-w"
);
$this->_argRelation["linuxredhat9"] = array (
"timeout" => "-W",
"iface" => "-I",
"ttl" => "-t",
"count" => "-c",
"quiet" => "-q",
"size" => "-s",
"deadline" => "-w"
);
$this->_argRelation["windows"] = array (
"timeout" => "-w",
"iface" => NULL,
"ttl" => "-i",
"count" => "-n",
"quiet" => NULL,
"size" => "-l"
);
$this->_argRelation["hpux"] = array (
"timeout" => NULL,
"iface" => NULL,
"ttl" => "-t",
"count" => "-n",
"quiet" => NULL,
"size" => " "
);
$this->_argRelation["aix"] = array (
"timeout" => "-i",
"iface" => NULL,
"ttl" => "-T",
"count" => "-c",
"quiet" => NULL,
"size" => "-s"
);
} /* function _initArgRelation() */
} /* class Net_Ping */
/**
* Container class for Net_Ping results
*
* @author Jan Lehnardt <jan@php.net>
* @version $Revision: 1.50 $
* @package Net
* @access private
*/
class Net_Ping_Result
{
/**
* ICMP sequence number and associated time in ms
*
* @var array
* @access private
*/
var $_icmp_sequence = array(); /* array($sequence_number => $time ) */
/**
* The target's IP Address
*
* @var string
* @access private
*/
var $_target_ip;
/**
* Number of bytes that are sent with each ICMP request
*
* @var int
* @access private
*/
var $_bytes_per_request;
/**
* The total number of bytes that are sent with all ICMP requests
*
* @var int
* @access private
*/
var $_bytes_total;
/**
* The ICMP request's TTL
*
* @var int
* @access private
*/
var $_ttl;
/**
* The raw Net_Ping::result
*
* @var array
* @access private
*/
var $_raw_data = array();
/**
* The Net_Ping::_sysname
*
* @var int
* @access private
*/
var $_sysname;
/**
* Statistical information about the ping
*
* @var int
* @access private
*/
var $_round_trip = array(); /* array('min' => xxx, 'avg' => yyy, 'max' => zzz) */
/**
* Constructor for the Class
*
* @access private
*/
function Net_Ping_Result($result, $sysname)
{
$this->_raw_data = $result;
// The _sysname property is no longer used by Net_Ping_result.
// The property remains for backwards compatibility so the
// getSystemName() method continues to work.
$this->_sysname = $sysname;
$this->_parseResult();
} /* function Net_Ping_Result() */
/**
* Factory for Net_Ping_Result
*
* @access public
* @param array $result Net_Ping result
* @param string $sysname OS_Guess::sysname
*/
function factory($result, $sysname)
{
return new Net_Ping_Result($result, $sysname);
} /* function factory() */
/**
* Parses the raw output from the ping utility.
*
* @access private
*/
function _parseResult()
{
// MAINTAINERS:
//
// If you're in this class fixing or extending the parser
// please add another file in the 'tests/test_parser_data/'
// directory which exemplafies the problem. And of course
// you'll want to run the 'tests/test_parser.php' (which
// contains easy how-to instructions) to make sure you haven't
// broken any existing behaviour.
// operate on a copy of the raw output since we're going to modify it
$data = $this->_raw_data;
// remove leading and trailing blank lines from output
$this->_parseResultTrimLines($data);
// separate the output into upper and lower portions,
// and trim those portions
$this->_parseResultSeparateParts($data, $upper, $lower);
$this->_parseResultTrimLines($upper);
$this->_parseResultTrimLines($lower);
// extract various things from the ping output . . .
$this->_target_ip = $this->_parseResultDetailTargetIp($upper);
$this->_bytes_per_request = $this->_parseResultDetailBytesPerRequest($upper);
$this->_ttl = $this->_parseResultDetailTtl($upper);
$this->_icmp_sequence = $this->_parseResultDetailIcmpSequence($upper);
$this->_round_trip = $this->_parseResultDetailRoundTrip($lower);
$this->_parseResultDetailTransmitted($lower);
$this->_parseResultDetailReceived($lower);
$this->_parseResultDetailLoss($lower);
if ( isset($this->_transmitted) ) {
$this->_bytes_total = $this->_transmitted * $this->_bytes_per_request;
}
} /* function _parseResult() */
/**
* determinces the number of bytes sent by ping per ICMP ECHO
*
* @access private
*/
function _parseResultDetailBytesPerRequest($upper)
{
// The ICMP ECHO REQUEST and REPLY packets should be the same
// size. So we can also find what we want in the output for any
// succesful ICMP reply which ping printed.
for ( $i=1; $i<count($upper); $i++ ) {
// anything like "64 bytes " at the front of any line in $upper??
if ( preg_match('/^\s*(\d+)\s*bytes/i', $upper[$i], $matches) ) {
return( (int)$matches[1] );
}
// anything like "bytes=64" in any line in the buffer??
if ( preg_match('/bytes=(\d+)/i', $upper[$i], $matches) ) {
return( (int)$matches[1] );
}
}
// Some flavors of ping give two numbers, as in "n(m) bytes", on
// the first line. We'll take the first number and add 8 for the
// 8 bytes of header and such in an ICMP ECHO REQUEST.
if ( preg_match('/(\d+)\(\d+\)\D+$/', $upper[0], $matches) ) {
return( (int)(8+$matches[1]) );
}
// Ok we'll just take the rightmost number on the first line. It
// could be "bytes of data" or "whole packet size". But to
// distinguish would require language-specific patterns. Most
// ping flavors just put the number of data (ie, payload) bytes
// if they don't specify both numbers as n(m). So we add 8 bytes
// for the ICMP headers.
if ( preg_match('/(\d+)\D+$/', $upper[0], $matches) ) {
return( (int)(8+$matches[1]) );
}
// then we have no idea...
return( NULL );
}
/**
* determines the round trip time (RTT) in milliseconds for each
* ICMP ECHO which returned. Note that the array is keyed with the
* sequence number of each packet; If any packets are lost, the
* corresponding sequence number will not be found in the array keys.
*
* @access private
*/
function _parseResultDetailIcmpSequence($upper)
{
// There is a great deal of variation in the per-packet output
// from various flavors of ping. There are language variations
// (time=, rtt=, zeit=, etc), field order variations, and some
// don't even generate sequence numbers.
//
// Since our goal is to build an array listing the round trip
// times of each packet, our primary concern is to locate the
// time. The best way seems to be to look for an equals
// character, a number and then 'ms'. All the "time=" versions
// of ping will match this methodology, and all the pings which
// don't show "time=" (that I've seen examples from) also match
// this methodolgy.
$results = array();
for ( $i=1; $i<count($upper); $i++ ) {
// by our definition, it's not a success line if we can't
// find the time
if ( preg_match('/=\s*([\d+\.]+)\s*ms/i', $upper[$i], $matches) ) {
// float cast deals neatly with values like "126." which
// some pings generate
$rtt = (float)$matches[1];
// does the line have an obvious sequence number?
if ( preg_match('/icmp_seq\s*=\s*([\d+]+)/i', $upper[$i], $matches) ) {
$results[$matches[1]] = $rtt;
}
else {
// we use the number of the line as the sequence number
$results[($i-1)] = $rtt;
}
}
}
return( $results );
}
/**
* Locates the "packets lost" percentage in the ping output
*
* @access private
*/
function _parseResultDetailLoss($lower)
{
for ( $i=1; $i<count($lower); $i++ ) {
if ( preg_match('/(\d+)%/', $lower[$i], $matches) ) {
$this->_loss = (int)$matches[1];
return;
}
}
}
/**
* Locates the "packets received" in the ping output
*
* @access private
*/
function _parseResultDetailReceived($lower)
{
for ( $i=1; $i<count($lower); $i++ ) {
// the second number on the line
if ( preg_match('/^\D*\d+\D+(\d+)/', $lower[$i], $matches) ) {
$this->_received = (int)$matches[1];
return;
}
}
}
/**
* determines the mininum, maximum, average and standard deviation
* of the round trip times.
*
* @access private
*/
function _parseResultDetailRoundTrip($lower)
{
// The first pattern will match a sequence of 3 or 4
// alaphabet-char strings separated with slashes without
// presuming the order. eg, "min/max/avg" and
// "min/max/avg/mdev". Some ping flavors don't have the standard
// deviation value, and some have different names for it when
// present.
$p1 = '[a-z]+/[a-z]+/[a-z]+/?[a-z]*';
// And the pattern for 3 or 4 numbers (decimal values permitted)
// separated by slashes.
$p2 = '[0-9\.]+/[0-9\.]+/[0-9\.]+/?[0-9\.]*';
$results = array();
$matches = array();
for ( $i=(count($lower)-1); $i>=0; $i-- ) {
if ( preg_match('|('.$p1.')[^0-9]+('.$p2.')|i', $lower[$i], $matches) ) {
break;
}
}
// matches?
if ( count($matches) > 0 ) {
// we want standardized keys in the array we return. Here we
// look for the values (min, max, etc) and setup the return
// hash
$fields = explode('/', $matches[1]);
$values = explode('/', $matches[2]);
for ( $i=0; $i<count($fields); $i++ ) {
if ( preg_match('/min/i', $fields[$i]) ) {
$results['min'] = (float)$values[$i];
}
else if ( preg_match('/max/i', $fields[$i]) ) {
$results['max'] = (float)$values[$i];
}
else if ( preg_match('/avg/i', $fields[$i]) ) {
$results['avg'] = (float)$values[$i];
}
else if ( preg_match('/dev/i', $fields[$i]) ) { # stddev or mdev
$results['stddev'] = (float)$values[$i];
}
}
return( $results );
}
// So we had no luck finding RTT info in a/b/c layout. Some ping
// flavors give the RTT information in an "a=1 b=2 c=3" sort of
// layout.
$p3 = '[a-z]+\s*=\s*([0-9\.]+).*';
for ( $i=(count($lower)-1); $i>=0; $i-- ) {
if ( preg_match('/min.*max/i', $lower[$i]) ) {
if ( preg_match('/'.$p3.$p3.$p3.'/i', $lower[$i], $matches) ) {
$results['min'] = $matches[1];
$results['max'] = $matches[2];
$results['avg'] = $matches[3];
}
break;
}
}
// either an array of min, max and avg from just above, or still
// the empty array from initialization way above
return( $results );
}
/**
* determinces the target IP address actually used by ping
*
* @access private
*/
function _parseResultDetailTargetIp($upper)
{
// Grab the first IP addr we can find. Most ping flavors
// put the target IP on the first line, but some only list it
// in successful ping packet lines.
for ( $i=0; $i<count($upper); $i++ ) {
if ( preg_match('/(\d+\.\d+\.\d+\.\d+)/', $upper[$i], $matches) ) {
return( $matches[0] );
}
}
// no idea...
return( NULL );
}
/**
* Locates the "packets received" in the ping output
*
* @access private
*/
function _parseResultDetailTransmitted($lower)
{
for ( $i=1; $i<count($lower); $i++ ) {
// the first number on the line
if ( preg_match('/^\D*(\d+)/', $lower[$i], $matches) ) {
$this->_transmitted = (int)$matches[1];
return;
}
}
}
/**
* determinces the time to live (TTL) actually used by ping
*
* @access private
*/
function _parseResultDetailTtl($upper)
{
//extract TTL from first icmp echo line
for ( $i=1; $i<count($upper); $i++ ) {
if ( preg_match('/ttl=(\d+)/i', $upper[$i], $matches)
&& (int)$matches[1] > 0
) {
return( (int)$matches[1] );
}
}
// No idea what ttl was used. Probably because no packets
// received in reply.
return( NULL );
}
/**
* Modifies the array to temoves leading and trailing blank lines
*
* @access private
*/
function _parseResultTrimLines(&$data)
{
if ( !is_array($data) ) {
print_r($this);
exit;
}
// Trim empty elements from the front
while ( preg_match('/^\s*$/', $data[0]) ) {
array_splice($data, 0, 1);
}
// Trim empty elements from the back
while ( preg_match('/^\s*$/', $data[(count($data)-1)]) ) {
array_splice($data, -1, 1);
}
}
/**
* Separates the upper portion (data about individual ICMP ECHO
* packets) and the lower portion (statistics about the ping
* execution as a whole.)
*
* @access private
*/
function _parseResultSeparateParts($data, &$upper, &$lower)
{
$upper = array();
$lower = array();
// find the blank line closest to the end
$dividerIndex = count($data) - 1;
while ( !preg_match('/^\s*$/', $data[$dividerIndex]) ) {
$dividerIndex--;
if ( $dividerIndex < 0 ) {
break;
}
}
// This is horrible; All the other methods assume we're able to
// separate the upper (preamble and per-packet output) and lower
// (statistics and summary output) sections.
if ( $dividerIndex < 0 ) {
$upper = $data;
$lower = $data;
return;
}
for ( $i=0; $i<$dividerIndex; $i++ ) {
$upper[] = $data[$i];
}
for ( $i=(1+$dividerIndex); $i<count($data); $i++ ) {
$lower[] = $data[$i];
}
}
/**
* Returns a Ping_Result property
*
* @param string $name property name
* @return mixed property value
* @access public
*/
function getValue($name)
{
return isset($this->$name)?$this->$name:'';
} /* function getValue() */
/**
* Accessor for $this->_target_ip;
*
* @return string IP address
* @access public
* @see Ping_Result::_target_ip
*/
function getTargetIp()
{
return $this->_target_ip;
} /* function getTargetIp() */
/**
* Accessor for $this->_icmp_sequence;
*
* @return array ICMP sequence
* @access private
* @see Ping_Result::_icmp_sequence
*/
function getICMPSequence()
{
return $this->_icmp_sequence;
} /* function getICMPSequencs() */
/**
* Accessor for $this->_bytes_per_request;
*
* @return int bytes per request
* @access private
* @see Ping_Result::_bytes_per_request
*/
function getBytesPerRequest()
{
return $this->_bytes_per_request;
} /* function getBytesPerRequest() */
/**
* Accessor for $this->_bytes_total;
*
* @return int total bytes
* @access private
* @see Ping_Result::_bytes_total
*/
function getBytesTotal()
{
return $this->_bytes_total;
} /* function getBytesTotal() */
/**
* Accessor for $this->_ttl;
*
* @return int TTL
* @access private
* @see Ping_Result::_ttl
*/
function getTTL()
{
return $this->_ttl;
} /* function getTTL() */
/**
* Accessor for $this->_raw_data;
*
* @return array raw data
* @access private
* @see Ping_Result::_raw_data
*/
function getRawData()
{
return $this->_raw_data;
} /* function getRawData() */
/**
* Accessor for $this->_sysname;
*
* @return string OS_Guess::sysname
* @access private
* @see Ping_Result::_sysname
*/
function getSystemName()
{
return $this->_sysname;
} /* function getSystemName() */
/**
* Accessor for $this->_round_trip;
*
* @return array statistical information
* @access private
* @see Ping_Result::_round_trip
*/
function getRoundTrip()
{
return $this->_round_trip;
} /* function getRoundTrip() */
/**
* Accessor for $this->_round_trip['min'];
*
* @return array statistical information
* @access private
* @see Ping_Result::_round_trip
*/
function getMin()
{
return $this->_round_trip['min'];
} /* function getMin() */
/**
* Accessor for $this->_round_trip['max'];
*
* @return array statistical information
* @access private
* @see Ping_Result::_round_trip
*/
function getMax()
{
return $this->_round_trip['max'];
} /* function getMax() */
/**
* Accessor for $this->_round_trip['stddev'];
*
* @return array statistical information
* @access private
* @see Ping_Result::_round_trip
*/
function getStddev()
{
return $this->_round_trip['stddev'];
} /* function getStddev() */
/**
* Accessor for $this->_round_tripp['avg'];
*
* @return array statistical information
* @access private
* @see Ping_Result::_round_trip
*/
function getAvg()
{
return $this->_round_trip['avg'];
} /* function getAvg() */
/**
* Accessor for $this->_transmitted;
*
* @return array statistical information
* @access private
*/
function getTransmitted()
{
return $this->_transmitted;
} /* function getTransmitted() */
/**
* Accessor for $this->_received;
*
* @return array statistical information
* @access private
*/
function getReceived()
{
return $this->_received;
} /* function getReceived() */
/**
* Accessor for $this->_loss;
*
* @return array statistical information
* @access private
*/
function getLoss()
{
return $this->_loss;
} /* function getLoss() */
} /* class Net_Ping_Result */
?>
| lucor/ortro | plugins/system/ping/lib/Pear/Net/Ping.php | PHP | gpl-2.0 | 38,812 | [
30522,
1026,
1029,
25718,
1013,
1013,
1013,
1013,
1009,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php namespace classes;
class Render
{
//Private properties.
private
$templator,
$template,
$data;
//Set the templator.
public function __construct(BaseTemplator $templator, $template, array $data = [])
{
$this->templator = $templator;
$this->setTemplate($template);
$this->data = $data;
}
//Set the template that we will inject the data into.
public function setTemplate($template)
{
//No template?
if(!is_string($template)){
throw new \exception\InvalidArgument('Expecting $template to be string. %s given.', typeof($template));
}
//Does it exist?
if(!file_exists($template)){
throw new \exception\ResourceMissing('Given template (%s) must be an existing file.', $template);
}
//Set the template.
$this->template = $template;
//Enable chaining.
return $this;
}
//Generate the output.
public function generate()
{
//Store references to the required variables under obscure names.
$___data =& $this->data;
$___path =& $this->template;
//Create the templator function that we will bind to the templator.
$templator = function()use(&$___data, &$___path){
$t = $templator = $this;
extract($___data);
unset($___data);
ob_start();
require($___path);
$r = new OutputData(ob_get_contents(), $t->getHeaders());
ob_end_clean();
return $r;
};
//Bind it.
$templator = $templator->bindTo($this->templator);
//Call it.
return $templator();
}
}
| Tuxion/tuxion.framework | framework/system/classes/Render.php | PHP | gpl-3.0 | 1,602 | [
30522,
1026,
1029,
25718,
3415,
15327,
4280,
1025,
2465,
17552,
1063,
1013,
1013,
2797,
5144,
1012,
2797,
1002,
8915,
8737,
20051,
2953,
1010,
1002,
23561,
1010,
1002,
2951,
1025,
1013,
1013,
2275,
1996,
8915,
8737,
20051,
2953,
1012,
2270,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
*utility.h*
provides feature functions.
author: Kai Zhao, Dezhong Deng
edited by: 02/2018
*/
#ifndef FASTCKY_UTILITY_H
#define FASTCKY_UTILITY_H
#include <algorithm>
#include <cstring>
#include <assert.h>
namespace LinearPartition {
#include "feature_weight.h"
#define INF 1000000007
#define NOTON 5 // NUM_OF_TYPE_OF_NUCS
#define NOTOND 25
#define NOTONT 125
#define EXPLICIT_MAX_LEN 4
#define SINGLE_MIN_LEN 0
#define SINGLE_MAX_LEN 30 // NOTE: *must* <= sizeof(char), otherwise modify State::TraceInfo accordingly
#define MULTI_MAX_LEN 30
#define HAIRPIN_MAX_LEN 30
#define BULGE_MAX_LEN SINGLE_MAX_LEN
#define INTERNAL_MAX_LEN SINGLE_MAX_LEN
#define SYMMETRIC_MAX_LEN 15
#define ASYMMETRY_MAX_LEN 28
#define GET_ACGU_NUM(x) ((x=='A'? 0 : (x=='C'? 1 : (x=='G'? 2 : (x=='U'?3: 4)))))
#define HELIX_STACKING_OLD(x, y, z, w) (_helix_stacking[GET_ACGU_NUM(x)][GET_ACGU_NUM(y)][GET_ACGU_NUM(z)][GET_ACGU_NUM(w)])
bool _allowed_pairs[NOTON][NOTON];
bool _helix_stacking[NOTON][NOTON][NOTON][NOTON];
float cache_single[SINGLE_MAX_LEN+1][SINGLE_MAX_LEN+1];
void initialize_cachesingle()
{
memset(cache_single, 0, sizeof(cache_single));
for (int l1 = SINGLE_MIN_LEN; l1 <= SINGLE_MAX_LEN; l1 ++)
for (int l2 = SINGLE_MIN_LEN; l2 <= SINGLE_MAX_LEN; l2 ++)
{
if (l1 == 0 && l2 == 0)
continue;
// bulge
else if (l1 == 0)
cache_single[l1][l2] += bulge_length[l2];
else if (l2 == 0)
cache_single[l1][l2] += bulge_length[l1];
else
{
// internal
cache_single[l1][l2] += internal_length[std::min(l1+l2, INTERNAL_MAX_LEN)];
// internal explicit
if (l1 <= EXPLICIT_MAX_LEN && l2 <= EXPLICIT_MAX_LEN)
cache_single[l1][l2] +=
internal_explicit[l1<=l2 ? l1*EXPLICIT_MAX_LEN+l2 : l2*EXPLICIT_MAX_LEN+l1];
// internal symmetry
if (l1 == l2)
cache_single[l1][l2] += internal_symmetric_length[std::min(l1, SYMMETRIC_MAX_LEN)];
else { // internal asymmetry
int diff = l1 - l2; if (diff < 0) diff = -diff;
cache_single[l1][l2] += internal_asymmetry[std::min(diff, ASYMMETRY_MAX_LEN)];
}
}
}
return;
}
void initialize()
{
_allowed_pairs[GET_ACGU_NUM('A')][GET_ACGU_NUM('U')] = true;
_allowed_pairs[GET_ACGU_NUM('U')][GET_ACGU_NUM('A')] = true;
_allowed_pairs[GET_ACGU_NUM('C')][GET_ACGU_NUM('G')] = true;
_allowed_pairs[GET_ACGU_NUM('G')][GET_ACGU_NUM('C')] = true;
_allowed_pairs[GET_ACGU_NUM('G')][GET_ACGU_NUM('U')] = true;
_allowed_pairs[GET_ACGU_NUM('U')][GET_ACGU_NUM('G')] = true;
HELIX_STACKING_OLD('A', 'U', 'A', 'U') = true;
HELIX_STACKING_OLD('A', 'U', 'C', 'G') = true;
HELIX_STACKING_OLD('A', 'U', 'G', 'C') = true;
HELIX_STACKING_OLD('A', 'U', 'G', 'U') = true;
HELIX_STACKING_OLD('A', 'U', 'U', 'A') = true;
HELIX_STACKING_OLD('A', 'U', 'U', 'G') = true;
HELIX_STACKING_OLD('C', 'G', 'A', 'U') = true;
HELIX_STACKING_OLD('C', 'G', 'C', 'G') = true;
HELIX_STACKING_OLD('C', 'G', 'G', 'C') = true;
HELIX_STACKING_OLD('C', 'G', 'G', 'U') = true;
HELIX_STACKING_OLD('C', 'G', 'U', 'G') = true;
HELIX_STACKING_OLD('G', 'C', 'A', 'U') = true;
HELIX_STACKING_OLD('G', 'C', 'C', 'G') = true;
HELIX_STACKING_OLD('G', 'C', 'G', 'U') = true;
HELIX_STACKING_OLD('G', 'C', 'U', 'G') = true;
HELIX_STACKING_OLD('G', 'U', 'A', 'U') = true;
HELIX_STACKING_OLD('G', 'U', 'G', 'U') = true;
HELIX_STACKING_OLD('G', 'U', 'U', 'G') = true;
HELIX_STACKING_OLD('U', 'A', 'A', 'U') = true;
HELIX_STACKING_OLD('U', 'A', 'G', 'U') = true;
HELIX_STACKING_OLD('U', 'G', 'G', 'U') = true;
}
// ------------- nucs based scores -------------
// parameters: nucs[i], nucs[j]
inline float base_pair_score(int nuci, int nucj) {
return base_pair[nucj*NOTON + nuci];
}
// parameters: nucs[i], nucs[i+1], nucs[j-1], nucs[j]
inline float helix_stacking_score(int nuci, int nuci1, int nucj_1, int nucj) {
return helix_stacking[nuci*NOTONT + nucj*NOTOND + nuci1*NOTON + nucj_1];
}
// parameters: nucs[i], nucs[j]
inline float helix_closing_score(int nuci, int nucj) {
return helix_closing[nuci*NOTON + nucj];
}
// parameters: nucs[i], nucs[i+1], nucs[j-1], nucs[j]
inline float terminal_mismatch_score(int nuci, int nuci1, int nucj_1, int nucj) {
return terminal_mismatch[nuci*NOTONT+nucj*NOTOND + nuci1*NOTON + nucj_1];
}
// parameter: nucs[i]
inline float bulge_nuc_score(int nuci) {
return bulge_0x1_nucleotides[nuci];
}
// parameters: nucs[i], nucs[j]
inline float internal_nuc_score(int nuci, int nucj) {
return internal_1x1_nucleotides[nuci*NOTON + nucj];
}
// parameters: nucs[i], nucs[i+1], nucs[j]
inline float dangle_left_score(int nuci, int nuci1, int nucj) {
return dangle_left[nuci*NOTOND + nucj*NOTON + nuci1];
}
// parameters: nucs[i], nucs[j-1], nucs[j]
inline float dangle_right_score(int nuci, int nucj_1, int nucj) {
return dangle_right[nuci*NOTOND + nucj*NOTON + nucj_1];
}
// ------------- length based scores -------------
inline float hairpin_score(int i, int j) {
return hairpin_length[std::min(j-i-1, HAIRPIN_MAX_LEN)];
}
inline float internal_length_score(int l) {
return internal_length[std::min(l, INTERNAL_MAX_LEN)];
}
inline float internal_explicit_score(int l1, int l2){
int l1_ = std::min(l1, EXPLICIT_MAX_LEN);
int l2_ = std::min(l2, EXPLICIT_MAX_LEN);
return internal_explicit[l1_<=l2_ ? l1_*NOTON+l2_ : l2_*NOTON+l1_];
}
inline float internal_sym_score(int l) {
return internal_symmetric_length[std::min(l, SYMMETRIC_MAX_LEN)];
}
inline float internal_asym_score(int l1, int l2)
{
int diff = l1 - l2; if (diff < 0) diff = -diff;
return internal_asymmetry[std::min(diff, ASYMMETRY_MAX_LEN)];
}
inline float bulge_length_score(int l){
return bulge_length[std::min(l, BULGE_MAX_LEN)];
}
inline float hairpin_at_least_score(int l) {
return hairpin_length_at_least[std::min(l, HAIRPIN_MAX_LEN)];
}
inline float buldge_length_at_least_score(int l) {
return bulge_length_at_least[std::min(l, BULGE_MAX_LEN)];
}
inline float internal_length_at_least_score(int l) {
return internal_length_at_least[std::min(l, INTERNAL_MAX_LEN)];
}
//-----------------------------------------------------
inline float score_junction_A(int i, int j, int nuci, int nuci1, int nucj_1, int nucj, int len) {
return helix_closing_score(nuci, nucj) +
(i < len - 1 ? dangle_left_score(nuci, nuci1, nucj) : 0) +
(j > 0 ? dangle_right_score(nuci, nucj_1, nucj) : 0);
}
inline float score_junction_B(int i, int j, int nuci, int nuci1, int nucj_1, int nucj) {
return helix_closing_score(nuci, nucj) + terminal_mismatch_score(nuci, nuci1, nucj_1, nucj);
}
inline float score_hairpin_length(int len) {
return hairpin_length[std::min(len, HAIRPIN_MAX_LEN)];
}
inline float score_hairpin(int i, int j, int nuci, int nuci1, int nucj_1, int nucj) {
return hairpin_length[std::min(j-i-1, HAIRPIN_MAX_LEN)] +
score_junction_B(i, j, nuci, nuci1, nucj_1, nucj);
}
inline float score_helix(int nuci, int nuci1, int nucj_1, int nucj) {
return helix_stacking_score(nuci, nuci1, nucj_1, nucj) + base_pair_score(nuci1, nucj_1);
}
inline float score_single_nuc(int i, int j, int p, int q, int nucp_1, int nucq1) {
int l1 = p-i-1, l2=j-q-1;
if (l1==0 && l2==1) return bulge_nuc_score(nucq1);
if (l1==1 && l2==0) return bulge_nuc_score(nucp_1);
if (l1==1 && l2==1) return internal_nuc_score(nucp_1, nucq1);
return 0;
}
inline float score_single(int i, int j, int p, int q, int len,
int nuci, int nuci1, int nucj_1, int nucj,
int nucp_1, int nucp, int nucq, int nucq1) {
int l1 = p-i-1, l2=j-q-1;
return cache_single[l1][l2] +
base_pair_score(nucp, nucq) +
score_junction_B(i, j, nuci, nuci1, nucj_1, nucj) +
score_junction_B(q, p, nucq, nucq1, nucp_1, nucp) +
score_single_nuc(i, j, p, q, nucp_1, nucq1);
}
// score_single without socre_junction_B
inline float score_single_without_junctionB(int i, int j, int p, int q,
int nucp_1, int nucp, int nucq, int nucq1) {
int l1 = p-i-1, l2=j-q-1;
return cache_single[l1][l2] +
base_pair_score(nucp, nucq) +
score_single_nuc(i, j, p, q, nucp_1, nucq1);
}
inline float score_multi(int i, int j, int nuci, int nuci1, int nucj_1, int nucj, int len) {
return score_junction_A(i, j, nuci, nuci1, nucj_1, nucj, len) +
multi_paired + multi_base;
}
inline float score_multi_unpaired(int i, int j) {
return (j-i+1) * multi_unpaired;
}
inline float score_M1(int i, int j, int k, int nuci_1, int nuci, int nuck, int nuck1, int len) {
return score_junction_A(k, i, nuck, nuck1, nuci_1, nuci, len) +
score_multi_unpaired(k+1, j) + base_pair_score(nuci, nuck) + multi_paired;
}
inline float score_external_paired(int i, int j, int nuci_1, int nuci, int nucj, int nucj1, int len) {
return score_junction_A(j, i, nucj, nucj1, nuci_1, nuci, len) +
external_paired + base_pair_score(nuci, nucj);
}
inline float score_external_unpaired(int i, int j) {
return (j-i+1) * external_unpaired;
}
}; // namespace LinearPartition
#endif //FASTCKY_UTILITY_H
| satoken/ipknot | src/linearpartition/Utils/utility.h | C | gpl-3.0 | 9,549 | [
30522,
1013,
1008,
1008,
9710,
1012,
1044,
1008,
3640,
3444,
4972,
1012,
3166,
1024,
11928,
15634,
1010,
2139,
27922,
5063,
26957,
5493,
2011,
1024,
6185,
1013,
2760,
1008,
1013,
1001,
2065,
13629,
2546,
3435,
17413,
1035,
9710,
1035,
1044,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
.clear {display:block; clear:both;}
.mainbox {display:block; width: 100%; margin: 25px auto; font-family:Verdana, Geneva, sans-serif;}
.mainbox .left {display:block; width: 800px; margin 0 auto; border: 1px solid #CCC; }
.mainbox .left h2 { padding-left: 25px; display:block; height: 40px; line-height: 40px; background: #eeeeee; /* Old browsers */
background: -moz-linear-gradient(top, #eeeeee 0%, #dddddd 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#dddddd)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #eeeeee 0%,#dddddd 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #eeeeee 0%,#dddddd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #eeeeee 0%,#dddddd 100%); /* IE10+ */
background: linear-gradient(top, #eeeeee 0%,#dddddd 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#dddddd',GradientType=0 ); /* IE6-9 */
border-bottom: 1px solid #CCC; font-weight: bold; color:#39F;}
.mainbox .left .content {background: #eeeeee; /* Old browsers */
background: -moz-linear-gradient(top, #eeeeee 0%, #eeeeee 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #eeeeee 0%,#eeeeee 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #eeeeee 0%,#eeeeee 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #eeeeee 0%,#eeeeee 100%); /* IE10+ */
background: linear-gradient(top, #eeeeee 0%,#eeeeee 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#eeeeee',GradientType=0 ); /* IE6-9 */
padding: 25px; color: #666;}
.mainbox .left .content fieldset {padding: 15px 0; border-bottom: 5px solid #ccc;}
.mainbox .left .content fieldset.last{ border-bottom: none; }
.mainbox .left .content h3 { padding-top: 0px; margin-top: 0px; padding-bottom: 3px; border-bottom: 1px dotted #3CF; color:#3CF; max-width: 50%; }
.mainbox .left .content fieldset label {display:block; width: 300px; float:left;}
.mainbox .left .content fieldset input[type="text"], .mainbox .left .content fieldset select {display:block; width: 80%; padding: 5px; height: 30px; line-height: 30px;}
.mainbox .left .content fieldset iframe { background: white; }
.mainbox #resetcounter {display:block; float:right; width:40px; cursor:pointer;}
#clickboxholder { position:fixed; background: transparent url(../images/overlay.png) repeat; z-index: 9999999; top: 0px; left: 0px; }
#clickboxholder #clickbox {display:block; margin-left: auto; margin-right: auto; background-color:white; padding: 25px; font-size: 12px; line-height: 16px; -webkit-border-radius: 10px; -moz-border-radius: 10px; -o-border-radius: 10px; border-radius: 10px; border: 5px solid #333; -moz-box-shadow: 0 0 15px #000; -webkit-box-shadow: 0 0 15px #000; box-shadow: 0 0 15px #000;}
#clickboxholder #clickbox p {margin-bottom: 10px;}
#clickboxholder #clickbox #clickpopclose {position:absolute; right:10px; top: 10px; display: block; background: white url(../images/close.png) no-repeat 0 0; width: 28px; height: 28px; cursor:pointer;}
#clickboxholder #clickbox #clickpopclose:hover {background-position: 0 -28px;} | jschnepple/zettablog | wp-content/plugins/zetta-subscribe/styles/style.css | CSS | gpl-2.0 | 3,367 | [
30522,
1012,
3154,
1063,
4653,
1024,
3796,
1025,
3154,
1024,
2119,
1025,
1065,
1012,
2364,
8758,
1063,
4653,
1024,
3796,
1025,
9381,
1024,
2531,
1003,
1025,
7785,
1024,
2423,
2361,
2595,
8285,
1025,
15489,
1011,
2155,
1024,
2310,
26992,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// vim: ts=4 sw=4 expandtab ft=c
// Copyright (C) 1998-2012 The University of Melbourne.
// This file may only be copied under the terms of the GNU Library General
// Public License - see the file COPYING.LIB in the Mercury distribution.
#ifndef MERCURY_STACK_LAYOUT_H
#define MERCURY_STACK_LAYOUT_H
// mercury_stack_layout.h -
//
// Definitions for stack layout data structures. These are generated by the
// compiler, and are used by the parts of the runtime system that need to look
// at the stacks (and sometimes the registers) and make sense of their
// contents. The parts of the runtime system that need to do this include
// exception handling, the debugger, and (eventually) the accurate garbage
// collector.
//
// For a general description of the idea of stack layouts, see the paper
// "Run time type information in Mercury" by Tyson Dowd, Zoltan Somogyi,
// Fergus Henderson, Thomas Conway and David Jeffery, which is available from
// the Mercury web site. The relevant section is section 3.8, but be warned:
// while the general principles remain applicable, the details have changed
// since that paper was written.
//
// NOTE: The constants and data-structures used here need to be kept in
// sync with the ones generated in the compiler. If you change anything here,
// you may need to change stack_layout.m, layout.m, and/or layout_out.m in
// the compiler directory as well.
#include "mercury_types.h"
#include "mercury_std.h" // for MR_VARIABLE_SIZED
#include "mercury_tags.h"
#include "mercury_type_info.h" // for MR_PseudoTypeInfo
#include "mercury_proc_id.h" // for MR_ProcId
#include "mercury_goto.h" // for MR_PROC_LAYOUT etc
#include "mercury_tabling.h" // for MR_TableTrieStep etc
////////////////////////////////////////////////////////////////////////////
// Definitions for MR_Determinism.
// The max_soln component of the determinism is encoded in the 1 and 2 bits.
// The can_fail component of the determinism is encoded in the 4 bit.
// The first_solution component of the determinism is encoded in the 8 bit.
//
// MR_DETISM_AT_MOST_MANY could also be defined as ((d) & 3) == 3),
// but this would be less efficient, since the C compiler does not know
// that we do not set the 1 bit unless we also set the 2 bit.
//
// NOTE: this must match the encoding specified by represent_determinism/1
// in mdbcomp/program_representation.m.
typedef MR_int_least16_t MR_Determinism;
#define MR_DETISM_DET 6
#define MR_DETISM_SEMI 2
#define MR_DETISM_NON 3
#define MR_DETISM_MULTI 7
#define MR_DETISM_ERRONEOUS 4
#define MR_DETISM_FAILURE 0
#define MR_DETISM_CCNON 10
#define MR_DETISM_CCMULTI 14
#define MR_DETISM_MAX 14
#define MR_DETISM_AT_MOST_ZERO(d) (((d) & 3) == 0)
#define MR_DETISM_AT_MOST_ONE(d) (((d) & 3) == 2)
#define MR_DETISM_AT_MOST_MANY(d) (((d) & 1) != 0)
#define MR_DETISM_CAN_FAIL(d) (((d) & 4) == 0)
#define MR_DETISM_FIRST_SOLN(d) (((d) & 8) != 0)
#define MR_DETISM_DET_STACK(d) (!MR_DETISM_AT_MOST_MANY(d) \
|| MR_DETISM_FIRST_SOLN(d))
////////////////////////////////////////////////////////////////////////////
// Definitions for MR_LongLval and MR_ShortLval.
// MR_LongLval is an MR_Unsigned which describes a location.
// This includes lvals such as stack slots, general registers, and special
// registers such as succip, hp, etc, as well as locations whose address is
// given as a typeinfo inside the type class info structure pointed to by an
// lval.
//
// What kind of location an MR_LongLval refers to is encoded using
// a low tag with MR_LONG_LVAL_TAGBITS bits; the type MR_LongLvalType
// describes the different tag values. The interpretation of the rest of
// the word depends on the location type:
//
// Locn Rest
//
// MR_r(Num) Num (register number)
// MR_f(Num) Num (register number)
// MR_stackvar(Num) Num (stack slot number)
// MR_framevar(Num) Num (stack slot number)
// MR_succip
// MR_maxfr
// MR_curfr
// MR_hp
// MR_sp
// constant See below
// indirect(Base, N) See below
// unknown (The location is not known)
//
// For constants, the rest of the word is a pointer to static data. The
// pointer has only two low tag bits free, so we reserve every four-bit tag
// which has 00 as its bottom two bits for representing them.
//
// For indirect references, the word exclusive of the tag consists of
// (a) an integer with MR_LONG_LVAL_OFFSETBITS bits giving the index of
// the typeinfo inside a type class info (to be interpreted by
// MR_typeclass_info_type_info or the predicate
// private_builtin.type_info_from_typeclass_info, which calls it) and
// (b) a MR_LongLval value giving the location of the pointer to the
// type class info. This MR_LongLval value will *not* have an indirect tag.
//
// This data is generated in stack_layout.represent_locn_as_int,
// which must be kept in sync with the constants and macros defined here.
typedef MR_Unsigned MR_LongLval;
typedef enum {
MR_LONG_LVAL_TYPE_CONS_0 = 0,
MR_LONG_LVAL_TYPE_R = 1,
MR_LONG_LVAL_TYPE_F = 2,
MR_LONG_LVAL_TYPE_STACKVAR = 3,
MR_LONG_LVAL_TYPE_CONS_1 = 4,
MR_LONG_LVAL_TYPE_FRAMEVAR = 5,
MR_LONG_LVAL_TYPE_SUCCIP = 6,
MR_LONG_LVAL_TYPE_MAXFR = 7,
MR_LONG_LVAL_TYPE_CONS_2 = 8,
MR_LONG_LVAL_TYPE_CURFR = 9,
MR_LONG_LVAL_TYPE_HP = 10,
MR_LONG_LVAL_TYPE_SP = 11,
MR_LONG_LVAL_TYPE_CONS_3 = 12,
MR_LONG_LVAL_TYPE_DOUBLE_STACKVAR = 13,
MR_LONG_LVAL_TYPE_DOUBLE_FRAMEVAR = 14,
MR_LONG_LVAL_TYPE_INDIRECT = 15,
MR_LONG_LVAL_TYPE_CONS_4 = 16,
MR_LONG_LVAL_TYPE_UNKNOWN = 17,
MR_LONG_LVAL_TYPE_CONS_5 = 20,
MR_LONG_LVAL_TYPE_CONS_6 = 24,
MR_LONG_LVAL_TYPE_CONS_7 = 28
} MR_LongLvalType;
// This must be in sync with stack_layout.long_lval_tag_bits.
#define MR_LONG_LVAL_TAGBITS 5
#define MR_LONG_LVAL_CONST_TAGBITS 2
#define MR_LONG_LVAL_TYPE(Locn) \
((MR_LongLvalType) ((Locn) & ((1 << MR_LONG_LVAL_TAGBITS) - 1)))
#define MR_LONG_LVAL_NUMBER(Locn) \
((int) ((Locn) >> MR_LONG_LVAL_TAGBITS))
#define MR_LONG_LVAL_CONST(Locn) \
(* (MR_Word *) ((Locn) & ~ ((1 << MR_LONG_LVAL_CONST_TAGBITS) - 1)))
// This must be in sync with stack_layout.offset_bits.
#define MR_LONG_LVAL_OFFSETBITS 6
#define MR_LONG_LVAL_INDIRECT_OFFSET(LocnNumber) \
((int) ((LocnNumber) & ((1 << MR_LONG_LVAL_OFFSETBITS) - 1)))
#define MR_LONG_LVAL_INDIRECT_BASE_LVAL_INT(LocnNumber) \
(((MR_uint_least32_t) (LocnNumber)) >> MR_LONG_LVAL_OFFSETBITS)
#define MR_LONG_LVAL_STACKVAR_INT(n) \
(((n) << MR_LONG_LVAL_TAGBITS) + MR_LONG_LVAL_TYPE_STACKVAR)
#define MR_LONG_LVAL_FRAMEVAR_INT(n) \
(((n) << MR_LONG_LVAL_TAGBITS) + MR_LONG_LVAL_TYPE_FRAMEVAR)
#define MR_LONG_LVAL_R_REG_INT(n) \
(((n) << MR_LONG_LVAL_TAGBITS) + MR_LONG_LVAL_TYPE_R)
// MR_ShortLval is a MR_uint_least8_t which describes an location. This
// includes lvals such as stack slots and general registers that have small
// numbers, and special registers such as succip, hp, etc.
//
// What kind of location an MR_LongLval refers to is encoded using
// a low tag with 2 bits; the type MR_ShortLval_Type describes
// the different tag values. The interpretation of the rest of the word
// depends on the location type:
//
// Locn Tag Rest
// MR_r(Num) 0 Num (register number)
// MR_stackvar(Num) 1 Num (stack slot number)
// MR_framevar(Num) 2 Num (stack slot number)
// special reg 3 MR_LongLvalType
//
// This data is generated in stack_layout.represent_locn_as_byte,
// which must be kept in sync with the constants and macros defined here.
typedef MR_uint_least8_t MR_ShortLval;
typedef enum {
MR_SHORT_LVAL_TYPE_R,
MR_SHORT_LVAL_TYPE_STACKVAR,
MR_SHORT_LVAL_TYPE_FRAMEVAR,
MR_SHORT_LVAL_TYPE_SPECIAL
} MR_ShortLval_Type;
// This must be in sync with stack_layout.short_lval_tag_bits.
#define MR_SHORT_LVAL_TAGBITS 2
#define MR_SHORT_LVAL_TYPE(Locn) \
((MR_ShortLval_Type) \
(((MR_Word) Locn) & ((1 << MR_SHORT_LVAL_TAGBITS) - 1)))
#define MR_SHORT_LVAL_NUMBER(Locn) \
((int) (((MR_Word) Locn) >> MR_SHORT_LVAL_TAGBITS))
#define MR_SHORT_LVAL_STACKVAR(n) \
((MR_ShortLval) (((n) << MR_SHORT_LVAL_TAGBITS) \
+ MR_SHORT_LVAL_TYPE_STACKVAR))
#define MR_SHORT_LVAL_FRAMEVAR(n) \
((MR_ShortLval) (((n) << MR_SHORT_LVAL_TAGBITS) \
+ MR_SHORT_LVAL_TYPE_FRAMEVAR))
#define MR_SHORT_LVAL_R_REG(n) \
((MR_ShortLval) (((n) << MR_SHORT_LVAL_TAGBITS) \
+ MR_SHORT_LVAL_TYPE_R))
////////////////////////////////////////////////////////////////////////////
// Definitions for MR_UserEvent and MR_UserEventSpec.
// Our layout structures link to information about user events from two places:
// the label layout structures of labels that correspond to user events,
// and the module layout structures of modules that contain user events.
// Label layout structures link to MR_UserEvent structures; module layout
// structures link to MR_UserEventSpec structures. Most of the information
// is in the MR_UserEventSpec structures; MR_UserEvent structures contain
// only information that may differ between two instances of the same event.
// The fields of MR_UserEvent:
//
// The event_number field contains the ordinal number of the event in the
// event set the module was compiled with: it gives the identity of the event.
// (Event numbers start at zero.) This field is also the link to the rest of
// the information about the event, contained in the MR_UserEventSpec structure
// linked to by the module layout structure. The MR_user_event_spec macro
// follows this link.
//
// The next two fields all point to arrays whose length is the number of
// attributes (which is available in the MR_UserEventSpec structure).
//
// attr_locns[i] gives the location where we can find the value of the
// i'th attribute (the first attribute is attribute zero). This is
// meaningful only if the attribute is not a synthesized attribute.
//
// attr_var_nums[i] gives the variable number of the i'th attribute;
// if it contains zero, that means the attribute is synthesized. This field
// is used by the debugger to display the associated value just once
// (not twice, as both attribute and variable value) with "print *". (Note
// that we don't delete the variables that are also attributes from the set of
// live variables in layout structures, because that would require any native
// garbage collector to look at the list of attributes as well as the list of
// other variables, slowing it down.)
typedef MR_uint_least16_t MR_HLDSVarNum;
struct MR_UserEvent_Struct {
MR_uint_least16_t MR_ue_event_number;
MR_LongLval *MR_ue_attr_locns;
const MR_HLDSVarNum *MR_ue_attr_var_nums;
};
// The fields of MR_UserEventSpec:
//
// The event_name field contains the name of the event.
//
// The num_attrs field gives the number of attributes.
//
// The next three fields (attr_names, attr_types and synth_attrs) all point
// to arrays whose length is the number of attributes.
//
// attr_names[i] gives the name of the i'th attribute.
//
// attr_types[i] is the typeinfo giving the type of the i'th attribute.
//
// If the i'th attribute is synthesized, synth_attrs[i] points to the
// information required to synthesize it: the number of the attribute
// containing the synthesis function, the number of arguments of the synthesis
// function, and an array of attribute numbers (of length num_arg_attrs)
// giving the list of those arguments. The depend_attrs field will point to
// a list of numbers of the synthesized attributes whose values must be
// materialized before this attribute can be evaluated. (This list will include
// the argument attributes, and will be in a feasible evaluation order.)
// If the i'th attribute is not synthesized, synth_attrs[i] and depend_attrs[i]
// will both be NULL. (For now, depend_attrs[i] will not be filled in for
// synthesized attributes either.)
//
// The synth_attr_order field points to an array of attribute numbers that
// gives the order in which the values of the synthesized attributes should be
// evaluated. The array is ended by -1 as a sentinel.
//
// The synth_attrs and synth_attr_order fields will both be NULL for events
// that have no synthesized attributes.
struct MR_SynthAttr_Struct {
MR_int_least16_t MR_sa_func_attr;
MR_int_least16_t MR_sa_num_arg_attrs;
MR_uint_least16_t *MR_sa_arg_attrs;
MR_int_least16_t *MR_sa_depend_attrs;
};
struct MR_UserEventSpec_Struct {
const char *MR_ues_event_name;
MR_uint_least16_t MR_ues_num_attrs;
const char **MR_ues_attr_names;
MR_TypeInfo *MR_ues_attr_types;
MR_SynthAttr *MR_ues_synth_attrs;
MR_int_least16_t *MR_ues_synth_attr_order;
};
#define MR_user_event_spec(label_layout) \
label_layout->MR_sll_entry->MR_sle_module_layout-> \
MR_ml_user_event_specs[label_layout->MR_sll_user_event-> \
MR_ue_event_number]
#define MR_user_event_set_name(label_layout) \
label_layout->MR_sll_entry->MR_sle_module_layout-> \
MR_ml_user_event_set_name
////////////////////////////////////////////////////////////////////////////
// Definitions for MR_LabelLayout.
// An MR_LabelLayout structure describes the debugging and accurate gc
// information available at a given label.
//
// The MR_sll_entry field points to the proc layout structure of the procedure
// in which the label occurs.
//
// The MR_sll_port field will contain a negative number if there is no
// execution tracing port associated with the label. If there is, the
// field will contain a value of type MR_TracePort. For labels associated
// with events, this will be the port of the event. For return labels,
// this port will be exception (since exception events are associated with
// the return from the call that raised the exception).
//
// The MR_sll_hidden field contains a boolean which is meaningful only if the
// label corresponds to an execution tracing event. It will be MR_HIDDEN if the
// event should have no effects that the user can see (no message printed, no
// increment of the event number etc), and MR_NOT_HIDDEN otherwise. Hidden
// events are sometimes needed by the declarative debugger to provide the
// proper context for other events.
//
// The MR_sll_goal_path field contains an offset into the module-wide string
// table, leading to a string that gives the goal path associated with the
// label. If there is no meaningful goal path associated with the label,
// the offset will be zero, leading to the empty string. You can use the macro
// MR_label_goal_path to convert the value in the MR_sll_goal_path field to a
// string.
//
// A possible alternative would be to represent goal paths using statically
// allocated terms of the reverse_goal_path type. An almost-complete diff
// making that change was posted to the mercury-reviews mailing list on
// 30 Sep 2011, but it was not committed, since it lead to a 4% *increase*
// in the size of asm_fast.gc.debug executables. Even though different goal
// paths share a tail (the part of the path near the root) with the
// static reverse_goal_path term representation but not with the string
// representation, the string representation is so much more compact
// (usually taking 4 to 6 bytes for most steps) than the Mercury term
// representation (1 to 4 words for a step, plus 2 words for the rgp_cons,
// totalling at least 24 bytes per step on 64 bit systems), that the string
// representation is significantly more compact overall. The Mercury term
// representation does have the potential to speed up the implementation of
// the operations in the declarative debugger that need to test whether
// two goal paths represent two different direct components of the same parent
// goal. If the two different goal paths are represented as reverse_goal_paths,
// then doing this test on RGPA and RGPB simply requires the test
//
// RGPA = rgp_cons(ParentRGPA, StepA),
// RGPB = rgp_cons(ParentRGPB, StepB),
// ParentRGPA = ParentRGPB
//
// and the last step can be done by a pointer comparison. This test can be done
// in constant time, whereas the current implementation of the same test
// (the function MR_trace_same_construct in trace/mercury_trace_declarative.c)
// works in linear time.
//
// If the label is the label of a user-defined event, then the
// MR_sll_user_event field will point to information about the user event;
// otherwise, the field will be NULL.
//
// The remaining fields give information about the values live at the given
// label, if this information is available. If it is available, the
// MR_has_valid_var_count macro will return true and the fields after the count
// are meaningful; if it is not available, the macro will return false and
// those fields are not meaningful (i.e. you are looking at an
// MR_LabelLayoutNoVarInfo structure).
//
// The format in which we store information about the values live at the label
// is somewhat complicated, due to our desire to make this information compact.
// We can represent a location in one of two ways, as an 8-bit MR_ShortLval
// or as a 32-bit MR_LongLval. We prefer representing a location as an
// MR_ShortLval, but of course not all locations can be represented in
// this way, so those other locations are represented as MR_LongLvals.
//
// The MR_sll_var_count field, if it is valid, is encoded by the formula
// (#Long << MR_SHORT_COUNT_BITS + #Short), where #Short is the number
// data items whose descriptions fit into an MR_ShortLval and #Long is the
// number of data items whose descriptions do not. (The number of distinct
// values that fit into 8 bits also fits into 8 bits, but since some
// locations hold the value of more than one variable at a time, not all
// the values need to be distinct; this is why MR_SHORT_COUNT_BITS is
// more than 8.)
//
// The MR_sll_types field points to an array of #Long + #Short
// MR_PseudoTypeInfos each giving the type of a live data item, with
// a small integer instead of a pointer representing a special kind of
// live data item (e.g. a saved succip or hp). This field will be null if
// #Long + #Short is zero.
//
// The MR_sll_long_locns field points to an array of #Long MR_LongLvals,
// while the MR_sll_short_locns field points to an array of #Short
// MR_ShortLvals. The element at index i in the MR_sll_long_locns vector
// will have its type described by the element at index i in the MR_sll_types
// vector, while the element at index i in the MR_sll_short_locns vector
// will have its type described by the element at index #Long + i in the
// MR_sll_types vector. MR_sll_long_locns will be NULL if #Long is zero,
// and similarly MR_sll_short_locns will be NULL if #Short is zero.
//
// The MR_sll_var_nums field may be NULL, which means that there is no
// information about the variable numbers of the live values. If the field
// is not NULL, it points to a vector of variable numbers, which has an element
// for each live data item. This is either the live data item's HLDS variable
// number, or one of two special values. Zero means that the live data item
// is not a variable (e.g. it is a saved copy of succip). The largest possible
// 16-bit number on the other hand means "the number of this variable does not
// fit into 16 bits". With the exception of these special values, the value
// in this slot uniquely identifies the live data item. (Not being able to
// uniquely identify nonvariable data items is never a problem. Not being able
// to uniquely identify variables is a problem, at the moment, only to the
// extent that the debugger cannot print their names.)
//
// The types of the live variables may or may not have type variables in them.
// If they do not, the MR_sll_tvars field will be NULL. If they do, it will
// point to an MR_TypeParamLocns structure that gives the locations of the
// typeinfos for those type variables. This structure gives the number of type
// variables and their locations, so that the code that needs the type
// parameters can materialize all the type parameters from their location
// descriptions in one go. This is an optimization, since the type parameter
// vector could simply be indexed on demand by the type variable's variable
// number stored within the MR_PseudoTypeInfos stored inside the vector
// pointed to by the MR_sll_types field.
//
// Since we allocate type variable numbers sequentially, the MR_tp_param_locns
// vector will usually be dense. However, after all variables whose types
// include e.g. type variable 2 have gone out of scope, variables whose
// types include type variable 3 may still be around. In cases like this,
// the entry for type variable 2 will be zero; this signals to the code
// in the internal debugger that materializes typeinfo structures that
// this typeinfo structure need not be materialized. Note that the array
// element MR_tp_param_locns[i] describes the location of the typeinfo
// structure for type variable i+1, since array offsets start at zero
// but type variable numbers start at one.
//
// The MR_sll_label_num_in_module is used for counting the number of times
// the event of this label is executed. It gives the label's index in the
// array pointed to by the module layout's MR_ml_label_exec_count field;
// whenever the event of this label is executed, the element in that array
// indicated by this index will be incremented (when MR_trace_count_enabled
// is set). The array element at index zero is ignored. A label layout will
// have zero in its MR_sll_label_num_in_module field if the label doesn't
// correspond to an event.
//
// XXX: Presently, inst information is ignored; we assume that all live values
// are ground.
#define MR_HIDDEN 1
#define MR_NOT_HIDDEN 0
struct MR_TypeParamLocns_Struct {
MR_uint_least32_t MR_tp_param_count;
MR_LongLval MR_tp_param_locns[MR_VARIABLE_SIZED];
};
struct MR_LabelLayout_Struct {
const MR_ProcLayout *MR_sll_entry;
MR_int_least8_t MR_sll_port;
MR_int_least8_t MR_sll_hidden;
MR_uint_least16_t MR_sll_label_num_in_module;
MR_uint_least32_t MR_sll_goal_path;
const MR_UserEvent *MR_sll_user_event;
MR_Integer MR_sll_var_count; // >= 0, encoding Long > 0
const MR_TypeParamLocns *MR_sll_tvars;
const MR_PseudoTypeInfo *MR_sll_types;
const MR_HLDSVarNum *MR_sll_var_nums;
const MR_ShortLval *MR_sll_short_locns;
const MR_LongLval *MR_sll_long_locns;
};
typedef struct MR_LabelLayoutShort_Struct {
const MR_ProcLayout *MR_sll_entry;
MR_int_least8_t MR_sll_port;
MR_int_least8_t MR_sll_hidden;
MR_uint_least16_t MR_sll_label_num_in_module;
MR_uint_least32_t MR_sll_goal_path;
const MR_UserEvent *MR_sll_user_event;
MR_Integer MR_sll_var_count; // >= 0 , encoding Long == 0
const MR_TypeParamLocns *MR_sll_tvars;
const MR_PseudoTypeInfo *MR_sll_types;
const MR_HLDSVarNum *MR_sll_var_nums;
const MR_ShortLval *MR_sll_short_locns;
} MR_LabelLayoutShort;
typedef struct MR_LabelLayoutNoVarInfo_Struct {
const MR_ProcLayout *MR_sll_entry;
MR_int_least8_t MR_sll_port;
MR_int_least8_t MR_sll_hidden;
MR_uint_least16_t MR_sll_label_num_in_module;
MR_uint_least32_t MR_sll_goal_path;
const MR_UserEvent *MR_sll_user_event;
MR_Integer MR_sll_var_count; // < 0
} MR_LabelLayoutNoVarInfo;
#define MR_label_goal_path(layout) \
((MR_PROC_LAYOUT_HAS_EXEC_TRACE((layout)->MR_sll_entry)) ? \
((layout)->MR_sll_entry->MR_sle_module_layout \
->MR_ml_string_table \
+ ((layout)->MR_sll_goal_path >> 1)) \
: "")
#define MR_SHORT_COUNT_BITS 10
#define MR_SHORT_COUNT_MASK ((1 << MR_SHORT_COUNT_BITS) - 1)
#define MR_has_valid_var_count(sll) \
(((sll)->MR_sll_var_count) >= 0)
#define MR_has_valid_var_info(sll) \
(((sll)->MR_sll_var_count) > 0)
#define MR_short_desc_var_count(sll) \
(((sll)->MR_sll_var_count) & MR_SHORT_COUNT_MASK)
#define MR_long_desc_var_count(sll) \
(((sll)->MR_sll_var_count) >> MR_SHORT_COUNT_BITS)
#define MR_all_desc_var_count(sll) \
(MR_long_desc_var_count(sll) + MR_short_desc_var_count(sll))
#define MR_var_pti(sll, i) \
((sll)->MR_sll_types[(i)])
#define MR_short_desc_var_locn(sll, i) \
((sll)->MR_sll_short_locns[(i)])
#define MR_long_desc_var_locn(sll, i) \
((sll)->MR_sll_long_locns[(i)])
// Define a stack layout for an internal label.
//
// The only useful information in the structures created by this macro
// is the reference to the procedure layout, which allows you to find the
// stack frame size and the succip location, thereby enabling stack tracing.
//
// For the native garbage collector, we will need to add meaningful
// live value information as well to these macros.
#define MR_LAYOUT_FROM_LABEL(label) \
MR_PASTE2(mercury_data__label_layout__, label)
#define MR_LABEL_LAYOUT_REF(label) \
((const MR_LabelLayout *) &MR_LAYOUT_FROM_LABEL(MR_add_prefix(label)))
#define MR_MAKE_USER_INTERNAL_LAYOUT(module, name, arity, mode, label) \
MR_LabelLayoutNoVarInfo \
MR_label_layout_user_name(module, name, arity, mode, label) = { \
(MR_ProcLayout *) & \
MR_proc_layout_user_name(module, name, arity, mode), \
0, \
-1, \
MR_FALSE, \
0, \
0, \
-1 /* No info about live values. */ \
}
////////////////////////////////////////////////////////////////////////////
// These macros are used as shorthands in generated C source files
// for some fields of MR_LabelLayouts.
//
// We need to cast the addresses of proc layout structures because there
// are several kinds of proc layouts, of different (though compatible) types.
#define MR_LL(e, port, num, path) \
MR_PROC_LAYOUT(MR_add_prefix(e)), \
MR_PASTE2(MR_PORT_, port), \
MR_NOT_HIDDEN, (num), (path), NULL
#define MR_LL_H(e, port, num, path) \
MR_PROC_LAYOUT(MR_add_prefix(e)), \
MR_PASTE2(MR_PORT_, port), \
MR_HIDDEN, (num), (path), NULL
#define MR_LL_U(e, port, num, path, ue) \
MR_PROC_LAYOUT(MR_add_prefix(e)), \
MR_PASTE2(MR_PORT_, port), \
MR_NOT_HIDDEN, (num), (path), (ue)
#define MR_LL_H_U(e, port, num, path, ue) \
MR_PROC_LAYOUT(MR_add_prefix(e)), \
MR_PASTE2(MR_PORT_, port), \
MR_HIDDEN, (num), (path), (ue)
#define MR_LLVS(m, p, h, s) \
&MR_pseudo_type_infos(m)[p], \
&MR_hlds_var_nums(m)[h], \
&MR_short_locns(m)[s]
#define MR_LLVL(m, p, h, s, l) \
&MR_pseudo_type_infos(m)[p], \
&MR_hlds_var_nums(m)[h], \
&MR_short_locns(m)[s], \
&MR_long_locns(m)[l]
#define MR_LLVS0(m, p, h, s) \
0, \
MR_LLVS(m, p, h, s)
#define MR_LLVL0(m, p, h, s, l) \
0, \
MR_LLVL(m, p, h, s, l)
#define MR_LLVSC(m, tpt, tpc, p, h, s) \
(const MR_TypeParamLocns *) MR_COMMON(tpt, tpc), \
MR_LLVS(m, p, h, s)
#define MR_LLVLC(m, tpt, tpc, p, h, s, l) \
(const MR_TypeParamLocns *) MR_COMMON(tpt, tpc), \
MR_LLVL(m, p, h, s, l)
#define MR_cast_to_pti1(r1) \
(MR_PseudoTypeInfo) (r1),
#define MR_cast_to_pti2(r1, r2) \
(MR_PseudoTypeInfo) (r1), \
(MR_PseudoTypeInfo) (r2),
#define MR_cast_to_pti3(r1, r2, r3) \
(MR_PseudoTypeInfo) (r1), \
(MR_PseudoTypeInfo) (r2), \
(MR_PseudoTypeInfo) (r3)
#define MR_cast_to_pti4(r1, r2, r3, r4) \
(MR_PseudoTypeInfo) (r1), \
(MR_PseudoTypeInfo) (r2), \
(MR_PseudoTypeInfo) (r3), \
(MR_PseudoTypeInfo) (r4),
#define MR_cast_to_pti5(r1, r2, r3, r4, r5) \
(MR_PseudoTypeInfo) (r1), \
(MR_PseudoTypeInfo) (r2), \
(MR_PseudoTypeInfo) (r3), \
(MR_PseudoTypeInfo) (r4), \
(MR_PseudoTypeInfo) (r5),
#define MR_cast_to_pti6(r1, r2, r3, r4, r5, r6) \
(MR_PseudoTypeInfo) (r1), \
(MR_PseudoTypeInfo) (r2), \
(MR_PseudoTypeInfo) (r3), \
(MR_PseudoTypeInfo) (r4), \
(MR_PseudoTypeInfo) (r5), \
(MR_PseudoTypeInfo) (r6),
#define MR_cast_to_pti7(r1, r2, r3, r4, r5, r6, r7) \
(MR_PseudoTypeInfo) (r1), \
(MR_PseudoTypeInfo) (r2), \
(MR_PseudoTypeInfo) (r3), \
(MR_PseudoTypeInfo) (r4), \
(MR_PseudoTypeInfo) (r5), \
(MR_PseudoTypeInfo) (r6), \
(MR_PseudoTypeInfo) (r7),
#define MR_cast_to_pti8(r1, r2, r3, r4, r5, r6, r7, r8) \
(MR_PseudoTypeInfo) (r1), \
(MR_PseudoTypeInfo) (r2), \
(MR_PseudoTypeInfo) (r3), \
(MR_PseudoTypeInfo) (r4), \
(MR_PseudoTypeInfo) (r5), \
(MR_PseudoTypeInfo) (r6), \
(MR_PseudoTypeInfo) (r7), \
(MR_PseudoTypeInfo) (r8),
#define MR_cast_to_pti9(r1, r2, r3, r4, r5, r6, r7, r8, r9) \
(MR_PseudoTypeInfo) (r1), \
(MR_PseudoTypeInfo) (r2), \
(MR_PseudoTypeInfo) (r3), \
(MR_PseudoTypeInfo) (r4), \
(MR_PseudoTypeInfo) (r5), \
(MR_PseudoTypeInfo) (r6), \
(MR_PseudoTypeInfo) (r7), \
(MR_PseudoTypeInfo) (r8), \
(MR_PseudoTypeInfo) (r9),
#define MR_cast_to_pti10(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10) \
(MR_PseudoTypeInfo) (r1), \
(MR_PseudoTypeInfo) (r2), \
(MR_PseudoTypeInfo) (r3), \
(MR_PseudoTypeInfo) (r4), \
(MR_PseudoTypeInfo) (r5), \
(MR_PseudoTypeInfo) (r6), \
(MR_PseudoTypeInfo) (r7), \
(MR_PseudoTypeInfo) (r8), \
(MR_PseudoTypeInfo) (r9), \
(MR_PseudoTypeInfo) (r10),
////////////////////////////////////////////////////////////////////////////
// Definitions for MR_ProcLayout.
// The MR_TableIoEntry structure.
//
// To enable printing and declarative debugging of I/O actions, the compiler
// generates one of these structures for each I/O primitive. The compiler
// transforms the bodies of those primitives to create a block of memory
// (the answerblock, the action's entry in the I/O table), and fill it in with
//
// - a pointer to the primitive's MR_TableIoEntry structure, and
// - the values of some of the primitive's arguments (excluding the
// I/O states, which are dummies).
//
// The arguments in the answerblock will always include the output arguments,
// since I/O tabling needs these to make the primitive idempotent.
// If the primitive does not have type class constraints, it will include
// the values of the input arguments as well, for two reasons:
//
// - to present them to the user on request, either via mdb's browsing
// commands, or via the declarative debugger
//
// - the input typeinfo arguments are needed to present the value of other
// arguments, both inputs and outputs, to the user.
//
// In the presence of typeclass constraints on the predicate, we cannot
// guarantee that we can encode the locations of the typeinfos (which may be
// arbitrarily deep inside typeclass_infos) in our fixed size location
// descriptions. We therefore set the have_arg_infos field to false,
// indicating that none of the following fields contain meaningful information.
//
// In the absence of typeclass constraints on the predicate, we set the
// have_arg_infos field to true. In that case, num_ptis will contain the
// number of arguments in the answer block, the ptis field will point to
// a vector of num_ptis pseudo-typeinfos (one for each argument in the answer
// block), and the type_params field maps the type variables that occur
// in the pseudo-typeinfos to the locations of the typeinfos describing
// the types bound to them.
//
// The entry_proc field, which is always meaningful, identifies the procedure
// that created the I/O table entry.
typedef struct MR_TableIoEntry_Struct {
const MR_ProcLayout *MR_table_io_entry_proc;
MR_bool MR_table_io_entry_have_arg_infos;
MR_Integer MR_table_io_entry_num_ptis;
const MR_PseudoTypeInfo *MR_table_io_entry_ptis;
const MR_TypeParamLocns *MR_table_io_entry_type_params;
} MR_TableIoEntry;
// MR_TableInfo: compiler generated information describing the tabling
// data structures used by a procedure.
//
// For I/O tabled procedures, the information is in the io_decl field.
// For other kinds of tabled procedures, it is in the gen field.
// The init field is used for initialization only.
//
// The MR_table_proc field is not const because the structure it points to
// has fields containing statistics, which are updated at runtime.
typedef union {
const void *MR_table_init;
const MR_TableIoEntry *MR_table_io_entry;
const MR_Table_Gen *MR_table_gen;
MR_ProcTableInfo *MR_table_proc;
} MR_TableInfo;
// The MR_StackTraversal structure contains the following fields:
//
// The code_addr field points to the start of the procedure's code.
// This allows the profiler to figure out which procedure a sampled program
// counter belongs to, and allows the debugger to implement retry.
//
// The succip_locn field encodes the location of the saved succip if it is
// saved in a general purpose stack slot. If the succip is saved in a special
// purpose stack slot (as it is for model_non procedures) or if the procedure
// never saves the succip (as in leaf procedures), this field will contain -1.
//
// The stack_slots field gives the number of general purpose stack slots
// in the procedure.
//
// The detism field encodes the determinism of the procedure.
typedef struct MR_StackTraversal_Struct {
MR_Code *MR_trav_code_addr;
MR_LongLval MR_trav_succip_locn;
MR_int_least16_t MR_trav_stack_slots;
MR_Determinism MR_trav_detism;
} MR_StackTraversal;
#define MR_PROC_LAYOUT_IS_UCI(entry) \
MR_PROC_ID_IS_UCI(entry->MR_sle_proc_id)
// The MR_ExecTrace structure contains the following fields.
//
// The call_label field points to the label layout structure for the label
// associated with the call event at the entry to the procedure. The purpose
// of this field is to allow the debugger to find out which variables
// are where on entry, so it can reexecute the procedure if asked to do so
// and if the values of the required variables are still available.
//
// The labels field contains a pointer to an array of pointers to label layout
// structures; the size of the array is given by the num_labels field. The
// initial part of the array will contain a pointer to the label layout
// structure of every interface event in the procedure; the later parts will
// contain a pointer to the label layout structure of every internal event.
// There is no ordering on the events beyond interface first, internal second.
//
// The used_var_names field points to an array that contains offsets
// into the string table, with the offset at index i-1 giving the name of
// variable i (since variable numbers start at one). If a variable has no name
// or cannot be referred to from an event, the offset will be zero, at which
// offset the string table will contain an empty string.
//
// The max_named_var_num field gives the number of elements in the
// used_var_names table, which is also the number of the highest numbered
// named variable. Note that unnamed variables may have numbers higher than
// this.
//
// The max_r_num field tells the debugger which Mercury abstract machine
// registers need saving in MR_trace: besides the special registers, it is
// the general-purpose registers rN for values of N up to and including the
// value of this field. Note that this field contains an upper bound; in
// general, there will be calls to MR_trace at which the number of the highest
// numbered general purpose (i.e. rN) registers is less than this. However,
// storing the upper bound gets us almost all the benefit (of not saving and
// restoring all the thousand rN registers) for a small fraction of the static
// space cost of storing the actual number in label layout structures.
//
// If the procedure is compiled with deep tracing, the maybe_from_full field
// will contain a negative number. If it is compiled with shallow tracing,
// it will contain the number of the stack slot that holds the flag that says
// whether this incarnation of the procedure was called from deeply traced code
// or not. (The determinism of the procedure decides whether the stack slot
// refers to a stackvar or a framevar.)
//
// If tabling of I/O actions is enabled, the maybe_io_seq field will contain
// the number of the stack slot that holds the value the I/O action counter
// had on entry to this procedure. Even procedures that do not have I/O state
// arguments will have such a slot, since they or their descendants may call
// unsafe_perform_io.
//
// If trailing is not enabled, the maybe_trail field will contain a negative
// number. If it is enabled, it will contain number of the first of two stack
// slots used for checkpointing the state of the trail on entry to the
// procedure. The first contains the trail pointer, the second the ticket.
//
// If the procedure lives on the nondet stack, or if it cannot create any
// temporary nondet stack frames, the maybe_maxfr field will contain a negative
// number. If it lives on the det stack, and can create temporary nondet stack
// frames, it will contain the number number of the stack slot that contains the
// value of maxfr on entry, for use in executing the retry debugger command
// from the middle of the procedure.
//
// The eval_method field contains a representation of the evaluation method
// used by the procedure. The retry command needs this information if it is
// to reset the call tables of the procedure invocations being retried.
//
// We cannot put enums into structures as bit fields. To avoid wasting space,
// we put MR_EvalMethodInts into structures instead of MR_EvalMethods
// themselves.
//
// If the procedure is compiled with some form of tabling, the maybe_call_table
// field contains the number of the stack slot through which we can reach the
// call table entry for this call. In forms of tabling which associate a C
// structure (MR_Subgoal, MR_MemoNonRecord) with a call table entry, the slot
// will point to that structure; in other forms of tabling, it will point
// to the call's MR_TableNode.
//
// The flags field encodes boolean properties of the procedure. For now,
// the only property is whether the procedure has a pair of I/O state
// arguments.
//
// If the procedure lives on the nondet stack, or if it cannot create any
// temporary nondet stack frames, the maybe_maxfr field will contain a negative
// number. If it lives on the det stack, and can create temporary nondet stack
// frames, it will contain the number of the stack slot that contains the
// value of maxfr on entry, for use in executing the retry debugger command
// from the middle of the procedure.
#define MR_EVAL_METHOD_MEMO_STRICT MR_EVAL_METHOD_MEMO
#define MR_EVAL_METHOD_MEMO_FAST_LOOSE MR_EVAL_METHOD_MEMO
#define MR_EVAL_METHOD_MEMO_SPECIFIED MR_EVAL_METHOD_MEMO
typedef enum {
MR_EVAL_METHOD_NORMAL,
MR_EVAL_METHOD_LOOP_CHECK,
MR_EVAL_METHOD_MEMO,
MR_EVAL_METHOD_MINIMAL_STACK_COPY,
MR_EVAL_METHOD_MINIMAL_OWN_STACKS_CONSUMER,
MR_EVAL_METHOD_MINIMAL_OWN_STACKS_GENERATOR,
MR_EVAL_METHOD_TABLE_IO,
MR_EVAL_METHOD_TABLE_IO_DECL,
MR_EVAL_METHOD_TABLE_IO_UNITIZE,
MR_EVAL_METHOD_TABLE_IO_UNITIZE_DECL
} MR_EvalMethod;
typedef MR_int_least8_t MR_EvalMethodInt;
typedef enum {
MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_NONE),
MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_BASIC),
MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_BASIC_USER),
MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_SHALLOW),
MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_DEEP),
MR_DEFINE_MERCURY_ENUM_CONST(MR_TRACE_LEVEL_DECL_REP)
} MR_TraceLevel;
typedef MR_int_least8_t MR_TraceLevelInt;
typedef struct MR_ExecTrace_Struct {
const MR_LabelLayout *MR_exec_call_label;
const MR_ModuleLayout *MR_exec_module_layout;
const MR_LabelLayout **MR_exec_labels;
MR_uint_least32_t MR_exec_num_labels;
MR_TableInfo MR_exec_table_info;
const MR_uint_least16_t *MR_exec_head_var_nums;
const MR_uint_least32_t *MR_exec_used_var_names;
MR_uint_least16_t MR_exec_num_head_vars;
MR_uint_least16_t MR_exec_max_named_var_num;
MR_uint_least16_t MR_exec_max_r_num;
MR_uint_least16_t MR_exec_max_f_num;
MR_int_least8_t MR_exec_maybe_from_full;
MR_int_least8_t MR_exec_maybe_io_seq;
MR_int_least8_t MR_exec_maybe_trail;
MR_int_least8_t MR_exec_maybe_maxfr;
MR_EvalMethodInt MR_exec_eval_method_CAST_ME;
MR_int_least8_t MR_exec_maybe_call_table;
MR_TraceLevelInt MR_exec_trace_level_CAST_ME;
MR_uint_least8_t MR_exec_flags;
MR_int_least8_t MR_exec_maybe_tail_rec;
} MR_ExecTrace;
#define MR_compute_max_mr_num(max_mr_num, layout) \
do { \
int max_r_num; \
\
max_r_num = (layout)->MR_sll_entry->MR_sle_max_r_num + \
MR_NUM_SPECIAL_REG; \
max_mr_num = MR_max(max_r_num, MR_FIRST_UNREAL_R_SLOT); \
} while (0)
// The code in the compiler that creates the flag field is
// encode_exec_trace_flags in stack_layout.m.
#define MR_PROC_LAYOUT_FLAG_HAS_IO_STATE_PAIR 0x1
#define MR_PROC_LAYOUT_FLAG_HAS_HIGHER_ORDER_ARG 0x2
#define MR_trace_find_reused_frames(proc_layout, sp, reused_frames) \
do { \
const MR_ExecTrace *exec_trace; \
int tailrec_slot; \
\
exec_trace = proc_layout->MR_sle_exec_trace; \
if (exec_trace == NULL) { \
(reused_frames) = 0; \
} else { \
tailrec_slot = proc_layout->MR_sle_maybe_tailrec; \
if (tailrec_slot <= 0) { \
(reused_frames) = 0; \
} else { \
if (MR_DETISM_DET_STACK(proc_layout->MR_sle_detism)) { \
(reused_frames) = MR_based_stackvar((sp), tailrec_slot);\
} else { \
MR_fatal_error("tailrec reuses nondet stack frames"); \
} \
} \
} \
} while (0)
// Proc layout structures contain one, two or three substructures.
//
// - The first substructure is the MR_StackTraversal structure, which contains
// information that enables the stack to be traversed, e.g. for accurate gc.
// It is always present if proc layouts are present at all.
//
// - The second group is the MR_ProcId union, which identifies the
// procedure in terms that are meaningful to both humans and machines.
// It will be generated only if the module is compiled with stack tracing,
// execution tracing or profiling. The MR_ProcId union has two alternatives,
// one for user-defined procedures and one for procedures of the compiler
// generated Unify, Index and Compare predicates.
//
// - The third group is everything else. Currently, this consists of
// information that is of interest to the debugger, to the deep profiler,
// or both.
//
// The information that is of interest to the debugger only is stored in
// the MR_ExecTrace structure, which will be generated only if the module
// is compiled with execution tracing. The information that is of interest to
// the deep profiler is stored in the MR_ProcStatic structure, which will be
// generated only if the module is compiled in a deep profiling grade. The
// other fields in the group are of interest to both the debugger and the
// deep profiler, and will be generated if either execution tracing or deep
// profiling is enabled.
//
// If the body_bytes field is NULL, it means that no representation of the
// procedure body is available. If non-NULL, it contains a pointer to an
// array of bytecodes that represents the body of the procedure. The
// bytecode array should be interpreted by the read_proc_rep predicate in
// mdbcomp/program_representation.m (it starts with an encoded form of the
// array's length). Its contents are generated by compiler/prog_rep.m.
//
// The module_common_layout field points to the part of the module layout
// structure of the module containing the procedure that is common to the
// debugger and the deep profiler. Amongst other things, it gives access to
// the string table that the body_bytes fields refers to.
//
// The runtime system considers all proc layout structures to be of type
// MR_ProcLayout, but must use the macros defined below to check for the
// existence of each substructure before accessing the fields of that
// substructure. The macros are MR_PROC_LAYOUT_HAS_PROC_ID to check for the
// MR_ProcId substructure, MR_PROC_LAYOUT_HAS_EXEC_TRACE to check for the
// MR_ExecTrace substructure, and MR_PROC_LAYOUT_HAS_PROC_STATIC to check for
// the MR_ProcStatic substructure.
//
// The reason why some substructures may be missing is to save space.
// If the options with which a module is compiled do not require execution
// tracing, then the MR_ExecTrace substructure will not present, and if the
// options do not require procedure identification, then the MR_ProcId
// substructure will not be present either. The body_bytes and module_layout
// fields cannot be non-NULL unless at least one of exec trace and proc static
// substructures is present, but they are otherwise independent of those
// substructures.
//
// The compiler itself generates proc layout structures using the following
// three types.
//
// - When generating only stack traversal information, the compiler will
// generate proc layout structures of type MR_ProcLayout_Traversal.
//
// - When generating stack traversal and procedure id information, plus
// possibly others, the compiler will generate proc layout structures of
// types MR_ProcLayoutUser and MR_ProcLayoutUCI.
struct MR_ProcLayout_Struct {
MR_StackTraversal MR_sle_traversal;
MR_ProcId MR_sle_proc_id;
MR_STATIC_CODE_CONST MR_ExecTrace *MR_sle_exec_trace;
MR_ProcStatic *MR_sle_proc_static;
const MR_uint_least8_t *MR_sle_body_bytes;
const MR_ModuleLayout *MR_sle_module_layout;
};
typedef struct MR_ProcLayoutUser_Struct {
MR_StackTraversal MR_user_traversal;
MR_UserProcId MR_user_id;
MR_STATIC_CODE_CONST MR_ExecTrace *MR_sle_exec_trace;
MR_ProcStatic *MR_sle_proc_static;
const MR_uint_least8_t *MR_sle_body_bytes;
const MR_ModuleLayout *MR_sle_module_layout;
} MR_ProcLayoutUser;
typedef struct MR_ProcLayoutUCI_Struct {
MR_StackTraversal MR_uci_traversal;
MR_UCIProcId MR_uci_id;
MR_STATIC_CODE_CONST MR_ExecTrace *MR_sle_exec_trace;
MR_ProcStatic *MR_sle_proc_static;
const MR_uint_least8_t *MR_sle_body_bytes;
const MR_ModuleLayout *MR_sle_module_layout;
} MR_ProcLayoutUCI;
typedef struct MR_ProcLayout_Traversal_Struct {
MR_StackTraversal MR_trav_traversal;
MR_Word MR_trav_no_proc_id; // will be -1
} MR_ProcLayout_Traversal;
#define MR_PROC_LAYOUT_HAS_PROC_ID(entry) \
(MR_PROC_ID_EXISTS(entry->MR_sle_proc_id))
#define MR_PROC_LAYOUT_HAS_EXEC_TRACE(entry) \
(MR_PROC_LAYOUT_HAS_PROC_ID(entry) && \
entry->MR_sle_exec_trace != NULL)
#define MR_PROC_LAYOUT_HAS_PROC_STATIC(entry) \
(MR_PROC_LAYOUT_HAS_PROC_ID(entry) && \
entry->MR_sle_proc_static != NULL)
#define MR_PROC_LAYOUT_HAS_THIRD_GROUP(entry) \
(MR_PROC_LAYOUT_HAS_PROC_ID(entry) && \
( entry->MR_sle_exec_trace != NULL \
|| entry->MR_sle_proc_static != NULL))
#define MR_sle_code_addr MR_sle_traversal.MR_trav_code_addr
#define MR_sle_succip_locn MR_sle_traversal.MR_trav_succip_locn
#define MR_sle_stack_slots MR_sle_traversal.MR_trav_stack_slots
#define MR_sle_detism MR_sle_traversal.MR_trav_detism
#define MR_sle_user MR_sle_proc_id.MR_proc_user
#define MR_sle_uci MR_sle_proc_id.MR_proc_uci
#define MR_sle_call_label MR_sle_exec_trace->MR_exec_call_label
#define MR_sle_module_layout MR_sle_exec_trace->MR_exec_module_layout
#define MR_sle_labels MR_sle_exec_trace->MR_exec_labels
#define MR_sle_num_labels MR_sle_exec_trace->MR_exec_num_labels
#define MR_sle_tabling_pointer MR_sle_exec_trace->MR_exec_tabling_pointer
#define MR_sle_table_info MR_sle_exec_trace->MR_exec_table_info
#define MR_sle_head_var_nums MR_sle_exec_trace->MR_exec_head_var_nums
#define MR_sle_num_head_vars MR_sle_exec_trace->MR_exec_num_head_vars
#define MR_sle_used_var_names MR_sle_exec_trace->MR_exec_used_var_names
#define MR_sle_max_named_var_num MR_sle_exec_trace->MR_exec_max_named_var_num
#define MR_sle_max_r_num MR_sle_exec_trace->MR_exec_max_r_num
#define MR_sle_max_f_num MR_sle_exec_trace->MR_exec_max_f_num
#define MR_sle_maybe_from_full MR_sle_exec_trace->MR_exec_maybe_from_full
#define MR_sle_maybe_io_seq MR_sle_exec_trace->MR_exec_maybe_io_seq
#define MR_sle_maybe_trail MR_sle_exec_trace->MR_exec_maybe_trail
#define MR_sle_maybe_maxfr MR_sle_exec_trace->MR_exec_maybe_maxfr
#define MR_sle_maybe_call_table MR_sle_exec_trace->MR_exec_maybe_call_table
#define MR_sle_maybe_decl_debug MR_sle_exec_trace->MR_exec_maybe_decl_debug
#define MR_sle_maybe_tailrec MR_sle_exec_trace->MR_exec_maybe_tail_rec
#define MR_sle_eval_method(proc_layout_ptr) \
((MR_EvalMethod) (proc_layout_ptr)-> \
MR_sle_exec_trace->MR_exec_eval_method_CAST_ME)
#define MR_sle_trace_level(proc_layout_ptr) \
((MR_TraceLevel) (proc_layout_ptr)-> \
MR_sle_exec_trace->MR_exec_trace_level_CAST_ME)
#define MR_proc_has_io_state_pair(proc_layout_ptr) \
((proc_layout_ptr)->MR_sle_exec_trace->MR_exec_flags \
& MR_PROC_LAYOUT_FLAG_HAS_IO_STATE_PAIR)
#define MR_proc_has_higher_order_arg(proc_layout_ptr) \
((proc_layout_ptr)->MR_sle_exec_trace->MR_exec_flags \
& MR_PROC_LAYOUT_FLAG_HAS_HIGHER_ORDER_ARG)
// Adjust the arity of functions for printing.
#define MR_sle_user_adjusted_arity(entry) \
((entry)->MR_sle_user.MR_user_arity - \
(((entry)->MR_sle_user.MR_user_pred_or_func == MR_FUNCTION) ? 1 : 0))
#define MR_MAX_VARNAME_SIZE 160
// Return the name (if any) of the variable with the given HLDS variable number
// in the procedure indicated by the first argument.
//
// The name will actually be found by MR_name_in_string_table, so the
// comments there about name size and should_copy apply here as well.
extern MR_ConstString MR_hlds_var_name(const MR_ProcLayout *entry,
int hlds_var_num, int *should_copy);
// Return the name (if any) of the variable with the given name code
// in the given string table.
//
// Sometimes, the returned name will point to static, const storage,
// whose contents are valid until the end of the program's execution,
// while at other times, it will point to a buffer whose contents
// will be valid only until the next call to MR_name_in_string_table.
//
// Callers that want to know which is the case should pass a non-NULL
// value for should_copy. The returned name will point to the buffer
// if and only if *should_copy is true. The size of the buffer is
// MR_MAX_VARNAME_SIZE bytes.
extern MR_ConstString MR_name_in_string_table(const char *string_table,
MR_Integer string_table_size,
MR_uint_least32_t name_code, int *should_copy);
// Given a string, see whether its end consists a sequence of digits.
// If yes, return the offset of the first digit in this sequence relative
// to the start of the string. Otherwise, return a negative number.
extern int MR_find_start_of_num_suffix(const char *str);
// Define a layout structure for a procedure, containing information
// for stack traversal and procedure identification.
//
// The slot count and the succip location parameters do not have to be
// supplied for procedures that live on the nondet stack, since for such
// procedures the size of the frame can be deduced from the prevfr field
// and the location of the succip is fixed.
//
// An unknown slot count should be signalled by MR_PROC_NO_SLOT_COUNT.
// An unknown succip location should be signalled by MR_LONG_LVAL_TYPE_UNKNOWN.
//
// For the procedure identification, we always use the same module name
// for the defining and declaring modules, since procedures whose code
// is hand-written as C modules cannot be inlined in other Mercury modules.
//
// Due to the possibility that code addresses are not static, any use of
// the MR_MAKE_PROC_ID_PROC_LAYOUT macro has to be accompanied by a call to the
// MR_INIT_PROC_LAYOUT_ADDR macro in the initialization code of the C module
// that defines the entry. (The cast in the body of MR_INIT_PROC_LAYOUT_ADDR
// is needed because compiler-generated layout structures may use any of the
// variant types listed above.)
#define MR_PROC_NO_SLOT_COUNT -1
#ifdef MR_STATIC_CODE_ADDRESSES
#define MR_MAKE_PROC_LAYOUT_ADDR(entry) MR_ENTRY(entry)
#define MR_INIT_PROC_LAYOUT_ADDR(entry) do { } while (0)
#else
#define MR_MAKE_PROC_LAYOUT_ADDR(entry) ((MR_Code *) NULL)
#define MR_INIT_PROC_LAYOUT_ADDR(entry) \
do { \
((MR_ProcLayout *) & \
MR_PASTE2(mercury_data__proc_layout__, entry)) \
->MR_sle_code_addr = MR_ENTRY(entry); \
} while (0)
#endif
#define MR_MAKE_USER_PROC_STATIC_PROC_LAYOUT(sc, detism, slots, succip_locn, \
pf, module, name, arity, mode, proc_static) \
MR_declare_entry(MR_proc_entry_user_name(module, name, \
arity, mode)); \
sc const MR_ProcLayoutUser \
MR_proc_layout_user_name(module, name, arity, mode) = { \
{ \
MR_MAKE_PROC_LAYOUT_ADDR( \
MR_proc_entry_user_name(module, name, \
arity, mode)), \
succip_locn, \
slots, \
detism \
}, \
{ \
pf, \
MR_STRINGIFY(module), \
MR_STRINGIFY(module), \
MR_STRINGIFY(name), \
arity, \
mode \
}, \
NULL, \
(MR_ProcStatic *) proc_static \
}
#define MR_MAKE_UCI_PROC_STATIC_PROC_LAYOUT(sc, detism, slots, succip_locn, \
module, name, type, arity, mode, proc_static) \
MR_declare_entry(MR_proc_entry_uci_name(module, name, \
type, arity, mode)); \
sc const MR_ProcLayoutUCI \
MR_proc_layout_uci_name(module, name, type, arity, mode) = { \
{ \
MR_MAKE_PROC_LAYOUT_ADDR( \
MR_proc_entry_uci_name(module, name, \
type, arity, mode)), \
succip_locn, \
slots, \
detism \
}, \
{ \
MR_STRINGIFY(type), \
MR_STRINGIFY(module), \
MR_STRINGIFY(module), \
MR_STRINGIFY(name), \
arity, \
mode \
}, \
NULL, \
(MR_ProcStatic *) proc_static \
}
#define MR_NO_EXTERN_DECL
#define MR_STATIC_USER_PROC_STATIC_PROC_LAYOUT(detism, slots, succip_locn, \
pf, module, name, arity, mode) \
MR_MAKE_USER_PROC_STATIC_PROC_LAYOUT(static, detism, slots, \
succip_locn, pf, module, name, arity, mode, \
&MR_proc_static_user_name(module, name, arity, mode))
#define MR_EXTERN_USER_PROC_STATIC_PROC_LAYOUT(detism, slots, succip_locn, \
pf, module, name, arity, mode) \
MR_MAKE_USER_PROC_STATIC_PROC_LAYOUT(MR_NO_EXTERN_DECL, detism, slots, \
succip_locn, pf, module, name, arity, mode, \
&MR_proc_static_user_name(module, name, arity, mode))
#define MR_STATIC_UCI_PROC_STATIC_PROC_LAYOUT(detism, slots, succip_locn, \
module, name, type, arity, mode) \
MR_MAKE_UCI_PROC_STATIC_PROC_LAYOUT(static, detism, slots, \
succip_locn, module, name, type, arity, mode, \
&MR_proc_static_uci_name(module, name, type, arity, mode))
#define MR_EXTERN_UCI_PROC_STATIC_PROC_LAYOUT(detism, slots, succip_locn, \
module, name, type, arity, mode) \
MR_MAKE_UCI_PROC_STATIC_PROC_LAYOUT(MR_NO_EXTERN_DECL, detism, slots, \
succip_locn, module, name, type, arity, mode, \
&MR_proc_static_uci_name(module, name, type, arity, mode))
#define MR_STATIC_USER_PROC_ID_PROC_LAYOUT(detism, slots, succip_locn, \
pf, module, name, arity, mode) \
MR_MAKE_USER_PROC_STATIC_PROC_LAYOUT(static, detism, slots, \
succip_locn, pf, module, name, arity, mode, NULL)
#define MR_EXTERN_USER_PROC_ID_PROC_LAYOUT(detism, slots, succip_locn, \
pf, module, name, arity, mode) \
MR_MAKE_USER_PROC_STATIC_PROC_LAYOUT(MR_NO_EXTERN_DECL, detism, slots, \
succip_locn, pf, module, name, arity, mode, NULL)
#define MR_DECLARE_UCI_PROC_STATIC_LAYOUTS(mod, n, a) \
const MR_ProcLayoutUCI \
MR_proc_layout_uci_name(mod, __Unify__, n, a, 0); \
const MR_ProcLayoutUCI \
MR_proc_layout_uci_name(mod, __Compare__, n, a, 0); \
const MR_ProcLayoutUCI \
MR_proc_layout_uci_name(mod, __CompareRep__, n, a, 0);
// In procedures compiled with execution tracing, three items are stored
// in stack slots with fixed numbers. They are:
//
// the event number of the last event before the call event,
// the call number, and
// the call depth.
//
// Note that the first slot does not store the number of the call event
// itself, but rather the number of the call event minus one. The reason
// for this is that (a) incrementing the number stored in this slot would
// increase executable size, and (b) if the procedure is shallow traced,
// MR_trace may not be called for the call event, so we cannot shift the
// burden of initializing fields to the MR_trace of the call event either.
//
// The following macros will access the fixed slots. They can be used whenever
// MR_PROC_LAYOUT_HAS_EXEC_TRACE(entry) is true; which set you should use
// depends on the determinism of the procedure.
//
// These macros have to be kept in sync with compiler/trace.m.
#define MR_event_num_framevar(base_curfr) MR_based_framevar(base_curfr, 1)
#define MR_call_num_framevar(base_curfr) MR_based_framevar(base_curfr, 2)
#define MR_call_depth_framevar(base_curfr) MR_based_framevar(base_curfr, 3)
#define MR_event_num_stackvar(base_sp) MR_based_stackvar(base_sp, 1)
#define MR_call_num_stackvar(base_sp) MR_based_stackvar(base_sp, 2)
#define MR_call_depth_stackvar(base_sp) MR_based_stackvar(base_sp, 3)
// In model_non procedures compiled with --trace-redo, one or two other items
// are stored in fixed stack slots. These are
//
// the address of the layout structure for the redo event
// the saved copy of the from-full flag (only if trace level is shallow)
//
// The following macros will access these slots. They should be used only from
// within the code that calls MR_trace for the REDO event.
//
// This macros have to be kept in sync with compiler/trace.m.
#define MR_redo_layout_framevar(base_curfr) MR_based_framevar(base_curfr, 4)
#define MR_redo_fromfull_framevar(base_curfr) MR_based_framevar(base_curfr, 5)
////////////////////////////////////////////////////////////////////////////
// Definitions for MR_ModuleLayout.
//
// The layout structure for a module contains the following fields.
//
// The MR_ml_name field contains the name of the module.
//
// The MR_ml_string_table field contains the module's string table, which
// contains strings referred to by other layout structures in the module
// (initially only the tables containing variables names, referred to from
// label layout structures). The MR_ml_string_table_size field gives the size
// of the table in bytes.
//
// The MR_ml_procs field points to an array containing pointers to the proc
// layout structures of all the procedures in the module; the MR_ml_proc_count
// field gives the number of entries in the array.
//
// The MR_ml_module_file_layout field points to an array of N file layout
// pointers if the module has labels corresponding to contexts that refer
// to the names of N files. For each file, the table gives its name, the
// number of labels in that file in this module, and for each such label,
// it gives its line number and a pointer to its label layout struct.
// The corresponding elements of the label_lineno and label_layout arrays
// refer to the same label. (The reason why they are not stored together
// is space efficiency; adding a 16 bit field to a label layout structure would
// require padding.) The labels are sorted on line number.
//
// The MR_ml_trace_level field gives the trace level that the module was
// compiled with. If the MR_TraceLevel enum is modified, then the
// corresponding function in compiler/trace_params.m must also be updated.
//
// The MR_ml_suppressed_events events field encodes the set of event types
// (ports) that were suppressed when generating code for this module. The bit
// given by the expression (1 << MR_PORT_<PORTTYPE>) will be set in this
// integer iff trace port MR_PORT_<PORTTYPE> is suppressed.
//
// The MR_ml_label_exec_count field points to an array of integers, with each
// integer holding the number of times execution has reached a given label.
// Each label's layout structure records the index of that label in this array.
// The most direct way to go the other way, to find out which label owns a
// particular slot in this array, is to search the label arrays in the file
// layout structures, and test their MR_sll_label_num_in_module fields.
// (If we needed faster access, we could add another array with elements
// corresponding to MR_ml_label_exec_count's pointing to the labels' layout
// structures.)
//
// The MR_ml_num_label_exec_counts field contains the number of elements
// in the MR_ml_label_exec_count array.
typedef struct MR_ModuleFileLayout_Struct {
MR_ConstString MR_mfl_filename;
MR_Integer MR_mfl_label_count;
// The following fields point to arrays of size MR_mfl_label_count.
const MR_int_least16_t *MR_mfl_label_lineno;
const MR_LabelLayout **MR_mfl_label_layout;
} MR_ModuleFileLayout;
// The version of the data structures in this file -- useful for bootstrapping.
// If you write runtime code that checks this version number and can at least
// handle the previous version of the data structure, it makes it easier to
// bootstrap changes to these data structures.
//
// This number should be kept in sync with layout_version_number in
// compiler/layout_out.m.
#define MR_LAYOUT_VERSION MR_LAYOUT_VERSION__OISU
#define MR_LAYOUT_VERSION__USER_DEFINED 1
#define MR_LAYOUT_VERSION__EVENTSETNAME 2
#define MR_LAYOUT_VERSION__SYNTH_ATTR 3
#define MR_LAYOUT_VERSION__COMMON 4
#define MR_LAYOUT_VERSION__OISU 5
struct MR_ModuleLayout_Struct {
// The fields that are of interest to both deep profiling and debugging.
MR_uint_least8_t MR_ml_version_number;
MR_ConstString MR_ml_name;
MR_Integer MR_ml_string_table_size;
const char *MR_ml_string_table;
// The fields that are of interest only to deep profiling.
MR_Integer MR_ml_num_oisu_types;
const MR_uint_least8_t *MR_ml_oisu_bytes;
MR_Integer MR_ml_num_table_types;
const MR_uint_least8_t *MR_ml_type_table_bytes;
// The fields that are of interest only to debugging.
MR_Integer MR_ml_proc_count;
const MR_ProcLayout **MR_ml_procs;
MR_Integer MR_ml_filename_count;
const MR_ModuleFileLayout **MR_ml_module_file_layout;
MR_TraceLevel MR_ml_trace_level;
MR_int_least32_t MR_ml_suppressed_events;
MR_int_least32_t MR_ml_num_label_exec_counts;
MR_Unsigned *MR_ml_label_exec_count;
const char *MR_ml_user_event_set_name;
const char *MR_ml_user_event_set_desc;
MR_int_least16_t MR_ml_user_event_max_num_attr;
MR_int_least16_t MR_ml_num_user_event_specs;
MR_UserEventSpec *MR_ml_user_event_specs;
};
////////////////////////////////////////////////////////////////////////////
// Definitions for MR_ClosureId.
//
// Each closure contains an MR_ClosureId structure. The proc_id field
// identifies the procedure called by the closure. The other fields identify
// the context where the closure was created.
//
// The compiler generates closure id structures as either MR_UserClosureId
// or MR_UCIClosureId structures in order to avoid initializing the
// MR_ProcId union through an inappropriate member.
struct MR_ClosureId_Struct {
MR_ProcId MR_closure_proc_id;
MR_ConstString MR_closure_module_name;
MR_ConstString MR_closure_file_name;
MR_Integer MR_closure_line_number;
MR_ConstString MR_closure_goal_path;
};
struct MR_UserClosureId_Struct {
MR_UserProcId MR_user_closure_proc_id;
MR_ConstString MR_user_closure_module_name;
MR_ConstString MR_user_closure_file_name;
MR_Integer MR_user_closure_line_number;
MR_ConstString MR_user_closure_goal_path;
};
struct MR_UCIClosureId_Struct {
MR_UCIProcId MR_uci_closure_proc_id;
MR_ConstString MR_uci_closure_module_name;
MR_ConstString MR_uci_closure_file_name;
MR_Integer MR_uci_closure_line_number;
MR_ConstString MR_uci_closure_goal_path;
};
#endif // not MERCURY_STACK_LAYOUT_H
| PaulBone/mercury | runtime/mercury_stack_layout.h | C | gpl-2.0 | 76,588 | [
30522,
1013,
1013,
6819,
2213,
1024,
24529,
1027,
1018,
25430,
1027,
1018,
7818,
2696,
2497,
3027,
1027,
1039,
1013,
1013,
9385,
1006,
1039,
1007,
2687,
1011,
2262,
1996,
2118,
1997,
4940,
1012,
1013,
1013,
2023,
5371,
2089,
2069,
2022,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*!
* tablesorter pager plugin
* updated 5/27/2013
*/
/*jshint browser:true, jquery:true, unused:false */
;(function($) {
"use strict";
/*jshint supernew:true */
$.extend({ tablesorterPager: new function() {
this.defaults = {
// target the pager markup
container: null,
// use this format: "http://mydatabase.com?page={page}&size={size}&{sortList:col}&{filterList:fcol}"
// where {page} is replaced by the page number, {size} is replaced by the number of records to show,
// {sortList:col} adds the sortList to the url into a "col" array, and {filterList:fcol} adds
// the filterList to the url into an "fcol" array.
// So a sortList = [[2,0],[3,0]] becomes "&col[2]=0&col[3]=0" in the url
// and a filterList = [[2,Blue],[3,13]] becomes "&fcol[2]=Blue&fcol[3]=13" in the url
ajaxUrl: null,
// modify the url after all processing has been applied
customAjaxUrl: function(table, url) { return url; },
// modify the $.ajax object to allow complete control over your ajax requests
ajaxObject: {
dataType: 'json'
},
// process ajax so that the following information is returned:
// [ total_rows (number), rows (array of arrays), headers (array; optional) ]
// example:
// [
// 100, // total rows
// [
// [ "row1cell1", "row1cell2", ... "row1cellN" ],
// [ "row2cell1", "row2cell2", ... "row2cellN" ],
// ...
// [ "rowNcell1", "rowNcell2", ... "rowNcellN" ]
// ],
// [ "header1", "header2", ... "headerN" ] // optional
// ]
ajaxProcessing: function(ajax){ return [ 0, [], null ]; },
// output default: '{page}/{totalPages}'
// possible variables: {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
output: '{startRow} to {endRow} of {totalRows} rows', // '{page}/{totalPages}'
// apply disabled classname to the pager arrows when the rows at either extreme is visible
updateArrows: true,
// starting page of the pager (zero based index)
page: 0,
// Number of visible rows
size: 10,
// if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty
// table row set to a height to compensate; default is false
fixedHeight: false,
// remove rows from the table to speed up the sort of large tables.
// setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled.
removeRows: false, // removing rows in larger tables speeds up the sort
// css class names of pager arrows
cssFirst: '.first', // go to first page arrow
cssPrev: '.prev', // previous page arrow
cssNext: '.next', // next page arrow
cssLast: '.last', // go to last page arrow
cssGoto: '.gotoPage', // go to page selector - select dropdown that sets the current page
cssPageDisplay: '.pagedisplay', // location of where the "output" is displayed
cssPageSize: '.pagesize', // page size selector - select dropdown that sets the "size" option
cssErrorRow: 'tablesorter-errorRow', // error information row
// class added to arrows when at the extremes (i.e. prev/first arrows are "disabled" when on the first page)
cssDisabled: 'disabled', // Note there is no period "." in front of this class name
// stuff not set by the user
totalRows: 0,
totalPages: 0,
filteredRows: 0,
filteredPages: 0
};
var $this = this,
// hide arrows at extremes
pagerArrows = function(c, disable) {
var a = 'addClass',
r = 'removeClass',
d = c.cssDisabled,
dis = !!disable,
tp = Math.min( c.totalPages, c.filteredPages );
if ( c.updateArrows ) {
c.$container.find(c.cssFirst + ',' + c.cssPrev)[ ( dis || c.page === 0 ) ? a : r ](d);
c.$container.find(c.cssNext + ',' + c.cssLast)[ ( dis || c.page === tp - 1 ) ? a : r ](d);
}
},
updatePageDisplay = function(table, c, flag) {
var i, p, s, t, out,
tc = table.config,
f = $(table).hasClass('hasFilters') && !c.ajaxUrl;
c.totalPages = Math.ceil( c.totalRows / c.size ); // needed for "pageSize" method
c.filteredRows = (f) ? tc.$tbodies.eq(0).children('tr:not(.' + (tc.widgetOptions && tc.widgetOptions.filter_filteredRow || 'filtered') + ',' + tc.selectorRemove + ')').length : c.totalRows;
c.filteredPages = (f) ? Math.ceil( c.filteredRows / c.size ) || 1 : c.totalPages;
if ( Math.min( c.totalPages, c.filteredPages ) >= 0 ) {
t = (c.size * c.page > c.filteredRows);
c.startRow = (t) ? 1 : (c.filteredRows === 0 ? 0 : c.size * c.page + 1);
c.page = (t) ? 0 : c.page;
c.endRow = Math.min( c.filteredRows, c.totalRows, c.size * ( c.page + 1 ) );
out = c.$container.find(c.cssPageDisplay);
// form the output string
s = c.output.replace(/\{(page|filteredRows|filteredPages|totalPages|startRow|endRow|totalRows)\}/gi, function(m){
return {
'{page}' : c.page + 1,
'{filteredRows}' : c.filteredRows,
'{filteredPages}' : c.filteredPages,
'{totalPages}' : c.totalPages,
'{startRow}' : c.startRow,
'{endRow}' : c.endRow,
'{totalRows}' : c.totalRows
}[m];
});
if (out.length) {
out[ (out[0].tagName === 'INPUT') ? 'val' : 'html' ](s);
if ( c.$goto.length ) {
t = '';
p = Math.min( c.totalPages, c.filteredPages );
for ( i = 1; i <= p; i++ ) {
t += '<option>' + i + '</option>';
}
c.$goto.html(t).val( c.page + 1 );
}
}
}
pagerArrows(c);
if (c.initialized && flag !== false) { $(table).trigger('pagerComplete', c); }
},
fixHeight = function(table, c) {
var d, h, $b = table.config.$tbodies.eq(0);
if (c.fixedHeight) {
$b.find('tr.pagerSavedHeightSpacer').remove();
h = $.data(table, 'pagerSavedHeight');
if (h) {
d = h - $b.height();
if ( d > 5 && $.data(table, 'pagerLastSize') === c.size && $b.children('tr:visible').length < c.size ) {
$b.append('<tr class="pagerSavedHeightSpacer ' + table.config.selectorRemove.replace(/(tr)?\./g,'') + '" style="height:' + d + 'px;"></tr>');
}
}
}
},
changeHeight = function(table, c) {
var $b = table.config.$tbodies.eq(0);
$b.find('tr.pagerSavedHeightSpacer').remove();
$.data(table, 'pagerSavedHeight', $b.height());
fixHeight(table, c);
$.data(table, 'pagerLastSize', c.size);
},
hideRows = function(table, c){
if (!c.ajaxUrl) {
var i,
tc = table.config,
rows = tc.$tbodies.eq(0).children('tr:not(.' + tc.cssChildRow + ')'),
l = rows.length,
s = ( c.page * c.size ),
e = s + c.size,
f = tc.widgetOptions && tc.widgetOptions.filter_filteredRow || 'filtered',
j = 0; // size counter
for ( i = 0; i < l; i++ ){
if ( !rows[i].className.match(f) ) {
rows[i].style.display = ( j >= s && j < e ) ? '' : 'none';
j++;
}
}
}
},
hideRowsSetup = function(table, c){
c.size = parseInt( c.$size.val(), 10 ) || c.size;
$.data(table, 'pagerLastSize', c.size);
pagerArrows(c);
if ( !c.removeRows ) {
hideRows(table, c);
$(table).bind('sortEnd.pager filterEnd.pager', function(){
hideRows(table, c);
});
}
},
renderAjax = function(data, table, c, xhr, exception){
// process data
if ( typeof(c.ajaxProcessing) === "function" ) {
// ajaxProcessing result: [ total, rows, headers ]
var i, j, hsh, $f, $sh, th, d, l, $err, rr_count,
$t = $(table),
tc = table.config,
result = c.ajaxProcessing(data, table) || [ 0, [] ],
hl = $t.find('thead th').length, tds = '',
// allow [ total, rows, headers ] or [ rows, total, headers ]
t = isNaN(result[0]) && !isNaN(result[1]);
$t.find('thead tr.' + c.cssErrorRow).remove(); // Clean up any previous error.
if ( exception ) {
$err = $('<tr class="' + c.cssErrorRow + '"><td style="text-align:center;" colspan="' + hl + '">' + (
xhr.status === 0 ? 'Not connected, verify Network' :
xhr.status === 404 ? 'Requested page not found [404]' :
xhr.status === 500 ? 'Internal Server Error [500]' :
exception === 'parsererror' ? 'Requested JSON parse failed' :
exception === 'timeout' ? 'Time out error' :
exception === 'abort' ? 'Ajax Request aborted' :
'Uncaught error: ' + xhr.statusText + ' [' + xhr.status + ']' ) + '</td></tr>')
.click(function(){
$(this).remove();
})
// add error row to thead instead of tbody, or clicking on the header will result in a parser error
.appendTo( $t.find('thead:first') );
tc.$tbodies.eq(0).empty();
} else {
//ensure a zero returned row count doesn't fail the logical ||
rr_count = result[t ? 1 : 0];
c.totalRows = isNaN(rr_count) ? c.totalRows || 0 : rr_count;
d = result[t ? 0 : 1] || []; // row data
l = d.length;
th = result[2]; // headers
if (d instanceof jQuery) {
// append jQuery object
tc.$tbodies.eq(0).empty().append(d);
} else if (d.length) {
// build table from array
if ( l > 0 ) {
for ( i = 0; i < l; i++ ) {
tds += '<tr>';
for ( j = 0; j < d[i].length; j++ ) {
// build tbody cells
tds += '<td>' + d[i][j] + '</td>';
}
tds += '</tr>';
}
}
// add rows to first tbody
tc.$tbodies.eq(0).html( tds );
}
// only add new header text if the length matches
if ( th && th.length === hl ) {
hsh = $t.hasClass('hasStickyHeaders');
$sh = hsh ? tc.$sticky.children('thead:first').children().children() : '';
$f = $t.find('tfoot tr:first').children();
$t.find('th.' + tc.cssHeader).each(function(j){
var $t = $(this), icn;
// add new test within the first span it finds, or just in the header
if ( $t.find('.' + tc.cssIcon).length ) {
icn = $t.find('.' + tc.cssIcon).clone(true);
$t.find('.tablesorter-header-inner').html( th[j] ).append(icn);
if ( hsh && $sh.length ) {
icn = $sh.eq(j).find('.' + tc.cssIcon).clone(true);
$sh.eq(j).find('.tablesorter-header-inner').html( th[j] ).append(icn);
}
} else {
$t.find('.tablesorter-header-inner').html( th[j] );
if (hsh && $sh.length) {
$sh.eq(j).find('.tablesorter-header-inner').html( th[j] );
}
}
$f.eq(j).html( th[j] );
});
}
}
if (tc.showProcessing) {
$.tablesorter.isProcessing(table); // remove loading icon
}
$t.trigger('update');
c.totalPages = Math.ceil( c.totalRows / c.size );
updatePageDisplay(table, c);
fixHeight(table, c);
if (c.initialized) { $t.trigger('pagerChange', c); }
}
if (!c.initialized) {
c.initialized = true;
$(table).trigger('pagerInitialized', c);
}
},
getAjax = function(table, c){
var url = getAjaxUrl(table, c),
$doc = $(document),
tc = table.config;
if ( url !== '' ) {
if (tc.showProcessing) {
$.tablesorter.isProcessing(table, true); // show loading icon
}
$doc.bind('ajaxError.pager', function(e, xhr, settings, exception) {
//show the error message on the table
if (url === settings.url) {
renderAjax(null, table, c, xhr, exception);
$doc.unbind('ajaxError.pager');
}
});
c.ajaxObject.url = url; // from the ajaxUrl option and modified by customAjaxUrl
c.ajaxObject.success = function(data) {
renderAjax(data, table, c);
$doc.unbind('ajaxError.pager');
if (typeof c.oldAjaxSuccess === 'function') {
c.oldAjaxSuccess(data);
}
};
$.ajax(c.ajaxObject);
}
},
getAjaxUrl = function(table, c) {
var url = (c.ajaxUrl) ? c.ajaxUrl
// allow using "{page+1}" in the url string to switch to a non-zero based index
.replace(/\{page([\-+]\d+)?\}/, function(s,n){ return c.page + (n ? parseInt(n, 10) : 0); })
.replace(/\{size\}/g, c.size) : '',
sl = table.config.sortList,
fl = c.currentFilters || [],
sortCol = url.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),
filterCol = url.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/),
arry = [];
if (sortCol) {
sortCol = sortCol[1];
$.each(sl, function(i,v){
arry.push(sortCol + '[' + v[0] + ']=' + v[1]);
});
// if the arry is empty, just add the col parameter... "&{sortList:col}" becomes "&col"
url = url.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g, arry.length ? arry.join('&') : sortCol );
arry = [];
}
if (filterCol) {
filterCol = filterCol[1];
$.each(fl, function(i,v){
if (v) {
arry.push(filterCol + '[' + i + ']=' + encodeURIComponent(v));
}
});
// if the arry is empty, just add the fcol parameter... "&{filterList:fcol}" becomes "&fcol"
url = url.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g, arry.length ? arry.join('&') : filterCol );
}
if ( typeof(c.customAjaxUrl) === "function" ) {
url = c.customAjaxUrl(table, url);
}
return url;
},
renderTable = function(table, rows, c) {
c.isDisabled = false; // needed because sorting will change the page and re-enable the pager
var i, j, o, $tb,
l = rows.length,
s = ( c.page * c.size ),
e = ( s + c.size );
if ( l < 1 ) { return; } // empty table, abort!
if (c.initialized) { $(table).trigger('pagerChange', c); }
if ( !c.removeRows ) {
hideRows(table, c);
} else {
if ( e > rows.length ) {
e = rows.length;
}
$.tablesorter.clearTableBody(table);
$tb = $.tablesorter.processTbody(table, table.config.$tbodies.eq(0), true);
for ( i = s; i < e; i++ ) {
o = rows[i];
l = o.length;
for ( j = 0; j < l; j++ ) {
$tb.appendChild(o[j]);
}
}
$.tablesorter.processTbody(table, $tb, false);
}
if ( c.page >= c.totalPages ) {
moveToLastPage(table, c);
}
updatePageDisplay(table, c);
if ( !c.isDisabled ) { fixHeight(table, c); }
$(table).trigger('applyWidgets');
},
showAllRows = function(table, c){
if ( c.ajax ) {
pagerArrows(c, true);
} else {
c.isDisabled = true;
$.data(table, 'pagerLastPage', c.page);
$.data(table, 'pagerLastSize', c.size);
c.page = 0;
c.size = c.totalRows;
c.totalPages = 1;
$(table).find('tr.pagerSavedHeightSpacer').remove();
renderTable(table, table.config.rowsCopy, c);
}
// disable size selector
c.$size.add(c.$goto).each(function(){
$(this).addClass(c.cssDisabled)[0].disabled = true;
});
},
moveToPage = function(table, c, flag) {
if ( c.isDisabled ) { return; }
var p = Math.min( c.totalPages, c.filteredPages );
if ( c.page < 0 ) { c.page = 0; }
if ( c.page > ( p - 1 ) && p !== 0 ) { c.page = p - 1; }
if (c.ajax) {
getAjax(table, c);
} else if (!c.ajax) {
renderTable(table, table.config.rowsCopy, c);
}
$.data(table, 'pagerLastPage', c.page);
$.data(table, 'pagerUpdateTriggered', true);
if (c.initialized && flag !== false) {
$(table).trigger('pageMoved', c);
}
},
setPageSize = function(table, size, c) {
c.size = size;
c.$size.val(size);
$.data(table, 'pagerLastPage', c.page);
$.data(table, 'pagerLastSize', c.size);
c.totalPages = Math.ceil( c.totalRows / c.size );
moveToPage(table, c);
},
moveToFirstPage = function(table, c) {
c.page = 0;
moveToPage(table, c);
},
moveToLastPage = function(table, c) {
c.page = ( Math.min( c.totalPages, c.filteredPages ) - 1 );
moveToPage(table, c);
},
moveToNextPage = function(table, c) {
c.page++;
if ( c.page >= ( Math.min( c.totalPages, c.filteredPages ) - 1 ) ) {
c.page = ( Math.min( c.totalPages, c.filteredPages ) - 1 );
}
moveToPage(table, c);
},
moveToPrevPage = function(table, c) {
c.page--;
if ( c.page <= 0 ) {
c.page = 0;
}
moveToPage(table, c);
},
destroyPager = function(table, c){
showAllRows(table, c);
c.$container.hide(); // hide pager
table.config.appender = null; // remove pager appender function
$(table).unbind('destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager');
},
enablePager = function(table, c, triggered){
var p = c.$size.removeClass(c.cssDisabled).removeAttr('disabled');
c.$goto.removeClass(c.cssDisabled).removeAttr('disabled');
c.isDisabled = false;
c.page = $.data(table, 'pagerLastPage') || c.page || 0;
c.size = $.data(table, 'pagerLastSize') || parseInt(p.find('option[selected]').val(), 10) || c.size;
p.val(c.size); // set page size
c.totalPages = Math.ceil( Math.min( c.totalPages, c.filteredPages ) / c.size);
if ( triggered ) {
$(table).trigger('update');
setPageSize(table, c.size, c);
hideRowsSetup(table, c);
fixHeight(table, c);
}
};
$this.appender = function(table, rows) {
var c = table.config.pager;
if ( !c.ajax ) {
table.config.rowsCopy = rows;
c.totalRows = rows.length;
c.size = $.data(table, 'pagerLastSize') || c.size;
c.totalPages = Math.ceil(c.totalRows / c.size);
renderTable(table, rows, c);
}
};
$this.construct = function(settings) {
return this.each(function() {
// check if tablesorter has initialized
if (!(this.config && this.hasInitialized)) { return; }
var t, ctrls, fxn,
config = this.config,
c = config.pager = $.extend( {}, $.tablesorterPager.defaults, settings ),
table = this,
tc = table.config,
$t = $(table),
// added in case the pager is reinitialized after being destroyed.
pager = c.$container = $(c.container).addClass('tablesorter-pager').show();
c.oldAjaxSuccess = c.oldAjaxSuccess || c.ajaxObject.success;
config.appender = $this.appender;
$t
.unbind('filterStart.pager filterEnd.pager sortEnd.pager disable.pager enable.pager destroy.pager update.pager pageSize.pager')
.bind('filterStart.pager', function(e, filters) {
$.data(table, 'pagerUpdateTriggered', false);
c.currentFilters = filters;
})
// update pager after filter widget completes
.bind('filterEnd.pager sortEnd.pager', function(e) {
//Prevent infinite event loops from occuring by setting this in all moveToPage calls and catching it here.
if ($.data(table, 'pagerUpdateTriggered')) {
$.data(table, 'pagerUpdateTriggered', false);
return;
}
//only run the server side sorting if it has been enabled
if (e.type === "filterEnd" || (e.type === "sortEnd" && tc.serverSideSorting)) {
moveToPage(table, c, false);
}
updatePageDisplay(table, c, false);
fixHeight(table, c);
})
.bind('disable.pager', function(e){
e.stopPropagation();
showAllRows(table, c);
})
.bind('enable.pager', function(e){
e.stopPropagation();
enablePager(table, c, true);
})
.bind('destroy.pager', function(e){
e.stopPropagation();
destroyPager(table, c);
})
.bind('update.pager', function(e){
e.stopPropagation();
hideRows(table, c);
})
.bind('pageSize.pager', function(e,v){
e.stopPropagation();
setPageSize(table, parseInt(v, 10) || 10, c);
hideRows(table, c);
updatePageDisplay(table, c, false);
if (c.$size.length) { c.$size.val(c.size); } // twice?
})
.bind('pageSet.pager', function(e,v){
e.stopPropagation();
c.page = (parseInt(v, 10) || 1) - 1;
if (c.$goto.length) { c.$goto.val(c.size); } // twice?
moveToPage(table, c);
updatePageDisplay(table, c, false);
});
// clicked controls
ctrls = [ c.cssFirst, c.cssPrev, c.cssNext, c.cssLast ];
fxn = [ moveToFirstPage, moveToPrevPage, moveToNextPage, moveToLastPage ];
pager.find(ctrls.join(','))
.unbind('click.pager')
.bind('click.pager', function(e){
var i, $t = $(this), l = ctrls.length;
if ( !$t.hasClass(c.cssDisabled) ) {
for (i = 0; i < l; i++) {
if ($t.is(ctrls[i])) {
fxn[i](table, c);
break;
}
}
}
return false;
});
// goto selector
c.$goto = pager.find(c.cssGoto);
if ( c.$goto.length ) {
c.$goto
.unbind('change')
.bind('change', function(){
c.page = $(this).val() - 1;
moveToPage(table, c);
});
updatePageDisplay(table, c, false);
}
// page size selector
c.$size = pager.find(c.cssPageSize);
if ( c.$size.length ) {
c.$size.unbind('change.pager').bind('change.pager', function() {
c.$size.val( $(this).val() ); // in case there are more than one pagers
if ( !$(this).hasClass(c.cssDisabled) ) {
setPageSize(table, parseInt( $(this).val(), 10 ), c);
changeHeight(table, c);
}
return false;
});
}
// clear initialized flag
c.initialized = false;
// before initialization event
$t.trigger('pagerBeforeInitialized', c);
enablePager(table, c, false);
if ( typeof(c.ajaxUrl) === 'string' ) {
// ajax pager; interact with database
c.ajax = true;
//When filtering with ajax, allow only custom filtering function, disable default filtering since it will be done server side.
tc.widgetOptions.filter_serversideFiltering = true;
tc.serverSideSorting = true;
moveToPage(table, c);
} else {
c.ajax = false;
// Regular pager; all rows stored in memory
$(this).trigger("appendCache", true);
hideRowsSetup(table, c);
}
changeHeight(table, c);
// pager initialized
if (!c.ajax) {
c.initialized = true;
$(table).trigger('pagerInitialized', c);
}
});
};
}()
});
// extend plugin scope
$.fn.extend({
tablesorterPager: $.tablesorterPager.construct
});
})(jQuery);
| churchill-lab/qtl-viewer | qtlviewer/static/jquery.tablesorter/addons/pager/jquery.tablesorter.pager.js | JavaScript | gpl-3.0 | 21,755 | [
30522,
1013,
1008,
999,
1008,
7251,
11589,
2121,
3931,
2099,
13354,
2378,
1008,
7172,
1019,
1013,
2676,
1013,
2286,
1008,
1013,
1013,
1008,
1046,
17426,
2102,
16602,
1024,
2995,
1010,
1046,
4226,
2854,
1024,
2995,
1010,
15171,
1024,
6270,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* yeast.cpp is part of Brewtarget, and is Copyright the following
* authors 2009-2014
* - marker5a
* - Philip Greggory Lee <rocketman768@gmail.com>
* - plut0nium
* - Samuel Östling <MrOstling@gmail.com>
*
* Brewtarget 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.
*
* Brewtarget 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/>.
*/
#include <QDomNode>
#include <QDomElement>
#include <QDomText>
#include <QObject>
#include "yeast.h"
#include "brewtarget.h"
QStringList Yeast::types = QStringList() << "Ale" << "Lager" << "Wheat" << "Wine" << "Champagne";
QStringList Yeast::forms = QStringList() << "Liquid" << "Dry" << "Slant" << "Culture";
QStringList Yeast::flocculations = QStringList() << "Low" << "Medium" << "High" << "Very High";
QHash<QString,QString> Yeast::tagToProp = Yeast::tagToPropHash();
QHash<QString,QString> Yeast::tagToPropHash()
{
QHash<QString,QString> propHash;
propHash["NAME"] = "name";
//propHash["TYPE"] = "type";
//propHash["FORM"] = "form";
propHash["AMOUNT"] = "amount";
propHash["INVENTORY"] = "inventory";
propHash["AMOUNT_IS_WEIGHT"] = "amountIsWeight";
propHash["LABORATORY"] = "laboratory";
propHash["PRODUCT_ID"] = "productID";
propHash["MIN_TEMPERATURE"] = "minTemperature_c";
propHash["MAX_TEMPERATURE"] = "maxTemperature_c";
//propHash["FLOCCULATION"] = "flocculation";
propHash["ATTENUATION"] = "attenuation_pct";
propHash["NOTES"] = "notes";
propHash["BEST_FOR"] = "bestFor";
propHash["TIMES_CULTURED"] = "timesCultured";
propHash["MAX_REUSE"] = "maxReuse";
propHash["ADD_TO_SECONDARY"] = "addToSecondary";
return propHash;
}
bool operator<(Yeast &y1, Yeast &y2)
{
return y1.name() < y2.name();
}
bool operator==(Yeast &y1, Yeast &y2)
{
return y1.name() == y2.name();
}
//============================CONSTRUCTORS======================================
Yeast::Yeast()
: BeerXMLElement()
{
}
Yeast::Yeast(Yeast const& other) : BeerXMLElement(other)
{
}
//============================="GET" METHODS====================================
QString Yeast::laboratory() const { return get("laboratory").toString();; }
QString Yeast::productID() const { return get("product_id").toString(); }
QString Yeast::notes() const { return get("notes").toString(); }
QString Yeast::bestFor() const { return get("best_for").toString(); }
const QString Yeast::typeString() const { return types.at(type()); }
const QString Yeast::formString() const { return forms.at(form()); }
const QString Yeast::flocculationString() const { return flocculations.at(flocculation()); }
double Yeast::amount() const { return get("amount").toDouble(); }
double Yeast::minTemperature_c() const { return get("min_temperature").toDouble(); }
double Yeast::maxTemperature_c() const { return get("max_temperature").toDouble(); }
double Yeast::attenuation_pct() const { return get("attenuation").toDouble(); }
int Yeast::inventory() const { return getInventory("quanta").toInt(); }
int Yeast::timesCultured() const { return get("times_cultured").toInt(); }
int Yeast::maxReuse() const { return get("max_reuse").toInt(); }
bool Yeast::addToSecondary() const { return get("add_to_secondary").toBool(); }
bool Yeast::amountIsWeight() const { return get("amount_is_weight").toBool(); }
Yeast::Form Yeast::form() const { return static_cast<Yeast::Form>( forms.indexOf(get("form").toString())); }
Yeast::Flocculation Yeast::flocculation() const { return static_cast<Yeast::Flocculation>( flocculations.indexOf(get("flocculation").toString())); }
Yeast::Type Yeast::type() const { return static_cast<Yeast::Type>( types.indexOf(get("ytype").toString())); }
const QString Yeast::typeStringTr() const
{
static QStringList typesTr = QStringList() << QObject::tr("Ale")
<< QObject::tr("Lager")
<< QObject::tr("Wheat")
<< QObject::tr("Wine")
<< QObject::tr("Champagne");
return typesTr.at(type());
}
const QString Yeast::formStringTr() const
{
static QStringList formsTr = QStringList() << QObject::tr("Liquid")
<< QObject::tr("Dry")
<< QObject::tr("Slant")
<< QObject::tr("Culture");
return formsTr.at(form());
}
const QString Yeast::flocculationStringTr() const
{
static QStringList flocculationsTr = QStringList() << QObject::tr("Low")
<< QObject::tr("Medium")
<< QObject::tr("High")
<< QObject::tr("Very High");
return flocculationsTr.at(flocculation());
}
//============================="SET" METHODS====================================
void Yeast::setType( Yeast::Type t )
{
set("type", "ytype", types.at(t));
}
void Yeast::setForm( Yeast::Form f )
{
set("form", "form", forms.at(f));
}
void Yeast::setAmount( double var )
{
if( var < 0.0 )
Brewtarget::logW( QString("Yeast: amount < 0: %1").arg(var) );
else
set("amount", "amount", var);
}
void Yeast::setInventoryQuanta( int var )
{
if( var < 0.0 )
Brewtarget::logW( QString("Yeast: inventory < 0: %1").arg(var) );
else
setInventory("inventory", "quanta", var);
}
void Yeast::setAmountIsWeight( bool var )
{
set("amountIsWeight", "amount_is_weight", var);
}
void Yeast::setLaboratory( const QString& var )
{
set("laboratory", "laboratory", var);
}
void Yeast::setProductID( const QString& var )
{
set("productID", "product_id", var);
}
void Yeast::setMinTemperature_c( double var )
{
if( var < -273.15 )
return;
else
set("minTemperature_c", "min_temperature", var);
}
void Yeast::setMaxTemperature_c( double var )
{
if( var < -273.15 )
return;
else
set("maxTemperature_c", "max_temperature", var);
}
void Yeast::setFlocculation( Yeast::Flocculation f )
{
set("flocculation", "flocculation", flocculations.at(f));
}
void Yeast::setAttenuation_pct( double var )
{
if( var < 0.0 || var > 100.0 )
return;
else
set("attenuation", "attenuation", var);
}
void Yeast::setNotes( const QString& var )
{
set("notes", "notes", var);
}
void Yeast::setBestFor( const QString& var )
{
set("bestFor", "best_for", var);
}
void Yeast::setTimesCultured( int var )
{
if( var < 0 )
return;
else
set("timesCultured", "times_cultured", var);
}
void Yeast::setMaxReuse( int var )
{
if( var < 0 )
return;
else
set("maxReuse", "max_reuse", var);
}
void Yeast::setAddToSecondary( bool var )
{
set("addToSecondary", "add_to_secondary", var);
}
//========================OTHER METHODS=========================================
bool Yeast::isValidType(const QString& str) const
{
static const QString types[] = {"Ale", "Lager", "Wheat", "Wine", "Champagne"};
unsigned int i, size = 5;
for( i = 0; i < size; ++i )
if( str == types[i] )
return true;
return false;
}
bool Yeast::isValidForm(const QString& str) const
{
static const QString forms[] = {"Liquid", "Dry", "Slant", "Culture"};
unsigned int i, size=4;
for( i = 0; i < size; ++i )
if( str == forms[i] )
return true;
return false;
}
bool Yeast::isValidFlocculation(const QString& str) const
{
static const QString floc[] = {"Low", "Medium", "High", "Very High"};
unsigned int i, size=4;
for( i = 0; i < size; ++i )
if( str == floc[i] )
return true;
return false;
}
| theophae/brewtarget | src/yeast.cpp | C++ | gpl-3.0 | 8,150 | [
30522,
1013,
1008,
1008,
21957,
1012,
18133,
2361,
2003,
2112,
1997,
24702,
7559,
18150,
1010,
1998,
2003,
9385,
1996,
2206,
1008,
6048,
2268,
1011,
2297,
1008,
1011,
12115,
2629,
2050,
1008,
1011,
5170,
18281,
10253,
3389,
1026,
7596,
2386... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Created by Samvel Khalatyan on Dec 12, 2013
// Copyright (c) 2013 Samvel Khalatyan. All rights reserved
//
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
#include <iostream>
#include <sstream>
#include "interface/11.13.h"
using std::cout;
using std::endl;
using std::istream;
using std::istringstream;
using std::shared_ptr;
using std::string;
namespace ex = ex_11_13;
using Token = ex::Token;
using Kind = Token::Kind;
using Itokenstream = ex::Itokenstream;
using Calculator = ex::Calculator;
// -- Token stream
//
Itokenstream::Itokenstream(std::istream &is):
_is{&is}
{}
istream &Itokenstream::stream() const noexcept
{
return *_is;
}
void Itokenstream::stream(istream &is) noexcept
{
_is = &is;
}
Token &Itokenstream::get()
// read next token
{
char ch {0};
do
// skip whitespaces
{
if (!_is->get(ch))
break;
} while(ch != '\n' && isspace(ch));
switch(ch)
{
case 0: // failed to read istream
_current.kind = {Kind::end};
break;
// either white space of semicolon are signals for print command
case '\n':
case ';':
_current = {Kind::print};
break;
case '+':
case '-':
case '*':
case '/':
case '=':
case '(':
case ')':
_current = {static_cast<Kind>(ch)};
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case '.':
_is->putback(ch);
*_is >> _current.value;
_current.kind = Kind::number;
break;
case '@':
{
if (Kind::name == get().kind)
_current.kind = Kind::function;
else
_current.kind = {Kind::function_list};
break;
}
default:
if (isalpha(ch))
// customized name read allows for next token follow the name
// without space
{
_current.name = {ch};
while(_is->get(ch) && isalpha(ch))
_current.name += ch;
_is->putback(ch);
_current.kind = Kind::name;
}
else
{
// failed input
_current.kind = Kind::end;
}
break;
}
return _current;
}
string Itokenstream::get_function()
{
std::string function;
for(char ch; _is->get(ch); )
{
// skip wite spaces at the beginning
if (function.empty() and isspace(ch))
continue;
if (ch == '\n')
break;
function += ch;
}
_current = {Kind::print};
return function;
}
const Token &Itokenstream::current() const noexcept
{
return _current;
}
// -- Calculator
//
Calculator::Calculator():
_its{new Itokenstream{std::cin}}
{
// add several constants
//
_table["pi"] = 3.14;
_table["e"] = 2.71;
_functions["abc"] = "2 + 3";
}
void Calculator::run()
// driver continuously process input
{
while(valid())
{
prompt();
_its->get();
if (Kind::end == _its->current().kind)
break;
if (Kind::print == _its->current().kind)
continue;
if (Kind::function_list == _its->current().kind)
{
for(const auto &f:_functions)
{
cout << "@" << f.first << ": " << f.second << endl;
}
continue;
}
print(expression(false));
}
}
Calculator::value_type Calculator::expression(const bool &get)
{
value_type left = term(get);
while(true)
{
switch(_its->current().kind)
{
case Kind::plus:
left += term(true);
break;
case Kind::minus:
left -= term(true);
break;
default:
return left;
}
}
}
Calculator::value_type Calculator::term(const bool &get)
{
value_type left = primary(get);
while(true)
{
switch(_its->current().kind)
{
case Kind::multiply:
left *= primary(true);
break;
case Kind::divide:
if (value_type value = primary(true))
left /= value;
else
error("division by zero");
break;
default:
return left;
}
}
}
Calculator::value_type Calculator::primary(const bool &get)
{
if (get)
_its->get();
switch(_its->current().kind)
{
case Kind::number:
{
value_type value {_its->current().value};
_its->get();
return value;
}
case Kind::minus:
return -primary(true);
case Kind::name:
{
value_type &value = _table[_its->current().name];
if (Kind::assign == _its->get().kind)
value = expression(true);
return value;
}
case Kind::function:
{
string function_name = _its->current().name;
string &function = _functions[function_name];
if (Kind::assign == _its->get().kind)
function = _its->get_function();
cout << '@' << function_name << ": " << function << endl;
// evaluate function
Calculator calc_ss;
calc_ss._table = _table; // copy constants
calc_ss._functions = _functions; // copy functions
// don't allow recursive calls
calc_ss._functions.erase(function_name);
istringstream iss {function};
calc_ss._its =
shared_ptr<Itokenstream>{new Itokenstream{iss}};
calc_ss._its->get();
return calc_ss.expression(false);
}
case Kind::lp:
{
value_type value = expression(true);
if (Kind::rp == _its->current().kind)
{
_its->get(); // eat ')'
return value;
}
// fall through
}
default:
error("unsupported primary");
}
return 1;
}
void Calculator::error(const std::string &message)
{
++_errors;
std::cerr << message << endl;
}
const int &Calculator::errors() const noexcept
{
return _errors;
}
bool Calculator::valid()
{
return not _errors;
}
void Calculator::print(const value_type &value)
{
std::cout << value << endl;
}
void Calculator::prompt()
{
cout << ">>> ";
}
| skhal/tcpppl | src/11.13.cc | C++ | mit | 6,976 | [
30522,
1013,
1013,
2580,
2011,
3520,
15985,
1047,
19531,
21426,
2078,
2006,
11703,
2260,
1010,
2286,
1013,
1013,
9385,
1006,
1039,
1007,
2286,
3520,
15985,
1047,
19531,
21426,
2078,
1012,
2035,
2916,
9235,
1013,
1013,
1013,
1013,
2224,
1997... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /Applications/CLion.app/Contents/bin/cmake/bin/cmake
# The command to remove a file.
RM = /Applications/CLion.app/Contents/bin/cmake/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = "/Users/sunqilong/Desktop/acm clion/Blue Jeans"
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = "/Users/sunqilong/Desktop/acm clion/Blue Jeans/cmake-build-debug"
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/Applications/CLion.app/Contents/bin/cmake/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
/Applications/CLion.app/Contents/bin/cmake/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# The main all target
all: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start "/Users/sunqilong/Desktop/acm clion/Blue Jeans/cmake-build-debug/CMakeFiles" "/Users/sunqilong/Desktop/acm clion/Blue Jeans/cmake-build-debug/CMakeFiles/progress.marks"
$(MAKE) -f CMakeFiles/Makefile2 all
$(CMAKE_COMMAND) -E cmake_progress_start "/Users/sunqilong/Desktop/acm clion/Blue Jeans/cmake-build-debug/CMakeFiles" 0
.PHONY : all
# The main clean target
clean:
$(MAKE) -f CMakeFiles/Makefile2 clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast
# clear depends
depend:
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
#=============================================================================
# Target rules for targets named Blue_Jeans
# Build rule for target.
Blue_Jeans: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 Blue_Jeans
.PHONY : Blue_Jeans
# fast build rule for target.
Blue_Jeans/fast:
$(MAKE) -f CMakeFiles/Blue_Jeans.dir/build.make CMakeFiles/Blue_Jeans.dir/build
.PHONY : Blue_Jeans/fast
Blue_Jeans.o: Blue_Jeans.cpp.o
.PHONY : Blue_Jeans.o
# target to build an object file
Blue_Jeans.cpp.o:
$(MAKE) -f CMakeFiles/Blue_Jeans.dir/build.make CMakeFiles/Blue_Jeans.dir/Blue_Jeans.cpp.o
.PHONY : Blue_Jeans.cpp.o
Blue_Jeans.i: Blue_Jeans.cpp.i
.PHONY : Blue_Jeans.i
# target to preprocess a source file
Blue_Jeans.cpp.i:
$(MAKE) -f CMakeFiles/Blue_Jeans.dir/build.make CMakeFiles/Blue_Jeans.dir/Blue_Jeans.cpp.i
.PHONY : Blue_Jeans.cpp.i
Blue_Jeans.s: Blue_Jeans.cpp.s
.PHONY : Blue_Jeans.s
# target to generate assembly for a file
Blue_Jeans.cpp.s:
$(MAKE) -f CMakeFiles/Blue_Jeans.dir/build.make CMakeFiles/Blue_Jeans.dir/Blue_Jeans.cpp.s
.PHONY : Blue_Jeans.cpp.s
main.o: main.cpp.o
.PHONY : main.o
# target to build an object file
main.cpp.o:
$(MAKE) -f CMakeFiles/Blue_Jeans.dir/build.make CMakeFiles/Blue_Jeans.dir/main.cpp.o
.PHONY : main.cpp.o
main.i: main.cpp.i
.PHONY : main.i
# target to preprocess a source file
main.cpp.i:
$(MAKE) -f CMakeFiles/Blue_Jeans.dir/build.make CMakeFiles/Blue_Jeans.dir/main.cpp.i
.PHONY : main.cpp.i
main.s: main.cpp.s
.PHONY : main.s
# target to generate assembly for a file
main.cpp.s:
$(MAKE) -f CMakeFiles/Blue_Jeans.dir/build.make CMakeFiles/Blue_Jeans.dir/main.cpp.s
.PHONY : main.cpp.s
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... rebuild_cache"
@echo "... edit_cache"
@echo "... Blue_Jeans"
@echo "... Blue_Jeans.o"
@echo "... Blue_Jeans.i"
@echo "... Blue_Jeans.s"
@echo "... main.o"
@echo "... main.i"
@echo "... main.s"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
| sunmoyi/ACM | acm clion/Blue Jeans/cmake-build-debug/Makefile | Makefile | gpl-2.0 | 5,871 | [
30522,
1001,
4642,
13808,
7013,
5371,
1024,
2079,
2025,
10086,
999,
1001,
7013,
2011,
1000,
19998,
2191,
8873,
4244,
1000,
13103,
1010,
4642,
13808,
2544,
1017,
1012,
1021,
1001,
12398,
4539,
6472,
2043,
2053,
9918,
2024,
2445,
2000,
2191,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Add-VSWAFv2RuleGroupQueryString
## SYNOPSIS
Adds an AWS::WAFv2::RuleGroup.QueryString resource property to the template.
## SYNTAX
```
Add-VSWAFv2RuleGroupQueryString [<CommonParameters>]
```
## DESCRIPTION
Adds an AWS::WAFv2::RuleGroup.QueryString resource property to the template.
## PARAMETERS
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### Vaporshell.Resource.WAFv2.RuleGroup.QueryString
## NOTES
## RELATED LINKS
[http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-querystring.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-querystring.html)
| scrthq/Vaporshell | docs/docs/glossary/Add-VSWAFv2RuleGroupQueryString.md | Markdown | apache-2.0 | 971 | [
30522,
1001,
5587,
1011,
5443,
4213,
2546,
2615,
2475,
6820,
23115,
22107,
4226,
24769,
18886,
3070,
1001,
1001,
19962,
22599,
9909,
2019,
22091,
2015,
1024,
1024,
11333,
2546,
2615,
2475,
1024,
1024,
3627,
17058,
1012,
23032,
3367,
4892,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import React from 'react';
const Footer = () => (
<div className="col s12 home-inner footer" >
<div className="inner-content center m-auto">
<p> Copyright © 2017 Andela24 News - All rights reserved </p>
</div>
</div>
);
export default Footer;
| Boluwatifes/andela24 | src/app/components/Footer.js | JavaScript | mit | 270 | [
30522,
12324,
10509,
2013,
1005,
10509,
1005,
1025,
9530,
3367,
3329,
2121,
1027,
1006,
1007,
1027,
1028,
1006,
1026,
4487,
2615,
2465,
18442,
1027,
1000,
8902,
1055,
12521,
2188,
1011,
5110,
3329,
2121,
1000,
1028,
1026,
4487,
2615,
2465,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/usr/bin/python
from heapq import heapify, heapreplace
class Solution(object):
def kthSmallest(self, matrix, k):
"""
:type matrix: List[List[int]]
:type k: int
:rtype: int
"""
if len(matrix) is 1:
return matrix[0][0]
z = zip(*matrix[1:])
h = [(matrix[0][i], z[i]) for i in xrange(len(matrix))]
heapify(h)
i = 0
while i < k - 1:
val, nextval = h[0]
if nextval:
heapreplace(h, (nextval[0], nextval[1:]))
else:
heappop(h)
i += 1
return h[0][0]
a = [[1,5,10], [4,5,11], [7,8,12]]
s = Solution()
print s.kthSmallest(a, 3)
| pisskidney/leetcode | medium/378.py | Python | mit | 745 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
18750,
2013,
16721,
4160,
12324,
16721,
8757,
1010,
16721,
2890,
24759,
10732,
2465,
5576,
1006,
4874,
1007,
1024,
13366,
1047,
26830,
9067,
4244,
2102,
1006,
2969,
1010,
8185,
1010,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stddef.h>
#include "sync/api/attachments/attachment_metadata.h"
namespace syncer {
AttachmentMetadata::AttachmentMetadata(const AttachmentId& id, size_t size)
: id_(id), size_(size) {
}
AttachmentMetadata::~AttachmentMetadata() {
}
const AttachmentId& AttachmentMetadata::GetId() const {
return id_;
}
size_t AttachmentMetadata::GetSize() const {
return size_;
}
} // namespace syncer
| js0701/chromium-crosswalk | sync/api/attachments/attachment_metadata.cc | C++ | bsd-3-clause | 577 | [
30522,
1013,
1013,
9385,
2297,
1996,
10381,
21716,
5007,
6048,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
2224,
1997,
2023,
3120,
3642,
2003,
9950,
2011,
1037,
18667,
2094,
1011,
2806,
6105,
2008,
2064,
2022,
1013,
1013,
2179,
1999,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
version https://git-lfs.github.com/spec/v1
oid sha256:8ecad6ce4ab24b16dd86e293b01f4b3d0ea62911d34288c6c78a9e6fe6b7da46
size 4972
| yogeshsaroya/new-cdnjs | ajax/libs/semantic-ui/1.11.3/components/image.css | CSS | mit | 129 | [
30522,
2544,
16770,
1024,
1013,
1013,
21025,
2102,
1011,
1048,
10343,
1012,
21025,
2705,
12083,
1012,
4012,
1013,
28699,
1013,
1058,
2487,
1051,
3593,
21146,
17788,
2575,
1024,
1022,
19281,
2094,
2575,
3401,
2549,
7875,
18827,
2497,
16048,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import complexism as cx
import complexism.agentbased.statespace as ss
import epidag as dag
dbp = cx.read_dbp_script(cx.load_txt('../scripts/SIR_BN.txt'))
pc = dag.quick_build_parameter_core(cx.load_txt('../scripts/pSIR.txt'))
dc = dbp.generate_model('M1', **pc.get_samplers())
ag = ss.StSpAgent('Helen', dc['Sus'], pc)
model = cx.SingleIndividualABM('M1', ag)
model.add_observing_attribute('State')
print(cx.simulate(model, None, 0, 10, 1))
| TimeWz667/Kamanian | example/OOP/O2.4 SS, Single agent model.py | Python | mit | 446 | [
30522,
12324,
3375,
2964,
2004,
1039,
2595,
12324,
3375,
2964,
1012,
4005,
15058,
2094,
1012,
2163,
15327,
2004,
7020,
12324,
4958,
8524,
2290,
2004,
4830,
2290,
16962,
2361,
1027,
1039,
2595,
1012,
3191,
1035,
16962,
2361,
1035,
5896,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
var Court = artifacts.require("./Court.sol");
contract('Court', (accounts) => {
it("test kleroterion", () => {})
})
| kleroterion/dapp | test/kleroterion.js | JavaScript | mit | 119 | [
30522,
13075,
2457,
1027,
10471,
1012,
5478,
1006,
1000,
1012,
1013,
2457,
1012,
14017,
1000,
1007,
1025,
3206,
1006,
1005,
2457,
1005,
1010,
1006,
6115,
1007,
1027,
1028,
1063,
2009,
1006,
1000,
3231,
1047,
3917,
12184,
14772,
1000,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<div class="container-fluid">
<div class="row">
<div class="col-lg-12"><h1 class="page-header">Monitor Reports</h1></div>
<!-- /.col-lg-12 --> </div>
<!-- /.row --> </div>
<div class="row">
<div class="col-lg-12" ng-controller="monitorReportCtrl">
<div class="panel panel-primary">
<div class="panel-heading"> Monitor Report List</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="at-list-table">
<thead>
<tr>
<th width="10%">#
<th width="30%">Description
<th width="20%">Method
<th width="20%">Protocol
<th width="10%">Status
<tbody>
<tr ng-repeat="el in listBean">
<td>{{el.id}}
<td>{{el.desc}}
<td>{{el.method}}
<td>{{el.protocol}}
<td>{{el.status}}
</table>
</div>
<!-- /.table-responsive --> </div>
<div class="panel-footer">
</div>
<delete></delete>
<!-- /.panel-body --> </div>
<!-- /.panel --> </div>
<!-- /.col-lg-12 --></div> | PendikBelediyesi/AquilaMonitor | src/main/webapp/admin/views/monitor/reports.html | HTML | mit | 1,546 | [
30522,
1026,
4487,
2615,
2465,
1027,
1000,
11661,
1011,
8331,
1000,
1028,
1026,
4487,
2615,
2465,
1027,
1000,
5216,
1000,
1028,
1026,
4487,
2615,
2465,
1027,
1000,
8902,
1011,
1048,
2290,
1011,
2260,
1000,
1028,
1026,
1044,
2487,
2465,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Implements parallel traversals over the DOM and flow trees.
//!
//! This code is highly unsafe. Keep this file small and easy to audit.
use context::{LayoutContext, SharedLayoutContext};
use flow::{Flow, MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal};
use flow;
use flow_ref::FlowRef;
use traversal::{RecalcStyleForNode, ConstructFlows};
use traversal::{BubbleISizes, AssignISizes, AssignBSizesAndStoreOverflow};
use traversal::{ComputeAbsolutePositions, BuildDisplayList};
use util::{LayoutDataAccess, LayoutDataWrapper};
use wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_node, LayoutNode};
use wrapper::{PostorderNodeMutTraversal, UnsafeLayoutNode};
use wrapper::{PreorderDomTraversal, PostorderDomTraversal};
use servo_util::opts;
use servo_util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan, profile};
use servo_util::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
use std::mem;
use std::ptr;
use std::sync::atomic::{AtomicInt, Relaxed, SeqCst};
#[allow(dead_code)]
fn static_assertion(node: UnsafeLayoutNode) {
unsafe {
let _: UnsafeFlow = ::std::intrinsics::transmute(node);
}
}
/// Vtable + pointer representation of a Flow trait object.
pub type UnsafeFlow = (uint, uint);
fn null_unsafe_flow() -> UnsafeFlow {
(0, 0)
}
pub fn owned_flow_to_unsafe_flow(flow: *const FlowRef) -> UnsafeFlow {
unsafe {
mem::transmute_copy(&*flow)
}
}
pub fn mut_owned_flow_to_unsafe_flow(flow: *mut FlowRef) -> UnsafeFlow {
unsafe {
mem::transmute_copy(&*flow)
}
}
pub fn borrowed_flow_to_unsafe_flow(flow: &Flow) -> UnsafeFlow {
unsafe {
mem::transmute_copy(&flow)
}
}
pub fn mut_borrowed_flow_to_unsafe_flow(flow: &mut Flow) -> UnsafeFlow {
unsafe {
mem::transmute_copy(&flow)
}
}
/// Information that we need stored in each DOM node.
pub struct DomParallelInfo {
/// The number of children that still need work done.
pub children_count: AtomicInt,
}
impl DomParallelInfo {
pub fn new() -> DomParallelInfo {
DomParallelInfo {
children_count: AtomicInt::new(0),
}
}
}
/// A parallel top-down DOM traversal.
pub trait ParallelPreorderDomTraversal : PreorderDomTraversal {
fn run_parallel(&self,
node: UnsafeLayoutNode,
proxy: &mut WorkerProxy<*const SharedLayoutContext,UnsafeLayoutNode>);
#[inline(always)]
fn run_parallel_helper(&self,
unsafe_node: UnsafeLayoutNode,
proxy: &mut WorkerProxy<*const SharedLayoutContext,UnsafeLayoutNode>,
top_down_func: extern "Rust" fn(UnsafeFlow,
&mut WorkerProxy<*const SharedLayoutContext,
UnsafeLayoutNode>),
bottom_up_func: extern "Rust" fn(UnsafeFlow,
&mut WorkerProxy<*const SharedLayoutContext,
UnsafeFlow>)) {
// Get a real layout node.
let node: LayoutNode = unsafe {
layout_node_from_unsafe_layout_node(&unsafe_node)
};
// Perform the appropriate traversal.
self.process(node);
// NB: O(n).
let child_count = node.children().count();
// Reset the count of children.
{
let mut layout_data_ref = node.mutate_layout_data();
let layout_data = layout_data_ref.as_mut().expect("no layout data");
layout_data.data.parallel.children_count.store(child_count as int, Relaxed);
}
// Possibly enqueue the children.
if child_count != 0 {
for kid in node.children() {
proxy.push(WorkUnit {
fun: top_down_func,
data: layout_node_to_unsafe_layout_node(&kid),
});
}
} else {
// If there were no more children, start walking back up.
bottom_up_func(unsafe_node, proxy)
}
}
}
/// A parallel bottom-up DOM traversal.
trait ParallelPostorderDomTraversal : PostorderDomTraversal {
/// Process current node and potentially traverse its ancestors.
///
/// If we are the last child that finished processing, recursively process
/// our parent. Else, stop. Also, stop at the root.
///
/// Thus, if we start with all the leaves of a tree, we end up traversing
/// the whole tree bottom-up because each parent will be processed exactly
/// once (by the last child that finishes processing).
///
/// The only communication between siblings is that they both
/// fetch-and-subtract the parent's children count.
fn run_parallel(&self,
mut unsafe_node: UnsafeLayoutNode,
proxy: &mut WorkerProxy<*const SharedLayoutContext,UnsafeLayoutNode>) {
loop {
// Get a real layout node.
let node: LayoutNode = unsafe {
layout_node_from_unsafe_layout_node(&unsafe_node)
};
// Perform the appropriate traversal.
self.process(node);
let shared_layout_context = unsafe { &**proxy.user_data() };
let layout_context = LayoutContext::new(shared_layout_context);
let parent =
match node.layout_parent_node(layout_context.shared) {
None => break,
Some(parent) => parent,
};
unsafe {
let parent_layout_data =
(*parent.borrow_layout_data_unchecked())
.as_ref()
.expect("no layout data");
unsafe_node = layout_node_to_unsafe_layout_node(&parent);
let parent_layout_data: &mut LayoutDataWrapper = mem::transmute(parent_layout_data);
if parent_layout_data
.data
.parallel
.children_count
.fetch_sub(1, SeqCst) == 1 {
// We were the last child of our parent. Construct flows for our parent.
} else {
// Get out of here and find another node to work on.
break
}
}
}
}
}
/// Information that we need stored in each flow.
pub struct FlowParallelInfo {
/// The number of children that still need work done.
pub children_count: AtomicInt,
/// The address of the parent flow.
pub parent: UnsafeFlow,
}
impl FlowParallelInfo {
pub fn new() -> FlowParallelInfo {
FlowParallelInfo {
children_count: AtomicInt::new(0),
parent: null_unsafe_flow(),
}
}
}
/// A parallel bottom-up flow traversal.
trait ParallelPostorderFlowTraversal : PostorderFlowTraversal {
/// Process current flow and potentially traverse its ancestors.
///
/// If we are the last child that finished processing, recursively process
/// our parent. Else, stop. Also, stop at the root.
///
/// Thus, if we start with all the leaves of a tree, we end up traversing
/// the whole tree bottom-up because each parent will be processed exactly
/// once (by the last child that finishes processing).
///
/// The only communication between siblings is that they both
/// fetch-and-subtract the parent's children count.
fn run_parallel(&self,
mut unsafe_flow: UnsafeFlow,
_: &mut WorkerProxy<*const SharedLayoutContext,UnsafeFlow>) {
loop {
unsafe {
// Get a real flow.
let flow: &mut FlowRef = mem::transmute(&unsafe_flow);
// Perform the appropriate traversal.
if self.should_process(flow.deref_mut()) {
self.process(flow.deref_mut());
}
let base = flow::mut_base(flow.deref_mut());
// Reset the count of children for the next layout traversal.
base.parallel.children_count.store(base.children.len() as int, Relaxed);
// Possibly enqueue the parent.
let unsafe_parent = base.parallel.parent;
if unsafe_parent == null_unsafe_flow() {
// We're done!
break
}
// No, we're not at the root yet. Then are we the last child
// of our parent to finish processing? If so, we can continue
// on with our parent; otherwise, we've gotta wait.
let parent: &mut FlowRef = mem::transmute(&unsafe_parent);
let parent_base = flow::mut_base(parent.deref_mut());
if parent_base.parallel.children_count.fetch_sub(1, SeqCst) == 1 {
// We were the last child of our parent. Reflow our parent.
unsafe_flow = unsafe_parent
} else {
// Stop.
break
}
}
}
}
}
/// A parallel top-down flow traversal.
trait ParallelPreorderFlowTraversal : PreorderFlowTraversal {
fn run_parallel(&self,
unsafe_flow: UnsafeFlow,
proxy: &mut WorkerProxy<*const SharedLayoutContext,UnsafeFlow>);
#[inline(always)]
fn run_parallel_helper(&self,
unsafe_flow: UnsafeFlow,
proxy: &mut WorkerProxy<*const SharedLayoutContext,UnsafeFlow>,
top_down_func: extern "Rust" fn(UnsafeFlow,
&mut WorkerProxy<*const SharedLayoutContext,
UnsafeFlow>),
bottom_up_func: extern "Rust" fn(UnsafeFlow,
&mut WorkerProxy<*const SharedLayoutContext,
UnsafeFlow>)) {
let mut had_children = false;
unsafe {
// Get a real flow.
let flow: &mut FlowRef = mem::transmute(&unsafe_flow);
if self.should_process(flow.deref_mut()) {
// Perform the appropriate traversal.
self.process(flow.deref_mut());
}
// Possibly enqueue the children.
for kid in flow::child_iter(flow.deref_mut()) {
had_children = true;
proxy.push(WorkUnit {
fun: top_down_func,
data: borrowed_flow_to_unsafe_flow(kid),
});
}
}
// If there were no more children, start assigning block-sizes.
if !had_children {
bottom_up_func(unsafe_flow, proxy)
}
}
}
impl<'a> ParallelPostorderFlowTraversal for BubbleISizes<'a> {}
impl<'a> ParallelPreorderFlowTraversal for AssignISizes<'a> {
fn run_parallel(&self,
unsafe_flow: UnsafeFlow,
proxy: &mut WorkerProxy<*const SharedLayoutContext,UnsafeFlow>) {
self.run_parallel_helper(unsafe_flow,
proxy,
assign_inline_sizes,
assign_block_sizes_and_store_overflow)
}
}
impl<'a> ParallelPostorderFlowTraversal for AssignBSizesAndStoreOverflow<'a> {}
impl<'a> ParallelPreorderFlowTraversal for ComputeAbsolutePositions<'a> {
fn run_parallel(&self,
unsafe_flow: UnsafeFlow,
proxy: &mut WorkerProxy<*const SharedLayoutContext, UnsafeFlow>) {
self.run_parallel_helper(unsafe_flow,
proxy,
compute_absolute_positions,
build_display_list)
}
}
impl<'a> ParallelPostorderFlowTraversal for BuildDisplayList<'a> {}
impl<'a> ParallelPostorderDomTraversal for ConstructFlows<'a> {}
impl <'a> ParallelPreorderDomTraversal for RecalcStyleForNode<'a> {
fn run_parallel(&self,
unsafe_node: UnsafeLayoutNode,
proxy: &mut WorkerProxy<*const SharedLayoutContext, UnsafeLayoutNode>) {
self.run_parallel_helper(unsafe_node,
proxy,
recalc_style,
construct_flows)
}
}
fn recalc_style(unsafe_node: UnsafeLayoutNode,
proxy: &mut WorkerProxy<*const SharedLayoutContext, UnsafeLayoutNode>) {
let shared_layout_context = unsafe { &**proxy.user_data() };
let layout_context = LayoutContext::new(shared_layout_context);
let recalc_style_for_node_traversal = RecalcStyleForNode {
layout_context: &layout_context,
};
recalc_style_for_node_traversal.run_parallel(unsafe_node, proxy)
}
fn construct_flows(unsafe_node: UnsafeLayoutNode,
proxy: &mut WorkerProxy<*const SharedLayoutContext, UnsafeLayoutNode>) {
let shared_layout_context = unsafe { &**proxy.user_data() };
let layout_context = LayoutContext::new(shared_layout_context);
let construct_flows_traversal = ConstructFlows {
layout_context: &layout_context,
};
construct_flows_traversal.run_parallel(unsafe_node, proxy)
}
fn assign_inline_sizes(unsafe_flow: UnsafeFlow,
proxy: &mut WorkerProxy<*const SharedLayoutContext,UnsafeFlow>) {
let shared_layout_context = unsafe { &**proxy.user_data() };
let layout_context = LayoutContext::new(shared_layout_context);
let assign_inline_sizes_traversal = AssignISizes {
layout_context: &layout_context,
};
assign_inline_sizes_traversal.run_parallel(unsafe_flow, proxy)
}
fn assign_block_sizes_and_store_overflow(unsafe_flow: UnsafeFlow,
proxy: &mut WorkerProxy<*const SharedLayoutContext,UnsafeFlow>) {
let shared_layout_context = unsafe { &**proxy.user_data() };
let layout_context = LayoutContext::new(shared_layout_context);
let assign_block_sizes_traversal = AssignBSizesAndStoreOverflow {
layout_context: &layout_context,
};
assign_block_sizes_traversal.run_parallel(unsafe_flow, proxy)
}
fn compute_absolute_positions(unsafe_flow: UnsafeFlow,
proxy: &mut WorkerProxy<*const SharedLayoutContext, UnsafeFlow>) {
let shared_layout_context = unsafe { &**proxy.user_data() };
let layout_context = LayoutContext::new(shared_layout_context);
let compute_absolute_positions_traversal = ComputeAbsolutePositions {
layout_context: &layout_context,
};
compute_absolute_positions_traversal.run_parallel(unsafe_flow, proxy);
}
fn build_display_list(unsafe_flow: UnsafeFlow,
proxy: &mut WorkerProxy<*const SharedLayoutContext, UnsafeFlow>) {
let shared_layout_context = unsafe { &**proxy.user_data() };
let layout_context = LayoutContext::new(shared_layout_context);
let build_display_list_traversal = BuildDisplayList {
layout_context: &layout_context,
};
build_display_list_traversal.run_parallel(unsafe_flow, proxy);
}
pub fn traverse_dom_preorder(root: LayoutNode,
shared_layout_context: &SharedLayoutContext,
queue: &mut WorkQueue<*const SharedLayoutContext, UnsafeLayoutNode>) {
queue.data = shared_layout_context as *const _;
queue.push(WorkUnit {
fun: recalc_style,
data: layout_node_to_unsafe_layout_node(&root),
});
queue.run();
queue.data = ptr::null();
}
pub fn traverse_flow_tree_preorder(root: &mut FlowRef,
profiler_metadata: ProfilerMetadata,
time_profiler_chan: TimeProfilerChan,
shared_layout_context: &SharedLayoutContext,
queue: &mut WorkQueue<*const SharedLayoutContext,UnsafeFlow>) {
if opts::get().bubble_inline_sizes_separately {
let layout_context = LayoutContext::new(shared_layout_context);
let bubble_inline_sizes = BubbleISizes { layout_context: &layout_context };
root.deref_mut().traverse_postorder(&bubble_inline_sizes);
}
queue.data = shared_layout_context as *const _;
profile(TimeProfilerCategory::LayoutParallelWarmup, profiler_metadata,
time_profiler_chan, || {
queue.push(WorkUnit {
fun: assign_inline_sizes,
data: mut_owned_flow_to_unsafe_flow(root),
})
});
queue.run();
queue.data = ptr::null()
}
pub fn build_display_list_for_subtree(root: &mut FlowRef,
profiler_metadata: ProfilerMetadata,
time_profiler_chan: TimeProfilerChan,
shared_layout_context: &SharedLayoutContext,
queue: &mut WorkQueue<*const SharedLayoutContext,UnsafeFlow>) {
queue.data = shared_layout_context as *const _;
profile(TimeProfilerCategory::LayoutParallelWarmup, profiler_metadata,
time_profiler_chan, || {
queue.push(WorkUnit {
fun: compute_absolute_positions,
data: mut_owned_flow_to_unsafe_flow(root),
})
});
queue.run();
queue.data = ptr::null()
}
| chotchki/servo | components/layout/parallel.rs | Rust | mpl-2.0 | 17,887 | [
30522,
1013,
1008,
2023,
3120,
3642,
2433,
2003,
3395,
2000,
1996,
3408,
1997,
1996,
9587,
5831,
4571,
2270,
1008,
6105,
1010,
1058,
1012,
1016,
1012,
1014,
1012,
2065,
1037,
6100,
1997,
1996,
6131,
2140,
2001,
2025,
5500,
2007,
2023,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS 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. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*
* The following #error directive is to remind users that a batch file must be
* executed prior to this project being built. The batch file *cannot* be
* executed from within the IDE! Once it has been executed, re-open or refresh
* the Eclipse project and remove the #error line below.
*/
#error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above.
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
#include <stdint.h>
extern uint32_t SystemCoreClock;
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 130 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 40960 ) )
#define configMAX_TASK_NAME_LEN ( 10 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 8
#define configCHECK_FOR_STACK_OVERFLOW 2
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_MALLOC_FAILED_HOOK 1
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configGENERATE_RUN_TIME_STATS 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Software timer definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( 2 )
#define configTIMER_QUEUE_LENGTH 5
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 1
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
/* Cortex-M specific definitions. */
#ifdef __NVIC_PRIO_BITS
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
#define configPRIO_BITS __NVIC_PRIO_BITS
#else
#define configPRIO_BITS 6 /* 63 priority levels */
#endif
/* The lowest interrupt priority that can be used in a call to a "set priority"
function. */
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x3f
/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
/* Interrupt priorities used by the kernel port layer itself. These are generic
to all Cortex-M ports, and do not rely on any particular library functions. */
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
/* Normal assert() semantics without relying on the provision of an assert.h
header file. */
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
standard names. */
#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
#define xPortSysTickHandler SysTick_Handler
#endif /* FREERTOS_CONFIG_H */
| RobsonRojas/frertos-udemy | Keil-FreeRTOS-Sample-Project/Keil-FreeRTOS/FreeRTOSv9.0.0/FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/src/FreeRTOSConfig.h | C | gpl-3.0 | 8,028 | [
30522,
1013,
1008,
2489,
5339,
2891,
1058,
2683,
1012,
1014,
1012,
1014,
1011,
9385,
1006,
1039,
1007,
2355,
2613,
2051,
6145,
5183,
1012,
2035,
2916,
9235,
3942,
8299,
1024,
1013,
1013,
7479,
1012,
2489,
5339,
2891,
1012,
8917,
2000,
567... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* PowerNV setup code.
*
* Copyright 2011 IBM Corp.
*/
#undef DEBUG
#include <linux/cpu.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/tty.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/console.h>
#include <linux/delay.h>
#include <linux/irq.h>
#include <linux/seq_file.h>
#include <linux/of.h>
#include <linux/of_fdt.h>
#include <linux/interrupt.h>
#include <linux/bug.h>
#include <linux/pci.h>
#include <linux/cpufreq.h>
#include <linux/memblock.h>
#include <asm/machdep.h>
#include <asm/firmware.h>
#include <asm/xics.h>
#include <asm/xive.h>
#include <asm/opal.h>
#include <asm/kexec.h>
#include <asm/smp.h>
#include <asm/tm.h>
#include <asm/setup.h>
#include <asm/security_features.h>
#include "powernv.h"
static bool fw_feature_is(const char *state, const char *name,
struct device_node *fw_features)
{
struct device_node *np;
bool rc = false;
np = of_get_child_by_name(fw_features, name);
if (np) {
rc = of_property_read_bool(np, state);
of_node_put(np);
}
return rc;
}
static void init_fw_feat_flags(struct device_node *np)
{
if (fw_feature_is("enabled", "inst-spec-barrier-ori31,31,0", np))
security_ftr_set(SEC_FTR_SPEC_BAR_ORI31);
if (fw_feature_is("enabled", "fw-bcctrl-serialized", np))
security_ftr_set(SEC_FTR_BCCTRL_SERIALISED);
if (fw_feature_is("enabled", "inst-l1d-flush-ori30,30,0", np))
security_ftr_set(SEC_FTR_L1D_FLUSH_ORI30);
if (fw_feature_is("enabled", "inst-l1d-flush-trig2", np))
security_ftr_set(SEC_FTR_L1D_FLUSH_TRIG2);
if (fw_feature_is("enabled", "fw-l1d-thread-split", np))
security_ftr_set(SEC_FTR_L1D_THREAD_PRIV);
if (fw_feature_is("enabled", "fw-count-cache-disabled", np))
security_ftr_set(SEC_FTR_COUNT_CACHE_DISABLED);
if (fw_feature_is("enabled", "fw-count-cache-flush-bcctr2,0,0", np))
security_ftr_set(SEC_FTR_BCCTR_FLUSH_ASSIST);
if (fw_feature_is("enabled", "needs-count-cache-flush-on-context-switch", np))
security_ftr_set(SEC_FTR_FLUSH_COUNT_CACHE);
/*
* The features below are enabled by default, so we instead look to see
* if firmware has *disabled* them, and clear them if so.
*/
if (fw_feature_is("disabled", "speculation-policy-favor-security", np))
security_ftr_clear(SEC_FTR_FAVOUR_SECURITY);
if (fw_feature_is("disabled", "needs-l1d-flush-msr-pr-0-to-1", np))
security_ftr_clear(SEC_FTR_L1D_FLUSH_PR);
if (fw_feature_is("disabled", "needs-l1d-flush-msr-hv-1-to-0", np))
security_ftr_clear(SEC_FTR_L1D_FLUSH_HV);
if (fw_feature_is("disabled", "needs-spec-barrier-for-bound-checks", np))
security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR);
}
static void pnv_setup_security_mitigations(void)
{
struct device_node *np, *fw_features;
enum l1d_flush_type type;
bool enable;
/* Default to fallback in case fw-features are not available */
type = L1D_FLUSH_FALLBACK;
np = of_find_node_by_name(NULL, "ibm,opal");
fw_features = of_get_child_by_name(np, "fw-features");
of_node_put(np);
if (fw_features) {
init_fw_feat_flags(fw_features);
of_node_put(fw_features);
if (security_ftr_enabled(SEC_FTR_L1D_FLUSH_TRIG2))
type = L1D_FLUSH_MTTRIG;
if (security_ftr_enabled(SEC_FTR_L1D_FLUSH_ORI30))
type = L1D_FLUSH_ORI;
}
/*
* If we are non-Power9 bare metal, we don't need to flush on kernel
* entry or after user access: they fix a P9 specific vulnerability.
*/
if (!pvr_version_is(PVR_POWER9)) {
security_ftr_clear(SEC_FTR_L1D_FLUSH_ENTRY);
security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS);
}
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) && \
(security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR) || \
security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV));
setup_rfi_flush(type, enable);
setup_count_cache_flush();
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
security_ftr_enabled(SEC_FTR_L1D_FLUSH_ENTRY);
setup_entry_flush(enable);
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
security_ftr_enabled(SEC_FTR_L1D_FLUSH_UACCESS);
setup_uaccess_flush(enable);
setup_stf_barrier();
}
static void __init pnv_check_guarded_cores(void)
{
struct device_node *dn;
int bad_count = 0;
for_each_node_by_type(dn, "cpu") {
if (of_property_match_string(dn, "status", "bad") >= 0)
bad_count++;
};
if (bad_count) {
printk(" _ _______________\n");
pr_cont(" | | / \\\n");
pr_cont(" | | | WARNING! |\n");
pr_cont(" | | | |\n");
pr_cont(" | | | It looks like |\n");
pr_cont(" |_| | you have %*d |\n", 3, bad_count);
pr_cont(" _ | guarded cores |\n");
pr_cont(" (_) \\_______________/\n");
}
}
static void __init pnv_setup_arch(void)
{
set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT);
pnv_setup_security_mitigations();
/* Initialize SMP */
pnv_smp_init();
/* Setup PCI */
pnv_pci_init();
/* Setup RTC and NVRAM callbacks */
if (firmware_has_feature(FW_FEATURE_OPAL))
opal_nvram_init();
/* Enable NAP mode */
powersave_nap = 1;
pnv_check_guarded_cores();
/* XXX PMCS */
}
static void __init pnv_init(void)
{
/*
* Initialize the LPC bus now so that legacy serial
* ports can be found on it
*/
opal_lpc_init();
#ifdef CONFIG_HVC_OPAL
if (firmware_has_feature(FW_FEATURE_OPAL))
hvc_opal_init_early();
else
#endif
add_preferred_console("hvc", 0, NULL);
if (!radix_enabled()) {
int i;
/* Allocate per cpu area to save old slb contents during MCE */
for_each_possible_cpu(i)
paca_ptrs[i]->mce_faulty_slbs = memblock_alloc_node(mmu_slb_size, __alignof__(*paca_ptrs[i]->mce_faulty_slbs), cpu_to_node(i));
}
}
static void __init pnv_init_IRQ(void)
{
/* Try using a XIVE if available, otherwise use a XICS */
if (!xive_native_init())
xics_init();
WARN_ON(!ppc_md.get_irq);
}
static void pnv_show_cpuinfo(struct seq_file *m)
{
struct device_node *root;
const char *model = "";
root = of_find_node_by_path("/");
if (root)
model = of_get_property(root, "model", NULL);
seq_printf(m, "machine\t\t: PowerNV %s\n", model);
if (firmware_has_feature(FW_FEATURE_OPAL))
seq_printf(m, "firmware\t: OPAL\n");
else
seq_printf(m, "firmware\t: BML\n");
of_node_put(root);
if (radix_enabled())
seq_printf(m, "MMU\t\t: Radix\n");
else
seq_printf(m, "MMU\t\t: Hash\n");
}
static void pnv_prepare_going_down(void)
{
/*
* Disable all notifiers from OPAL, we can't
* service interrupts anymore anyway
*/
opal_event_shutdown();
/* Print flash update message if one is scheduled. */
opal_flash_update_print_message();
smp_send_stop();
hard_irq_disable();
}
static void __noreturn pnv_restart(char *cmd)
{
long rc;
pnv_prepare_going_down();
do {
if (!cmd || !strlen(cmd))
rc = opal_cec_reboot();
else if (strcmp(cmd, "full") == 0)
rc = opal_cec_reboot2(OPAL_REBOOT_FULL_IPL, NULL);
else if (strcmp(cmd, "mpipl") == 0)
rc = opal_cec_reboot2(OPAL_REBOOT_MPIPL, NULL);
else if (strcmp(cmd, "error") == 0)
rc = opal_cec_reboot2(OPAL_REBOOT_PLATFORM_ERROR, NULL);
else if (strcmp(cmd, "fast") == 0)
rc = opal_cec_reboot2(OPAL_REBOOT_FAST, NULL);
else
rc = OPAL_UNSUPPORTED;
if (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
/* Opal is busy wait for some time and retry */
opal_poll_events(NULL);
mdelay(10);
} else if (cmd && rc) {
/* Unknown error while issuing reboot */
if (rc == OPAL_UNSUPPORTED)
pr_err("Unsupported '%s' reboot.\n", cmd);
else
pr_err("Unable to issue '%s' reboot. Err=%ld\n",
cmd, rc);
pr_info("Forcing a cec-reboot\n");
cmd = NULL;
rc = OPAL_BUSY;
} else if (rc != OPAL_SUCCESS) {
/* Unknown error while issuing cec-reboot */
pr_err("Unable to reboot. Err=%ld\n", rc);
}
} while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT);
for (;;)
opal_poll_events(NULL);
}
static void __noreturn pnv_power_off(void)
{
long rc = OPAL_BUSY;
pnv_prepare_going_down();
while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
rc = opal_cec_power_down(0);
if (rc == OPAL_BUSY_EVENT)
opal_poll_events(NULL);
else
mdelay(10);
}
for (;;)
opal_poll_events(NULL);
}
static void __noreturn pnv_halt(void)
{
pnv_power_off();
}
static void pnv_progress(char *s, unsigned short hex)
{
}
static void pnv_shutdown(void)
{
/* Let the PCI code clear up IODA tables */
pnv_pci_shutdown();
/*
* Stop OPAL activity: Unregister all OPAL interrupts so they
* don't fire up while we kexec and make sure all potentially
* DMA'ing ops are complete (such as dump retrieval).
*/
opal_shutdown();
}
#ifdef CONFIG_KEXEC_CORE
static void pnv_kexec_wait_secondaries_down(void)
{
int my_cpu, i, notified = -1;
my_cpu = get_cpu();
for_each_online_cpu(i) {
uint8_t status;
int64_t rc, timeout = 1000;
if (i == my_cpu)
continue;
for (;;) {
rc = opal_query_cpu_status(get_hard_smp_processor_id(i),
&status);
if (rc != OPAL_SUCCESS || status != OPAL_THREAD_STARTED)
break;
barrier();
if (i != notified) {
printk(KERN_INFO "kexec: waiting for cpu %d "
"(physical %d) to enter OPAL\n",
i, paca_ptrs[i]->hw_cpu_id);
notified = i;
}
/*
* On crash secondaries might be unreachable or hung,
* so timeout if we've waited too long
* */
mdelay(1);
if (timeout-- == 0) {
printk(KERN_ERR "kexec: timed out waiting for "
"cpu %d (physical %d) to enter OPAL\n",
i, paca_ptrs[i]->hw_cpu_id);
break;
}
}
}
}
static void pnv_kexec_cpu_down(int crash_shutdown, int secondary)
{
u64 reinit_flags;
if (xive_enabled())
xive_teardown_cpu();
else
xics_kexec_teardown_cpu(secondary);
/* On OPAL, we return all CPUs to firmware */
if (!firmware_has_feature(FW_FEATURE_OPAL))
return;
if (secondary) {
/* Return secondary CPUs to firmware on OPAL v3 */
mb();
get_paca()->kexec_state = KEXEC_STATE_REAL_MODE;
mb();
/* Return the CPU to OPAL */
opal_return_cpu();
} else {
/* Primary waits for the secondaries to have reached OPAL */
pnv_kexec_wait_secondaries_down();
/* Switch XIVE back to emulation mode */
if (xive_enabled())
xive_shutdown();
/*
* We might be running as little-endian - now that interrupts
* are disabled, reset the HILE bit to big-endian so we don't
* take interrupts in the wrong endian later
*
* We reinit to enable both radix and hash on P9 to ensure
* the mode used by the next kernel is always supported.
*/
reinit_flags = OPAL_REINIT_CPUS_HILE_BE;
if (cpu_has_feature(CPU_FTR_ARCH_300))
reinit_flags |= OPAL_REINIT_CPUS_MMU_RADIX |
OPAL_REINIT_CPUS_MMU_HASH;
opal_reinit_cpus(reinit_flags);
}
}
#endif /* CONFIG_KEXEC_CORE */
#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
static unsigned long pnv_memory_block_size(void)
{
/*
* We map the kernel linear region with 1GB large pages on radix. For
* memory hot unplug to work our memory block size must be at least
* this size.
*/
if (radix_enabled())
return radix_mem_block_size;
else
return 256UL * 1024 * 1024;
}
#endif
static void __init pnv_setup_machdep_opal(void)
{
ppc_md.get_boot_time = opal_get_boot_time;
ppc_md.restart = pnv_restart;
pm_power_off = pnv_power_off;
ppc_md.halt = pnv_halt;
/* ppc_md.system_reset_exception gets filled in by pnv_smp_init() */
ppc_md.machine_check_exception = opal_machine_check;
ppc_md.mce_check_early_recovery = opal_mce_check_early_recovery;
if (opal_check_token(OPAL_HANDLE_HMI2))
ppc_md.hmi_exception_early = opal_hmi_exception_early2;
else
ppc_md.hmi_exception_early = opal_hmi_exception_early;
ppc_md.handle_hmi_exception = opal_handle_hmi_exception;
}
static int __init pnv_probe(void)
{
if (!of_machine_is_compatible("ibm,powernv"))
return 0;
if (firmware_has_feature(FW_FEATURE_OPAL))
pnv_setup_machdep_opal();
pr_debug("PowerNV detected !\n");
pnv_init();
return 1;
}
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
void __init pnv_tm_init(void)
{
if (!firmware_has_feature(FW_FEATURE_OPAL) ||
!pvr_version_is(PVR_POWER9) ||
early_cpu_has_feature(CPU_FTR_TM))
return;
if (opal_reinit_cpus(OPAL_REINIT_CPUS_TM_SUSPEND_DISABLED) != OPAL_SUCCESS)
return;
pr_info("Enabling TM (Transactional Memory) with Suspend Disabled\n");
cur_cpu_spec->cpu_features |= CPU_FTR_TM;
/* Make sure "normal" HTM is off (it should be) */
cur_cpu_spec->cpu_user_features2 &= ~PPC_FEATURE2_HTM;
/* Turn on no suspend mode, and HTM no SC */
cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_HTM_NO_SUSPEND | \
PPC_FEATURE2_HTM_NOSC;
tm_suspend_disabled = true;
}
#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
/*
* Returns the cpu frequency for 'cpu' in Hz. This is used by
* /proc/cpuinfo
*/
static unsigned long pnv_get_proc_freq(unsigned int cpu)
{
unsigned long ret_freq;
ret_freq = cpufreq_get(cpu) * 1000ul;
/*
* If the backend cpufreq driver does not exist,
* then fallback to old way of reporting the clockrate.
*/
if (!ret_freq)
ret_freq = ppc_proc_freq;
return ret_freq;
}
static long pnv_machine_check_early(struct pt_regs *regs)
{
long handled = 0;
if (cur_cpu_spec && cur_cpu_spec->machine_check_early)
handled = cur_cpu_spec->machine_check_early(regs);
return handled;
}
define_machine(powernv) {
.name = "PowerNV",
.probe = pnv_probe,
.setup_arch = pnv_setup_arch,
.init_IRQ = pnv_init_IRQ,
.show_cpuinfo = pnv_show_cpuinfo,
.get_proc_freq = pnv_get_proc_freq,
.progress = pnv_progress,
.machine_shutdown = pnv_shutdown,
.power_save = NULL,
.calibrate_decr = generic_calibrate_decr,
.machine_check_early = pnv_machine_check_early,
#ifdef CONFIG_KEXEC_CORE
.kexec_cpu_down = pnv_kexec_cpu_down,
#endif
#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
.memory_block_size = pnv_memory_block_size,
#endif
};
| aristeu/linux-2.6 | arch/powerpc/platforms/powernv/setup.c | C | gpl-2.0 | 13,777 | [
30522,
1013,
1013,
23772,
2595,
1011,
6105,
1011,
8909,
4765,
18095,
1024,
14246,
2140,
1011,
1016,
1012,
1014,
1011,
2030,
1011,
2101,
1013,
1008,
1008,
2373,
2078,
2615,
16437,
3642,
1012,
1008,
1008,
9385,
2249,
9980,
13058,
1012,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
{% extends "base_body_links.html" %}
{% block header%}
{% if header_main %}
{{ header_main }}
{% else %}
Куда пойдём дальше {{user.username}}?
{% endif %}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-4">
<img class="img-circle" src="/media/other/find_car.png" alt="Generic placeholder image" width="200px" height="200px"/>
<h2>Искать рейс</h2>
<p>Если вам надо добраться из одного пункта в другой, то это можно сделать бесплатно или же
записаться на коммерческий рейс.</p>
<p><a class="btn btn-default" href="/waybill/find/" role="button">Найти рейс »</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<img class="img-circle" src="/media/other/add_order.png" alt="Generic placeholder image" width="200px" height="200px"/>
<h2>Добавить рейс</h2>
<p>Возможно вы едите на своей машине и хотите подвести кого-нибудь или быть может вы
таксист и хотите разместить коммерческое объявление, тогда вам сюда.</p>
<p><a class="btn btn-default" href="/waybill/add/" role="button">Добавить рейс »</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<img class="img-circle" src="/media/other/chair.png" alt="Generic placeholder image" width="200px" height="200px"/>
<h2>Отменить рейс</h2>
<p>Если вы не можете предоставить машину для поездки
, тогда отменить рейс можно здесь.</p>
<p><a class="btn btn-default" href="/waybill/del/" role="button">Куда я записан »</a></p>
</div><!-- /.col-lg-4 -->
</div><!-- /.row -->
<div class="row">
<div class="col-lg-4">
<img class="img-circle" src="/media/other/fellow_traveller.png" alt="Generic placeholder image" width="200px" height="200px"/>
<h2>Найти попутчиков</h2>
<p>для поездки на такси, например из аэропорта можно здесь.</p>
<p><a class="btn btn-default" href="/waybill/travel/" role="button">Искать попутчиков »</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<img class="img-circle" src="/media/other/passangers.png" alt="Generic placeholder image" width="200px" height="200px"/>
<h2>Кого я везу</h2>
<p>Этот сервис расскажет вам о пассажирах, которые записались на ваши рейсы</p>
<p><a class="btn btn-default" href="/waybill/passangers/" role="button">Мои пассажиры »</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<img class="img-circle" src="/media/other/where_i_am.png" alt="Generic placeholder image" width="200px" height="200px"/>
<h2>Куда я еду</h2>
<p>Здесь представлена информация о рейсах, на которые вы зарегистрированы.</p>
<p><a class="btn btn-default" href="/waybill/trips/" role="button">Куда я еду »</a></p>
</div><!-- /.col-lg-4 -->
</div><!-- /.row -->
{% endblock %}
| rasmadeus/iyoume | templates/others/main_known_user.html | HTML | gpl-2.0 | 3,656 | [
30522,
1063,
1003,
8908,
1000,
2918,
1035,
2303,
1035,
6971,
1012,
16129,
1000,
1003,
1065,
1063,
1003,
3796,
20346,
1003,
1065,
1063,
1003,
2065,
20346,
1035,
2364,
1003,
1065,
1063,
1063,
20346,
1035,
2364,
1065,
1065,
1063,
1003,
2842,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
.materialize-red.lighten-5 {
background-color: #fdeaeb !important;
}
.materialize-red-text.text-lighten-5 {
color: #fdeaeb !important;
}
.materialize-red.lighten-4 {
background-color: #f8c1c3 !important;
}
.materialize-red-text.text-lighten-4 {
color: #f8c1c3 !important;
}
.materialize-red.lighten-3 {
background-color: #f3989b !important;
}
.materialize-red-text.text-lighten-3 {
color: #f3989b !important;
}
.materialize-red.lighten-2 {
background-color: #ee6e73 !important;
}
.materialize-red-text.text-lighten-2 {
color: #ee6e73 !important;
}
.materialize-red.lighten-1 {
background-color: #ea454b !important;
}
.materialize-red-text.text-lighten-1 {
color: #ea454b !important;
}
.materialize-red {
background-color: #e51c23 !important;
}
.materialize-red-text {
color: #e51c23 !important;
}
.materialize-red.darken-1 {
background-color: #d0181e !important;
}
.materialize-red-text.text-darken-1 {
color: #d0181e !important;
}
.materialize-red.darken-2 {
background-color: #b9151b !important;
}
.materialize-red-text.text-darken-2 {
color: #b9151b !important;
}
.materialize-red.darken-3 {
background-color: #a21318 !important;
}
.materialize-red-text.text-darken-3 {
color: #a21318 !important;
}
.materialize-red.darken-4 {
background-color: #8b1014 !important;
}
.materialize-red-text.text-darken-4 {
color: #8b1014 !important;
}
.red.lighten-5 {
background-color: #FFEBEE !important;
}
.red-text.text-lighten-5 {
color: #FFEBEE !important;
}
.red.lighten-4 {
background-color: #FFCDD2 !important;
}
.red-text.text-lighten-4 {
color: #FFCDD2 !important;
}
.red.lighten-3 {
background-color: #EF9A9A !important;
}
.red-text.text-lighten-3 {
color: #EF9A9A !important;
}
.red.lighten-2 {
background-color: #E57373 !important;
}
.red-text.text-lighten-2 {
color: #E57373 !important;
}
.red.lighten-1 {
background-color: #EF5350 !important;
}
.red-text.text-lighten-1 {
color: #EF5350 !important;
}
.red {
background-color: #F44336 !important;
}
.red-text {
color: #F44336 !important;
}
.red.darken-1 {
background-color: #E53935 !important;
}
.red-text.text-darken-1 {
color: #E53935 !important;
}
.red.darken-2 {
background-color: #D32F2F !important;
}
.red-text.text-darken-2 {
color: #D32F2F !important;
}
.red.darken-3 {
background-color: #C62828 !important;
}
.red-text.text-darken-3 {
color: #C62828 !important;
}
.red.darken-4 {
background-color: #B71C1C !important;
}
.red-text.text-darken-4 {
color: #B71C1C !important;
}
.red.accent-1 {
background-color: #FF8A80 !important;
}
.red-text.text-accent-1 {
color: #FF8A80 !important;
}
.red.accent-2 {
background-color: #FF5252 !important;
}
.red-text.text-accent-2 {
color: #FF5252 !important;
}
.red.accent-3 {
background-color: #FF1744 !important;
}
.red-text.text-accent-3 {
color: #FF1744 !important;
}
.red.accent-4 {
background-color: #D50000 !important;
}
.red-text.text-accent-4 {
color: #D50000 !important;
}
.pink.lighten-5 {
background-color: #fce4ec !important;
}
.pink-text.text-lighten-5 {
color: #fce4ec !important;
}
.pink.lighten-4 {
background-color: #f8bbd0 !important;
}
.pink-text.text-lighten-4 {
color: #f8bbd0 !important;
}
.pink.lighten-3 {
background-color: #f48fb1 !important;
}
.pink-text.text-lighten-3 {
color: #f48fb1 !important;
}
.pink.lighten-2 {
background-color: #f06292 !important;
}
.pink-text.text-lighten-2 {
color: #f06292 !important;
}
.pink.lighten-1 {
background-color: #ec407a !important;
}
.pink-text.text-lighten-1 {
color: #ec407a !important;
}
.pink {
background-color: #e91e63 !important;
}
.pink-text {
color: #e91e63 !important;
}
.pink.darken-1 {
background-color: #d81b60 !important;
}
.pink-text.text-darken-1 {
color: #d81b60 !important;
}
.pink.darken-2 {
background-color: #c2185b !important;
}
.pink-text.text-darken-2 {
color: #c2185b !important;
}
.pink.darken-3 {
background-color: #ad1457 !important;
}
.pink-text.text-darken-3 {
color: #ad1457 !important;
}
.pink.darken-4 {
background-color: #880e4f !important;
}
.pink-text.text-darken-4 {
color: #880e4f !important;
}
.pink.accent-1 {
background-color: #ff80ab !important;
}
.pink-text.text-accent-1 {
color: #ff80ab !important;
}
.pink.accent-2 {
background-color: #ff4081 !important;
}
.pink-text.text-accent-2 {
color: #ff4081 !important;
}
.pink.accent-3 {
background-color: #f50057 !important;
}
.pink-text.text-accent-3 {
color: #f50057 !important;
}
.pink.accent-4 {
background-color: #c51162 !important;
}
.pink-text.text-accent-4 {
color: #c51162 !important;
}
.purple.lighten-5 {
background-color: #f3e5f5 !important;
}
.purple-text.text-lighten-5 {
color: #f3e5f5 !important;
}
.purple.lighten-4 {
background-color: #e1bee7 !important;
}
.purple-text.text-lighten-4 {
color: #e1bee7 !important;
}
.purple.lighten-3 {
background-color: #ce93d8 !important;
}
.purple-text.text-lighten-3 {
color: #ce93d8 !important;
}
.purple.lighten-2 {
background-color: #ba68c8 !important;
}
.purple-text.text-lighten-2 {
color: #ba68c8 !important;
}
.purple.lighten-1 {
background-color: #ab47bc !important;
}
.purple-text.text-lighten-1 {
color: #ab47bc !important;
}
.purple {
background-color: #9c27b0 !important;
}
.purple-text {
color: #9c27b0 !important;
}
.purple.darken-1 {
background-color: #8e24aa !important;
}
.purple-text.text-darken-1 {
color: #8e24aa !important;
}
.purple.darken-2 {
background-color: #7b1fa2 !important;
}
.purple-text.text-darken-2 {
color: #7b1fa2 !important;
}
.purple.darken-3 {
background-color: #6a1b9a !important;
}
.purple-text.text-darken-3 {
color: #6a1b9a !important;
}
.purple.darken-4 {
background-color: #4a148c !important;
}
.purple-text.text-darken-4 {
color: #4a148c !important;
}
.purple.accent-1 {
background-color: #ea80fc !important;
}
.purple-text.text-accent-1 {
color: #ea80fc !important;
}
.purple.accent-2 {
background-color: #e040fb !important;
}
.purple-text.text-accent-2 {
color: #e040fb !important;
}
.purple.accent-3 {
background-color: #d500f9 !important;
}
.purple-text.text-accent-3 {
color: #d500f9 !important;
}
.purple.accent-4 {
background-color: #aa00ff !important;
}
.purple-text.text-accent-4 {
color: #aa00ff !important;
}
.deep-purple.lighten-5 {
background-color: #ede7f6 !important;
}
.deep-purple-text.text-lighten-5 {
color: #ede7f6 !important;
}
.deep-purple.lighten-4 {
background-color: #d1c4e9 !important;
}
.deep-purple-text.text-lighten-4 {
color: #d1c4e9 !important;
}
.deep-purple.lighten-3 {
background-color: #b39ddb !important;
}
.deep-purple-text.text-lighten-3 {
color: #b39ddb !important;
}
.deep-purple.lighten-2 {
background-color: #9575cd !important;
}
.deep-purple-text.text-lighten-2 {
color: #9575cd !important;
}
.deep-purple.lighten-1 {
background-color: #7e57c2 !important;
}
.deep-purple-text.text-lighten-1 {
color: #7e57c2 !important;
}
.deep-purple {
background-color: #673ab7 !important;
}
.deep-purple-text {
color: #673ab7 !important;
}
.deep-purple.darken-1 {
background-color: #5e35b1 !important;
}
.deep-purple-text.text-darken-1 {
color: #5e35b1 !important;
}
.deep-purple.darken-2 {
background-color: #512da8 !important;
}
.deep-purple-text.text-darken-2 {
color: #512da8 !important;
}
.deep-purple.darken-3 {
background-color: #4527a0 !important;
}
.deep-purple-text.text-darken-3 {
color: #4527a0 !important;
}
.deep-purple.darken-4 {
background-color: #311b92 !important;
}
.deep-purple-text.text-darken-4 {
color: #311b92 !important;
}
.deep-purple.accent-1 {
background-color: #b388ff !important;
}
.deep-purple-text.text-accent-1 {
color: #b388ff !important;
}
.deep-purple.accent-2 {
background-color: #7c4dff !important;
}
.deep-purple-text.text-accent-2 {
color: #7c4dff !important;
}
.deep-purple.accent-3 {
background-color: #651fff !important;
}
.deep-purple-text.text-accent-3 {
color: #651fff !important;
}
.deep-purple.accent-4 {
background-color: #6200ea !important;
}
.deep-purple-text.text-accent-4 {
color: #6200ea !important;
}
.indigo.lighten-5 {
background-color: #e8eaf6 !important;
}
.indigo-text.text-lighten-5 {
color: #e8eaf6 !important;
}
.indigo.lighten-4 {
background-color: #c5cae9 !important;
}
.indigo-text.text-lighten-4 {
color: #c5cae9 !important;
}
.indigo.lighten-3 {
background-color: #9fa8da !important;
}
.indigo-text.text-lighten-3 {
color: #9fa8da !important;
}
.indigo.lighten-2 {
background-color: #7986cb !important;
}
.indigo-text.text-lighten-2 {
color: #7986cb !important;
}
.indigo.lighten-1 {
background-color: #5c6bc0 !important;
}
.indigo-text.text-lighten-1 {
color: #5c6bc0 !important;
}
.indigo {
background-color: #3f51b5 !important;
}
.indigo-text {
color: #3f51b5 !important;
}
.indigo.darken-1 {
background-color: #3949ab !important;
}
.indigo-text.text-darken-1 {
color: #3949ab !important;
}
.indigo.darken-2 {
background-color: #303f9f !important;
}
.indigo-text.text-darken-2 {
color: #303f9f !important;
}
.indigo.darken-3 {
background-color: #283593 !important;
}
.indigo-text.text-darken-3 {
color: #283593 !important;
}
.indigo.darken-4 {
background-color: #1a237e !important;
}
.indigo-text.text-darken-4 {
color: #1a237e !important;
}
.indigo.accent-1 {
background-color: #8c9eff !important;
}
.indigo-text.text-accent-1 {
color: #8c9eff !important;
}
.indigo.accent-2 {
background-color: #536dfe !important;
}
.indigo-text.text-accent-2 {
color: #536dfe !important;
}
.indigo.accent-3 {
background-color: #3d5afe !important;
}
.indigo-text.text-accent-3 {
color: #3d5afe !important;
}
.indigo.accent-4 {
background-color: #304ffe !important;
}
.indigo-text.text-accent-4 {
color: #304ffe !important;
}
.blue.lighten-5 {
background-color: #E3F2FD !important;
}
.blue-text.text-lighten-5 {
color: #E3F2FD !important;
}
.blue.lighten-4 {
background-color: #BBDEFB !important;
}
.blue-text.text-lighten-4 {
color: #BBDEFB !important;
}
.blue.lighten-3 {
background-color: #90CAF9 !important;
}
.blue-text.text-lighten-3 {
color: #90CAF9 !important;
}
.blue.lighten-2 {
background-color: #64B5F6 !important;
}
.blue-text.text-lighten-2 {
color: #64B5F6 !important;
}
.blue.lighten-1 {
background-color: #42A5F5 !important;
}
.blue-text.text-lighten-1 {
color: #42A5F5 !important;
}
.blue {
background-color: #2196F3 !important;
}
.blue-text {
color: #2196F3 !important;
}
.blue.darken-1 {
background-color: #1E88E5 !important;
}
.blue-text.text-darken-1 {
color: #1E88E5 !important;
}
.blue.darken-2 {
background-color: #1976D2 !important;
}
.blue-text.text-darken-2 {
color: #1976D2 !important;
}
.blue.darken-3 {
background-color: #1565C0 !important;
}
.blue-text.text-darken-3 {
color: #1565C0 !important;
}
.blue.darken-4 {
background-color: #0D47A1 !important;
}
.blue-text.text-darken-4 {
color: #0D47A1 !important;
}
.blue.accent-1 {
background-color: #82B1FF !important;
}
.blue-text.text-accent-1 {
color: #82B1FF !important;
}
.blue.accent-2 {
background-color: #448AFF !important;
}
.blue-text.text-accent-2 {
color: #448AFF !important;
}
.blue.accent-3 {
background-color: #2979FF !important;
}
.blue-text.text-accent-3 {
color: #2979FF !important;
}
.blue.accent-4 {
background-color: #2962FF !important;
}
.blue-text.text-accent-4 {
color: #2962FF !important;
}
.light-blue.lighten-5 {
background-color: #e1f5fe !important;
}
.light-blue-text.text-lighten-5 {
color: #e1f5fe !important;
}
.light-blue.lighten-4 {
background-color: #b3e5fc !important;
}
.light-blue-text.text-lighten-4 {
color: #b3e5fc !important;
}
.light-blue.lighten-3 {
background-color: #81d4fa !important;
}
.light-blue-text.text-lighten-3 {
color: #81d4fa !important;
}
.light-blue.lighten-2 {
background-color: #4fc3f7 !important;
}
.light-blue-text.text-lighten-2 {
color: #4fc3f7 !important;
}
.light-blue.lighten-1 {
background-color: #29b6f6 !important;
}
.light-blue-text.text-lighten-1 {
color: #29b6f6 !important;
}
.light-blue {
background-color: #03a9f4 !important;
}
.light-blue-text {
color: #03a9f4 !important;
}
.light-blue.darken-1 {
background-color: #039be5 !important;
}
.light-blue-text.text-darken-1 {
color: #039be5 !important;
}
.light-blue.darken-2 {
background-color: #0288d1 !important;
}
.light-blue-text.text-darken-2 {
color: #0288d1 !important;
}
.light-blue.darken-3 {
background-color: #0277bd !important;
}
.light-blue-text.text-darken-3 {
color: #0277bd !important;
}
.light-blue.darken-4 {
background-color: #01579b !important;
}
.light-blue-text.text-darken-4 {
color: #01579b !important;
}
.light-blue.accent-1 {
background-color: #80d8ff !important;
}
.light-blue-text.text-accent-1 {
color: #80d8ff !important;
}
.light-blue.accent-2 {
background-color: #40c4ff !important;
}
.light-blue-text.text-accent-2 {
color: #40c4ff !important;
}
.light-blue.accent-3 {
background-color: #00b0ff !important;
}
.light-blue-text.text-accent-3 {
color: #00b0ff !important;
}
.light-blue.accent-4 {
background-color: #0091ea !important;
}
.light-blue-text.text-accent-4 {
color: #0091ea !important;
}
.cyan.lighten-5 {
background-color: #e0f7fa !important;
}
.cyan-text.text-lighten-5 {
color: #e0f7fa !important;
}
.cyan.lighten-4 {
background-color: #b2ebf2 !important;
}
.cyan-text.text-lighten-4 {
color: #b2ebf2 !important;
}
.cyan.lighten-3 {
background-color: #80deea !important;
}
.cyan-text.text-lighten-3 {
color: #80deea !important;
}
.cyan.lighten-2 {
background-color: #4dd0e1 !important;
}
.cyan-text.text-lighten-2 {
color: #4dd0e1 !important;
}
.cyan.lighten-1 {
background-color: #26c6da !important;
}
.cyan-text.text-lighten-1 {
color: #26c6da !important;
}
.cyan {
background-color: #00bcd4 !important;
}
.cyan-text {
color: #00bcd4 !important;
}
.cyan.darken-1 {
background-color: #00acc1 !important;
}
.cyan-text.text-darken-1 {
color: #00acc1 !important;
}
.cyan.darken-2 {
background-color: #0097a7 !important;
}
.cyan-text.text-darken-2 {
color: #0097a7 !important;
}
.cyan.darken-3 {
background-color: #00838f !important;
}
.cyan-text.text-darken-3 {
color: #00838f !important;
}
.cyan.darken-4 {
background-color: #006064 !important;
}
.cyan-text.text-darken-4 {
color: #006064 !important;
}
.cyan.accent-1 {
background-color: #84ffff !important;
}
.cyan-text.text-accent-1 {
color: #84ffff !important;
}
.cyan.accent-2 {
background-color: #18ffff !important;
}
.cyan-text.text-accent-2 {
color: #18ffff !important;
}
.cyan.accent-3 {
background-color: #00e5ff !important;
}
.cyan-text.text-accent-3 {
color: #00e5ff !important;
}
.cyan.accent-4 {
background-color: #00b8d4 !important;
}
.cyan-text.text-accent-4 {
color: #00b8d4 !important;
}
.teal.lighten-5 {
background-color: #e0f2f1 !important;
}
.teal-text.text-lighten-5 {
color: #e0f2f1 !important;
}
.teal.lighten-4 {
background-color: #b2dfdb !important;
}
.teal-text.text-lighten-4 {
color: #b2dfdb !important;
}
.teal.lighten-3 {
background-color: #80cbc4 !important;
}
.teal-text.text-lighten-3 {
color: #80cbc4 !important;
}
.teal.lighten-2 {
background-color: #4db6ac !important;
}
.teal-text.text-lighten-2 {
color: #4db6ac !important;
}
.teal.lighten-1 {
background-color: #26a69a !important;
}
.teal-text.text-lighten-1 {
color: #26a69a !important;
}
.teal {
background-color: #009688 !important;
}
.teal-text {
color: #009688 !important;
}
.teal.darken-1 {
background-color: #00897b !important;
}
.teal-text.text-darken-1 {
color: #00897b !important;
}
.teal.darken-2 {
background-color: #00796b !important;
}
.teal-text.text-darken-2 {
color: #00796b !important;
}
.teal.darken-3 {
background-color: #00695c !important;
}
.teal-text.text-darken-3 {
color: #00695c !important;
}
.teal.darken-4 {
background-color: #004d40 !important;
}
.teal-text.text-darken-4 {
color: #004d40 !important;
}
.teal.accent-1 {
background-color: #a7ffeb !important;
}
.teal-text.text-accent-1 {
color: #a7ffeb !important;
}
.teal.accent-2 {
background-color: #64ffda !important;
}
.teal-text.text-accent-2 {
color: #64ffda !important;
}
.teal.accent-3 {
background-color: #1de9b6 !important;
}
.teal-text.text-accent-3 {
color: #1de9b6 !important;
}
.teal.accent-4 {
background-color: #00bfa5 !important;
}
.teal-text.text-accent-4 {
color: #00bfa5 !important;
}
.green.lighten-5 {
background-color: #E8F5E9 !important;
}
.green-text.text-lighten-5 {
color: #E8F5E9 !important;
}
.green.lighten-4 {
background-color: #C8E6C9 !important;
}
.green-text.text-lighten-4 {
color: #C8E6C9 !important;
}
.green.lighten-3 {
background-color: #A5D6A7 !important;
}
.green-text.text-lighten-3 {
color: #A5D6A7 !important;
}
.green.lighten-2 {
background-color: #81C784 !important;
}
.green-text.text-lighten-2 {
color: #81C784 !important;
}
.green.lighten-1 {
background-color: #66BB6A !important;
}
.green-text.text-lighten-1 {
color: #66BB6A !important;
}
.green {
background-color: #4CAF50 !important;
}
.green-text {
color: #4CAF50 !important;
}
.green.darken-1 {
background-color: #43A047 !important;
}
.green-text.text-darken-1 {
color: #43A047 !important;
}
.green.darken-2 {
background-color: #388E3C !important;
}
.green-text.text-darken-2 {
color: #388E3C !important;
}
.green.darken-3 {
background-color: #2E7D32 !important;
}
.green-text.text-darken-3 {
color: #2E7D32 !important;
}
.green.darken-4 {
background-color: #1B5E20 !important;
}
.green-text.text-darken-4 {
color: #1B5E20 !important;
}
.green.accent-1 {
background-color: #B9F6CA !important;
}
.green-text.text-accent-1 {
color: #B9F6CA !important;
}
.green.accent-2 {
background-color: #69F0AE !important;
}
.green-text.text-accent-2 {
color: #69F0AE !important;
}
.green.accent-3 {
background-color: #00E676 !important;
}
.green-text.text-accent-3 {
color: #00E676 !important;
}
.green.accent-4 {
background-color: #00C853 !important;
}
.green-text.text-accent-4 {
color: #00C853 !important;
}
.light-green.lighten-5 {
background-color: #f1f8e9 !important;
}
.light-green-text.text-lighten-5 {
color: #f1f8e9 !important;
}
.light-green.lighten-4 {
background-color: #dcedc8 !important;
}
.light-green-text.text-lighten-4 {
color: #dcedc8 !important;
}
.light-green.lighten-3 {
background-color: #c5e1a5 !important;
}
.light-green-text.text-lighten-3 {
color: #c5e1a5 !important;
}
.light-green.lighten-2 {
background-color: #aed581 !important;
}
.light-green-text.text-lighten-2 {
color: #aed581 !important;
}
.light-green.lighten-1 {
background-color: #9ccc65 !important;
}
.light-green-text.text-lighten-1 {
color: #9ccc65 !important;
}
.light-green {
background-color: #8bc34a !important;
}
.light-green-text {
color: #8bc34a !important;
}
.light-green.darken-1 {
background-color: #7cb342 !important;
}
.light-green-text.text-darken-1 {
color: #7cb342 !important;
}
.light-green.darken-2 {
background-color: #689f38 !important;
}
.light-green-text.text-darken-2 {
color: #689f38 !important;
}
.light-green.darken-3 {
background-color: #558b2f !important;
}
.light-green-text.text-darken-3 {
color: #558b2f !important;
}
.light-green.darken-4 {
background-color: #33691e !important;
}
.light-green-text.text-darken-4 {
color: #33691e !important;
}
.light-green.accent-1 {
background-color: #ccff90 !important;
}
.light-green-text.text-accent-1 {
color: #ccff90 !important;
}
.light-green.accent-2 {
background-color: #b2ff59 !important;
}
.light-green-text.text-accent-2 {
color: #b2ff59 !important;
}
.light-green.accent-3 {
background-color: #76ff03 !important;
}
.light-green-text.text-accent-3 {
color: #76ff03 !important;
}
.light-green.accent-4 {
background-color: #64dd17 !important;
}
.light-green-text.text-accent-4 {
color: #64dd17 !important;
}
.lime.lighten-5 {
background-color: #f9fbe7 !important;
}
.lime-text.text-lighten-5 {
color: #f9fbe7 !important;
}
.lime.lighten-4 {
background-color: #f0f4c3 !important;
}
.lime-text.text-lighten-4 {
color: #f0f4c3 !important;
}
.lime.lighten-3 {
background-color: #e6ee9c !important;
}
.lime-text.text-lighten-3 {
color: #e6ee9c !important;
}
.lime.lighten-2 {
background-color: #dce775 !important;
}
.lime-text.text-lighten-2 {
color: #dce775 !important;
}
.lime.lighten-1 {
background-color: #d4e157 !important;
}
.lime-text.text-lighten-1 {
color: #d4e157 !important;
}
.lime {
background-color: #cddc39 !important;
}
.lime-text {
color: #cddc39 !important;
}
.lime.darken-1 {
background-color: #c0ca33 !important;
}
.lime-text.text-darken-1 {
color: #c0ca33 !important;
}
.lime.darken-2 {
background-color: #afb42b !important;
}
.lime-text.text-darken-2 {
color: #afb42b !important;
}
.lime.darken-3 {
background-color: #9e9d24 !important;
}
.lime-text.text-darken-3 {
color: #9e9d24 !important;
}
.lime.darken-4 {
background-color: #827717 !important;
}
.lime-text.text-darken-4 {
color: #827717 !important;
}
.lime.accent-1 {
background-color: #f4ff81 !important;
}
.lime-text.text-accent-1 {
color: #f4ff81 !important;
}
.lime.accent-2 {
background-color: #eeff41 !important;
}
.lime-text.text-accent-2 {
color: #eeff41 !important;
}
.lime.accent-3 {
background-color: #c6ff00 !important;
}
.lime-text.text-accent-3 {
color: #c6ff00 !important;
}
.lime.accent-4 {
background-color: #aeea00 !important;
}
.lime-text.text-accent-4 {
color: #aeea00 !important;
}
.yellow.lighten-5 {
background-color: #fffde7 !important;
}
.yellow-text.text-lighten-5 {
color: #fffde7 !important;
}
.yellow.lighten-4 {
background-color: #fff9c4 !important;
}
.yellow-text.text-lighten-4 {
color: #fff9c4 !important;
}
.yellow.lighten-3 {
background-color: #fff59d !important;
}
.yellow-text.text-lighten-3 {
color: #fff59d !important;
}
.yellow.lighten-2 {
background-color: #fff176 !important;
}
.yellow-text.text-lighten-2 {
color: #fff176 !important;
}
.yellow.lighten-1 {
background-color: #ffee58 !important;
}
.yellow-text.text-lighten-1 {
color: #ffee58 !important;
}
.yellow {
background-color: #ffeb3b !important;
}
.yellow-text {
color: #ffeb3b !important;
}
.yellow.darken-1 {
background-color: #fdd835 !important;
}
.yellow-text.text-darken-1 {
color: #fdd835 !important;
}
.yellow.darken-2 {
background-color: #fbc02d !important;
}
.yellow-text.text-darken-2 {
color: #fbc02d !important;
}
.yellow.darken-3 {
background-color: #f9a825 !important;
}
.yellow-text.text-darken-3 {
color: #f9a825 !important;
}
.yellow.darken-4 {
background-color: #f57f17 !important;
}
.yellow-text.text-darken-4 {
color: #f57f17 !important;
}
.yellow.accent-1 {
background-color: #ffff8d !important;
}
.yellow-text.text-accent-1 {
color: #ffff8d !important;
}
.yellow.accent-2 {
background-color: #ffff00 !important;
}
.yellow-text.text-accent-2 {
color: #ffff00 !important;
}
.yellow.accent-3 {
background-color: #ffea00 !important;
}
.yellow-text.text-accent-3 {
color: #ffea00 !important;
}
.yellow.accent-4 {
background-color: #ffd600 !important;
}
.yellow-text.text-accent-4 {
color: #ffd600 !important;
}
.amber.lighten-5 {
background-color: #fff8e1 !important;
}
.amber-text.text-lighten-5 {
color: #fff8e1 !important;
}
.amber.lighten-4 {
background-color: #ffecb3 !important;
}
.amber-text.text-lighten-4 {
color: #ffecb3 !important;
}
.amber.lighten-3 {
background-color: #ffe082 !important;
}
.amber-text.text-lighten-3 {
color: #ffe082 !important;
}
.amber.lighten-2 {
background-color: #ffd54f !important;
}
.amber-text.text-lighten-2 {
color: #ffd54f !important;
}
.amber.lighten-1 {
background-color: #ffca28 !important;
}
.amber-text.text-lighten-1 {
color: #ffca28 !important;
}
.amber {
background-color: #ffc107 !important;
}
.amber-text {
color: #ffc107 !important;
}
.amber.darken-1 {
background-color: #ffb300 !important;
}
.amber-text.text-darken-1 {
color: #ffb300 !important;
}
.amber.darken-2 {
background-color: #ffa000 !important;
}
.amber-text.text-darken-2 {
color: #ffa000 !important;
}
.amber.darken-3 {
background-color: #ff8f00 !important;
}
.amber-text.text-darken-3 {
color: #ff8f00 !important;
}
.amber.darken-4 {
background-color: #ff6f00 !important;
}
.amber-text.text-darken-4 {
color: #ff6f00 !important;
}
.amber.accent-1 {
background-color: #ffe57f !important;
}
.amber-text.text-accent-1 {
color: #ffe57f !important;
}
.amber.accent-2 {
background-color: #ffd740 !important;
}
.amber-text.text-accent-2 {
color: #ffd740 !important;
}
.amber.accent-3 {
background-color: #ffc400 !important;
}
.amber-text.text-accent-3 {
color: #ffc400 !important;
}
.amber.accent-4 {
background-color: #ffab00 !important;
}
.amber-text.text-accent-4 {
color: #ffab00 !important;
}
.orange.lighten-5 {
background-color: #fff3e0 !important;
}
.orange-text.text-lighten-5 {
color: #fff3e0 !important;
}
.orange.lighten-4 {
background-color: #ffe0b2 !important;
}
.orange-text.text-lighten-4 {
color: #ffe0b2 !important;
}
.orange.lighten-3 {
background-color: #ffcc80 !important;
}
.orange-text.text-lighten-3 {
color: #ffcc80 !important;
}
.orange.lighten-2 {
background-color: #ffb74d !important;
}
.orange-text.text-lighten-2 {
color: #ffb74d !important;
}
.orange.lighten-1 {
background-color: #ffa726 !important;
}
.orange-text.text-lighten-1 {
color: #ffa726 !important;
}
.orange {
background-color: #ff9800 !important;
}
.orange-text {
color: #ff9800 !important;
}
.orange.darken-1 {
background-color: #fb8c00 !important;
}
.orange-text.text-darken-1 {
color: #fb8c00 !important;
}
.orange.darken-2 {
background-color: #f57c00 !important;
}
.orange-text.text-darken-2 {
color: #f57c00 !important;
}
.orange.darken-3 {
background-color: #ef6c00 !important;
}
.orange-text.text-darken-3 {
color: #ef6c00 !important;
}
.orange.darken-4 {
background-color: #e65100 !important;
}
.orange-text.text-darken-4 {
color: #e65100 !important;
}
.orange.accent-1 {
background-color: #ffd180 !important;
}
.orange-text.text-accent-1 {
color: #ffd180 !important;
}
.orange.accent-2 {
background-color: #ffab40 !important;
}
.orange-text.text-accent-2 {
color: #ffab40 !important;
}
.orange.accent-3 {
background-color: #ff9100 !important;
}
.orange-text.text-accent-3 {
color: #ff9100 !important;
}
.orange.accent-4 {
background-color: #ff6d00 !important;
}
.orange-text.text-accent-4 {
color: #ff6d00 !important;
}
.deep-orange.lighten-5 {
background-color: #fbe9e7 !important;
}
.deep-orange-text.text-lighten-5 {
color: #fbe9e7 !important;
}
.deep-orange.lighten-4 {
background-color: #ffccbc !important;
}
.deep-orange-text.text-lighten-4 {
color: #ffccbc !important;
}
.deep-orange.lighten-3 {
background-color: #ffab91 !important;
}
.deep-orange-text.text-lighten-3 {
color: #ffab91 !important;
}
.deep-orange.lighten-2 {
background-color: #ff8a65 !important;
}
.deep-orange-text.text-lighten-2 {
color: #ff8a65 !important;
}
.deep-orange.lighten-1 {
background-color: #ff7043 !important;
}
.deep-orange-text.text-lighten-1 {
color: #ff7043 !important;
}
.deep-orange {
background-color: #ff5722 !important;
}
.deep-orange-text {
color: #ff5722 !important;
}
.deep-orange.darken-1 {
background-color: #f4511e !important;
}
.deep-orange-text.text-darken-1 {
color: #f4511e !important;
}
.deep-orange.darken-2 {
background-color: #e64a19 !important;
}
.deep-orange-text.text-darken-2 {
color: #e64a19 !important;
}
.deep-orange.darken-3 {
background-color: #d84315 !important;
}
.deep-orange-text.text-darken-3 {
color: #d84315 !important;
}
.deep-orange.darken-4 {
background-color: #bf360c !important;
}
.deep-orange-text.text-darken-4 {
color: #bf360c !important;
}
.deep-orange.accent-1 {
background-color: #ff9e80 !important;
}
.deep-orange-text.text-accent-1 {
color: #ff9e80 !important;
}
.deep-orange.accent-2 {
background-color: #ff6e40 !important;
}
.deep-orange-text.text-accent-2 {
color: #ff6e40 !important;
}
.deep-orange.accent-3 {
background-color: #ff3d00 !important;
}
.deep-orange-text.text-accent-3 {
color: #ff3d00 !important;
}
.deep-orange.accent-4 {
background-color: #dd2c00 !important;
}
.deep-orange-text.text-accent-4 {
color: #dd2c00 !important;
}
.brown.lighten-5 {
background-color: #efebe9 !important;
}
.brown-text.text-lighten-5 {
color: #efebe9 !important;
}
.brown.lighten-4 {
background-color: #d7ccc8 !important;
}
.brown-text.text-lighten-4 {
color: #d7ccc8 !important;
}
.brown.lighten-3 {
background-color: #bcaaa4 !important;
}
.brown-text.text-lighten-3 {
color: #bcaaa4 !important;
}
.brown.lighten-2 {
background-color: #a1887f !important;
}
.brown-text.text-lighten-2 {
color: #a1887f !important;
}
.brown.lighten-1 {
background-color: #8d6e63 !important;
}
.brown-text.text-lighten-1 {
color: #8d6e63 !important;
}
.brown {
background-color: #795548 !important;
}
.brown-text {
color: #795548 !important;
}
.brown.darken-1 {
background-color: #6d4c41 !important;
}
.brown-text.text-darken-1 {
color: #6d4c41 !important;
}
.brown.darken-2 {
background-color: #5d4037 !important;
}
.brown-text.text-darken-2 {
color: #5d4037 !important;
}
.brown.darken-3 {
background-color: #4e342e !important;
}
.brown-text.text-darken-3 {
color: #4e342e !important;
}
.brown.darken-4 {
background-color: #3e2723 !important;
}
.brown-text.text-darken-4 {
color: #3e2723 !important;
}
.blue-grey.lighten-5 {
background-color: #eceff1 !important;
}
.blue-grey-text.text-lighten-5 {
color: #eceff1 !important;
}
.blue-grey.lighten-4 {
background-color: #cfd8dc !important;
}
.blue-grey-text.text-lighten-4 {
color: #cfd8dc !important;
}
.blue-grey.lighten-3 {
background-color: #b0bec5 !important;
}
.blue-grey-text.text-lighten-3 {
color: #b0bec5 !important;
}
.blue-grey.lighten-2 {
background-color: #90a4ae !important;
}
.blue-grey-text.text-lighten-2 {
color: #90a4ae !important;
}
.blue-grey.lighten-1 {
background-color: #78909c !important;
}
.blue-grey-text.text-lighten-1 {
color: #78909c !important;
}
.blue-grey {
background-color: #607d8b !important;
}
.blue-grey-text {
color: #607d8b !important;
}
.blue-grey.darken-1 {
background-color: #546e7a !important;
}
.blue-grey-text.text-darken-1 {
color: #546e7a !important;
}
.blue-grey.darken-2 {
background-color: #455a64 !important;
}
.blue-grey-text.text-darken-2 {
color: #455a64 !important;
}
.blue-grey.darken-3 {
background-color: #37474f !important;
}
.blue-grey-text.text-darken-3 {
color: #37474f !important;
}
.blue-grey.darken-4 {
background-color: #263238 !important;
}
.blue-grey-text.text-darken-4 {
color: #263238 !important;
}
.grey.lighten-5 {
background-color: #fafafa !important;
}
.grey-text.text-lighten-5 {
color: #fafafa !important;
}
.grey.lighten-4 {
background-color: #f5f5f5 !important;
}
.grey-text.text-lighten-4 {
color: #f5f5f5 !important;
}
.grey.lighten-3 {
background-color: #eeeeee !important;
}
.grey-text.text-lighten-3 {
color: #eeeeee !important;
}
.grey.lighten-2 {
background-color: #e0e0e0 !important;
}
.grey-text.text-lighten-2 {
color: #e0e0e0 !important;
}
.grey.lighten-1 {
background-color: #bdbdbd !important;
}
.grey-text.text-lighten-1 {
color: #bdbdbd !important;
}
.grey {
background-color: #9e9e9e !important;
}
.grey-text {
color: #9e9e9e !important;
}
.grey.darken-1 {
background-color: #757575 !important;
}
.grey-text.text-darken-1 {
color: #757575 !important;
}
.grey.darken-2 {
background-color: #616161 !important;
}
.grey-text.text-darken-2 {
color: #616161 !important;
}
.grey.darken-3 {
background-color: #424242 !important;
}
.grey-text.text-darken-3 {
color: #424242 !important;
}
.grey.darken-4 {
background-color: #212121 !important;
}
.grey-text.text-darken-4 {
color: #212121 !important;
}
.shades.black {
background-color: #000000 !important;
}
.shades-text.text-black {
color: #000000 !important;
}
.shades.white {
background-color: #FFFFFF !important;
}
.shades-text.text-white {
color: #FFFFFF !important;
}
.shades.transparent {
background-color: transparent !important;
}
.shades-text.text-transparent {
color: transparent !important;
}
.black {
background-color: #000000 !important;
}
.black-text {
color: #000000 !important;
}
.white {
background-color: #FFFFFF !important;
}
.white-text {
color: #FFFFFF !important;
}
.transparent {
background-color: transparent !important;
}
.transparent-text {
color: transparent !important;
}
/*** Colors ***/
/*** Badges ***/
/*** Buttons ***/
/*** Cards ***/
/*** Collapsible ***/
/*** Dropdown ***/
/*** Fonts ***/
/*** Forms ***/
/*** Global ***/
/*** Navbar ***/
/*** SideNav ***/
/*** Photo Slider ***/
/*** Tabs ***/
/*** Tables ***/
/*** Toasts ***/
/*** Typography ***/
/*** Collections ***/
/* Progress Bar */
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif;
/* 1 */
-ms-text-size-adjust: 100%;
/* 2 */
-webkit-text-size-adjust: 100%;
/* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block;
/* 1 */
vertical-align: baseline;
/* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit;
/* 1 */
font: inherit;
/* 2 */
margin: 0;
/* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
/* 1 */
html input[type="button"],
button,
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
/* 2 */
cursor: pointer;
/* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield;
/* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
/* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
ul {
list-style-type: none;
}
a {
color: #039be5;
text-decoration: none;
-webkit-tap-highlight-color: transparent;
}
.valign-wrapper {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
.valign-wrapper .valign {
display: block;
}
ul {
padding: 0;
}
ul li {
list-style-type: none;
}
.clearfix {
clear: both;
}
.z-depth-0 {
box-shadow: none !important;
}
.z-depth-1, nav, .card-panel, .card, .toast, .btn, .btn-large, .btn-floating, .dropdown-content, .collapsible, .side-nav {
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}
.z-depth-1-half, .btn:hover, .btn-large:hover, .btn-floating:hover {
box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
}
.z-depth-2 {
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.z-depth-3 {
box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
}
.z-depth-4, .modal {
box-shadow: 0 16px 28px 0 rgba(0, 0, 0, 0.22), 0 25px 55px 0 rgba(0, 0, 0, 0.21);
}
.z-depth-5 {
box-shadow: 0 27px 24px 0 rgba(0, 0, 0, 0.2), 0 40px 77px 0 rgba(0, 0, 0, 0.22);
}
.hoverable:hover {
transition: box-shadow .25s;
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.divider {
height: 1px;
overflow: hidden;
background-color: #e0e0e0;
}
blockquote {
margin: 20px 0;
padding-left: 1.5rem;
border-left: 5px solid #004785;
}
i {
line-height: inherit;
}
i.left {
float: left;
margin-right: 15px;
}
i.right {
float: right;
margin-left: 15px;
}
i.tiny {
font-size: 1rem;
}
i.small {
font-size: 2rem;
}
i.medium {
font-size: 4rem;
}
i.large {
font-size: 6rem;
}
img.responsive-img,
video.responsive-video {
max-width: 100%;
height: auto;
}
.pagination li {
float: left;
font-size: 1.2rem;
padding: 0 10px;
line-height: 30px;
border-radius: 2px;
text-align: center;
}
.pagination li a {
color: #444;
}
.pagination li.active a {
color: #fff;
}
.pagination li.active {
background-color: #004785;
}
.pagination li.disabled a {
cursor: default;
color: #999;
}
.pagination li i {
font-size: 2rem;
}
.pagination li.pages ul li {
display: inline-block;
float: none;
}
@media only screen and (max-width: 992px) {
.pagination {
width: 100%;
}
.pagination li.prev,
.pagination li.next {
width: 10%;
}
.pagination li.pages {
width: 80%;
overflow: hidden;
white-space: nowrap;
}
}
.parallax-container {
position: relative;
overflow: hidden;
height: 500px;
}
.parallax {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
}
.parallax img {
display: none;
position: absolute;
left: 50%;
bottom: 0;
min-width: 100%;
min-height: 100%;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
transform: translateX(-50%);
}
.pin-top, .pin-bottom {
position: relative;
}
.pinned {
position: fixed !important;
}
/*********************
Transition Classes
**********************/
ul.staggered-list li {
opacity: 0;
}
.fade-in {
opacity: 0;
transform-origin: 0 50%;
}
/*********************
Media Query Classes
**********************/
@media only screen and (max-width: 600px) {
.hide-on-small-only, .hide-on-small-and-down {
display: none !important;
}
}
@media only screen and (max-width: 992px) {
.hide-on-med-and-down {
display: none !important;
}
}
@media only screen and (min-width: 601px) {
.hide-on-med-and-up {
display: none !important;
}
}
@media only screen and (min-width: 600px) and (max-width: 992px) {
.hide-on-med-only {
display: none !important;
}
}
@media only screen and (min-width: 993px) {
.hide-on-large-only {
display: none !important;
}
}
@media only screen and (min-width: 993px) {
.show-on-large {
display: initial !important;
}
}
@media only screen and (min-width: 600px) and (max-width: 992px) {
.show-on-medium {
display: initial !important;
}
}
@media only screen and (max-width: 600px) {
.show-on-small {
display: initial !important;
}
}
@media only screen and (min-width: 601px) {
.show-on-medium-and-up {
display: initial !important;
}
}
@media only screen and (max-width: 992px) {
.show-on-medium-and-down {
display: initial !important;
}
}
@media only screen and (max-width: 600px) {
.center-on-small-only {
text-align: center;
}
}
footer.page-footer {
margin-top: 20px;
padding-top: 20px;
background-color: #004785;
}
footer.page-footer .footer-copyright {
overflow: hidden;
height: 50px;
line-height: 50px;
color: rgba(255, 255, 255, 0.8);
background-color: rgba(51, 51, 51, 0.08);
}
table, th, td {
border: none;
}
table {
width: 100%;
display: table;
}
table.bordered > thead > tr, table.bordered > tbody > tr {
border-bottom: 1px solid #d0d0d0;
}
table.striped > tbody > tr:nth-child(odd) {
background-color: #f2f2f2;
}
table.striped > tbody > tr > td {
border-radius: 0px;
}
table.hoverable > tbody > tr {
-webkit-transition: background-color 0.25s ease;
-moz-transition: background-color 0.25s ease;
-o-transition: background-color 0.25s ease;
-ms-transition: background-color 0.25s ease;
transition: background-color 0.25s ease;
}
table.hoverable > tbody > tr:hover {
background-color: #f2f2f2;
}
table.centered thead tr th, table.centered tbody tr td {
text-align: center;
}
thead {
border-bottom: 1px solid #d0d0d0;
}
td, th {
padding: 15px 5px;
display: table-cell;
text-align: left;
vertical-align: middle;
border-radius: 2px;
}
@media only screen and (max-width: 992px) {
table.responsive-table {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
display: block;
position: relative;
/* sort out borders */
}
table.responsive-table th,
table.responsive-table td {
margin: 0;
vertical-align: top;
}
table.responsive-table th {
text-align: left;
}
table.responsive-table thead {
display: block;
float: left;
}
table.responsive-table thead tr {
display: block;
padding: 0 10px 0 0;
}
table.responsive-table thead tr th::before {
content: "\00a0";
}
table.responsive-table tbody {
display: block;
width: auto;
position: relative;
overflow-x: auto;
white-space: nowrap;
}
table.responsive-table tbody tr {
display: inline-block;
vertical-align: top;
}
table.responsive-table th {
display: block;
text-align: right;
}
table.responsive-table td {
display: block;
min-height: 1.25em;
text-align: left;
}
table.responsive-table tr {
padding: 0 10px;
}
table.responsive-table thead {
border: 0;
border-right: 1px solid #d0d0d0;
}
table.responsive-table.bordered th {
border-bottom: 0;
border-left: 0;
}
table.responsive-table.bordered td {
border-left: 0;
border-right: 0;
border-bottom: 0;
}
table.responsive-table.bordered tr {
border: 0;
}
table.responsive-table.bordered tbody tr {
border-right: 1px solid #d0d0d0;
}
}
.collection {
margin: 0.5rem 0 1rem 0;
border: 1px solid #e0e0e0;
border-radius: 2px;
overflow: hidden;
position: relative;
}
.collection .collection-item {
background-color: #fff;
line-height: 1.5rem;
padding: 10px 20px;
margin: 0;
border-bottom: 1px solid #e0e0e0;
}
.collection .collection-item.avatar {
min-height: 84px;
padding-left: 72px;
position: relative;
}
.collection .collection-item.avatar .circle {
position: absolute;
width: 42px;
height: 42px;
overflow: hidden;
left: 15px;
display: inline-block;
vertical-align: middle;
}
.collection .collection-item.avatar i.circle {
font-size: 18px;
line-height: 42px;
color: #fff;
background-color: #999;
text-align: center;
}
.collection .collection-item.avatar .title {
font-size: 16px;
}
.collection .collection-item.avatar p {
margin: 0;
}
.collection .collection-item.avatar .secondary-content {
position: absolute;
top: 16px;
right: 16px;
}
.collection .collection-item:last-child {
border-bottom: none;
}
.collection .collection-item.active {
background-color: #26a69a;
color: #eafaf9;
}
.collection a.collection-item {
display: block;
-webkit-transition: 0.25s;
-moz-transition: 0.25s;
-o-transition: 0.25s;
-ms-transition: 0.25s;
transition: 0.25s;
color: #26a69a;
}
.collection a.collection-item:not(.active):hover {
background-color: #ddd;
}
.collection.with-header .collection-header {
background-color: #fff;
border-bottom: 1px solid #e0e0e0;
padding: 10px 20px;
}
.collection.with-header .collection-item {
padding-left: 30px;
}
.collection.with-header .collection-item.avatar {
padding-left: 72px;
}
.secondary-content {
float: right;
color: #26a69a;
}
span.badge {
min-width: 3rem;
padding: 0 6px;
text-align: center;
font-size: 1rem;
line-height: inherit;
color: #757575;
position: absolute;
right: 15px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
span.badge.new {
font-weight: 300;
font-size: 0.8rem;
color: #fff;
background-color: #26a69a;
border-radius: 2px;
}
span.badge.new:after {
content: " new";
}
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container.no-controls {
padding-top: 0;
}
.video-container iframe, .video-container object, .video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.progress {
position: relative;
height: 4px;
display: block;
width: 100%;
background-color: #acece6;
border-radius: 2px;
margin: 0.5rem 0 1rem 0;
overflow: hidden;
}
.progress .determinate {
position: absolute;
background-color: inherit;
top: 0;
left: 0;
bottom: 0;
background-color: #26a69a;
-webkit-transition: width 0.3s linear;
-moz-transition: width 0.3s linear;
-o-transition: width 0.3s linear;
-ms-transition: width 0.3s linear;
transition: width 0.3s linear;
}
.progress .indeterminate {
background-color: #26a69a;
}
.progress .indeterminate:before {
content: '';
position: absolute;
background-color: inherit;
top: 0;
left: 0;
bottom: 0;
will-change: left, right;
-webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
-moz-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
-ms-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
-o-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
}
.progress .indeterminate:after {
content: '';
position: absolute;
background-color: inherit;
top: 0;
left: 0;
bottom: 0;
will-change: left, right;
-webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
-moz-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
-ms-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
-o-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
-webkit-animation-delay: 1.15s;
-moz-animation-delay: 1.15s;
-ms-animation-delay: 1.15s;
-o-animation-delay: 1.15s;
animation-delay: 1.15s;
}
@-webkit-keyframes indeterminate {
0% {
left: -35%;
right: 100%;
}
60% {
left: 100%;
right: -90%;
}
100% {
left: 100%;
right: -90%;
}
}
@-moz-keyframes indeterminate {
0% {
left: -35%;
right: 100%;
}
60% {
left: 100%;
right: -90%;
}
100% {
left: 100%;
right: -90%;
}
}
@keyframes indeterminate {
0% {
left: -35%;
right: 100%;
}
60% {
left: 100%;
right: -90%;
}
100% {
left: 100%;
right: -90%;
}
}
@-webkit-keyframes indeterminate-short {
0% {
left: -200%;
right: 100%;
}
60% {
left: 107%;
right: -8%;
}
100% {
left: 107%;
right: -8%;
}
}
@-moz-keyframes indeterminate-short {
0% {
left: -200%;
right: 100%;
}
60% {
left: 107%;
right: -8%;
}
100% {
left: 107%;
right: -8%;
}
}
@keyframes indeterminate-short {
0% {
left: -200%;
right: 100%;
}
60% {
left: 107%;
right: -8%;
}
100% {
left: 107%;
right: -8%;
}
}
/*******************
Utility Classes
*******************/
.hide {
display: none !important;
}
.left-align {
text-align: left;
}
.right-align {
text-align: right;
}
.center, .center-align {
text-align: center;
}
.left {
float: left !important;
}
.right {
float: right !important;
}
.no-select, input[type=range], input[type=range] + .thumb {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.circle {
border-radius: 50%;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.truncate {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.no-padding {
padding: 0 !important;
}
@font-face {
font-family: "Material-Design-Icons";
src: url("../font/material-design-icons/Material-Design-Icons.eot?#iefix") format("embedded-opentype"), url("../font/material-design-icons/Material-Design-Icons.woff2") format("woff2"), url("../font/material-design-icons/Material-Design-Icons.woff") format("woff"), url("../font/material-design-icons/Material-Design-Icons.ttf") format("truetype"), url("../font/material-design-icons/Material-Design-Icons.svg#Material-Design-Icons") format("svg");
font-weight: normal;
font-style: normal;
}
[class^="mdi-"], [class*="mdi-"] {
speak: none;
display: inline-block;
font-family: "Material-Design-Icons";
font-style: normal;
font-weight: normal;
font-variant: normal;
text-rendering: auto;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: translate(0, 0);
}
[class^="mdi-"]:before, [class*="mdi-"]:before {
display: inline-block;
speak: none;
text-decoration: inherit;
}
[class^="mdi-"].pull-left, [class*="mdi-"].pull-left {
margin-right: .3em;
}
[class^="mdi-"].pull-right, [class*="mdi-"].pull-right {
margin-left: .3em;
}
[class^="mdi-"].mdi-lg:before, [class^="mdi-"].mdi-lg:after, [class*="mdi-"].mdi-lg:before, [class*="mdi-"].mdi-lg:after {
font-size: 1.33333333em;
line-height: 0.75em;
vertical-align: -15%;
}
[class^="mdi-"].mdi-2x:before, [class^="mdi-"].mdi-2x:after, [class*="mdi-"].mdi-2x:before, [class*="mdi-"].mdi-2x:after {
font-size: 2em;
}
[class^="mdi-"].mdi-3x:before, [class^="mdi-"].mdi-3x:after, [class*="mdi-"].mdi-3x:before, [class*="mdi-"].mdi-3x:after {
font-size: 3em;
}
[class^="mdi-"].mdi-4x:before, [class^="mdi-"].mdi-4x:after, [class*="mdi-"].mdi-4x:before, [class*="mdi-"].mdi-4x:after {
font-size: 4em;
}
[class^="mdi-"].mdi-5x:before, [class^="mdi-"].mdi-5x:after, [class*="mdi-"].mdi-5x:before, [class*="mdi-"].mdi-5x:after {
font-size: 5em;
}
[class^="mdi-device-signal-cellular-"]:after,
[class^="mdi-device-battery-"]:after,
[class^="mdi-device-battery-charging-"]:after,
[class^="mdi-device-signal-cellular-connected-no-internet-"]:after,
[class^="mdi-device-signal-wifi-"]:after,
[class^="mdi-device-signal-wifi-statusbar-not-connected"]:after,
.mdi-device-network-wifi:after {
opacity: .3;
position: absolute;
left: 0;
top: 0;
z-index: 1;
display: inline-block;
speak: none;
text-decoration: inherit;
}
[class^="mdi-device-signal-cellular-"]:after {
content: "\e758";
}
[class^="mdi-device-battery-"]:after {
content: "\e735";
}
[class^="mdi-device-battery-charging-"]:after {
content: "\e733";
}
[class^="mdi-device-signal-cellular-connected-no-internet-"]:after {
content: "\e75d";
}
[class^="mdi-device-signal-wifi-"]:after, .mdi-device-network-wifi:after {
content: "\e765";
}
[class^="mdi-device-signal-wifi-statusbasr-not-connected"]:after {
content: "\e8f7";
}
.mdi-device-signal-cellular-off:after, .mdi-device-signal-cellular-null:after, .mdi-device-signal-cellular-no-sim:after, .mdi-device-signal-wifi-off:after, .mdi-device-signal-wifi-4-bar:after, .mdi-device-signal-cellular-4-bar:after, .mdi-device-battery-alert:after, .mdi-device-signal-cellular-connected-no-internet-4-bar:after, .mdi-device-battery-std:after, .mdi-device-battery-full .mdi-device-battery-unknown:after {
content: "";
}
.mdi-fw {
width: 1.28571429em;
text-align: center;
}
.mdi-ul {
padding-left: 0;
margin-left: 2.14285714em;
list-style-type: none;
}
.mdi-ul > li {
position: relative;
}
.mdi-li {
position: absolute;
left: -2.14285714em;
width: 2.14285714em;
top: 0.14285714em;
text-align: center;
}
.mdi-li.mdi-lg {
left: -1.85714286em;
}
.mdi-border {
padding: .2em .25em .15em;
border: solid 0.08em #eeeeee;
border-radius: .1em;
}
.mdi-spin {
-webkit-animation: mdi-spin 2s infinite linear;
animation: mdi-spin 2s infinite linear;
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
transform-origin: 50% 50%;
}
.mdi-pulse {
-webkit-animation: mdi-spin 1s steps(8) infinite;
animation: mdi-spin 1s steps(8) infinite;
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
transform-origin: 50% 50%;
}
@-webkit-keyframes mdi-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes mdi-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
.mdi-rotate-90 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
}
.mdi-rotate-180 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}
.mdi-rotate-270 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
}
.mdi-flip-horizontal {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
-webkit-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
transform: scale(-1, 1);
}
.mdi-flip-vertical {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
-webkit-transform: scale(1, -1);
-ms-transform: scale(1, -1);
transform: scale(1, -1);
}
:root .mdi-rotate-90,
:root .mdi-rotate-180,
:root .mdi-rotate-270,
:root .mdi-flip-horizontal,
:root .mdi-flip-vertical {
filter: none;
}
.mdi-stack {
position: relative;
display: inline-block;
width: 2em;
height: 2em;
line-height: 2em;
vertical-align: middle;
}
.mdi-stack-1x,
.mdi-stack-2x {
position: absolute;
left: 0;
width: 100%;
text-align: center;
}
.mdi-stack-1x {
line-height: inherit;
}
.mdi-stack-2x {
font-size: 2em;
}
.mdi-inverse {
color: #ffffff;
}
/* Start Icons */
.mdi-action-3d-rotation:before {
content: "\e600";
}
.mdi-action-accessibility:before {
content: "\e601";
}
.mdi-action-account-balance-wallet:before {
content: "\e602";
}
.mdi-action-account-balance:before {
content: "\e603";
}
.mdi-action-account-box:before {
content: "\e604";
}
.mdi-action-account-child:before {
content: "\e605";
}
.mdi-action-account-circle:before {
content: "\e606";
}
.mdi-action-add-shopping-cart:before {
content: "\e607";
}
.mdi-action-alarm-add:before {
content: "\e608";
}
.mdi-action-alarm-off:before {
content: "\e609";
}
.mdi-action-alarm-on:before {
content: "\e60a";
}
.mdi-action-alarm:before {
content: "\e60b";
}
.mdi-action-android:before {
content: "\e60c";
}
.mdi-action-announcement:before {
content: "\e60d";
}
.mdi-action-aspect-ratio:before {
content: "\e60e";
}
.mdi-action-assessment:before {
content: "\e60f";
}
.mdi-action-assignment-ind:before {
content: "\e610";
}
.mdi-action-assignment-late:before {
content: "\e611";
}
.mdi-action-assignment-return:before {
content: "\e612";
}
.mdi-action-assignment-returned:before {
content: "\e613";
}
.mdi-action-assignment-turned-in:before {
content: "\e614";
}
.mdi-action-assignment:before {
content: "\e615";
}
.mdi-action-autorenew:before {
content: "\e616";
}
.mdi-action-backup:before {
content: "\e617";
}
.mdi-action-book:before {
content: "\e618";
}
.mdi-action-bookmark-outline:before {
content: "\e619";
}
.mdi-action-bookmark:before {
content: "\e61a";
}
.mdi-action-bug-report:before {
content: "\e61b";
}
.mdi-action-cached:before {
content: "\e61c";
}
.mdi-action-check-circle:before {
content: "\e61d";
}
.mdi-action-class:before {
content: "\e61e";
}
.mdi-action-credit-card:before {
content: "\e61f";
}
.mdi-action-dashboard:before {
content: "\e620";
}
.mdi-action-delete:before {
content: "\e621";
}
.mdi-action-description:before {
content: "\e622";
}
.mdi-action-dns:before {
content: "\e623";
}
.mdi-action-done-all:before {
content: "\e624";
}
.mdi-action-done:before {
content: "\e625";
}
.mdi-action-event:before {
content: "\e626";
}
.mdi-action-exit-to-app:before {
content: "\e627";
}
.mdi-action-explore:before {
content: "\e628";
}
.mdi-action-extension:before {
content: "\e629";
}
.mdi-action-face-unlock:before {
content: "\e62a";
}
.mdi-action-favorite-outline:before {
content: "\e62b";
}
.mdi-action-favorite:before {
content: "\e62c";
}
.mdi-action-find-in-page:before {
content: "\e62d";
}
.mdi-action-find-replace:before {
content: "\e62e";
}
.mdi-action-flip-to-back:before {
content: "\e62f";
}
.mdi-action-flip-to-front:before {
content: "\e630";
}
.mdi-action-get-app:before {
content: "\e631";
}
.mdi-action-grade:before {
content: "\e632";
}
.mdi-action-group-work:before {
content: "\e633";
}
.mdi-action-help:before {
content: "\e634";
}
.mdi-action-highlight-remove:before {
content: "\e635";
}
.mdi-action-history:before {
content: "\e636";
}
.mdi-action-home:before {
content: "\e637";
}
.mdi-action-https:before {
content: "\e638";
}
.mdi-action-info-outline:before {
content: "\e639";
}
.mdi-action-info:before {
content: "\e63a";
}
.mdi-action-input:before {
content: "\e63b";
}
.mdi-action-invert-colors:before {
content: "\e63c";
}
.mdi-action-label-outline:before {
content: "\e63d";
}
.mdi-action-label:before {
content: "\e63e";
}
.mdi-action-language:before {
content: "\e63f";
}
.mdi-action-launch:before {
content: "\e640";
}
.mdi-action-list:before {
content: "\e641";
}
.mdi-action-lock-open:before {
content: "\e642";
}
.mdi-action-lock-outline:before {
content: "\e643";
}
.mdi-action-lock:before {
content: "\e644";
}
.mdi-action-loyalty:before {
content: "\e645";
}
.mdi-action-markunread-mailbox:before {
content: "\e646";
}
.mdi-action-note-add:before {
content: "\e647";
}
.mdi-action-open-in-browser:before {
content: "\e648";
}
.mdi-action-open-in-new:before {
content: "\e649";
}
.mdi-action-open-with:before {
content: "\e64a";
}
.mdi-action-pageview:before {
content: "\e64b";
}
.mdi-action-payment:before {
content: "\e64c";
}
.mdi-action-perm-camera-mic:before {
content: "\e64d";
}
.mdi-action-perm-contact-cal:before {
content: "\e64e";
}
.mdi-action-perm-data-setting:before {
content: "\e64f";
}
.mdi-action-perm-device-info:before {
content: "\e650";
}
.mdi-action-perm-identity:before {
content: "\e651";
}
.mdi-action-perm-media:before {
content: "\e652";
}
.mdi-action-perm-phone-msg:before {
content: "\e653";
}
.mdi-action-perm-scan-wifi:before {
content: "\e654";
}
.mdi-action-picture-in-picture:before {
content: "\e655";
}
.mdi-action-polymer:before {
content: "\e656";
}
.mdi-action-print:before {
content: "\e657";
}
.mdi-action-query-builder:before {
content: "\e658";
}
.mdi-action-question-answer:before {
content: "\e659";
}
.mdi-action-receipt:before {
content: "\e65a";
}
.mdi-action-redeem:before {
content: "\e65b";
}
.mdi-action-reorder:before {
content: "\e65c";
}
.mdi-action-report-problem:before {
content: "\e65d";
}
.mdi-action-restore:before {
content: "\e65e";
}
.mdi-action-room:before {
content: "\e65f";
}
.mdi-action-schedule:before {
content: "\e660";
}
.mdi-action-search:before {
content: "\e661";
}
.mdi-action-settings-applications:before {
content: "\e662";
}
.mdi-action-settings-backup-restore:before {
content: "\e663";
}
.mdi-action-settings-bluetooth:before {
content: "\e664";
}
.mdi-action-settings-cell:before {
content: "\e665";
}
.mdi-action-settings-display:before {
content: "\e666";
}
.mdi-action-settings-ethernet:before {
content: "\e667";
}
.mdi-action-settings-input-antenna:before {
content: "\e668";
}
.mdi-action-settings-input-component:before {
content: "\e669";
}
.mdi-action-settings-input-composite:before {
content: "\e66a";
}
.mdi-action-settings-input-hdmi:before {
content: "\e66b";
}
.mdi-action-settings-input-svideo:before {
content: "\e66c";
}
.mdi-action-settings-overscan:before {
content: "\e66d";
}
.mdi-action-settings-phone:before {
content: "\e66e";
}
.mdi-action-settings-power:before {
content: "\e66f";
}
.mdi-action-settings-remote:before {
content: "\e670";
}
.mdi-action-settings-voice:before {
content: "\e671";
}
.mdi-action-settings:before {
content: "\e672";
}
.mdi-action-shop-two:before {
content: "\e673";
}
.mdi-action-shop:before {
content: "\e674";
}
.mdi-action-shopping-basket:before {
content: "\e675";
}
.mdi-action-shopping-cart:before {
content: "\e676";
}
.mdi-action-speaker-notes:before {
content: "\e677";
}
.mdi-action-spellcheck:before {
content: "\e678";
}
.mdi-action-star-rate:before {
content: "\e679";
}
.mdi-action-stars:before {
content: "\e67a";
}
.mdi-action-store:before {
content: "\e67b";
}
.mdi-action-subject:before {
content: "\e67c";
}
.mdi-action-supervisor-account:before {
content: "\e67d";
}
.mdi-action-swap-horiz:before {
content: "\e67e";
}
.mdi-action-swap-vert-circle:before {
content: "\e67f";
}
.mdi-action-swap-vert:before {
content: "\e680";
}
.mdi-action-system-update-tv:before {
content: "\e681";
}
.mdi-action-tab-unselected:before {
content: "\e682";
}
.mdi-action-tab:before {
content: "\e683";
}
.mdi-action-theaters:before {
content: "\e684";
}
.mdi-action-thumb-down:before {
content: "\e685";
}
.mdi-action-thumb-up:before {
content: "\e686";
}
.mdi-action-thumbs-up-down:before {
content: "\e687";
}
.mdi-action-toc:before {
content: "\e688";
}
.mdi-action-today:before {
content: "\e689";
}
.mdi-action-track-changes:before {
content: "\e68a";
}
.mdi-action-translate:before {
content: "\e68b";
}
.mdi-action-trending-down:before {
content: "\e68c";
}
.mdi-action-trending-neutral:before {
content: "\e68d";
}
.mdi-action-trending-up:before {
content: "\e68e";
}
.mdi-action-turned-in-not:before {
content: "\e68f";
}
.mdi-action-turned-in:before {
content: "\e690";
}
.mdi-action-verified-user:before {
content: "\e691";
}
.mdi-action-view-agenda:before {
content: "\e692";
}
.mdi-action-view-array:before {
content: "\e693";
}
.mdi-action-view-carousel:before {
content: "\e694";
}
.mdi-action-view-column:before {
content: "\e695";
}
.mdi-action-view-day:before {
content: "\e696";
}
.mdi-action-view-headline:before {
content: "\e697";
}
.mdi-action-view-list:before {
content: "\e698";
}
.mdi-action-view-module:before {
content: "\e699";
}
.mdi-action-view-quilt:before {
content: "\e69a";
}
.mdi-action-view-stream:before {
content: "\e69b";
}
.mdi-action-view-week:before {
content: "\e69c";
}
.mdi-action-visibility-off:before {
content: "\e69d";
}
.mdi-action-visibility:before {
content: "\e69e";
}
.mdi-action-wallet-giftcard:before {
content: "\e69f";
}
.mdi-action-wallet-membership:before {
content: "\e6a0";
}
.mdi-action-wallet-travel:before {
content: "\e6a1";
}
.mdi-action-work:before {
content: "\e6a2";
}
.mdi-alert-error:before {
content: "\e6a3";
}
.mdi-alert-warning:before {
content: "\e6a4";
}
.mdi-av-album:before {
content: "\e6a5";
}
.mdi-av-closed-caption:before {
content: "\e6a6";
}
.mdi-av-equalizer:before {
content: "\e6a7";
}
.mdi-av-explicit:before {
content: "\e6a8";
}
.mdi-av-fast-forward:before {
content: "\e6a9";
}
.mdi-av-fast-rewind:before {
content: "\e6aa";
}
.mdi-av-games:before {
content: "\e6ab";
}
.mdi-av-hearing:before {
content: "\e6ac";
}
.mdi-av-high-quality:before {
content: "\e6ad";
}
.mdi-av-loop:before {
content: "\e6ae";
}
.mdi-av-mic-none:before {
content: "\e6af";
}
.mdi-av-mic-off:before {
content: "\e6b0";
}
.mdi-av-mic:before {
content: "\e6b1";
}
.mdi-av-movie:before {
content: "\e6b2";
}
.mdi-av-my-library-add:before {
content: "\e6b3";
}
.mdi-av-my-library-books:before {
content: "\e6b4";
}
.mdi-av-my-library-music:before {
content: "\e6b5";
}
.mdi-av-new-releases:before {
content: "\e6b6";
}
.mdi-av-not-interested:before {
content: "\e6b7";
}
.mdi-av-pause-circle-fill:before {
content: "\e6b8";
}
.mdi-av-pause-circle-outline:before {
content: "\e6b9";
}
.mdi-av-pause:before {
content: "\e6ba";
}
.mdi-av-play-arrow:before {
content: "\e6bb";
}
.mdi-av-play-circle-fill:before {
content: "\e6bc";
}
.mdi-av-play-circle-outline:before {
content: "\e6bd";
}
.mdi-av-play-shopping-bag:before {
content: "\e6be";
}
.mdi-av-playlist-add:before {
content: "\e6bf";
}
.mdi-av-queue-music:before {
content: "\e6c0";
}
.mdi-av-queue:before {
content: "\e6c1";
}
.mdi-av-radio:before {
content: "\e6c2";
}
.mdi-av-recent-actors:before {
content: "\e6c3";
}
.mdi-av-repeat-one:before {
content: "\e6c4";
}
.mdi-av-repeat:before {
content: "\e6c5";
}
.mdi-av-replay:before {
content: "\e6c6";
}
.mdi-av-shuffle:before {
content: "\e6c7";
}
.mdi-av-skip-next:before {
content: "\e6c8";
}
.mdi-av-skip-previous:before {
content: "\e6c9";
}
.mdi-av-snooze:before {
content: "\e6ca";
}
.mdi-av-stop:before {
content: "\e6cb";
}
.mdi-av-subtitles:before {
content: "\e6cc";
}
.mdi-av-surround-sound:before {
content: "\e6cd";
}
.mdi-av-timer:before {
content: "\e6ce";
}
.mdi-av-video-collection:before {
content: "\e6cf";
}
.mdi-av-videocam-off:before {
content: "\e6d0";
}
.mdi-av-videocam:before {
content: "\e6d1";
}
.mdi-av-volume-down:before {
content: "\e6d2";
}
.mdi-av-volume-mute:before {
content: "\e6d3";
}
.mdi-av-volume-off:before {
content: "\e6d4";
}
.mdi-av-volume-up:before {
content: "\e6d5";
}
.mdi-av-web:before {
content: "\e6d6";
}
.mdi-communication-business:before {
content: "\e6d7";
}
.mdi-communication-call-end:before {
content: "\e6d8";
}
.mdi-communication-call-made:before {
content: "\e6d9";
}
.mdi-communication-call-merge:before {
content: "\e6da";
}
.mdi-communication-call-missed:before {
content: "\e6db";
}
.mdi-communication-call-received:before {
content: "\e6dc";
}
.mdi-communication-call-split:before {
content: "\e6dd";
}
.mdi-communication-call:before {
content: "\e6de";
}
.mdi-communication-chat:before {
content: "\e6df";
}
.mdi-communication-clear-all:before {
content: "\e6e0";
}
.mdi-communication-comment:before {
content: "\e6e1";
}
.mdi-communication-contacts:before {
content: "\e6e2";
}
.mdi-communication-dialer-sip:before {
content: "\e6e3";
}
.mdi-communication-dialpad:before {
content: "\e6e4";
}
.mdi-communication-dnd-on:before {
content: "\e6e5";
}
.mdi-communication-email:before {
content: "\e6e6";
}
.mdi-communication-forum:before {
content: "\e6e7";
}
.mdi-communication-import-export:before {
content: "\e6e8";
}
.mdi-communication-invert-colors-off:before {
content: "\e6e9";
}
.mdi-communication-invert-colors-on:before {
content: "\e6ea";
}
.mdi-communication-live-help:before {
content: "\e6eb";
}
.mdi-communication-location-off:before {
content: "\e6ec";
}
.mdi-communication-location-on:before {
content: "\e6ed";
}
.mdi-communication-message:before {
content: "\e6ee";
}
.mdi-communication-messenger:before {
content: "\e6ef";
}
.mdi-communication-no-sim:before {
content: "\e6f0";
}
.mdi-communication-phone:before {
content: "\e6f1";
}
.mdi-communication-portable-wifi-off:before {
content: "\e6f2";
}
.mdi-communication-quick-contacts-dialer:before {
content: "\e6f3";
}
.mdi-communication-quick-contacts-mail:before {
content: "\e6f4";
}
.mdi-communication-ring-volume:before {
content: "\e6f5";
}
.mdi-communication-stay-current-landscape:before {
content: "\e6f6";
}
.mdi-communication-stay-current-portrait:before {
content: "\e6f7";
}
.mdi-communication-stay-primary-landscape:before {
content: "\e6f8";
}
.mdi-communication-stay-primary-portrait:before {
content: "\e6f9";
}
.mdi-communication-swap-calls:before {
content: "\e6fa";
}
.mdi-communication-textsms:before {
content: "\e6fb";
}
.mdi-communication-voicemail:before {
content: "\e6fc";
}
.mdi-communication-vpn-key:before {
content: "\e6fd";
}
.mdi-content-add-box:before {
content: "\e6fe";
}
.mdi-content-add-circle-outline:before {
content: "\e6ff";
}
.mdi-content-add-circle:before {
content: "\e700";
}
.mdi-content-add:before {
content: "\e701";
}
.mdi-content-archive:before {
content: "\e702";
}
.mdi-content-backspace:before {
content: "\e703";
}
.mdi-content-block:before {
content: "\e704";
}
.mdi-content-clear:before {
content: "\e705";
}
.mdi-content-content-copy:before {
content: "\e706";
}
.mdi-content-content-cut:before {
content: "\e707";
}
.mdi-content-content-paste:before {
content: "\e708";
}
.mdi-content-create:before {
content: "\e709";
}
.mdi-content-drafts:before {
content: "\e70a";
}
.mdi-content-filter-list:before {
content: "\e70b";
}
.mdi-content-flag:before {
content: "\e70c";
}
.mdi-content-forward:before {
content: "\e70d";
}
.mdi-content-gesture:before {
content: "\e70e";
}
.mdi-content-inbox:before {
content: "\e70f";
}
.mdi-content-link:before {
content: "\e710";
}
.mdi-content-mail:before {
content: "\e711";
}
.mdi-content-markunread:before {
content: "\e712";
}
.mdi-content-redo:before {
content: "\e713";
}
.mdi-content-remove-circle-outline:before {
content: "\e714";
}
.mdi-content-remove-circle:before {
content: "\e715";
}
.mdi-content-remove:before {
content: "\e716";
}
.mdi-content-reply-all:before {
content: "\e717";
}
.mdi-content-reply:before {
content: "\e718";
}
.mdi-content-report:before {
content: "\e719";
}
.mdi-content-save:before {
content: "\e71a";
}
.mdi-content-select-all:before {
content: "\e71b";
}
.mdi-content-send:before {
content: "\e71c";
}
.mdi-content-sort:before {
content: "\e71d";
}
.mdi-content-text-format:before {
content: "\e71e";
}
.mdi-content-undo:before {
content: "\e71f";
}
.mdi-editor-attach-file:before {
content: "\e776";
}
.mdi-editor-attach-money:before {
content: "\e777";
}
.mdi-editor-border-all:before {
content: "\e778";
}
.mdi-editor-border-bottom:before {
content: "\e779";
}
.mdi-editor-border-clear:before {
content: "\e77a";
}
.mdi-editor-border-color:before {
content: "\e77b";
}
.mdi-editor-border-horizontal:before {
content: "\e77c";
}
.mdi-editor-border-inner:before {
content: "\e77d";
}
.mdi-editor-border-left:before {
content: "\e77e";
}
.mdi-editor-border-outer:before {
content: "\e77f";
}
.mdi-editor-border-right:before {
content: "\e780";
}
.mdi-editor-border-style:before {
content: "\e781";
}
.mdi-editor-border-top:before {
content: "\e782";
}
.mdi-editor-border-vertical:before {
content: "\e783";
}
.mdi-editor-format-align-center:before {
content: "\e784";
}
.mdi-editor-format-align-justify:before {
content: "\e785";
}
.mdi-editor-format-align-left:before {
content: "\e786";
}
.mdi-editor-format-align-right:before {
content: "\e787";
}
.mdi-editor-format-bold:before {
content: "\e788";
}
.mdi-editor-format-clear:before {
content: "\e789";
}
.mdi-editor-format-color-fill:before {
content: "\e78a";
}
.mdi-editor-format-color-reset:before {
content: "\e78b";
}
.mdi-editor-format-color-text:before {
content: "\e78c";
}
.mdi-editor-format-indent-decrease:before {
content: "\e78d";
}
.mdi-editor-format-indent-increase:before {
content: "\e78e";
}
.mdi-editor-format-italic:before {
content: "\e78f";
}
.mdi-editor-format-line-spacing:before {
content: "\e790";
}
.mdi-editor-format-list-bulleted:before {
content: "\e791";
}
.mdi-editor-format-list-numbered:before {
content: "\e792";
}
.mdi-editor-format-paint:before {
content: "\e793";
}
.mdi-editor-format-quote:before {
content: "\e794";
}
.mdi-editor-format-size:before {
content: "\e795";
}
.mdi-editor-format-strikethrough:before {
content: "\e796";
}
.mdi-editor-format-textdirection-l-to-r:before {
content: "\e797";
}
.mdi-editor-format-textdirection-r-to-l:before {
content: "\e798";
}
.mdi-editor-format-underline:before {
content: "\e799";
}
.mdi-editor-functions:before {
content: "\e79a";
}
.mdi-editor-insert-chart:before {
content: "\e79b";
}
.mdi-editor-insert-comment:before {
content: "\e79c";
}
.mdi-editor-insert-drive-file:before {
content: "\e79d";
}
.mdi-editor-insert-emoticon:before {
content: "\e79e";
}
.mdi-editor-insert-invitation:before {
content: "\e79f";
}
.mdi-editor-insert-link:before {
content: "\e7a0";
}
.mdi-editor-insert-photo:before {
content: "\e7a1";
}
.mdi-editor-merge-type:before {
content: "\e7a2";
}
.mdi-editor-mode-comment:before {
content: "\e7a3";
}
.mdi-editor-mode-edit:before {
content: "\e7a4";
}
.mdi-editor-publish:before {
content: "\e7a5";
}
.mdi-editor-vertical-align-bottom:before {
content: "\e7a6";
}
.mdi-editor-vertical-align-center:before {
content: "\e7a7";
}
.mdi-editor-vertical-align-top:before {
content: "\e7a8";
}
.mdi-editor-wrap-text:before {
content: "\e7a9";
}
.mdi-file-attachment:before {
content: "\e7aa";
}
.mdi-file-cloud-circle:before {
content: "\e7ab";
}
.mdi-file-cloud-done:before {
content: "\e7ac";
}
.mdi-file-cloud-download:before {
content: "\e7ad";
}
.mdi-file-cloud-off:before {
content: "\e7ae";
}
.mdi-file-cloud-queue:before {
content: "\e7af";
}
.mdi-file-cloud-upload:before {
content: "\e7b0";
}
.mdi-file-cloud:before {
content: "\e7b1";
}
.mdi-file-file-download:before {
content: "\e7b2";
}
.mdi-file-file-upload:before {
content: "\e7b3";
}
.mdi-file-folder-open:before {
content: "\e7b4";
}
.mdi-file-folder-shared:before {
content: "\e7b5";
}
.mdi-file-folder:before {
content: "\e7b6";
}
.mdi-device-access-alarm:before {
content: "\e720";
}
.mdi-device-access-alarms:before {
content: "\e721";
}
.mdi-device-access-time:before {
content: "\e722";
}
.mdi-device-add-alarm:before {
content: "\e723";
}
.mdi-device-airplanemode-off:before {
content: "\e724";
}
.mdi-device-airplanemode-on:before {
content: "\e725";
}
.mdi-device-battery-20:before {
content: "\e726";
}
.mdi-device-battery-30:before {
content: "\e727";
}
.mdi-device-battery-50:before {
content: "\e728";
}
.mdi-device-battery-60:before {
content: "\e729";
}
.mdi-device-battery-80:before {
content: "\e72a";
}
.mdi-device-battery-90:before {
content: "\e72b";
}
.mdi-device-battery-alert:before {
content: "\e72c";
}
.mdi-device-battery-charging-20:before {
content: "\e72d";
}
.mdi-device-battery-charging-30:before {
content: "\e72e";
}
.mdi-device-battery-charging-50:before {
content: "\e72f";
}
.mdi-device-battery-charging-60:before {
content: "\e730";
}
.mdi-device-battery-charging-80:before {
content: "\e731";
}
.mdi-device-battery-charging-90:before {
content: "\e732";
}
.mdi-device-battery-charging-full:before {
content: "\e733";
}
.mdi-device-battery-full:before {
content: "\e734";
}
.mdi-device-battery-std:before {
content: "\e735";
}
.mdi-device-battery-unknown:before {
content: "\e736";
}
.mdi-device-bluetooth-connected:before {
content: "\e737";
}
.mdi-device-bluetooth-disabled:before {
content: "\e738";
}
.mdi-device-bluetooth-searching:before {
content: "\e739";
}
.mdi-device-bluetooth:before {
content: "\e73a";
}
.mdi-device-brightness-auto:before {
content: "\e73b";
}
.mdi-device-brightness-high:before {
content: "\e73c";
}
.mdi-device-brightness-low:before {
content: "\e73d";
}
.mdi-device-brightness-medium:before {
content: "\e73e";
}
.mdi-device-data-usage:before {
content: "\e73f";
}
.mdi-device-developer-mode:before {
content: "\e740";
}
.mdi-device-devices:before {
content: "\e741";
}
.mdi-device-dvr:before {
content: "\e742";
}
.mdi-device-gps-fixed:before {
content: "\e743";
}
.mdi-device-gps-not-fixed:before {
content: "\e744";
}
.mdi-device-gps-off:before {
content: "\e745";
}
.mdi-device-location-disabled:before {
content: "\e746";
}
.mdi-device-location-searching:before {
content: "\e747";
}
.mdi-device-multitrack-audio:before {
content: "\e748";
}
.mdi-device-network-cell:before {
content: "\e749";
}
.mdi-device-network-wifi:before {
content: "\e74a";
}
.mdi-device-nfc:before {
content: "\e74b";
}
.mdi-device-now-wallpaper:before {
content: "\e74c";
}
.mdi-device-now-widgets:before {
content: "\e74d";
}
.mdi-device-screen-lock-landscape:before {
content: "\e74e";
}
.mdi-device-screen-lock-portrait:before {
content: "\e74f";
}
.mdi-device-screen-lock-rotation:before {
content: "\e750";
}
.mdi-device-screen-rotation:before {
content: "\e751";
}
.mdi-device-sd-storage:before {
content: "\e752";
}
.mdi-device-settings-system-daydream:before {
content: "\e753";
}
.mdi-device-signal-cellular-0-bar:before {
content: "\e754";
}
.mdi-device-signal-cellular-1-bar:before {
content: "\e755";
}
.mdi-device-signal-cellular-2-bar:before {
content: "\e756";
}
.mdi-device-signal-cellular-3-bar:before {
content: "\e757";
}
.mdi-device-signal-cellular-4-bar:before {
content: "\e758";
}
.mdi-signal-wifi-statusbar-connected-no-internet-after:before {
content: "\e8f6";
}
.mdi-device-signal-cellular-connected-no-internet-0-bar:before {
content: "\e759";
}
.mdi-device-signal-cellular-connected-no-internet-1-bar:before {
content: "\e75a";
}
.mdi-device-signal-cellular-connected-no-internet-2-bar:before {
content: "\e75b";
}
.mdi-device-signal-cellular-connected-no-internet-3-bar:before {
content: "\e75c";
}
.mdi-device-signal-cellular-connected-no-internet-4-bar:before {
content: "\e75d";
}
.mdi-device-signal-cellular-no-sim:before {
content: "\e75e";
}
.mdi-device-signal-cellular-null:before {
content: "\e75f";
}
.mdi-device-signal-cellular-off:before {
content: "\e760";
}
.mdi-device-signal-wifi-0-bar:before {
content: "\e761";
}
.mdi-device-signal-wifi-1-bar:before {
content: "\e762";
}
.mdi-device-signal-wifi-2-bar:before {
content: "\e763";
}
.mdi-device-signal-wifi-3-bar:before {
content: "\e764";
}
.mdi-device-signal-wifi-4-bar:before {
content: "\e765";
}
.mdi-device-signal-wifi-off:before {
content: "\e766";
}
.mdi-device-signal-wifi-statusbar-1-bar:before {
content: "\e767";
}
.mdi-device-signal-wifi-statusbar-2-bar:before {
content: "\e768";
}
.mdi-device-signal-wifi-statusbar-3-bar:before {
content: "\e769";
}
.mdi-device-signal-wifi-statusbar-4-bar:before {
content: "\e76a";
}
.mdi-device-signal-wifi-statusbar-connected-no-internet-:before {
content: "\e76b";
}
.mdi-device-signal-wifi-statusbar-connected-no-internet:before {
content: "\e76f";
}
.mdi-device-signal-wifi-statusbar-connected-no-internet-2:before {
content: "\e76c";
}
.mdi-device-signal-wifi-statusbar-connected-no-internet-3:before {
content: "\e76d";
}
.mdi-device-signal-wifi-statusbar-connected-no-internet-4:before {
content: "\e76e";
}
.mdi-signal-wifi-statusbar-not-connected-after:before {
content: "\e8f7";
}
.mdi-device-signal-wifi-statusbar-not-connected:before {
content: "\e770";
}
.mdi-device-signal-wifi-statusbar-null:before {
content: "\e771";
}
.mdi-device-storage:before {
content: "\e772";
}
.mdi-device-usb:before {
content: "\e773";
}
.mdi-device-wifi-lock:before {
content: "\e774";
}
.mdi-device-wifi-tethering:before {
content: "\e775";
}
.mdi-hardware-cast-connected:before {
content: "\e7b7";
}
.mdi-hardware-cast:before {
content: "\e7b8";
}
.mdi-hardware-computer:before {
content: "\e7b9";
}
.mdi-hardware-desktop-mac:before {
content: "\e7ba";
}
.mdi-hardware-desktop-windows:before {
content: "\e7bb";
}
.mdi-hardware-dock:before {
content: "\e7bc";
}
.mdi-hardware-gamepad:before {
content: "\e7bd";
}
.mdi-hardware-headset-mic:before {
content: "\e7be";
}
.mdi-hardware-headset:before {
content: "\e7bf";
}
.mdi-hardware-keyboard-alt:before {
content: "\e7c0";
}
.mdi-hardware-keyboard-arrow-down:before {
content: "\e7c1";
}
.mdi-hardware-keyboard-arrow-left:before {
content: "\e7c2";
}
.mdi-hardware-keyboard-arrow-right:before {
content: "\e7c3";
}
.mdi-hardware-keyboard-arrow-up:before {
content: "\e7c4";
}
.mdi-hardware-keyboard-backspace:before {
content: "\e7c5";
}
.mdi-hardware-keyboard-capslock:before {
content: "\e7c6";
}
.mdi-hardware-keyboard-control:before {
content: "\e7c7";
}
.mdi-hardware-keyboard-hide:before {
content: "\e7c8";
}
.mdi-hardware-keyboard-return:before {
content: "\e7c9";
}
.mdi-hardware-keyboard-tab:before {
content: "\e7ca";
}
.mdi-hardware-keyboard-voice:before {
content: "\e7cb";
}
.mdi-hardware-keyboard:before {
content: "\e7cc";
}
.mdi-hardware-laptop-chromebook:before {
content: "\e7cd";
}
.mdi-hardware-laptop-mac:before {
content: "\e7ce";
}
.mdi-hardware-laptop-windows:before {
content: "\e7cf";
}
.mdi-hardware-laptop:before {
content: "\e7d0";
}
.mdi-hardware-memory:before {
content: "\e7d1";
}
.mdi-hardware-mouse:before {
content: "\e7d2";
}
.mdi-hardware-phone-android:before {
content: "\e7d3";
}
.mdi-hardware-phone-iphone:before {
content: "\e7d4";
}
.mdi-hardware-phonelink-off:before {
content: "\e7d5";
}
.mdi-hardware-phonelink:before {
content: "\e7d6";
}
.mdi-hardware-security:before {
content: "\e7d7";
}
.mdi-hardware-sim-card:before {
content: "\e7d8";
}
.mdi-hardware-smartphone:before {
content: "\e7d9";
}
.mdi-hardware-speaker:before {
content: "\e7da";
}
.mdi-hardware-tablet-android:before {
content: "\e7db";
}
.mdi-hardware-tablet-mac:before {
content: "\e7dc";
}
.mdi-hardware-tablet:before {
content: "\e7dd";
}
.mdi-hardware-tv:before {
content: "\e7de";
}
.mdi-hardware-watch:before {
content: "\e7df";
}
.mdi-image-add-to-photos:before {
content: "\e7e0";
}
.mdi-image-adjust:before {
content: "\e7e1";
}
.mdi-image-assistant-photo:before {
content: "\e7e2";
}
.mdi-image-audiotrack:before {
content: "\e7e3";
}
.mdi-image-blur-circular:before {
content: "\e7e4";
}
.mdi-image-blur-linear:before {
content: "\e7e5";
}
.mdi-image-blur-off:before {
content: "\e7e6";
}
.mdi-image-blur-on:before {
content: "\e7e7";
}
.mdi-image-brightness-1:before {
content: "\e7e8";
}
.mdi-image-brightness-2:before {
content: "\e7e9";
}
.mdi-image-brightness-3:before {
content: "\e7ea";
}
.mdi-image-brightness-4:before {
content: "\e7eb";
}
.mdi-image-brightness-5:before {
content: "\e7ec";
}
.mdi-image-brightness-6:before {
content: "\e7ed";
}
.mdi-image-brightness-7:before {
content: "\e7ee";
}
.mdi-image-brush:before {
content: "\e7ef";
}
.mdi-image-camera-alt:before {
content: "\e7f0";
}
.mdi-image-camera-front:before {
content: "\e7f1";
}
.mdi-image-camera-rear:before {
content: "\e7f2";
}
.mdi-image-camera-roll:before {
content: "\e7f3";
}
.mdi-image-camera:before {
content: "\e7f4";
}
.mdi-image-center-focus-strong:before {
content: "\e7f5";
}
.mdi-image-center-focus-weak:before {
content: "\e7f6";
}
.mdi-image-collections:before {
content: "\e7f7";
}
.mdi-image-color-lens:before {
content: "\e7f8";
}
.mdi-image-colorize:before {
content: "\e7f9";
}
.mdi-image-compare:before {
content: "\e7fa";
}
.mdi-image-control-point-duplicate:before {
content: "\e7fb";
}
.mdi-image-control-point:before {
content: "\e7fc";
}
.mdi-image-crop-3-2:before {
content: "\e7fd";
}
.mdi-image-crop-5-4:before {
content: "\e7fe";
}
.mdi-image-crop-7-5:before {
content: "\e7ff";
}
.mdi-image-crop-16-9:before {
content: "\e800";
}
.mdi-image-crop-din:before {
content: "\e801";
}
.mdi-image-crop-free:before {
content: "\e802";
}
.mdi-image-crop-landscape:before {
content: "\e803";
}
.mdi-image-crop-original:before {
content: "\e804";
}
.mdi-image-crop-portrait:before {
content: "\e805";
}
.mdi-image-crop-square:before {
content: "\e806";
}
.mdi-image-crop:before {
content: "\e807";
}
.mdi-image-dehaze:before {
content: "\e808";
}
.mdi-image-details:before {
content: "\e809";
}
.mdi-image-edit:before {
content: "\e80a";
}
.mdi-image-exposure-minus-1:before {
content: "\e80b";
}
.mdi-image-exposure-minus-2:before {
content: "\e80c";
}
.mdi-image-exposure-plus-1:before {
content: "\e80d";
}
.mdi-image-exposure-plus-2:before {
content: "\e80e";
}
.mdi-image-exposure-zero:before {
content: "\e80f";
}
.mdi-image-exposure:before {
content: "\e810";
}
.mdi-image-filter-1:before {
content: "\e811";
}
.mdi-image-filter-2:before {
content: "\e812";
}
.mdi-image-filter-3:before {
content: "\e813";
}
.mdi-image-filter-4:before {
content: "\e814";
}
.mdi-image-filter-5:before {
content: "\e815";
}
.mdi-image-filter-6:before {
content: "\e816";
}
.mdi-image-filter-7:before {
content: "\e817";
}
.mdi-image-filter-8:before {
content: "\e818";
}
.mdi-image-filter-9-plus:before {
content: "\e819";
}
.mdi-image-filter-9:before {
content: "\e81a";
}
.mdi-image-filter-b-and-w:before {
content: "\e81b";
}
.mdi-image-filter-center-focus:before {
content: "\e81c";
}
.mdi-image-filter-drama:before {
content: "\e81d";
}
.mdi-image-filter-frames:before {
content: "\e81e";
}
.mdi-image-filter-hdr:before {
content: "\e81f";
}
.mdi-image-filter-none:before {
content: "\e820";
}
.mdi-image-filter-tilt-shift:before {
content: "\e821";
}
.mdi-image-filter-vintage:before {
content: "\e822";
}
.mdi-image-filter:before {
content: "\e823";
}
.mdi-image-flare:before {
content: "\e824";
}
.mdi-image-flash-auto:before {
content: "\e825";
}
.mdi-image-flash-off:before {
content: "\e826";
}
.mdi-image-flash-on:before {
content: "\e827";
}
.mdi-image-flip:before {
content: "\e828";
}
.mdi-image-gradient:before {
content: "\e829";
}
.mdi-image-grain:before {
content: "\e82a";
}
.mdi-image-grid-off:before {
content: "\e82b";
}
.mdi-image-grid-on:before {
content: "\e82c";
}
.mdi-image-hdr-off:before {
content: "\e82d";
}
.mdi-image-hdr-on:before {
content: "\e82e";
}
.mdi-image-hdr-strong:before {
content: "\e82f";
}
.mdi-image-hdr-weak:before {
content: "\e830";
}
.mdi-image-healing:before {
content: "\e831";
}
.mdi-image-image-aspect-ratio:before {
content: "\e832";
}
.mdi-image-image:before {
content: "\e833";
}
.mdi-image-iso:before {
content: "\e834";
}
.mdi-image-landscape:before {
content: "\e835";
}
.mdi-image-leak-add:before {
content: "\e836";
}
.mdi-image-leak-remove:before {
content: "\e837";
}
.mdi-image-lens:before {
content: "\e838";
}
.mdi-image-looks-3:before {
content: "\e839";
}
.mdi-image-looks-4:before {
content: "\e83a";
}
.mdi-image-looks-5:before {
content: "\e83b";
}
.mdi-image-looks-6:before {
content: "\e83c";
}
.mdi-image-looks-one:before {
content: "\e83d";
}
.mdi-image-looks-two:before {
content: "\e83e";
}
.mdi-image-looks:before {
content: "\e83f";
}
.mdi-image-loupe:before {
content: "\e840";
}
.mdi-image-movie-creation:before {
content: "\e841";
}
.mdi-image-nature-people:before {
content: "\e842";
}
.mdi-image-nature:before {
content: "\e843";
}
.mdi-image-navigate-before:before {
content: "\e844";
}
.mdi-image-navigate-next:before {
content: "\e845";
}
.mdi-image-palette:before {
content: "\e846";
}
.mdi-image-panorama-fisheye:before {
content: "\e847";
}
.mdi-image-panorama-horizontal:before {
content: "\e848";
}
.mdi-image-panorama-vertical:before {
content: "\e849";
}
.mdi-image-panorama-wide-angle:before {
content: "\e84a";
}
.mdi-image-panorama:before {
content: "\e84b";
}
.mdi-image-photo-album:before {
content: "\e84c";
}
.mdi-image-photo-camera:before {
content: "\e84d";
}
.mdi-image-photo-library:before {
content: "\e84e";
}
.mdi-image-photo:before {
content: "\e84f";
}
.mdi-image-portrait:before {
content: "\e850";
}
.mdi-image-remove-red-eye:before {
content: "\e851";
}
.mdi-image-rotate-left:before {
content: "\e852";
}
.mdi-image-rotate-right:before {
content: "\e853";
}
.mdi-image-slideshow:before {
content: "\e854";
}
.mdi-image-straighten:before {
content: "\e855";
}
.mdi-image-style:before {
content: "\e856";
}
.mdi-image-switch-camera:before {
content: "\e857";
}
.mdi-image-switch-video:before {
content: "\e858";
}
.mdi-image-tag-faces:before {
content: "\e859";
}
.mdi-image-texture:before {
content: "\e85a";
}
.mdi-image-timelapse:before {
content: "\e85b";
}
.mdi-image-timer-3:before {
content: "\e85c";
}
.mdi-image-timer-10:before {
content: "\e85d";
}
.mdi-image-timer-auto:before {
content: "\e85e";
}
.mdi-image-timer-off:before {
content: "\e85f";
}
.mdi-image-timer:before {
content: "\e860";
}
.mdi-image-tonality:before {
content: "\e861";
}
.mdi-image-transform:before {
content: "\e862";
}
.mdi-image-tune:before {
content: "\e863";
}
.mdi-image-wb-auto:before {
content: "\e864";
}
.mdi-image-wb-cloudy:before {
content: "\e865";
}
.mdi-image-wb-incandescent:before {
content: "\e866";
}
.mdi-image-wb-irradescent:before {
content: "\e867";
}
.mdi-image-wb-sunny:before {
content: "\e868";
}
.mdi-maps-beenhere:before {
content: "\e869";
}
.mdi-maps-directions-bike:before {
content: "\e86a";
}
.mdi-maps-directions-bus:before {
content: "\e86b";
}
.mdi-maps-directions-car:before {
content: "\e86c";
}
.mdi-maps-directions-ferry:before {
content: "\e86d";
}
.mdi-maps-directions-subway:before {
content: "\e86e";
}
.mdi-maps-directions-train:before {
content: "\e86f";
}
.mdi-maps-directions-transit:before {
content: "\e870";
}
.mdi-maps-directions-walk:before {
content: "\e871";
}
.mdi-maps-directions:before {
content: "\e872";
}
.mdi-maps-flight:before {
content: "\e873";
}
.mdi-maps-hotel:before {
content: "\e874";
}
.mdi-maps-layers-clear:before {
content: "\e875";
}
.mdi-maps-layers:before {
content: "\e876";
}
.mdi-maps-local-airport:before {
content: "\e877";
}
.mdi-maps-local-atm:before {
content: "\e878";
}
.mdi-maps-local-attraction:before {
content: "\e879";
}
.mdi-maps-local-bar:before {
content: "\e87a";
}
.mdi-maps-local-cafe:before {
content: "\e87b";
}
.mdi-maps-local-car-wash:before {
content: "\e87c";
}
.mdi-maps-local-convenience-store:before {
content: "\e87d";
}
.mdi-maps-local-drink:before {
content: "\e87e";
}
.mdi-maps-local-florist:before {
content: "\e87f";
}
.mdi-maps-local-gas-station:before {
content: "\e880";
}
.mdi-maps-local-grocery-store:before {
content: "\e881";
}
.mdi-maps-local-hospital:before {
content: "\e882";
}
.mdi-maps-local-hotel:before {
content: "\e883";
}
.mdi-maps-local-laundry-service:before {
content: "\e884";
}
.mdi-maps-local-library:before {
content: "\e885";
}
.mdi-maps-local-mall:before {
content: "\e886";
}
.mdi-maps-local-movies:before {
content: "\e887";
}
.mdi-maps-local-offer:before {
content: "\e888";
}
.mdi-maps-local-parking:before {
content: "\e889";
}
.mdi-maps-local-pharmacy:before {
content: "\e88a";
}
.mdi-maps-local-phone:before {
content: "\e88b";
}
.mdi-maps-local-pizza:before {
content: "\e88c";
}
.mdi-maps-local-play:before {
content: "\e88d";
}
.mdi-maps-local-post-office:before {
content: "\e88e";
}
.mdi-maps-local-print-shop:before {
content: "\e88f";
}
.mdi-maps-local-restaurant:before {
content: "\e890";
}
.mdi-maps-local-see:before {
content: "\e891";
}
.mdi-maps-local-shipping:before {
content: "\e892";
}
.mdi-maps-local-taxi:before {
content: "\e893";
}
.mdi-maps-location-history:before {
content: "\e894";
}
.mdi-maps-map:before {
content: "\e895";
}
.mdi-maps-my-location:before {
content: "\e896";
}
.mdi-maps-navigation:before {
content: "\e897";
}
.mdi-maps-pin-drop:before {
content: "\e898";
}
.mdi-maps-place:before {
content: "\e899";
}
.mdi-maps-rate-review:before {
content: "\e89a";
}
.mdi-maps-restaurant-menu:before {
content: "\e89b";
}
.mdi-maps-satellite:before {
content: "\e89c";
}
.mdi-maps-store-mall-directory:before {
content: "\e89d";
}
.mdi-maps-terrain:before {
content: "\e89e";
}
.mdi-maps-traffic:before {
content: "\e89f";
}
.mdi-navigation-apps:before {
content: "\e8a0";
}
.mdi-navigation-arrow-back:before {
content: "\e8a1";
}
.mdi-navigation-arrow-drop-down-circle:before {
content: "\e8a2";
}
.mdi-navigation-arrow-drop-down:before {
content: "\e8a3";
}
.mdi-navigation-arrow-drop-up:before {
content: "\e8a4";
}
.mdi-navigation-arrow-forward:before {
content: "\e8a5";
}
.mdi-navigation-cancel:before {
content: "\e8a6";
}
.mdi-navigation-check:before {
content: "\e8a7";
}
.mdi-navigation-chevron-left:before {
content: "\e8a8";
}
.mdi-navigation-chevron-right:before {
content: "\e8a9";
}
.mdi-navigation-close:before {
content: "\e8aa";
}
.mdi-navigation-expand-less:before {
content: "\e8ab";
}
.mdi-navigation-expand-more:before {
content: "\e8ac";
}
.mdi-navigation-fullscreen-exit:before {
content: "\e8ad";
}
.mdi-navigation-fullscreen:before {
content: "\e8ae";
}
.mdi-navigation-menu:before {
content: "\e8af";
}
.mdi-navigation-more-horiz:before {
content: "\e8b0";
}
.mdi-navigation-more-vert:before {
content: "\e8b1";
}
.mdi-navigation-refresh:before {
content: "\e8b2";
}
.mdi-navigation-unfold-less:before {
content: "\e8b3";
}
.mdi-navigation-unfold-more:before {
content: "\e8b4";
}
.mdi-notification-adb:before {
content: "\e8b5";
}
.mdi-notification-bluetooth-audio:before {
content: "\e8b6";
}
.mdi-notification-disc-full:before {
content: "\e8b7";
}
.mdi-notification-dnd-forwardslash:before {
content: "\e8b8";
}
.mdi-notification-do-not-disturb:before {
content: "\e8b9";
}
.mdi-notification-drive-eta:before {
content: "\e8ba";
}
.mdi-notification-event-available:before {
content: "\e8bb";
}
.mdi-notification-event-busy:before {
content: "\e8bc";
}
.mdi-notification-event-note:before {
content: "\e8bd";
}
.mdi-notification-folder-special:before {
content: "\e8be";
}
.mdi-notification-mms:before {
content: "\e8bf";
}
.mdi-notification-more:before {
content: "\e8c0";
}
.mdi-notification-network-locked:before {
content: "\e8c1";
}
.mdi-notification-phone-bluetooth-speaker:before {
content: "\e8c2";
}
.mdi-notification-phone-forwarded:before {
content: "\e8c3";
}
.mdi-notification-phone-in-talk:before {
content: "\e8c4";
}
.mdi-notification-phone-locked:before {
content: "\e8c5";
}
.mdi-notification-phone-missed:before {
content: "\e8c6";
}
.mdi-notification-phone-paused:before {
content: "\e8c7";
}
.mdi-notification-play-download:before {
content: "\e8c8";
}
.mdi-notification-play-install:before {
content: "\e8c9";
}
.mdi-notification-sd-card:before {
content: "\e8ca";
}
.mdi-notification-sim-card-alert:before {
content: "\e8cb";
}
.mdi-notification-sms-failed:before {
content: "\e8cc";
}
.mdi-notification-sms:before {
content: "\e8cd";
}
.mdi-notification-sync-disabled:before {
content: "\e8ce";
}
.mdi-notification-sync-problem:before {
content: "\e8cf";
}
.mdi-notification-sync:before {
content: "\e8d0";
}
.mdi-notification-system-update:before {
content: "\e8d1";
}
.mdi-notification-tap-and-play:before {
content: "\e8d2";
}
.mdi-notification-time-to-leave:before {
content: "\e8d3";
}
.mdi-notification-vibration:before {
content: "\e8d4";
}
.mdi-notification-voice-chat:before {
content: "\e8d5";
}
.mdi-notification-vpn-lock:before {
content: "\e8d6";
}
.mdi-social-cake:before {
content: "\e8d7";
}
.mdi-social-domain:before {
content: "\e8d8";
}
.mdi-social-group-add:before {
content: "\e8d9";
}
.mdi-social-group:before {
content: "\e8da";
}
.mdi-social-location-city:before {
content: "\e8db";
}
.mdi-social-mood:before {
content: "\e8dc";
}
.mdi-social-notifications-none:before {
content: "\e8dd";
}
.mdi-social-notifications-off:before {
content: "\e8de";
}
.mdi-social-notifications-on:before {
content: "\e8df";
}
.mdi-social-notifications-paused:before {
content: "\e8e0";
}
.mdi-social-notifications:before {
content: "\e8e1";
}
.mdi-social-pages:before {
content: "\e8e2";
}
.mdi-social-party-mode:before {
content: "\e8e3";
}
.mdi-social-people-outline:before {
content: "\e8e4";
}
.mdi-social-people:before {
content: "\e8e5";
}
.mdi-social-person-add:before {
content: "\e8e6";
}
.mdi-social-person-outline:before {
content: "\e8e7";
}
.mdi-social-person:before {
content: "\e8e8";
}
.mdi-social-plus-one:before {
content: "\e8e9";
}
.mdi-social-poll:before {
content: "\e8ea";
}
.mdi-social-public:before {
content: "\e8eb";
}
.mdi-social-school:before {
content: "\e8ec";
}
.mdi-social-share:before {
content: "\e8ed";
}
.mdi-social-whatshot:before {
content: "\e8ee";
}
.mdi-toggle-check-box-outline-blank:before {
content: "\e8ef";
}
.mdi-toggle-check-box:before {
content: "\e8f0";
}
.mdi-toggle-radio-button-off:before {
content: "\e8f1";
}
.mdi-toggle-radio-button-on:before {
content: "\e8f2";
}
.mdi-toggle-star-half:before {
content: "\e8f3";
}
.mdi-toggle-star-outline:before {
content: "\e8f4";
}
.mdi-toggle-star:before {
content: "\e8f5";
}
.container {
margin: 0 auto;
max-width: 1280px;
width: 90%;
}
@media only screen and (min-width: 601px) {
.container {
width: 85%;
}
}
@media only screen and (min-width: 993px) {
.container {
width: 70%;
}
}
.container .row {
margin-left: -0.75rem;
margin-right: -0.75rem;
}
.section {
padding-top: 1rem;
padding-bottom: 1rem;
}
.section.no-pad {
padding: 0;
}
.section.no-pad-bot {
padding-bottom: 0;
}
.section.no-pad-top {
padding-top: 0;
}
.row {
margin-left: auto;
margin-right: auto;
margin-bottom: 20px;
}
.row:after {
content: "";
display: table;
clear: both;
}
.row .col {
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0 0.75rem;
}
.row .col.s1 {
width: 8.33333%;
margin-left: 0;
}
.row .col.s2 {
width: 16.66667%;
margin-left: 0;
}
.row .col.s3 {
width: 25%;
margin-left: 0;
}
.row .col.s4 {
width: 33.33333%;
margin-left: 0;
}
.row .col.s5 {
width: 41.66667%;
margin-left: 0;
}
.row .col.s6 {
width: 50%;
margin-left: 0;
}
.row .col.s7 {
width: 58.33333%;
margin-left: 0;
}
.row .col.s8 {
width: 66.66667%;
margin-left: 0;
}
.row .col.s9 {
width: 75%;
margin-left: 0;
}
.row .col.s10 {
width: 83.33333%;
margin-left: 0;
}
.row .col.s11 {
width: 91.66667%;
margin-left: 0;
}
.row .col.s12 {
width: 100%;
margin-left: 0;
}
.row .col.offset-s1 {
margin-left: 8.33333%;
}
.row .col.offset-s2 {
margin-left: 16.66667%;
}
.row .col.offset-s3 {
margin-left: 25%;
}
.row .col.offset-s4 {
margin-left: 33.33333%;
}
.row .col.offset-s5 {
margin-left: 41.66667%;
}
.row .col.offset-s6 {
margin-left: 50%;
}
.row .col.offset-s7 {
margin-left: 58.33333%;
}
.row .col.offset-s8 {
margin-left: 66.66667%;
}
.row .col.offset-s9 {
margin-left: 75%;
}
.row .col.offset-s10 {
margin-left: 83.33333%;
}
.row .col.offset-s11 {
margin-left: 91.66667%;
}
.row .col.offset-s12 {
margin-left: 100%;
}
@media only screen and (min-width: 601px) {
.row .col.m1 {
width: 8.33333%;
margin-left: 0;
}
.row .col.m2 {
width: 16.66667%;
margin-left: 0;
}
.row .col.m3 {
width: 25%;
margin-left: 0;
}
.row .col.m4 {
width: 33.33333%;
margin-left: 0;
}
.row .col.m5 {
width: 41.66667%;
margin-left: 0;
}
.row .col.m6 {
width: 50%;
margin-left: 0;
}
.row .col.m7 {
width: 58.33333%;
margin-left: 0;
}
.row .col.m8 {
width: 66.66667%;
margin-left: 0;
}
.row .col.m9 {
width: 75%;
margin-left: 0;
}
.row .col.m10 {
width: 83.33333%;
margin-left: 0;
}
.row .col.m11 {
width: 91.66667%;
margin-left: 0;
}
.row .col.m12 {
width: 100%;
margin-left: 0;
}
.row .col.offset-m1 {
margin-left: 8.33333%;
}
.row .col.offset-m2 {
margin-left: 16.66667%;
}
.row .col.offset-m3 {
margin-left: 25%;
}
.row .col.offset-m4 {
margin-left: 33.33333%;
}
.row .col.offset-m5 {
margin-left: 41.66667%;
}
.row .col.offset-m6 {
margin-left: 50%;
}
.row .col.offset-m7 {
margin-left: 58.33333%;
}
.row .col.offset-m8 {
margin-left: 66.66667%;
}
.row .col.offset-m9 {
margin-left: 75%;
}
.row .col.offset-m10 {
margin-left: 83.33333%;
}
.row .col.offset-m11 {
margin-left: 91.66667%;
}
.row .col.offset-m12 {
margin-left: 100%;
}
}
@media only screen and (min-width: 993px) {
.row .col.l1 {
width: 8.33333%;
margin-left: 0;
}
.row .col.l2 {
width: 16.66667%;
margin-left: 0;
}
.row .col.l3 {
width: 25%;
margin-left: 0;
}
.row .col.l4 {
width: 33.33333%;
margin-left: 0;
}
.row .col.l5 {
width: 41.66667%;
margin-left: 0;
}
.row .col.l6 {
width: 50%;
margin-left: 0;
}
.row .col.l7 {
width: 58.33333%;
margin-left: 0;
}
.row .col.l8 {
width: 66.66667%;
margin-left: 0;
}
.row .col.l9 {
width: 75%;
margin-left: 0;
}
.row .col.l10 {
width: 83.33333%;
margin-left: 0;
}
.row .col.l11 {
width: 91.66667%;
margin-left: 0;
}
.row .col.l12 {
width: 100%;
margin-left: 0;
}
.row .col.offset-l1 {
margin-left: 8.33333%;
}
.row .col.offset-l2 {
margin-left: 16.66667%;
}
.row .col.offset-l3 {
margin-left: 25%;
}
.row .col.offset-l4 {
margin-left: 33.33333%;
}
.row .col.offset-l5 {
margin-left: 41.66667%;
}
.row .col.offset-l6 {
margin-left: 50%;
}
.row .col.offset-l7 {
margin-left: 58.33333%;
}
.row .col.offset-l8 {
margin-left: 66.66667%;
}
.row .col.offset-l9 {
margin-left: 75%;
}
.row .col.offset-l10 {
margin-left: 83.33333%;
}
.row .col.offset-l11 {
margin-left: 91.66667%;
}
.row .col.offset-l12 {
margin-left: 100%;
}
}
nav {
color: #fff;
background-color: #004785;
width: 100%;
height: 56px;
line-height: 56px;
}
nav a {
color: #fff;
}
nav .nav-wrapper {
position: relative;
height: 100%;
}
nav .nav-wrapper i {
display: block;
font-size: 2rem;
}
@media only screen and (min-width: 993px) {
nav a.button-collapse {
display: none;
}
}
nav .button-collapse {
float: left;
position: relative;
z-index: 1;
height: 56px;
}
nav .button-collapse i {
font-size: 2.7rem;
height: 56px;
line-height: 56px;
}
nav .brand-logo {
position: absolute;
color: #fff;
display: inline-block;
font-size: 2.1rem;
padding: 0;
white-space: nowrap;
}
nav .brand-logo.center {
left: 50%;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
-o-transform: translateX(-50%);
transform: translateX(-50%);
}
@media only screen and (max-width: 992px) {
nav .brand-logo {
left: 50%;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
-o-transform: translateX(-50%);
transform: translateX(-50%);
}
}
nav .brand-logo.right {
right: 0.5rem;
padding: 0;
}
nav ul {
margin: 0;
}
nav ul li {
-webkit-transition: background-color 0.3s;
-moz-transition: background-color 0.3s;
-o-transition: background-color 0.3s;
-ms-transition: background-color 0.3s;
transition: background-color 0.3s;
float: left;
padding: 0;
}
nav ul li:hover, nav ul li.active {
background-color: rgba(0, 0, 0, 0.1);
}
nav ul a {
font-size: 1rem;
color: #fff;
display: block;
padding: 0 15px;
}
nav ul.left {
float: left;
}
nav .input-field {
margin: 0;
}
nav .input-field input {
height: 100%;
font-size: 1.2rem;
border: none;
padding-left: 2rem;
}
nav .input-field input:focus, nav .input-field input[type=text]:valid, nav .input-field input[type=password]:valid, nav .input-field input[type=email]:valid, nav .input-field input[type=url]:valid, nav .input-field input[type=date]:valid {
border: none;
box-shadow: none;
}
nav .input-field label {
top: 0;
left: 0;
}
nav .input-field label i {
color: rgba(255, 255, 255, 0.7);
-webkit-transition: color 0.3s;
-moz-transition: color 0.3s;
-o-transition: color 0.3s;
-ms-transition: color 0.3s;
transition: color 0.3s;
}
nav .input-field label.active i {
color: #fff;
}
nav .input-field label.active {
-webkit-transform: translateY(0);
-moz-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0);
transform: translateY(0);
}
.navbar-fixed {
position: relative;
height: 56px;
z-index: 998;
}
.navbar-fixed nav {
position: fixed;
}
@media only screen and (min-width: 601px) {
nav, nav .nav-wrapper i, nav a.button-collapse, nav a.button-collapse i {
height: 64px;
line-height: 64px;
}
.navbar-fixed {
height: 64px;
}
}
@font-face {
font-family: "Roboto";
src: url("../font/roboto/Roboto-Thin.woff2") format("woff2"), url("../font/roboto/Roboto-Thin.woff") format("woff"), url("../font/roboto/Roboto-Thin.ttf") format("truetype");
font-weight: 200;
}
@font-face {
font-family: "Roboto";
src: url("../font/roboto/Roboto-Light.woff2") format("woff2"), url("../font/roboto/Roboto-Light.woff") format("woff"), url("../font/roboto/Roboto-Light.ttf") format("truetype");
font-weight: 300;
}
@font-face {
font-family: "Roboto";
src: url("../font/roboto/Roboto-Regular.woff2") format("woff2"), url("../font/roboto/Roboto-Regular.woff") format("woff"), url("../font/roboto/Roboto-Regular.ttf") format("truetype");
font-weight: 400;
}
@font-face {
font-family: "Roboto";
src: url("../font/roboto/Roboto-Medium.woff2") format("woff2"), url("../font/roboto/Roboto-Medium.woff") format("woff"), url("../font/roboto/Roboto-Medium.ttf") format("truetype");
font-weight: 500;
}
@font-face {
font-family: "Roboto";
src: url("../font/roboto/Roboto-Bold.woff2") format("woff2"), url("../font/roboto/Roboto-Bold.woff") format("woff"), url("../font/roboto/Roboto-Bold.ttf") format("truetype");
font-weight: 700;
}
a {
text-decoration: none;
}
html {
line-height: 1.5;
font-family: "Roboto", sans-serif;
font-weight: normal;
color: rgba(0, 0, 0, 0.7);
}
@media only screen and (min-width: 0) {
html {
font-size: 14px;
}
}
@media only screen and (min-width: 992px) {
html {
font-size: 14.5px;
}
}
@media only screen and (min-width: 1200px) {
html {
font-size: 15px;
}
}
h1, h2, h3, h4, h5, h6 {
font-weight: 400;
line-height: 1.1;
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
font-weight: inherit;
}
h1 {
font-size: 4.2rem;
line-height: 110%;
margin: 2.1rem 0 1.68rem 0;
}
h2 {
font-size: 3.56rem;
line-height: 110%;
margin: 1.78rem 0 1.424rem 0;
}
h3 {
font-size: 2.92rem;
line-height: 110%;
margin: 1.46rem 0 1.168rem 0;
}
h4 {
font-size: 2.28rem;
line-height: 110%;
margin: 1.14rem 0 0.912rem 0;
}
h5 {
font-size: 1.64rem;
line-height: 110%;
margin: 0.82rem 0 0.656rem 0;
}
h6 {
font-size: 1rem;
line-height: 110%;
margin: 0.5rem 0 0.4rem 0;
}
em {
font-style: italic;
}
strong {
font-weight: 500;
}
small {
font-size: 75%;
}
.light, footer.page-footer .footer-copyright {
font-weight: 300;
}
.thin {
font-weight: 200;
}
.flow-text {
font-weight: 300;
}
@media only screen and (min-width: 360px) {
.flow-text {
font-size: 1.2rem;
}
}
@media only screen and (min-width: 390px) {
.flow-text {
font-size: 1.224rem;
}
}
@media only screen and (min-width: 420px) {
.flow-text {
font-size: 1.248rem;
}
}
@media only screen and (min-width: 450px) {
.flow-text {
font-size: 1.272rem;
}
}
@media only screen and (min-width: 480px) {
.flow-text {
font-size: 1.296rem;
}
}
@media only screen and (min-width: 510px) {
.flow-text {
font-size: 1.32rem;
}
}
@media only screen and (min-width: 540px) {
.flow-text {
font-size: 1.344rem;
}
}
@media only screen and (min-width: 570px) {
.flow-text {
font-size: 1.368rem;
}
}
@media only screen and (min-width: 600px) {
.flow-text {
font-size: 1.392rem;
}
}
@media only screen and (min-width: 630px) {
.flow-text {
font-size: 1.416rem;
}
}
@media only screen and (min-width: 660px) {
.flow-text {
font-size: 1.44rem;
}
}
@media only screen and (min-width: 690px) {
.flow-text {
font-size: 1.464rem;
}
}
@media only screen and (min-width: 720px) {
.flow-text {
font-size: 1.488rem;
}
}
@media only screen and (min-width: 750px) {
.flow-text {
font-size: 1.512rem;
}
}
@media only screen and (min-width: 780px) {
.flow-text {
font-size: 1.536rem;
}
}
@media only screen and (min-width: 810px) {
.flow-text {
font-size: 1.56rem;
}
}
@media only screen and (min-width: 840px) {
.flow-text {
font-size: 1.584rem;
}
}
@media only screen and (min-width: 870px) {
.flow-text {
font-size: 1.608rem;
}
}
@media only screen and (min-width: 900px) {
.flow-text {
font-size: 1.632rem;
}
}
@media only screen and (min-width: 930px) {
.flow-text {
font-size: 1.656rem;
}
}
@media only screen and (min-width: 960px) {
.flow-text {
font-size: 1.68rem;
}
}
@media only screen and (max-width: 360px) {
.flow-text {
font-size: 1.2rem;
}
}
.card-panel {
transition: box-shadow .25s;
padding: 20px;
margin: 0.5rem 0 1rem 0;
border-radius: 2px;
background-color: #fff;
}
.card {
position: relative;
overflow: hidden;
margin: 0.5rem 0 1rem 0;
background-color: #fff;
transition: box-shadow .25s;
border-radius: 2px;
}
.card .card-title {
color: #fff;
font-size: 24px;
font-weight: 300;
}
.card .card-title.activator {
cursor: pointer;
}
.card.small, .card.medium, .card.large {
position: relative;
}
.card.small .card-image, .card.medium .card-image, .card.large .card-image {
overflow: hidden;
}
.card.small .card-content, .card.medium .card-content, .card.large .card-content {
overflow: hidden;
}
.card.small .card-action, .card.medium .card-action, .card.large .card-action {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
.card.small {
height: 300px;
}
.card.small .card-image {
height: 150px;
}
.card.small .card-content {
height: 150px;
}
.card.medium {
height: 400px;
}
.card.medium .card-image {
height: 250px;
}
.card.medium .card-content {
height: 150px;
}
.card.large {
height: 500px;
}
.card.large .card-image {
height: 330px;
}
.card.large .card-content {
height: 170px;
}
.card .card-image {
position: relative;
}
.card .card-image img {
border-radius: 2px 2px 0 0;
position: relative;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100%;
}
.card .card-image .card-title {
position: absolute;
bottom: 0;
left: 0;
padding: 20px;
}
.card .card-content {
padding: 20px;
border-radius: 0 0 2px 2px;
}
.card .card-content p {
margin: 0;
color: inherit;
}
.card .card-content .card-title {
line-height: 48px;
}
.card .card-action {
border-top: 1px solid rgba(160, 160, 160, 0.2);
padding: 20px;
}
.card .card-action a {
color: #ffab40;
margin-right: 20px;
-webkit-transition: color 0.3s ease;
-moz-transition: color 0.3s ease;
-o-transition: color 0.3s ease;
-ms-transition: color 0.3s ease;
transition: color 0.3s ease;
text-transform: uppercase;
}
.card .card-action a:hover {
color: #ffd8a6;
}
.card .card-reveal {
padding: 20px;
position: absolute;
background-color: #fff;
width: 100%;
overflow-y: auto;
top: 100%;
height: 100%;
z-index: 1;
display: none;
}
.card .card-reveal .card-title {
cursor: pointer;
display: block;
}
#toast-container {
display: block;
position: fixed;
z-index: 1001;
}
@media only screen and (max-width: 600px) {
#toast-container {
min-width: 100%;
bottom: 0%;
}
}
@media only screen and (min-width: 601px) and (max-width: 992px) {
#toast-container {
min-width: 30%;
left: 5%;
bottom: 7%;
}
}
@media only screen and (min-width: 993px) {
#toast-container {
min-width: 8%;
top: 10%;
right: 7%;
}
}
.toast {
border-radius: 2px;
top: 0;
width: auto;
clear: both;
margin-top: 10px;
position: relative;
max-width: 100%;
height: 48px;
line-height: 48px;
background-color: #323232;
padding: 0 25px;
font-size: 1.1rem;
font-weight: 300;
color: #fff;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.toast .btn, .toast .btn-large, .toast .btn-flat {
margin: 0;
margin-left: 3rem;
}
.toast.rounded {
border-radius: 24px;
}
@media only screen and (max-width: 600px) {
.toast {
width: 100%;
border-radius: 0;
}
}
@media only screen and (min-width: 601px) and (max-width: 992px) {
.toast {
float: left;
}
}
@media only screen and (min-width: 993px) {
.toast {
float: right;
}
}
.tabs {
position: relative;
height: 48px;
background-color: #fff;
margin: 0 auto;
width: 100%;
white-space: nowrap;
}
.tabs .tab {
display: block;
float: left;
text-align: center;
line-height: 48px;
height: 48px;
padding: 0 20px;
margin: 0;
text-transform: uppercase;
letter-spacing: .8px;
width: 15%;
}
.tabs .tab a {
color: #004785;
display: block;
width: 100%;
height: 100%;
-webkit-transition: color 0.28s ease;
-moz-transition: color 0.28s ease;
-o-transition: color 0.28s ease;
-ms-transition: color 0.28s ease;
transition: color 0.28s ease;
}
.tabs .tab a:hover {
color: #007deb;
}
.tabs .tab.disabled a {
color: #007deb;
cursor: default;
}
.tabs .indicator {
position: absolute;
bottom: 0;
height: 2px;
background-color: #0070d2;
will-change: left, right;
}
.tabs .tab {
padding: 0;
}
.material-tooltip {
padding: 10px 8px;
font-size: 1rem;
z-index: 2000;
background-color: transparent;
border-radius: 2px;
color: #fff;
min-height: 36px;
line-height: 1rem;
opacity: 0;
display: none;
position: absolute;
text-align: center;
overflow: hidden;
left: 0;
top: 0;
will-change: top, left;
}
.backdrop {
position: absolute;
opacity: 0;
display: none;
height: 7px;
width: 14px;
border-radius: 0 0 14px 14px;
background-color: #323232;
z-index: -1;
-webkit-transform-origin: 50% 10%;
-moz-transform-origin: 50% 10%;
-ms-transform-origin: 50% 10%;
-o-transform-origin: 50% 10%;
transform-origin: 50% 10%;
will-change: transform, opacity;
}
.btn, .btn-large, .btn-flat {
border: none;
border-radius: 2px;
display: inline-block;
height: 36px;
line-height: 36px;
margin-bottom: 15px;
outline: 0;
padding: 0 2rem;
text-transform: uppercase;
vertical-align: middle;
-webkit-tap-highlight-color: transparent;
}
.btn.disabled, .disabled.btn-large, .btn-floating.disabled, .btn-large.disabled, .btn:disabled, .btn-large:disabled, .btn-large:disabled, .btn-floating:disabled {
background-color: #DFDFDF !important;
box-shadow: none;
color: #9F9F9F !important;
cursor: default;
}
.btn.disabled *, .disabled.btn-large *, .btn-floating.disabled *, .btn-large.disabled *, .btn:disabled *, .btn-large:disabled *, .btn-large:disabled *, .btn-floating:disabled * {
pointer-events: none;
}
.btn.disabled:hover, .disabled.btn-large:hover, .btn-floating.disabled:hover, .btn-large.disabled:hover, .btn:disabled:hover, .btn-large:disabled:hover, .btn-large:disabled:hover, .btn-floating:disabled:hover {
background-color: #DFDFDF;
color: #9F9F9F;
}
.btn i, .btn-large i, .btn-floating i, .btn-large i, .btn-flat i {
font-size: 1.3rem;
line-height: inherit;
}
.btn, .btn-large {
text-decoration: none;
color: #fff;
background-color: #26a69a;
text-align: center;
letter-spacing: .5px;
-webkit-transition: 0.2s ease-out;
-moz-transition: 0.2s ease-out;
-o-transition: 0.2s ease-out;
-ms-transition: 0.2s ease-out;
transition: 0.2s ease-out;
cursor: pointer;
}
.btn:hover, .btn-large:hover {
background-color: #2bbbad;
}
.btn-floating {
display: inline-block;
color: #fff;
position: relative;
overflow: hidden;
z-index: 1;
width: 37px;
height: 37px;
line-height: 37px;
padding: 0;
background-color: #26a69a;
border-radius: 50%;
transition: .3s;
cursor: pointer;
vertical-align: middle;
}
.btn-floating i {
width: inherit;
display: inline-block;
text-align: center;
color: #fff;
font-size: 1.6rem;
line-height: 37px;
}
.btn-floating:before {
border-radius: 0;
}
.btn-floating.btn-large {
width: 55.5px;
height: 55.5px;
}
.btn-floating.btn-large i {
line-height: 55.5px;
}
button.btn-floating {
border: none;
}
.fixed-action-btn {
position: fixed;
right: 23px;
bottom: 23px;
padding-top: 15px;
margin-bottom: 0;
z-index: 998;
}
.fixed-action-btn ul {
left: 0;
right: 0;
text-align: center;
position: absolute;
bottom: 64px;
margin: 0;
}
.fixed-action-btn ul li {
margin-bottom: 15px;
}
.fixed-action-btn ul a.btn-floating {
opacity: 0;
}
.btn-flat {
box-shadow: none;
background-color: transparent;
color: #343434;
cursor: pointer;
}
.btn-flat.disabled {
color: #b3b3b3;
cursor: default;
}
.btn-large {
height: 54px;
line-height: 56px;
}
.btn-large i {
font-size: 1.6rem;
}
.btn-block {
display: block;
}
.dropdown-content {
background-color: #fff;
margin: 0;
display: none;
min-width: 100px;
max-height: 650px;
overflow-y: auto;
opacity: 0;
position: absolute;
z-index: 999;
will-change: width, height;
}
.dropdown-content li {
clear: both;
color: rgba(0, 0, 0, 0.7);
cursor: pointer;
line-height: 1.5rem;
width: 100%;
text-align: left;
text-transform: none;
}
.dropdown-content li:hover, .dropdown-content li.active {
background-color: #eee;
}
.dropdown-content li > a, .dropdown-content li > span {
font-size: 1.2rem;
color: #26a69a;
display: block;
padding: 1rem 1rem;
}
.dropdown-content li > a > i {
height: inherit;
line-height: inherit;
}
/*!
* Waves v0.6.0
* http://fian.my.id/Waves
*
* Copyright 2014 Alfiana E. Sibuea and other contributors
* Released under the MIT license
* https://github.com/fians/Waves/blob/master/LICENSE
*/
.waves-effect {
position: relative;
cursor: pointer;
display: inline-block;
overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
vertical-align: middle;
z-index: 1;
will-change: opacity, transform;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.waves-effect .waves-ripple {
position: absolute;
border-radius: 50%;
width: 20px;
height: 20px;
margin-top: -10px;
margin-left: -10px;
opacity: 0;
background: rgba(0, 0, 0, 0.2);
-webkit-transition: all 0.7s ease-out;
-moz-transition: all 0.7s ease-out;
-o-transition: all 0.7s ease-out;
-ms-transition: all 0.7s ease-out;
transition: all 0.7s ease-out;
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform, opacity;
-o-transition-property: -o-transform, opacity;
transition-property: transform, opacity;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0);
pointer-events: none;
}
.waves-effect.waves-light .waves-ripple {
background-color: rgba(255, 255, 255, 0.45);
}
.waves-effect.waves-red .waves-ripple {
background-color: rgba(244, 67, 54, 0.7);
}
.waves-effect.waves-yellow .waves-ripple {
background-color: rgba(255, 235, 59, 0.7);
}
.waves-effect.waves-orange .waves-ripple {
background-color: rgba(255, 152, 0, 0.7);
}
.waves-effect.waves-purple .waves-ripple {
background-color: rgba(156, 39, 176, 0.7);
}
.waves-effect.waves-green .waves-ripple {
background-color: rgba(76, 175, 80, 0.7);
}
.waves-effect.waves-teal .waves-ripple {
background-color: rgba(0, 150, 136, 0.7);
}
.waves-notransition {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}
.waves-circle {
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
-webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%);
}
.waves-input-wrapper {
border-radius: 0.2em;
vertical-align: bottom;
}
.waves-input-wrapper .waves-button-input {
position: relative;
top: 0;
left: 0;
z-index: 1;
}
.waves-circle {
text-align: center;
width: 2.5em;
height: 2.5em;
line-height: 2.5em;
border-radius: 50%;
-webkit-mask-image: none;
}
.waves-block {
display: block;
}
/* Firefox Bug: link not triggered */
a.waves-effect .waves-ripple {
z-index: -1;
}
.modal {
display: none;
position: fixed;
left: 0;
right: 0;
background-color: #fafafa;
padding: 0;
max-height: 70%;
width: 55%;
margin: auto;
overflow-y: auto;
border-radius: 2px;
will-change: top, opacity;
}
@media only screen and (max-width: 992px) {
.modal {
width: 80%;
}
}
.modal h1, .modal h2, .modal h3, .modal h4 {
margin-top: 0;
}
.modal .modal-content {
padding: 24px;
}
.modal .modal-close {
cursor: pointer;
}
.modal .modal-footer {
border-radius: 0 0 2px 2px;
background-color: #fafafa;
padding: 4px 6px;
height: 56px;
width: 100%;
}
.modal .modal-footer .btn, .modal .modal-footer .btn-large, .modal .modal-footer .btn-flat {
float: right;
margin: 6px 0;
}
.lean-overlay {
position: fixed;
z-index: 999;
top: -100px;
left: 0;
bottom: 0;
right: 0;
height: 125%;
width: 100%;
background: #000;
display: none;
will-change: opacity;
}
.modal.modal-fixed-footer {
padding: 0;
height: 70%;
}
.modal.modal-fixed-footer .modal-content {
position: absolute;
height: calc(100% - 56px);
max-height: 100%;
width: 100%;
overflow-y: auto;
}
.modal.modal-fixed-footer .modal-footer {
border-top: 1px solid rgba(0, 0, 0, 0.1);
position: absolute;
bottom: 0;
}
.modal.bottom-sheet {
top: auto;
bottom: -100%;
margin: 0;
width: 100%;
max-height: 45%;
border-radius: 0;
will-change: bottom, opacity;
}
.collapsible {
border-top: 1px solid #ddd;
border-right: 1px solid #ddd;
border-left: 1px solid #ddd;
margin: 0.5rem 0 1rem 0;
}
.collapsible-header {
display: block;
cursor: pointer;
height: 3rem;
line-height: 3rem;
padding: 0 1rem;
background-color: #fff;
border-bottom: 1px solid #ddd;
}
.collapsible-header i {
width: 2rem;
font-size: 1.6rem;
line-height: 3rem;
display: block;
float: left;
text-align: center;
margin-right: 1rem;
}
.collapsible-body {
display: none;
border-bottom: 1px solid #ddd;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.collapsible-body p {
margin: 0;
padding: 2rem;
}
.side-nav .collapsible {
border: none;
box-shadow: none;
}
.side-nav .collapsible li {
padding: 0;
}
.side-nav .collapsible-header {
background-color: transparent;
border: none;
line-height: inherit;
height: inherit;
margin: 0 1rem;
}
.side-nav .collapsible-header i {
line-height: inherit;
}
.side-nav .collapsible-body {
border: 0;
background-color: #fff;
}
.side-nav .collapsible-body li a {
margin: 0 1rem 0 2rem;
}
.collapsible.popout {
border: none;
box-shadow: none;
}
.collapsible.popout > li {
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
margin: 0 24px;
transition: margin 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.collapsible.popout > li.active {
box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
margin: 16px 0;
}
.materialboxed {
cursor: zoom-in;
position: relative;
-webkit-transition: opacity 0.4s;
-moz-transition: opacity 0.4s;
-o-transition: opacity 0.4s;
-ms-transition: opacity 0.4s;
transition: opacity 0.4s;
}
.materialboxed:hover {
will-change: left, top, width, height;
}
.materialboxed:hover:not(.active) {
opacity: .8;
}
.materialboxed.active {
cursor: zoom-out;
}
#materialbox-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #292929;
z-index: 999;
will-change: opacity;
}
.materialbox-caption {
position: fixed;
display: none;
color: #fff;
line-height: 50px;
bottom: 0;
width: 100%;
text-align: center;
padding: 0% 15%;
height: 50px;
z-index: 1000;
-webkit-font-smoothing: antialiased;
}
/* Remove Focus Boxes */
select:focus {
outline: 1px solid #c9f3ef;
}
button:focus {
outline: none;
background-color: #2ab7a9;
}
label {
font-size: 0.8rem;
color: #757575;
}
/***************************
Text Inputs + Textarea
****************************/
::-webkit-input-placeholder {
color: #a8a8a8;
}
:-moz-placeholder {
/* Firefox 18- */
color: #a8a8a8;
}
::-moz-placeholder {
/* Firefox 19+ */
color: #a8a8a8;
}
:-ms-input-placeholder {
color: #a8a8a8;
}
input[type=text],
input[type=password],
input[type=email],
input[type=url],
input[type=time],
input[type=date],
input[type=datetime-local],
input[type=tel],
input[type=number],
input[type=search],
textarea.materialize-textarea {
background-color: transparent;
border: none;
border-bottom: 1px solid #757575;
border-radius: 0;
outline: none;
height: 3rem;
width: 100%;
color: #757575;
font-size: 1rem;
margin: 0 0 15px 0;
padding: 0;
box-shadow: none;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
transition: all .3s;
}
input[type=text]:disabled, input[type=text][readonly="readonly"],
input[type=password]:disabled,
input[type=password][readonly="readonly"],
input[type=email]:disabled,
input[type=email][readonly="readonly"],
input[type=url]:disabled,
input[type=url][readonly="readonly"],
input[type=time]:disabled,
input[type=time][readonly="readonly"],
input[type=date]:disabled,
input[type=date][readonly="readonly"],
input[type=datetime-local]:disabled,
input[type=datetime-local][readonly="readonly"],
input[type=tel]:disabled,
input[type=tel][readonly="readonly"],
input[type=number]:disabled,
input[type=number][readonly="readonly"],
input[type=search]:disabled,
input[type=search][readonly="readonly"],
textarea.materialize-textarea:disabled,
textarea.materialize-textarea[readonly="readonly"] {
color: rgba(0, 0, 0, 0.26);
border-bottom: 1px dotted rgba(0, 0, 0, 0.26);
}
input[type=text]:disabled + label, input[type=text][readonly="readonly"] + label,
input[type=password]:disabled + label,
input[type=password][readonly="readonly"] + label,
input[type=email]:disabled + label,
input[type=email][readonly="readonly"] + label,
input[type=url]:disabled + label,
input[type=url][readonly="readonly"] + label,
input[type=time]:disabled + label,
input[type=time][readonly="readonly"] + label,
input[type=date]:disabled + label,
input[type=date][readonly="readonly"] + label,
input[type=datetime-local]:disabled + label,
input[type=datetime-local][readonly="readonly"] + label,
input[type=tel]:disabled + label,
input[type=tel][readonly="readonly"] + label,
input[type=number]:disabled + label,
input[type=number][readonly="readonly"] + label,
input[type=search]:disabled + label,
input[type=search][readonly="readonly"] + label,
textarea.materialize-textarea:disabled + label,
textarea.materialize-textarea[readonly="readonly"] + label {
color: rgba(0, 0, 0, 0.26);
}
input[type=text]:focus:not([readonly]),
input[type=password]:focus:not([readonly]),
input[type=email]:focus:not([readonly]),
input[type=url]:focus:not([readonly]),
input[type=time]:focus:not([readonly]),
input[type=date]:focus:not([readonly]),
input[type=datetime-local]:focus:not([readonly]),
input[type=tel]:focus:not([readonly]),
input[type=number]:focus:not([readonly]),
input[type=search]:focus:not([readonly]),
textarea.materialize-textarea:focus:not([readonly]) {
border-bottom: 1px solid #26a69a;
box-shadow: 0 1px 0 0 #26a69a;
}
input[type=text]:focus:not([readonly]) + label,
input[type=password]:focus:not([readonly]) + label,
input[type=email]:focus:not([readonly]) + label,
input[type=url]:focus:not([readonly]) + label,
input[type=time]:focus:not([readonly]) + label,
input[type=date]:focus:not([readonly]) + label,
input[type=datetime-local]:focus:not([readonly]) + label,
input[type=tel]:focus:not([readonly]) + label,
input[type=number]:focus:not([readonly]) + label,
input[type=search]:focus:not([readonly]) + label,
textarea.materialize-textarea:focus:not([readonly]) + label {
color: #26a69a;
}
input[type=text].valid, input[type=text]:focus.valid,
input[type=password].valid,
input[type=password]:focus.valid,
input[type=email].valid,
input[type=email]:focus.valid,
input[type=url].valid,
input[type=url]:focus.valid,
input[type=time].valid,
input[type=time]:focus.valid,
input[type=date].valid,
input[type=date]:focus.valid,
input[type=datetime-local].valid,
input[type=datetime-local]:focus.valid,
input[type=tel].valid,
input[type=tel]:focus.valid,
input[type=number].valid,
input[type=number]:focus.valid,
input[type=search].valid,
input[type=search]:focus.valid,
textarea.materialize-textarea.valid,
textarea.materialize-textarea:focus.valid {
border-bottom: 1px solid #4CAF50;
box-shadow: 0 1px 0 0 #4CAF50;
}
input[type=text].valid + label:after, input[type=text]:focus.valid + label:after,
input[type=password].valid + label:after,
input[type=password]:focus.valid + label:after,
input[type=email].valid + label:after,
input[type=email]:focus.valid + label:after,
input[type=url].valid + label:after,
input[type=url]:focus.valid + label:after,
input[type=time].valid + label:after,
input[type=time]:focus.valid + label:after,
input[type=date].valid + label:after,
input[type=date]:focus.valid + label:after,
input[type=datetime-local].valid + label:after,
input[type=datetime-local]:focus.valid + label:after,
input[type=tel].valid + label:after,
input[type=tel]:focus.valid + label:after,
input[type=number].valid + label:after,
input[type=number]:focus.valid + label:after,
input[type=search].valid + label:after,
input[type=search]:focus.valid + label:after,
textarea.materialize-textarea.valid + label:after,
textarea.materialize-textarea:focus.valid + label:after {
content: attr(data-success);
color: #4CAF50;
opacity: 1;
}
input[type=text].invalid, input[type=text]:focus.invalid,
input[type=password].invalid,
input[type=password]:focus.invalid,
input[type=email].invalid,
input[type=email]:focus.invalid,
input[type=url].invalid,
input[type=url]:focus.invalid,
input[type=time].invalid,
input[type=time]:focus.invalid,
input[type=date].invalid,
input[type=date]:focus.invalid,
input[type=datetime-local].invalid,
input[type=datetime-local]:focus.invalid,
input[type=tel].invalid,
input[type=tel]:focus.invalid,
input[type=number].invalid,
input[type=number]:focus.invalid,
input[type=search].invalid,
input[type=search]:focus.invalid,
textarea.materialize-textarea.invalid,
textarea.materialize-textarea:focus.invalid {
border-bottom: 1px solid #F44336;
box-shadow: 0 1px 0 0 #F44336;
}
input[type=text].invalid + label:after, input[type=text]:focus.invalid + label:after,
input[type=password].invalid + label:after,
input[type=password]:focus.invalid + label:after,
input[type=email].invalid + label:after,
input[type=email]:focus.invalid + label:after,
input[type=url].invalid + label:after,
input[type=url]:focus.invalid + label:after,
input[type=time].invalid + label:after,
input[type=time]:focus.invalid + label:after,
input[type=date].invalid + label:after,
input[type=date]:focus.invalid + label:after,
input[type=datetime-local].invalid + label:after,
input[type=datetime-local]:focus.invalid + label:after,
input[type=tel].invalid + label:after,
input[type=tel]:focus.invalid + label:after,
input[type=number].invalid + label:after,
input[type=number]:focus.invalid + label:after,
input[type=search].invalid + label:after,
input[type=search]:focus.invalid + label:after,
textarea.materialize-textarea.invalid + label:after,
textarea.materialize-textarea:focus.invalid + label:after {
content: attr(data-error);
color: #F44336;
opacity: 1;
}
input[type=text] + label:after,
input[type=password] + label:after,
input[type=email] + label:after,
input[type=url] + label:after,
input[type=time] + label:after,
input[type=date] + label:after,
input[type=datetime-local] + label:after,
input[type=tel] + label:after,
input[type=number] + label:after,
input[type=search] + label:after,
textarea.materialize-textarea + label:after {
display: block;
content: "";
position: absolute;
top: 65px;
opacity: 0;
transition: .2s opacity ease-out, .2s color ease-out;
}
.input-field {
position: relative;
margin-top: 1rem;
}
.input-field label {
color: #757575;
position: absolute;
top: 0.8rem;
left: 0.75rem;
font-size: 1rem;
cursor: text;
-webkit-transition: 0.2s ease-out;
-moz-transition: 0.2s ease-out;
-o-transition: 0.2s ease-out;
-ms-transition: 0.2s ease-out;
transition: 0.2s ease-out;
}
.input-field label.active {
font-size: 0.8rem;
-webkit-transform: translateY(-140%);
-moz-transform: translateY(-140%);
-ms-transform: translateY(-140%);
-o-transform: translateY(-140%);
transform: translateY(-140%);
}
.input-field .prefix {
position: absolute;
width: 3rem;
font-size: 2rem;
-webkit-transition: color 0.2s;
-moz-transition: color 0.2s;
-o-transition: color 0.2s;
-ms-transition: color 0.2s;
transition: color 0.2s;
}
.input-field .prefix.active {
color: #26a69a;
}
.input-field .prefix ~ input,
.input-field .prefix ~ textarea {
margin-left: 3rem;
width: 92%;
width: calc(100% - 3rem);
}
.input-field .prefix ~ textarea {
padding-top: .8rem;
}
.input-field .prefix ~ label {
margin-left: 3rem;
}
@media only screen and (max-width: 992px) {
.input-field .prefix ~ input {
width: 86%;
width: calc(100% - 3rem);
}
}
@media only screen and (max-width: 600px) {
.input-field .prefix ~ input {
width: 80%;
width: calc(100% - 3rem);
}
}
.input-field input[type=search] {
display: block;
line-height: inherit;
padding-left: 4rem;
width: calc(100% - 4rem);
}
.input-field input[type=search]:focus {
background-color: #fff;
border: 0;
box-shadow: none;
color: #444;
}
.input-field input[type=search]:focus + label i, .input-field input[type=search]:focus ~ .mdi-navigation-close {
color: #444;
}
.input-field input[type=search] + label {
left: 1rem;
}
.input-field input[type=search] ~ .mdi-navigation-close {
position: absolute;
top: 0;
right: 1rem;
color: transparent;
cursor: pointer;
font-size: 2rem;
transition: .3s color;
}
textarea {
width: 100%;
height: 3rem;
background-color: transparent;
}
textarea.materialize-textarea {
overflow-y: hidden;
/* prevents scroll bar flash */
padding: 1.6rem 0;
/* prevents text jump on Enter keypress */
resize: none;
min-height: 3rem;
}
.hiddendiv {
display: none;
white-space: pre-wrap;
word-wrap: break-word;
overflow-wrap: break-word;
/* future version of deprecated 'word-wrap' */
padding-top: 1.2rem;
/* prevents text jump on Enter keypress */
}
/***************
Radio Buttons
***************/
/* Remove default Radio Buttons */
[type="radio"]:not(:checked),
[type="radio"]:checked {
position: absolute;
left: -9999px;
visibility: hidden;
}
[type="radio"]:not(:checked) + label,
[type="radio"]:checked + label {
position: relative;
padding-left: 35px;
cursor: pointer;
display: inline-block;
height: 25px;
line-height: 25px;
font-size: 1rem;
-webkit-transition: 0.28s ease;
-moz-transition: 0.28s ease;
-o-transition: 0.28s ease;
-ms-transition: 0.28s ease;
transition: 0.28s ease;
-webkit-user-select: none;
/* webkit (safari, chrome) browsers */
-moz-user-select: none;
/* mozilla browsers */
-khtml-user-select: none;
/* webkit (konqueror) browsers */
-ms-user-select: none;
/* IE10+ */
}
[type="radio"] + label:before,
[type="radio"] + label:after {
content: '';
position: absolute;
left: 0;
top: 0;
margin: 4px;
width: 16px;
height: 16px;
z-index: 0;
-webkit-transition: 0.28s ease;
-moz-transition: 0.28s ease;
-o-transition: 0.28s ease;
-ms-transition: 0.28s ease;
transition: 0.28s ease;
}
/* Unchecked styles */
[type="radio"]:not(:checked) + label:before {
border-radius: 50%;
border: 2px solid #5a5a5a;
}
[type="radio"]:not(:checked) + label:after {
border-radius: 50%;
border: 2px solid #5a5a5a;
z-index: -1;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0);
}
/* Checked styles */
[type="radio"]:checked + label:before {
border-radius: 50%;
border: 2px solid transparent;
}
[type="radio"]:checked + label:after {
border-radius: 50%;
border: 2px solid #26a69a;
background-color: #26a69a;
z-index: 0;
-webkit-transform: scale(1.02);
-moz-transform: scale(1.02);
-ms-transform: scale(1.02);
-o-transform: scale(1.02);
transform: scale(1.02);
}
/* Radio With gap */
[type="radio"].with-gap:checked + label:before {
border-radius: 50%;
border: 2px solid #26a69a;
}
[type="radio"].with-gap:checked + label:after {
border-radius: 50%;
border: 2px solid #26a69a;
background-color: #26a69a;
z-index: 0;
-webkit-transform: scale(0.5);
-moz-transform: scale(0.5);
-ms-transform: scale(0.5);
-o-transform: scale(0.5);
transform: scale(0.5);
}
/* Disabled Radio With gap */
[type="radio"].with-gap:disabled:checked + label:before {
border: 2px solid rgba(0, 0, 0, 0.26);
}
[type="radio"].with-gap:disabled:checked + label:after {
border: none;
background-color: rgba(0, 0, 0, 0.26);
}
/* Disabled style */
[type="radio"]:disabled:not(:checked) + label:before,
[type="radio"]:disabled:checked + label:before {
background-color: transparent;
border-color: rgba(0, 0, 0, 0.26);
}
[type="radio"]:disabled + label {
color: rgba(0, 0, 0, 0.26);
}
[type="radio"]:disabled:not(:checked) + label:before {
border-color: rgba(0, 0, 0, 0.26);
}
[type="radio"]:disabled:checked + label:after {
background-color: rgba(0, 0, 0, 0.26);
border-color: #BDBDBD;
}
/***************
Checkboxes
***************/
/* CUSTOM CSS CHECKBOXES */
form p {
margin-bottom: 10px;
text-align: left;
}
form p:last-child {
margin-bottom: 0;
}
/* Remove default checkbox */
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
position: absolute;
left: -9999px;
visibility: hidden;
}
[type="checkbox"] {
/* checkbox aspect */
}
[type="checkbox"] + label {
position: relative;
padding-left: 35px;
cursor: pointer;
display: inline-block;
height: 25px;
line-height: 25px;
font-size: 1rem;
-webkit-user-select: none;
/* webkit (safari, chrome) browsers */
-moz-user-select: none;
/* mozilla browsers */
-khtml-user-select: none;
/* webkit (konqueror) browsers */
-ms-user-select: none;
/* IE10+ */
}
[type="checkbox"] + label:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 18px;
height: 18px;
z-index: 0;
border: 2px solid #5a5a5a;
border-radius: 1px;
margin-top: 2px;
-webkit-transition: 0.2s;
-moz-transition: 0.2s;
-o-transition: 0.2s;
-ms-transition: 0.2s;
transition: 0.2s;
}
[type="checkbox"]:not(:checked):disabled + label:before {
border: none;
background-color: rgba(0, 0, 0, 0.26);
}
[type="checkbox"]:checked + label:before {
top: -4px;
left: -3px;
width: 12px;
height: 22px;
border-top: 2px solid transparent;
border-left: 2px solid transparent;
border-right: 2px solid #26a69a;
border-bottom: 2px solid #26a69a;
-webkit-transform: rotate(40deg);
-moz-transform: rotate(40deg);
-ms-transform: rotate(40deg);
-o-transform: rotate(40deg);
transform: rotate(40deg);
-webkit-backface-visibility: hidden;
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
[type="checkbox"]:checked:disabled + label:before {
border-right: 2px solid rgba(0, 0, 0, 0.26);
border-bottom: 2px solid rgba(0, 0, 0, 0.26);
}
/* Indeterminate checkbox */
[type="checkbox"]:indeterminate + label:before {
left: -10px;
top: -11px;
width: 10px;
height: 22px;
border-top: none;
border-left: none;
border-right: 2px solid #26a69a;
border-bottom: none;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
-webkit-backface-visibility: hidden;
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
[type="checkbox"]:indeterminate:disabled + label:before {
border-right: 2px solid rgba(0, 0, 0, 0.26);
background-color: transparent;
}
[type="checkbox"].filled-in + label:after {
border-radius: 2px;
}
[type="checkbox"].filled-in + label:before,
[type="checkbox"].filled-in + label:after {
content: '';
left: 0;
position: absolute;
/* .1s delay is for check animation */
transition: border .25s, background-color .25s, width .20s .1s, height .20s .1s, top .20s .1s, left .20s .1s;
z-index: 1;
}
[type="checkbox"].filled-in:not(:checked) + label:before {
width: 0;
height: 0;
border: 3px solid transparent;
left: 6px;
top: 10px;
-webkit-transform: rotateZ(37deg);
transform: rotateZ(37deg);
-webkit-transform-origin: 20% 40%;
transform-origin: 100% 100%;
}
[type="checkbox"].filled-in:not(:checked) + label:after {
height: 20px;
width: 20px;
background-color: transparent;
border: 2px solid #5a5a5a;
top: 0px;
z-index: 0;
}
[type="checkbox"].filled-in:checked + label:before {
top: 0;
left: 1px;
width: 8px;
height: 13px;
border-top: 2px solid transparent;
border-left: 2px solid transparent;
border-right: 2px solid #fff;
border-bottom: 2px solid #fff;
-webkit-transform: rotateZ(37deg);
transform: rotateZ(37deg);
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
[type="checkbox"].filled-in:checked + label:after {
top: 0px;
width: 20px;
height: 20px;
border: 2px solid #26a69a;
background-color: #26a69a;
z-index: 0;
}
[type="checkbox"].filled-in:disabled:not(:checked) + label:before {
background-color: transparent;
border: 2px solid transparent;
}
[type="checkbox"].filled-in:disabled:not(:checked) + label:after {
border-color: transparent;
background-color: #BDBDBD;
}
[type="checkbox"].filled-in:disabled:checked + label:before {
background-color: transparent;
}
[type="checkbox"].filled-in:disabled:checked + label:after {
background-color: #BDBDBD;
border-color: #BDBDBD;
}
/***************
Switch
***************/
.switch,
.switch * {
-webkit-user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
-ms-user-select: none;
}
.switch label {
cursor: pointer;
}
.switch label input[type=checkbox] {
opacity: 0;
width: 0;
height: 0;
}
.switch label input[type=checkbox]:checked + .lever {
background-color: #84c7c1;
}
.switch label input[type=checkbox]:checked + .lever:after {
background-color: #26a69a;
}
.switch label .lever {
content: "";
display: inline-block;
position: relative;
width: 40px;
height: 15px;
background-color: #818181;
border-radius: 15px;
margin-right: 10px;
transition: background 0.3s ease;
vertical-align: middle;
margin: 0 16px;
}
.switch label .lever:after {
content: "";
position: absolute;
display: inline-block;
width: 21px;
height: 21px;
background-color: #F1F1F1;
border-radius: 21px;
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4);
left: -5px;
top: -3px;
transition: left 0.3s ease, background .3s ease, box-shadow 0.1s ease;
}
input[type=checkbox]:checked:not(:disabled) ~ .lever:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(38, 166, 154, 0.1);
}
input[type=checkbox]:not(:disabled) ~ .lever:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(0, 0, 0, 0.08);
}
.switch label input[type=checkbox]:checked + .lever:after {
left: 24px;
}
.switch input[type=checkbox][disabled] + .lever {
cursor: default;
}
.switch label input[type=checkbox][disabled] + .lever:after,
.switch label input[type=checkbox][disabled]:checked + .lever:after {
background-color: #BDBDBD;
}
/***************
Select Field
***************/
.select-label {
position: absolute;
}
.select-wrapper {
position: relative;
}
.select-wrapper input.select-dropdown {
position: relative;
cursor: pointer;
background-color: transparent;
border: none;
border-bottom: 1px solid #757575;
outline: none;
height: 3rem;
line-height: 3rem;
width: 100%;
font-size: 1rem;
margin: 0 0 15px 0;
padding: 0;
display: block;
}
.select-wrapper span.caret {
color: initial;
position: absolute;
right: 0;
top: 16px;
font-size: 10px;
}
.select-wrapper span.caret.disabled {
color: rgba(0, 0, 0, 0.26);
}
.select-wrapper + label {
position: absolute;
top: -14px;
font-size: 0.8rem;
}
select {
display: none;
}
select.browser-default {
display: block;
}
select:disabled {
color: rgba(0, 0, 0, 0.3);
}
.select-wrapper input.select-dropdown:disabled {
color: rgba(0, 0, 0, 0.3);
cursor: default;
-webkit-user-select: none;
/* webkit (safari, chrome) browsers */
-moz-user-select: none;
/* mozilla browsers */
-ms-user-select: none;
/* IE10+ */
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}
.select-wrapper i {
color: rgba(0, 0, 0, 0.3);
}
.select-dropdown li.disabled {
color: rgba(0, 0, 0, 0.3);
background-color: transparent;
}
/*********************
File Input
**********************/
.file-field {
position: relative;
}
.file-field .file-path-wrapper {
overflow: hidden;
padding-left: 10px;
}
.file-field input.file-path {
width: 100%;
}
.file-field .btn, .file-field .btn-large {
float: left;
height: 3rem;
line-height: 3rem;
}
.file-field span {
cursor: pointer;
}
.file-field input[type=file] {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
width: 100%;
margin: 0;
padding: 0;
font-size: 20px;
cursor: pointer;
opacity: 0;
filter: alpha(opacity=0);
}
/***************
Range
***************/
.range-field {
position: relative;
}
input[type=range], input[type=range] + .thumb {
cursor: pointer;
}
input[type=range] {
position: relative;
background-color: transparent;
border: none;
outline: none;
width: 100%;
margin: 15px 0px;
padding: 0;
}
input[type=range] + .thumb {
position: absolute;
border: none;
height: 0;
width: 0;
border-radius: 50%;
background-color: #26a69a;
top: 10px;
margin-left: -6px;
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
input[type=range] + .thumb .value {
display: block;
width: 30px;
text-align: center;
color: #26a69a;
font-size: 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
input[type=range] + .thumb.active {
border-radius: 50% 50% 50% 0;
}
input[type=range] + .thumb.active .value {
color: #fff;
margin-left: -1px;
margin-top: 8px;
font-size: 10px;
}
input[type=range]:focus {
outline: none;
}
input[type=range] {
-webkit-appearance: none;
}
input[type=range]::-webkit-slider-runnable-track {
height: 3px;
background: #c2c0c2;
border: none;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border: none;
height: 14px;
width: 14px;
border-radius: 50%;
background-color: #26a69a;
transform-origin: 50% 50%;
margin: -5px 0 0 0;
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
-o-transition: 0.3s;
-ms-transition: 0.3s;
transition: 0.3s;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #ccc;
}
input[type=range] {
/* fix for FF unable to apply focus style bug */
border: 1px solid white;
/*required for proper track sizing in FF*/
}
input[type=range]::-moz-range-track {
height: 3px;
background: #ddd;
border: none;
}
input[type=range]::-moz-range-thumb {
border: none;
height: 14px;
width: 14px;
border-radius: 50%;
background: #26a69a;
margin-top: -5px;
}
/*hide the outline behind the border*/
input[type=range]:-moz-focusring {
outline: 1px solid white;
outline-offset: -1px;
}
input[type=range]:focus::-moz-range-track {
background: #ccc;
}
input[type=range]::-ms-track {
height: 3px;
/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
background: transparent;
/*leave room for the larger thumb to overflow with a transparent border */
border-color: transparent;
border-width: 6px 0;
/*remove default tick marks*/
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #777;
}
input[type=range]::-ms-fill-upper {
background: #ddd;
}
input[type=range]::-ms-thumb {
border: none;
height: 14px;
width: 14px;
border-radius: 50%;
background: #26a69a;
}
input[type=range]:focus::-ms-fill-lower {
background: #888;
}
input[type=range]:focus::-ms-fill-upper {
background: #ccc;
}
/***************************
Text Inputs + Textarea
****************************/
select {
background-color: rgba(255, 255, 255, 0.9);
width: 100%;
padding: 5px;
border: 1px solid #f2f2f2;
border-radius: 2px;
height: 3rem;
}
/***************
Nav List
***************/
.table-of-contents.fixed {
position: fixed;
}
.table-of-contents li {
padding: 2px 0;
}
.table-of-contents a {
display: inline-block;
font-weight: 300;
color: #757575;
padding-left: 20px;
height: 1.5rem;
line-height: 1.5rem;
letter-spacing: .4;
display: inline-block;
}
.table-of-contents a:hover {
color: #a8a8a8;
padding-left: 19px;
border-left: 1px solid #ea4a4f;
}
.table-of-contents a.active {
font-weight: 500;
padding-left: 18px;
border-left: 2px solid #ea4a4f;
}
.side-nav {
position: fixed;
width: 240px;
left: -105%;
top: 0;
margin: 0;
height: 100%;
height: calc(100% + 60px);
height: -moz-calc(100%);
padding-bottom: 60px;
background-color: #fff;
z-index: 999;
overflow-y: auto;
will-change: left;
}
.side-nav.right-aligned {
will-change: right;
right: -105%;
left: auto;
}
.side-nav .collapsible {
margin: 0;
}
.side-nav li {
float: none;
padding: 0 15px;
}
.side-nav li:hover, .side-nav li.active {
background-color: #ddd;
}
.side-nav a {
color: #444;
display: block;
font-size: 1rem;
height: 64px;
line-height: 64px;
padding: 0 15px;
}
.drag-target {
height: 100%;
width: 10px;
position: fixed;
top: 0;
z-index: 998;
}
.side-nav.fixed a {
display: block;
padding: 0 15px;
color: #444;
}
.side-nav.fixed {
left: 0;
position: fixed;
}
.side-nav.fixed.right-aligned {
right: 0;
left: auto;
}
@media only screen and (max-width: 992px) {
.side-nav.fixed {
left: -105%;
}
.side-nav.fixed.right-aligned {
right: -105%;
left: auto;
}
}
.side-nav .collapsible-body li.active,
.side-nav.fixed .collapsible-body li.active {
background-color: #004785;
}
.side-nav .collapsible-body li.active a,
.side-nav.fixed .collapsible-body li.active a {
color: #fff;
}
#sidenav-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 120vh;
background-color: rgba(0, 0, 0, 0.5);
z-index: 997;
will-change: opacity;
}
/*
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
/**************************/
/* STYLES FOR THE SPINNER */
/**************************/
/*
* Constants:
* STROKEWIDTH = 3px
* ARCSIZE = 270 degrees (amount of circle the arc takes up)
* ARCTIME = 1333ms (time it takes to expand and contract arc)
* ARCSTARTROT = 216 degrees (how much the start location of the arc
* should rotate each time, 216 gives us a
* 5 pointed star shape (it's 360/5 * 3).
* For a 7 pointed star, we might do
* 360/7 * 3 = 154.286)
* CONTAINERWIDTH = 28px
* SHRINK_TIME = 400ms
*/
.preloader-wrapper {
display: inline-block;
position: relative;
width: 48px;
height: 48px;
}
.preloader-wrapper.small {
width: 36px;
height: 36px;
}
.preloader-wrapper.big {
width: 64px;
height: 64px;
}
.preloader-wrapper.active {
/* duration: 360 * ARCTIME / (ARCSTARTROT + (360-ARCSIZE)) */
-webkit-animation: container-rotate 1568ms linear infinite;
animation: container-rotate 1568ms linear infinite;
}
@-webkit-keyframes container-rotate {
to {
-webkit-transform: rotate(360deg);
}
}
@keyframes container-rotate {
to {
transform: rotate(360deg);
}
}
.spinner-layer {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
}
.spinner-blue,
.spinner-blue-only {
border-color: #4285f4;
}
.spinner-red,
.spinner-red-only {
border-color: #db4437;
}
.spinner-yellow,
.spinner-yellow-only {
border-color: #f4b400;
}
.spinner-green,
.spinner-green-only {
border-color: #0f9d58;
}
/**
* IMPORTANT NOTE ABOUT CSS ANIMATION PROPERTIES (keanulee):
*
* iOS Safari (tested on iOS 8.1) does not handle animation-delay very well - it doesn't
* guarantee that the animation will start _exactly_ after that value. So we avoid using
* animation-delay and instead set custom keyframes for each color (as redundant as it
* seems).
*
* We write out each animation in full (instead of separating animation-name,
* animation-duration, etc.) because under the polyfill, Safari does not recognize those
* specific properties properly, treats them as -webkit-animation, and overrides the
* other animation rules. See https://github.com/Polymer/platform/issues/53.
*/
.active .spinner-layer.spinner-blue {
/* durations: 4 * ARCTIME */
-webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, blue-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, blue-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.active .spinner-layer.spinner-red {
/* durations: 4 * ARCTIME */
-webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.active .spinner-layer.spinner-yellow {
/* durations: 4 * ARCTIME */
-webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, yellow-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, yellow-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.active .spinner-layer.spinner-green {
/* durations: 4 * ARCTIME */
-webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, green-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, green-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.active .spinner-layer.spinner-blue-only,
.active .spinner-layer.spinner-red-only,
.active .spinner-layer.spinner-yellow-only,
.active .spinner-layer.spinner-green-only {
/* durations: 4 * ARCTIME */
opacity: 1;
-webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
@-webkit-keyframes fill-unfill-rotate {
12.5% {
-webkit-transform: rotate(135deg);
}
/* 0.5 * ARCSIZE */
25% {
-webkit-transform: rotate(270deg);
}
/* 1 * ARCSIZE */
37.5% {
-webkit-transform: rotate(405deg);
}
/* 1.5 * ARCSIZE */
50% {
-webkit-transform: rotate(540deg);
}
/* 2 * ARCSIZE */
62.5% {
-webkit-transform: rotate(675deg);
}
/* 2.5 * ARCSIZE */
75% {
-webkit-transform: rotate(810deg);
}
/* 3 * ARCSIZE */
87.5% {
-webkit-transform: rotate(945deg);
}
/* 3.5 * ARCSIZE */
to {
-webkit-transform: rotate(1080deg);
}
/* 4 * ARCSIZE */
}
@keyframes fill-unfill-rotate {
12.5% {
transform: rotate(135deg);
}
/* 0.5 * ARCSIZE */
25% {
transform: rotate(270deg);
}
/* 1 * ARCSIZE */
37.5% {
transform: rotate(405deg);
}
/* 1.5 * ARCSIZE */
50% {
transform: rotate(540deg);
}
/* 2 * ARCSIZE */
62.5% {
transform: rotate(675deg);
}
/* 2.5 * ARCSIZE */
75% {
transform: rotate(810deg);
}
/* 3 * ARCSIZE */
87.5% {
transform: rotate(945deg);
}
/* 3.5 * ARCSIZE */
to {
transform: rotate(1080deg);
}
/* 4 * ARCSIZE */
}
@-webkit-keyframes blue-fade-in-out {
from {
opacity: 1;
}
25% {
opacity: 1;
}
26% {
opacity: 0;
}
89% {
opacity: 0;
}
90% {
opacity: 1;
}
100% {
opacity: 1;
}
}
@keyframes blue-fade-in-out {
from {
opacity: 1;
}
25% {
opacity: 1;
}
26% {
opacity: 0;
}
89% {
opacity: 0;
}
90% {
opacity: 1;
}
100% {
opacity: 1;
}
}
@-webkit-keyframes red-fade-in-out {
from {
opacity: 0;
}
15% {
opacity: 0;
}
25% {
opacity: 1;
}
50% {
opacity: 1;
}
51% {
opacity: 0;
}
}
@keyframes red-fade-in-out {
from {
opacity: 0;
}
15% {
opacity: 0;
}
25% {
opacity: 1;
}
50% {
opacity: 1;
}
51% {
opacity: 0;
}
}
@-webkit-keyframes yellow-fade-in-out {
from {
opacity: 0;
}
40% {
opacity: 0;
}
50% {
opacity: 1;
}
75% {
opacity: 1;
}
76% {
opacity: 0;
}
}
@keyframes yellow-fade-in-out {
from {
opacity: 0;
}
40% {
opacity: 0;
}
50% {
opacity: 1;
}
75% {
opacity: 1;
}
76% {
opacity: 0;
}
}
@-webkit-keyframes green-fade-in-out {
from {
opacity: 0;
}
65% {
opacity: 0;
}
75% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes green-fade-in-out {
from {
opacity: 0;
}
65% {
opacity: 0;
}
75% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
/**
* Patch the gap that appear between the two adjacent div.circle-clipper while the
* spinner is rotating (appears on Chrome 38, Safari 7.1, and IE 11).
*/
.gap-patch {
position: absolute;
top: 0;
left: 45%;
width: 10%;
height: 100%;
overflow: hidden;
border-color: inherit;
}
.gap-patch .circle {
width: 1000%;
left: -450%;
}
.circle-clipper {
display: inline-block;
position: relative;
width: 50%;
height: 100%;
overflow: hidden;
border-color: inherit;
}
.circle-clipper .circle {
width: 200%;
height: 100%;
border-width: 3px;
/* STROKEWIDTH */
border-style: solid;
border-color: inherit;
border-bottom-color: transparent !important;
border-radius: 50%;
-webkit-animation: none;
animation: none;
position: absolute;
top: 0;
right: 0;
bottom: 0;
}
.circle-clipper.left .circle {
left: 0;
border-right-color: transparent !important;
-webkit-transform: rotate(129deg);
transform: rotate(129deg);
}
.circle-clipper.right .circle {
left: -100%;
border-left-color: transparent !important;
-webkit-transform: rotate(-129deg);
transform: rotate(-129deg);
}
.active .circle-clipper.left .circle {
/* duration: ARCTIME */
-webkit-animation: left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
animation: left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.active .circle-clipper.right .circle {
/* duration: ARCTIME */
-webkit-animation: right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
animation: right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
@-webkit-keyframes left-spin {
from {
-webkit-transform: rotate(130deg);
}
50% {
-webkit-transform: rotate(-5deg);
}
to {
-webkit-transform: rotate(130deg);
}
}
@keyframes left-spin {
from {
transform: rotate(130deg);
}
50% {
transform: rotate(-5deg);
}
to {
transform: rotate(130deg);
}
}
@-webkit-keyframes right-spin {
from {
-webkit-transform: rotate(-130deg);
}
50% {
-webkit-transform: rotate(5deg);
}
to {
-webkit-transform: rotate(-130deg);
}
}
@keyframes right-spin {
from {
transform: rotate(-130deg);
}
50% {
transform: rotate(5deg);
}
to {
transform: rotate(-130deg);
}
}
#spinnerContainer.cooldown {
/* duration: SHRINK_TIME */
-webkit-animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0, 0.2, 1);
animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0, 0.2, 1);
}
@-webkit-keyframes fade-out {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@keyframes fade-out {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
.slider {
position: relative;
height: 400px;
width: 100%;
}
.slider.fullscreen {
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.slider.fullscreen ul.slides {
height: 100%;
}
.slider.fullscreen ul.indicators {
z-index: 2;
bottom: 30px;
}
.slider .slides {
background-color: #9e9e9e;
margin: 0;
height: 400px;
}
.slider .slides li {
opacity: 0;
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 100%;
height: inherit;
overflow: hidden;
}
.slider .slides li img {
height: 100%;
width: 100%;
background-size: cover;
background-position: center;
}
.slider .slides li .caption {
color: #fff;
position: absolute;
top: 15%;
left: 15%;
width: 70%;
opacity: 0;
}
.slider .slides li .caption p {
color: #e0e0e0;
}
.slider .slides li.active {
z-index: 2;
}
.slider .indicators {
position: absolute;
text-align: center;
left: 0;
right: 0;
bottom: 0;
margin: 0;
}
.slider .indicators .indicator-item {
display: inline-block;
position: relative;
cursor: pointer;
height: 16px;
width: 16px;
margin: 0 12px;
background-color: #e0e0e0;
-webkit-transition: background-color 0.3s;
-moz-transition: background-color 0.3s;
-o-transition: background-color 0.3s;
-ms-transition: background-color 0.3s;
transition: background-color 0.3s;
border-radius: 50%;
}
.slider .indicators .indicator-item.active {
background-color: #4CAF50;
}
/* ==========================================================================
$BASE-PICKER
========================================================================== */
/**
* Note: the root picker element should *NOT* be styled more than what's here.
*/
.picker {
font-size: 16px;
text-align: left;
line-height: 1.2;
color: #000000;
position: absolute;
z-index: 10000;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/**
* The picker input element.
*/
.picker__input {
cursor: default;
}
/**
* When the picker is opened, the input element is "activated".
*/
.picker__input.picker__input--active {
border-color: #0089ec;
}
/**
* The holder is the only "scrollable" top-level container element.
*/
.picker__holder {
width: 100%;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
/*!
* Default mobile-first, responsive styling for pickadate.js
* Demo: http://amsul.github.io/pickadate.js
*/
/**
* Note: the root picker element should *NOT* be styled more than what's here.
*/
/**
* Make the holder and frame fullscreen.
*/
.picker__holder,
.picker__frame {
bottom: 0;
left: 0;
right: 0;
top: 100%;
}
/**
* The holder should overlay the entire screen.
*/
.picker__holder {
position: fixed;
-webkit-transition: background 0.15s ease-out, top 0s 0.15s;
-moz-transition: background 0.15s ease-out, top 0s 0.15s;
transition: background 0.15s ease-out, top 0s 0.15s;
-webkit-backface-visibility: hidden;
}
/**
* The frame that bounds the box contents of the picker.
*/
.picker__frame {
position: absolute;
margin: 0 auto;
min-width: 256px;
width: 300px;
max-height: 350px;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-moz-opacity: 0;
opacity: 0;
-webkit-transition: all 0.15s ease-out;
-moz-transition: all 0.15s ease-out;
transition: all 0.15s ease-out;
}
@media (min-height: 28.875em) {
.picker__frame {
overflow: visible;
top: auto;
bottom: -100%;
max-height: 80%;
}
}
@media (min-height: 40.125em) {
.picker__frame {
margin-bottom: 7.5%;
}
}
/**
* The wrapper sets the stage to vertically align the box contents.
*/
.picker__wrap {
display: table;
width: 100%;
height: 100%;
}
@media (min-height: 28.875em) {
.picker__wrap {
display: block;
}
}
/**
* The box contains all the picker contents.
*/
.picker__box {
background: #ffffff;
display: table-cell;
vertical-align: middle;
}
@media (min-height: 28.875em) {
.picker__box {
display: block;
border: 1px solid #777777;
border-top-color: #898989;
border-bottom-width: 0;
-webkit-border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
border-radius: 5px 5px 0 0;
-webkit-box-shadow: 0 12px 36px 16px rgba(0, 0, 0, 0.24);
-moz-box-shadow: 0 12px 36px 16px rgba(0, 0, 0, 0.24);
box-shadow: 0 12px 36px 16px rgba(0, 0, 0, 0.24);
}
}
/**
* When the picker opens...
*/
.picker--opened .picker__holder {
top: 0;
background: transparent;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#1E000000,endColorstr=#1E000000)";
zoom: 1;
background: rgba(0, 0, 0, 0.32);
-webkit-transition: background 0.15s ease-out;
-moz-transition: background 0.15s ease-out;
transition: background 0.15s ease-out;
}
.picker--opened .picker__frame {
top: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
-moz-opacity: 1;
opacity: 1;
}
@media (min-height: 35.875em) {
.picker--opened .picker__frame {
top: 10%;
bottom: 20% auto;
}
}
/**
* For `large` screens, transform into an inline picker.
*/
/* ==========================================================================
CUSTOM MATERIALIZE STYLES
========================================================================== */
.picker__input.picker__input--active {
border-color: #E3F2FD;
}
.picker__frame {
margin: 0 auto;
max-width: 325px;
}
@media (min-height: 38.875em) {
.picker--opened .picker__frame {
top: 10%;
bottom: auto;
}
}
/* ==========================================================================
$BASE-DATE-PICKER
========================================================================== */
/**
* The picker box.
*/
.picker__box {
padding: 0 1em;
}
/**
* The header containing the month and year stuff.
*/
.picker__header {
text-align: center;
position: relative;
margin-top: .75em;
}
/**
* The month and year labels.
*/
.picker__month,
.picker__year {
display: inline-block;
margin-left: .25em;
margin-right: .25em;
}
/**
* The month and year selectors.
*/
.picker__select--month,
.picker__select--year {
height: 2em;
padding: 0;
margin-left: .25em;
margin-right: .25em;
}
.picker__select--month.browser-default {
display: inline;
background-color: #FFFFFF;
width: 40%;
}
.picker__select--year.browser-default {
display: inline;
background-color: #FFFFFF;
width: 25%;
}
.picker__select--month:focus,
.picker__select--year:focus {
border-color: rgba(0, 0, 0, 0.05);
}
/**
* The month navigation buttons.
*/
.picker__nav--prev,
.picker__nav--next {
position: absolute;
padding: .5em 1.25em;
width: 1em;
height: 1em;
box-sizing: content-box;
top: -0.25em;
}
.picker__nav--prev {
left: -1em;
padding-right: 1.25em;
}
.picker__nav--next {
right: -1em;
padding-left: 1.25em;
}
.picker__nav--disabled,
.picker__nav--disabled:hover,
.picker__nav--disabled:before,
.picker__nav--disabled:before:hover {
cursor: default;
background: none;
border-right-color: #f5f5f5;
border-left-color: #f5f5f5;
}
/**
* The calendar table of dates
*/
.picker__table {
text-align: center;
border-collapse: collapse;
border-spacing: 0;
table-layout: fixed;
font-size: 1rem;
width: 100%;
margin-top: .75em;
margin-bottom: .5em;
}
.picker__table th, .picker__table td {
text-align: center;
}
.picker__table td {
margin: 0;
padding: 0;
}
/**
* The weekday labels
*/
.picker__weekday {
width: 14.285714286%;
font-size: .75em;
padding-bottom: .25em;
color: #999999;
font-weight: 500;
/* Increase the spacing a tad */
}
@media (min-height: 33.875em) {
.picker__weekday {
padding-bottom: .5em;
}
}
/**
* The days on the calendar
*/
.picker__day--today {
position: relative;
color: #595959;
letter-spacing: -.3;
padding: .75rem 0;
font-weight: 400;
border: 1px solid transparent;
}
.picker__day--disabled:before {
border-top-color: #aaaaaa;
}
.picker__day--infocus:hover {
cursor: pointer;
color: #000;
font-weight: 500;
}
.picker__day--outfocus {
display: none;
padding: .75rem 0;
color: #fff;
}
.picker__day--outfocus:hover {
cursor: pointer;
color: #dddddd;
font-weight: 500;
}
.picker__day--highlighted:hover,
.picker--focused .picker__day--highlighted {
cursor: pointer;
}
.picker__day--selected,
.picker__day--selected:hover,
.picker--focused .picker__day--selected {
border-radius: 50%;
-webkit-transform: scale(0.75);
-moz-transform: scale(0.75);
-ms-transform: scale(0.75);
-o-transform: scale(0.75);
transform: scale(0.75);
background: #0089ec;
color: #ffffff;
}
.picker__day--disabled,
.picker__day--disabled:hover,
.picker--focused .picker__day--disabled {
background: #f5f5f5;
border-color: #f5f5f5;
color: #dddddd;
cursor: default;
}
.picker__day--highlighted.picker__day--disabled,
.picker__day--highlighted.picker__day--disabled:hover {
background: #bbbbbb;
}
/**
* The footer containing the "today", "clear", and "close" buttons.
*/
.picker__footer {
text-align: center;
display: flex;
align-items: center;
justify-content: space-between;
}
.picker__button--today,
.picker__button--clear,
.picker__button--close {
border: 1px solid #ffffff;
background: #ffffff;
font-size: .8em;
padding: .66em 0;
font-weight: bold;
width: 33%;
display: inline-block;
vertical-align: bottom;
}
.picker__button--today:hover,
.picker__button--clear:hover,
.picker__button--close:hover {
cursor: pointer;
color: #000000;
background: #b1dcfb;
border-bottom-color: #b1dcfb;
}
.picker__button--today:focus,
.picker__button--clear:focus,
.picker__button--close:focus {
background: #b1dcfb;
border-color: rgba(0, 0, 0, 0.05);
outline: none;
}
.picker__button--today:before,
.picker__button--clear:before,
.picker__button--close:before {
position: relative;
display: inline-block;
height: 0;
}
.picker__button--today:before,
.picker__button--clear:before {
content: " ";
margin-right: .45em;
}
.picker__button--today:before {
top: -0.05em;
width: 0;
border-top: 0.66em solid #0059bc;
border-left: .66em solid transparent;
}
.picker__button--clear:before {
top: -0.25em;
width: .66em;
border-top: 3px solid #ee2200;
}
.picker__button--close:before {
content: "\D7";
top: -0.1em;
vertical-align: top;
font-size: 1.1em;
margin-right: .35em;
color: #777777;
}
.picker__button--today[disabled],
.picker__button--today[disabled]:hover {
background: #f5f5f5;
border-color: #f5f5f5;
color: #dddddd;
cursor: default;
}
.picker__button--today[disabled]:before {
border-top-color: #aaaaaa;
}
/* ==========================================================================
CUSTOM MATERIALIZE STYLES
========================================================================== */
.picker__box {
border-radius: 2px;
overflow: hidden;
}
.picker__date-display {
text-align: center;
background-color: #26a69a;
color: #fff;
padding-bottom: 15px;
font-weight: 300;
}
.picker__nav--prev:hover,
.picker__nav--next:hover {
cursor: pointer;
color: #000000;
background: #a1ded8;
}
.picker__weekday-display {
background-color: #1f897f;
padding: 10px;
font-weight: 200;
letter-spacing: .5;
font-size: 1rem;
margin-bottom: 15px;
}
.picker__month-display {
text-transform: uppercase;
font-size: 2rem;
}
.picker__day-display {
font-size: 4.5rem;
font-weight: 400;
}
.picker__year-display {
font-size: 1.8rem;
color: rgba(255, 255, 255, 0.4);
}
.picker__box {
padding: 0;
}
.picker__calendar-container {
padding: 0 1rem;
}
.picker__calendar-container thead {
border: none;
}
.picker__table {
margin-top: 0;
margin-bottom: .5em;
}
.picker__day--infocus {
color: #595959;
letter-spacing: -.3;
padding: .75rem 0;
font-weight: 400;
border: 1px solid transparent;
}
.picker__day.picker__day--today {
color: #26a69a;
}
.picker__day.picker__day--today.picker__day--selected {
color: #fff;
}
.picker__weekday {
font-size: .9rem;
}
.picker__day--selected,
.picker__day--selected:hover,
.picker--focused .picker__day--selected {
border-radius: 50%;
-webkit-transform: scale(0.9);
-moz-transform: scale(0.9);
-ms-transform: scale(0.9);
-o-transform: scale(0.9);
transform: scale(0.9);
background-color: #26a69a;
color: #ffffff;
}
.picker__day--selected.picker__day--outfocus,
.picker__day--selected:hover.picker__day--outfocus,
.picker--focused .picker__day--selected.picker__day--outfocus {
background-color: #a1ded8;
}
.picker__footer {
text-align: right;
padding: 5px 10px;
}
.picker__close, .picker__today {
font-size: 1.1rem;
padding: 0 1rem;
color: #26a69a;
}
.picker__nav--prev:before,
.picker__nav--next:before {
content: " ";
border-top: .5em solid transparent;
border-bottom: .5em solid transparent;
border-right: 0.75em solid #676767;
width: 0;
height: 0;
display: block;
margin: 0 auto;
}
.picker__nav--next:before {
border-right: 0;
border-left: 0.75em solid #676767;
}
button.picker__today:focus, button.picker__clear:focus, button.picker__close:focus {
background-color: #a1ded8;
}
/* ==========================================================================
$BASE-TIME-PICKER
========================================================================== */
/**
* The list of times.
*/
.picker__list {
list-style: none;
padding: 0.75em 0 4.2em;
margin: 0;
}
/**
* The times on the clock.
*/
.picker__list-item {
border-bottom: 1px solid #dddddd;
border-top: 1px solid #dddddd;
margin-bottom: -1px;
position: relative;
background: #ffffff;
padding: .75em 1.25em;
}
@media (min-height: 46.75em) {
.picker__list-item {
padding: .5em 1em;
}
}
/* Hovered time */
.picker__list-item:hover {
cursor: pointer;
color: #000000;
background: #b1dcfb;
border-color: #0089ec;
z-index: 10;
}
/* Highlighted and hovered/focused time */
.picker__list-item--highlighted {
border-color: #0089ec;
z-index: 10;
}
.picker__list-item--highlighted:hover,
.picker--focused .picker__list-item--highlighted {
cursor: pointer;
color: #000000;
background: #b1dcfb;
}
/* Selected and hovered/focused time */
.picker__list-item--selected,
.picker__list-item--selected:hover,
.picker--focused .picker__list-item--selected {
background: #0089ec;
color: #ffffff;
z-index: 10;
}
/* Disabled time */
.picker__list-item--disabled,
.picker__list-item--disabled:hover,
.picker--focused .picker__list-item--disabled {
background: #f5f5f5;
border-color: #f5f5f5;
color: #dddddd;
cursor: default;
border-color: #dddddd;
z-index: auto;
}
/**
* The clear button
*/
.picker--time .picker__button--clear {
display: block;
width: 80%;
margin: 1em auto 0;
padding: 1em 1.25em;
background: none;
border: 0;
font-weight: 500;
font-size: .67em;
text-align: center;
text-transform: uppercase;
color: #666;
}
.picker--time .picker__button--clear:hover,
.picker--time .picker__button--clear:focus {
color: #000000;
background: #b1dcfb;
background: #ee2200;
border-color: #ee2200;
cursor: pointer;
color: #ffffff;
outline: none;
}
.picker--time .picker__button--clear:before {
top: -0.25em;
color: #666;
font-size: 1.25em;
font-weight: bold;
}
.picker--time .picker__button--clear:hover:before,
.picker--time .picker__button--clear:focus:before {
color: #ffffff;
}
/* ==========================================================================
$DEFAULT-TIME-PICKER
========================================================================== */
/**
* The frame the bounds the time picker.
*/
.picker--time .picker__frame {
min-width: 256px;
max-width: 320px;
}
/**
* The picker box.
*/
.picker--time .picker__box {
font-size: 1em;
background: #f2f2f2;
padding: 0;
}
@media (min-height: 40.125em) {
.picker--time .picker__box {
margin-bottom: 5em;
}
}
body, html {
background: #FCFCFC;
}
h1, h2, h3, h4, h5 {
margin-top: 1em;
margin-bottom: 1em;
}
.logo-img {
max-height: 100%;
max-width: 100%;
margin: .5em;
}
.paddy {
padding: 2em !important;
}
.hidden {
display: none;
}
.day-input {
margin-left: 1em !important;
margin-right: 1em !important;
}
.request form {
margin-top: 2em;
}
.card-header {
margin: 0;
padding: 2em;
width: 100%;
height: 100%;
}
.primary {
background: #004785;
}
.secondary {
background: #26a69a;
}
.divider {
margin: 1em auto;
width: 100%;
}
/*# sourceMappingURL=style.css.map */
| thebedivere/Material-Wordpress-Theme | style.css | CSS | mit | 186,316 | [
30522,
1012,
3430,
4697,
1011,
2417,
1012,
2422,
2368,
1011,
1019,
1063,
4281,
1011,
3609,
1024,
1001,
1042,
3207,
6679,
2497,
999,
2590,
1025,
1065,
1012,
3430,
4697,
1011,
2417,
1011,
3793,
1012,
3793,
1011,
2422,
2368,
1011,
1019,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\CatalogImportExport\Model\Export;
/**
* @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php
* @magentoAppIsolation enabled
* @magentoDbIsolation enabled
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ProductTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Magento\CatalogImportExport\Model\Export\Product
*/
protected $model;
/**
* @var \Magento\Framework\ObjectManagerInterface
*/
protected $objectManager;
/**
* @var \Magento\Framework\Filesystem
*/
protected $fileSystem;
/**
* Stock item attributes which must be exported
*
* @var array
*/
public static $stockItemAttributes = [
'qty',
'min_qty',
'use_config_min_qty',
'is_qty_decimal',
'backorders',
'use_config_backorders',
'min_sale_qty',
'use_config_min_sale_qty',
'max_sale_qty',
'use_config_max_sale_qty',
'is_in_stock',
'notify_stock_qty',
'use_config_notify_stock_qty',
'manage_stock',
'use_config_manage_stock',
'use_config_qty_increments',
'qty_increments',
'use_config_enable_qty_inc',
'enable_qty_increments',
'is_decimal_divided'
];
protected function setUp()
{
parent::setUp();
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->fileSystem = $this->objectManager->get(\Magento\Framework\Filesystem::class);
$this->model = $this->objectManager->create(
\Magento\CatalogImportExport\Model\Export\Product::class
);
}
/**
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_data.php
* @magentoDbIsolation enabled
*/
public function testExport()
{
$this->model->setWriter(
$this->objectManager->create(
\Magento\ImportExport\Model\Export\Adapter\Csv::class
)
);
$exportData = $this->model->export();
$this->assertContains('New Product', $exportData);
$this->assertContains('Option 1 & Value 1"', $exportData);
$this->assertContains('Option 1 & Value 2"', $exportData);
$this->assertContains('Option 1 & Value 3"', $exportData);
$this->assertContains('Option 4 ""!@#$%^&*', $exportData);
$this->assertContains('test_option_code_2', $exportData);
$this->assertContains('max_characters=10', $exportData);
$this->assertContains('text_attribute=!@#$%^&*()_+1234567890-=|\\:;""\'<,>.?/', $exportData);
$occurrencesCount = substr_count($exportData, 'Hello "" &"" Bring the water bottle when you can!');
$this->assertEquals(1, $occurrencesCount);
}
/**
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_data_special_chars.php
* @magentoDbIsolation enabled
*/
public function testExportSpecialChars()
{
$this->model->setWriter(
$this->objectManager->create(
\Magento\ImportExport\Model\Export\Adapter\Csv::class
)
);
$exportData = $this->model->export();
$this->assertContains('simple ""1""', $exportData);
$this->assertContains('Category with slash\/ symbol', $exportData);
}
/**
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_with_product_links_data.php
* @magentoDbIsolation enabled
*/
public function testExportWithProductLinks()
{
$this->model->setWriter(
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\ImportExport\Model\Export\Adapter\Csv::class
)
);
$this->assertNotEmpty($this->model->export());
}
/**
* Verify that all stock item attribute values are exported (aren't equal to empty string)
*
* @magentoAppIsolation enabled
* @magentoDbIsolation enabled
* @covers \Magento\CatalogImportExport\Model\Export\Product::export
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_data.php
*/
public function testExportStockItemAttributesAreFilled()
{
$this->markTestSkipped('Test needs to be skipped.');
$fileWrite = $this->createMock(\Magento\Framework\Filesystem\File\Write::class);
$directoryMock = $this->createPartialMock(
\Magento\Framework\Filesystem\Directory\Write::class,
['getParentDirectory', 'isWritable', 'isFile', 'readFile', 'openFile']
);
$directoryMock->expects($this->any())->method('getParentDirectory')->will($this->returnValue('some#path'));
$directoryMock->expects($this->any())->method('isWritable')->will($this->returnValue(true));
$directoryMock->expects($this->any())->method('isFile')->will($this->returnValue(true));
$directoryMock->expects(
$this->any()
)->method(
'readFile'
)->will(
$this->returnValue('some string read from file')
);
$directoryMock->expects($this->once())->method('openFile')->will($this->returnValue($fileWrite));
$filesystemMock = $this->createPartialMock(\Magento\Framework\Filesystem::class, ['getDirectoryWrite']);
$filesystemMock->expects($this->once())->method('getDirectoryWrite')->will($this->returnValue($directoryMock));
$exportAdapter = new \Magento\ImportExport\Model\Export\Adapter\Csv($filesystemMock);
$this->model->setWriter($exportAdapter)->export();
}
/**
* Verify header columns (that stock item attributes column headers are present)
*
* @param array $headerColumns
*/
public function verifyHeaderColumns(array $headerColumns)
{
foreach (self::$stockItemAttributes as $stockItemAttribute) {
$this->assertContains(
$stockItemAttribute,
$headerColumns,
"Stock item attribute {$stockItemAttribute} is absent among header columns"
);
}
}
/**
* Verify row data (stock item attribute values)
*
* @param array $rowData
*/
public function verifyRow(array $rowData)
{
foreach (self::$stockItemAttributes as $stockItemAttribute) {
$this->assertNotSame(
'',
$rowData[$stockItemAttribute],
"Stock item attribute {$stockItemAttribute} value is empty string"
);
}
}
/**
* Verifies if exception processing works properly
* @magentoDbIsolation enabled
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_data.php
*/
public function testExceptionInGetExportData()
{
$this->markTestSkipped('Test needs to be skipped.');
$exception = new \Exception('Error');
$rowCustomizerMock =
$this->getMockBuilder(\Magento\CatalogImportExport\Model\Export\RowCustomizerInterface::class)
->disableOriginalConstructor()
->getMock();
$loggerMock = $this->getMockBuilder(\Psr\Log\LoggerInterface::class)->getMock();
$directoryMock = $this->createPartialMock(
\Magento\Framework\Filesystem\Directory\Write::class,
['getParentDirectory', 'isWritable']
);
$directoryMock->expects($this->any())->method('getParentDirectory')->will($this->returnValue('some#path'));
$directoryMock->expects($this->any())->method('isWritable')->will($this->returnValue(true));
$filesystemMock = $this->createPartialMock(\Magento\Framework\Filesystem::class, ['getDirectoryWrite']);
$filesystemMock->expects($this->once())->method('getDirectoryWrite')->will($this->returnValue($directoryMock));
$exportAdapter = new \Magento\ImportExport\Model\Export\Adapter\Csv($filesystemMock);
$rowCustomizerMock->expects($this->once())->method('prepareData')->willThrowException($exception);
$loggerMock->expects($this->once())->method('critical')->with($exception);
$collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\ResourceModel\Product\Collection::class
);
/** @var \Magento\CatalogImportExport\Model\Export\Product $model */
$model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\CatalogImportExport\Model\Export\Product::class,
[
'rowCustomizer' => $rowCustomizerMock,
'logger' => $loggerMock,
'collection' => $collection
]
);
$data = $model->setWriter($exportAdapter)->export();
$this->assertEmpty($data);
}
/**
* Verify if fields wrapping works correct when "Fields Enclosure" option enabled
*
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_data.php
*/
public function testExportWithFieldsEnclosure()
{
$this->model->setParameters([
\Magento\ImportExport\Model\Export::FIELDS_ENCLOSURE => 1
]);
$this->model->setWriter(
$this->objectManager->create(
\Magento\ImportExport\Model\Export\Adapter\Csv::class
)
);
$exportData = $this->model->export();
$this->assertContains('""Option 2""', $exportData);
$this->assertContains('""Option 3""', $exportData);
$this->assertContains('""Option 4 """"!@#$%^&*""', $exportData);
$this->assertContains('text_attribute=""!@#$%^&*()_+1234567890-=|\:;""""\'<,>.?/', $exportData);
}
/**
* Verify that "category ids" filter correctly applies to export result
*
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_with_categories.php
*/
public function testCategoryIdsFilter()
{
$this->model->setWriter(
$this->objectManager->create(
\Magento\ImportExport\Model\Export\Adapter\Csv::class
)
);
$this->model->setParameters([
\Magento\ImportExport\Model\Export::FILTER_ELEMENT_GROUP => [
'category_ids' => '2,13'
]
]);
$exportData = $this->model->export();
$this->assertContains('Simple Product', $exportData);
$this->assertContains('Simple Product Three', $exportData);
$this->assertNotContains('Simple Product Two', $exportData);
$this->assertNotContains('Simple Product Not Visible On Storefront', $exportData);
}
/**
* Test 'hide from product page' export for non-default store.
*
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_with_images.php
*/
public function testExportWithMedia()
{
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
$productRepository = $this->objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
$product = $productRepository->get('simple', 1);
$mediaGallery = $product->getData('media_gallery');
$image = array_shift($mediaGallery['images']);
$this->model->setWriter(
$this->objectManager->create(
\Magento\ImportExport\Model\Export\Adapter\Csv::class
)
);
$exportData = $this->model->export();
/** @var $varDirectory \Magento\Framework\Filesystem\Directory\WriteInterface */
$varDirectory = $this->objectManager->get(\Magento\Framework\Filesystem::class)
->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR);
$varDirectory->writeFile('test_product_with_image.csv', $exportData);
/** @var \Magento\Framework\File\Csv $csv */
$csv = $this->objectManager->get(\Magento\Framework\File\Csv::class);
$data = $csv->getData($varDirectory->getAbsolutePath('test_product_with_image.csv'));
foreach ($data[0] as $columnNumber => $columnName) {
if ($columnName === 'hide_from_product_page') {
self::assertSame($image['file'], $data[2][$columnNumber]);
}
}
}
/**
* @magentoDataFixture Magento/CatalogImportExport/_files/product_export_data.php
* @return void
*/
public function testExportWithCustomOptions(): void
{
$storeCode = 'default';
$expectedData = [];
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
$productRepository = $this->objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
$store = $this->objectManager->create(\Magento\Store\Model\Store::class);
$store->load('default', 'code');
/** @var \Magento\Catalog\Api\Data\ProductInterface $product */
$product = $productRepository->get('simple', 1, $store->getStoreId());
$newCustomOptions = [];
foreach ($product->getOptions() as $customOption) {
$defaultOptionTitle = $customOption->getTitle();
$secondStoreOptionTitle = $customOption->getTitle() . '_' . $storeCode;
$expectedData['admin_store'][$defaultOptionTitle] = [];
$expectedData[$storeCode][$secondStoreOptionTitle] = [];
$customOption->setTitle($secondStoreOptionTitle);
if ($customOption->getValues()) {
$newOptionValues = [];
foreach ($customOption->getValues() as $customOptionValue) {
$valueTitle = $customOptionValue->getTitle();
$expectedData['admin_store'][$defaultOptionTitle][] = $valueTitle;
$expectedData[$storeCode][$secondStoreOptionTitle][] = $valueTitle . '_' . $storeCode;
$newOptionValues[] = $customOptionValue->setTitle($valueTitle . '_' . $storeCode);
}
$customOption->setValues($newOptionValues);
}
$newCustomOptions[] = $customOption;
}
$product->setOptions($newCustomOptions);
$productRepository->save($product);
$this->model->setWriter(
$this->objectManager->create(\Magento\ImportExport\Model\Export\Adapter\Csv::class)
);
$exportData = $this->model->export();
/** @var $varDirectory \Magento\Framework\Filesystem\Directory\WriteInterface */
$varDirectory = $this->objectManager->get(\Magento\Framework\Filesystem::class)
->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR);
$varDirectory->writeFile('test_product_with_custom_options_and_second_store.csv', $exportData);
/** @var \Magento\Framework\File\Csv $csv */
$csv = $this->objectManager->get(\Magento\Framework\File\Csv::class);
$data = $csv->getData($varDirectory->getAbsolutePath('test_product_with_custom_options_and_second_store.csv'));
$customOptionData = [];
foreach ($data[0] as $columnNumber => $columnName) {
if ($columnName === 'custom_options') {
$customOptionData['admin_store'] = $this->parseExportedCustomOption($data[1][$columnNumber]);
$customOptionData[$storeCode] = $this->parseExportedCustomOption($data[2][$columnNumber]);
}
}
self::assertSame($expectedData, $customOptionData);
}
/**
* @param string $exportedCustomOption
* @return array
*/
private function parseExportedCustomOption(string $exportedCustomOption): array
{
$customOptions = explode('|', $exportedCustomOption);
$optionItems = [];
foreach ($customOptions as $customOption) {
$parsedOptions = array_values(
array_map(
function ($input) {
$data = explode('=', $input);
return [$data[0] => $data[1]];
},
explode(',', $customOption)
)
);
$optionName = array_column($parsedOptions, 'name')[0];
if (!empty(array_column($parsedOptions, 'option_title'))) {
$optionItems[$optionName][] = array_column($parsedOptions, 'option_title')[0];
} else {
$optionItems[$optionName] = [];
}
}
return $optionItems;
}
}
| kunj1988/Magento2 | dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php | PHP | gpl-2.0 | 16,617 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
9385,
1075,
17454,
13663,
1010,
4297,
1012,
2035,
2916,
9235,
1012,
1008,
2156,
24731,
1012,
19067,
2102,
2005,
6105,
4751,
1012,
1008,
1013,
3415,
15327,
17454,
13663,
1032,
12105,
5714,
64... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.