answer stringlengths 15 1.25M |
|---|
package generated.zcsclient.mail;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "<API key>")
public class <API key> {
} |
<!
Copyright (c) 2015 by Rafael Angel Aznar Aparici (rafaaznar at gmail dot com)
sisane: The stunning micro-library that helps you to develop easily
AJAX web applications by using Angular.js 1.x & sisane-server
sisane is distributed under the MIT License (MIT)
Sources at https://github.com/rafaelaznar/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
<div id="wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading" style="font-family:Oswald , serif;" ng-include="'js/system/header.html'"></div>
<div class="panel-body" ng-cloak>
<div class="row">
<div class="col-xs-12" ng-show="status">
<div class="alert alert-danger" role="alert">
<h3 class="bg-danger">{{status}}</h3>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12" ng-show="!status">
<div role="tabpanel">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a data-target="#pane0" aria-controls="pane0" role="tab" data-toggle="tab" aria-expanded="false">Consulta</a>
</li>
<li role="presentation"><a data-target="#pane1" aria-controls="pane1" role="tab" data-toggle="tab" aria-expanded="true">Campos visibles</a></li>
<li role="presentation"><a data-target="#pane2" aria-controls="pane2" role="tab" data-toggle="tab">Filtro de servidor</a></li>
<li role="presentation"><a data-target="#pane3" aria-controls="pane3" role="tab" data-toggle="tab">Filtro de cliente</a></li>
<li role="presentation"><a data-target="#pane4" aria-controls="pane4" role="tab" data-toggle="tab">Nuevo {{obtitle}}</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" id="pane0" class="tab-pane fade active in">
<p></p>
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-12">
<cplistinfo
ob="ob"
op="op"
numpage="numpage"
rpp="rpp"
registers="registers"
orderParams="orderParams"
filterParams="filterParams"
sfilterParams="sfilterParams"
searchText="searchText">
</cplistinfo>
</div>
<div class="col-lg-6 col-md-6 col-sm-8 text-center">
<cplistpagination
ob="ob"
op="op"
numpage="numpage"
rpp="rpp"
pages="pages"
neighbourhood="neighbourhood"
filterParams="filterParams"
orderParams="orderParams"
sfilterParams="sfilterParams">
</cplistpagination>
</div>
<div class="col-lg-3 col-md-3 col-sm-4 text-center">
<cplistrpp
ob="ob"
op="op"
numpage="numpage"
rpp="rpp"
filterParams="filterParams"
orderParams="orderParams"
sfilterParams="sfilterParams">
</cplistrpp>
</div>
</div>
<p></p>
</div>
<div role="tabpanel" id="pane1" class="tab-pane fade">
<div class="row">
<div class="col-md-12 text-center">
<p></p>
<cplistvisiblefields fields="fields"></cplistvisiblefields>
<p></p>
</div>
</div>
</div>
<div role="tabpanel" id="pane2" class="tab-pane fade">
<div class="row">
<div class="col-md-12">
<p></p>
<cplistfilter
ob="ob"
op="op"
fields="fields"
rpp="rpp"
numpage="numpage"
order="orderParams"
filter="filterParams"
sfilter="sfilterParams">
</cplistfilter>
</div>
</div>
</div>
<div role="tabpanel" id="pane3" class="tab-pane fade">
<div class="row">
<div class="col-md-12">
<p></p>
<form class="navbar-form navbar-right" role="form" action="Controller" method="post" id="empresaForm">
<input id="<API key>" class="form-control" name="filtervalue" type="text" size="20" maxlength="50" value="" width="100" style="width: 140px" placeholder="Valor" ng-model="searchText">
</form>
<p></p>
</div>
</div>
</div>
<div role="tabpanel" id="pane4" class="tab-pane fade">
<div class="row">
<div class="col-md-12 text-center">
<p><br>
<a class="btn btn-primary" href="{{ob}}/new">Crear un nuevo {{obtitle}}</a>
</p>
</div>
</div>
</div>
</div>
</div>
<div id="datos" ng-show="!status">
<table class="table table-responsive table-bordered table-hover table-striped table-condensed dataTable no-footer">
<thead plistheader></thead>
<tbody>
<tr ng-repeat="obj in page| filter:searchText">
<td ng-repeat="f in fields" ng-show="f.visible" class="text-right">
<div ng-show="f.visible && f.type == 'id'"><b>{{obj[f.name]}}</b></div>
<div ng-show="f.visible && f.type == 'date'" class="text-center">{{obj[f.name]}}</div>
<div ng-show="f.visible && f.type == 'integer'" class="text-center">{{obj[f.name]}}</div>
<div ng-show="f.visible && f.type == 'decimal'" class="text-center">{{obj[f.name]}}</div>
<div ng-show="f.visible && f.type == 'text'" class="text-left">{{obj[f.name]|clipString}}</div>
<div ng-show="f.visible && f.type == 'boolean'" class="text-center" ng-bind-html="obj[f.name] | booleanizate"></div>
<div ng-show="f.visible && f.name == 'obj_tipodiagnostico'" class="text-center"><a href="tipodiagnostico/view/{{obj.obj_tipodiagnostico.id}}">{{obj.obj_tipodiagnostico.descripcion}}</a></div>
<div ng-show="f.visible && f.name == 'obj_episodio'" class="text-center"><a href="episodio/view/{{obj.obj_episodio.id}}">{{obj.obj_episodio.informe|clipString}}</a></div>
<!
</td>
<td>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group">
<a class="btn btn-default btn-xs" href="{{ob}}/view/{{obj.id}}">
<span class="glyphicon glyphicon-eye-open"></span>
</a>
<a class="btn btn-default btn-xs" ng-click="pop(obj.id, 'diagnostico', '<API key>', 'viewpop')">
<span class="glyphicon glyphicon-eye-open"></span>
</a>
<a class="btn btn-default btn-xs" href="{{ob}}/edit/{{obj.id}}">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<a class="btn btn-default btn-xs" href="{{ob}}/remove/{{obj.id}}">
<span class="glyphicon glyphicon-remove"></span>
</a>
<a class="btn btn-default btn-xs" ng-click="pop(obj.id, 'diagnostico', '<API key>', 'removepop')">
<span class="glyphicon glyphicon-remove"></span>
</a>
<a class="btn btn-default btn-xs" href="tratamiento/plist/1/10?sfilter=and,id_diagnostico,equa,{{obj.id}}">
<span class="glyphicon <API key>"></span>
</a>
<manytomany iconbootstrap="glyphicon-plus" id="obj.id" referencetable="tableinfo" table="ob"></manytomany>
</div>
</div>
</td>
</tr>
<!
<tr ng-repeat="obj in page| filter:searchText">
<td ng-show="fields[0].visible" class="text-right">{{obj.id}}</td>
<td ng-show="fields[1].visible">{{obj.name}}</td>
<td ng-show="fields[2].visible">{{obj.surname}}</td>
<td ng-show="fields[3].visible">{{obj.login}}</td>
<td ng-show="fields[4].visible">{{obj.password}}</td>
<td ng-show="fields[5].visible">{{obj.address}}</td>
<td ng-show="fields[6].visible">{{obj.city}}</td>
<td ng-show="fields[7].visible">{{obj.zip}}</td>
<td ng-show="fields[8].visible">{{obj.state}}</td>
<td ng-show="fields[9].visible">{{obj.country}}</td>
<td ng-show="fields[10].visible">{{obj.email}}</td>
<td ng-show="fields[11].visible">{{obj.phone}}</td>
<td ng-show="fields[12].visible"><a href="#/usertype/view/{{obj.obj_usertype.id}}">{{obj.obj_usertype.description}}</a></td>
<td>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group">
<a class="btn btn-default btn-xs" href="#/{{ob}}/view/{{obj.id}}">
<span class="glyphicon glyphicon-eye-open"></span>
</a>
<a class="btn btn-default btn-xs" ng-click="pop(obj.id, 'user', '<API key>', 'viewpop')">
<span class="glyphicon glyphicon-eye-open"></span>
</a>
<a class="btn btn-default btn-xs" href="#/{{ob}}/edit/{{obj.id}}">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<a class="btn btn-default btn-xs" href="#/{{ob}}/remove/{{obj.id}}">
<span class="glyphicon glyphicon-remove"></span>
</a>
<a class="btn btn-default btn-xs" ng-click="pop(obj.id, 'user', '<API key>', 'removepop')">
<span class="glyphicon glyphicon-remove"></span>
</a>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="panel-footer" style="font-family: Questrial, serif;" ng-include="'js/system/footer.html'"></div>
</div>
</div>
</div>
</div>
</div> |
body {
font-family: 'Lora', 'Times New Roman', serif;
font-size: 20px;
color: #333333;
}
p {
line-height: 1.5;
margin: 30px 0;
}
p a {
text-decoration: underline;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 800;
}
a {
color: #333333;
}
a:hover,
a:focus {
color: #0085A1;
}
a img:hover,
a img:focus {
cursor: zoom-in;
}
blockquote {
color: #777777;
font-style: italic;
}
hr.small {
max-width: 100px;
margin: 15px auto;
border-width: 4px;
border-color: white;
}
.navbar-custom {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 3;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.navbar-custom .navbar-brand {
font-weight: 800;
}
.navbar-custom .navbar-header .navbar-toggle {
color: #777777;
font-weight: 800;
text-transform: uppercase;
font-size: 12px;
}
.navbar-custom .nav li a {
text-transform: uppercase;
font-size: 12px;
font-weight: 800;
letter-spacing: 1px;
}
@media only screen and (min-width: 768px) {
.navbar-custom {
background: transparent;
border-bottom: 1px solid transparent;
}
.navbar-custom .navbar-brand {
color: white;
padding: 20px;
}
.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-brand:focus {
color: rgba(255, 255, 255, 0.8);
}
.navbar-custom .nav li a {
color: white;
padding: 20px;
}
.navbar-custom .nav li a:hover,
.navbar-custom .nav li a:focus {
color: rgba(255, 255, 255, 0.8);
}
}
@media only screen and (min-width: 1170px) {
.navbar-custom {
-webkit-transition: background-color 0.3s;
-moz-transition: background-color 0.3s;
transition: background-color 0.3s;
/* Force Hardware Acceleration in WebKit */
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-<API key>: hidden;
backface-visibility: hidden;
}
.navbar-custom.is-fixed {
/* when the user scrolls down, we hide the header right above the viewport */
position: fixed;
top: -61px;
background-color: rgba(255, 255, 255, 0.9);
border-bottom: 1px solid #f2f2f2;
-webkit-transition: -webkit-transform 0.3s;
-moz-transition: -moz-transform 0.3s;
transition: transform 0.3s;
}
.navbar-custom.is-fixed .navbar-brand {
color: #333333;
}
.navbar-custom.is-fixed .navbar-brand:hover,
.navbar-custom.is-fixed .navbar-brand:focus {
color: #0085A1;
}
.navbar-custom.is-fixed .nav li a {
color: #333333;
}
.navbar-custom.is-fixed .nav li a:hover,
.navbar-custom.is-fixed .nav li a:focus {
color: #0085A1;
}
.navbar-custom.is-visible {
/* if the user changes the scrolling direction, we show the header */
-webkit-transform: translate3d(0, 100%, 0);
-moz-transform: translate3d(0, 100%, 0);
-ms-transform: translate3d(0, 100%, 0);
-o-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
}
}
.intro-header {
background-color: #777777;
background: no-repeat center center;
<API key>: scroll;
-<API key>: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
margin-bottom: 50px;
}
.intro-header .site-heading,
.intro-header .post-heading,
.intro-header .page-heading {
padding: 100px 0 50px;
color: white;
}
@media only screen and (min-width: 768px) {
.intro-header .site-heading,
.intro-header .post-heading,
.intro-header .page-heading {
padding: 150px 0;
}
}
.intro-header .site-heading,
.intro-header .page-heading {
text-align: center;
}
.intro-header .site-heading h1,
.intro-header .page-heading h1 {
margin-top: 0;
font-size: 50px;
}
.intro-header .site-heading .subheading,
.intro-header .page-heading .subheading {
font-size: 24px;
line-height: 1.1;
display: block;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 300;
margin: 10px 0 0;
}
@media only screen and (min-width: 768px) {
.intro-header .site-heading h1,
.intro-header .page-heading h1 {
font-size: 80px;
}
}
.intro-header .post-heading h1 {
font-size: 35px;
}
.intro-header .post-heading .subheading,
.intro-header .post-heading .meta {
line-height: 1.1;
display: block;
}
.intro-header .post-heading .subheading {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 24px;
margin: 10px 0 30px;
font-weight: 600;
}
.intro-header .post-heading .meta {
font-family: 'Lora', 'Times New Roman', serif;
font-style: italic;
font-weight: 300;
font-size: 20px;
}
.intro-header .post-heading .meta a {
color: white;
}
@media only screen and (min-width: 768px) {
.intro-header .post-heading h1 {
font-size: 55px;
}
.intro-header .post-heading .subheading {
font-size: 30px;
}
}
.post-preview > a {
color: #333333;
}
.post-preview > a:hover,
.post-preview > a:focus {
text-decoration: none;
color: #0085A1;
}
.post-preview > a > .post-title {
font-size: 30px;
margin-top: 30px;
margin-bottom: 10px;
}
.post-preview > a > .post-subtitle {
margin: 0;
font-weight: 300;
margin-bottom: 10px;
}
.post-preview > .post-meta {
color: #777777;
font-size: 18px;
font-style: italic;
margin-top: 0;
}
.post-preview > .post-meta > a {
text-decoration: none;
color: #333333;
}
.post-preview > .post-meta > a:hover,
.post-preview > .post-meta > a:focus {
color: #0085A1;
text-decoration: underline;
}
@media only screen and (min-width: 768px) {
.post-preview > a > .post-title {
font-size: 36px;
}
}
.section-heading {
text-align: left;
font-size: 36px;
margin-top: 60px;
font-weight: 700;
}
.caption {
text-align: center;
font-size: 14px;
padding: 10px;
font-style: italic;
margin: 0;
display: block;
<API key>: 5px;
<API key>: 5px;
}
footer {
padding: 50px 0 65px;
}
footer .list-inline {
margin: 0;
padding: 0;
}
footer .copyright {
font-size: 14px;
text-align: center;
margin-bottom: 0;
}
.<API key> {
font-size: 14px;
position: relative;
margin-bottom: 0;
padding-bottom: 0.5em;
border-bottom: 1px solid #eeeeee;
}
.<API key> input,
.<API key> textarea {
z-index: 1;
position: relative;
padding-right: 0;
padding-left: 0;
border: none;
border-radius: 0;
font-size: 1.5em;
background: none;
box-shadow: none !important;
resize: none;
}
.<API key> label {
display: block;
z-index: 0;
position: relative;
top: 2em;
margin: 0;
font-size: 0.85em;
line-height: 1.764705882em;
vertical-align: middle;
vertical-align: baseline;
opacity: 0;
-webkit-transition: top 0.3s ease,opacity 0.3s ease;
-moz-transition: top 0.3s ease,opacity 0.3s ease;
-ms-transition: top 0.3s ease,opacity 0.3s ease;
transition: top 0.3s ease,opacity 0.3s ease;
}
.<API key>::not(:first-child) {
padding-left: 14px;
border-left: 1px solid #eeeeee;
}
.<API key> label {
top: 0;
opacity: 1;
}
.<API key> label {
color: #0085A1;
}
form .row:first-child .<API key> {
border-top: 1px solid #eeeeee;
}
.btn {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
text-transform: uppercase;
font-size: 14px;
font-weight: 800;
letter-spacing: 1px;
border-radius: 0;
padding: 15px 25px;
}
.btn-lg {
font-size: 16px;
padding: 25px 35px;
}
.btn-default:hover,
.btn-default:focus {
background-color: #0085A1;
border: 1px solid #0085A1;
color: white;
}
.pager {
margin: 20px 0 0;
}
.pager li > a,
.pager li > span {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
text-transform: uppercase;
font-size: 14px;
font-weight: 800;
letter-spacing: 1px;
padding: 15px 25px;
background-color: white;
border-radius: 0;
}
.pager li > a:hover,
.pager li > a:focus {
color: white;
background-color: #0085A1;
border: 1px solid #0085A1;
}
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
color: #777777;
background-color: #333333;
cursor: not-allowed;
}
::-moz-selection {
color: white;
text-shadow: none;
background: #0085A1;
}
::selection {
color: white;
text-shadow: none;
background: #0085A1;
}
img::selection {
color: white;
background: transparent;
}
img::-moz-selection {
color: white;
background: transparent;
}
body {
-<API key>: #0085A1;
} |
using System.Collections.Generic;
namespace Manatee.Trello.Json
{
<summary>
Defines the JSON structure for the BoardBackground object.
</summary>
public interface <API key> : IJsonCacheable, IAcceptId
{
<summary>
Gets or sets the bottom color of a gradient background.
</summary>
string BottomColor { get; set; }
<summary>
Gets the overall brightness of the background.
</summary>
<API key>? Brightness { get; set; }
<summary>
Gets or sets the color.
</summary>
[JsonDeserialize]
[JsonSerialize]
string Color { get; set; }
<summary>
Gets or sets the url for the image.
</summary>
[JsonDeserialize]
[JsonSerialize]
string Image { get; set; }
<summary>
Gets or sets a collection of scaled images.
</summary>
[JsonDeserialize]
[JsonSerialize]
List<IJsonImagePreview> ImageScaled { get; set; }
<summary>
Gets or sets whether the image should be tiled when displayed.
</summary>
[JsonDeserialize]
[JsonSerialize]
bool? Tile { get; set; }
<summary>
Gets or sets the top color of a gradient background.
</summary>
string TopColor { get; set; }
<summary>
Gets or sets the type of background.
</summary>
BoardBackgroundType? Type { get; set; }
}
} |
from nose.tools import *
from Loggers import SearchLogger
from <TwitterConsumerkey> import *
from DaoMocks import *
from TwitterMocks import *
from ObserverMocks import *
import unittest
class SearchTest(unittest.TestCase):
def setUp(self):
self.object = Search()
self.redis = RedisDaoMock()
self.couch = CouchDaoMock()
self.logger = SearchLogger()
self.observer = ISearchObserverMock()
def tearDown(self):
self.object = ''
self.redis = ''
self.couch = ''
self.observer = ''
def <API key>(self):
self.object.attach_observer(self.observer)
self.assertTrue(len(self.object._observers), 1)
def <API key>(self):
# TODO check with multiple observers that correct one removed
self.object._observers.append(self.observer)
self.assertEquals(len(self.object._observers), 1)
self.object.detach_observer(self.observer)
self.assertEquals(len(self.object._observers), 0)
def <API key>(self):
self.object._observers.append({'kind': 'housecat'})
with self.assertRaises(ObserverError):
self.object.detach_observer(self.observer)
def <API key>(self):
# TODO try with multiple observers
# setup
self.object._observers.append(self.observer)
self.assertFalse(self.observer.update_called)
# test
self.object.notify_observers()
self.assertTrue(self.observer.update_called)
self.assertEquals(self.observer.caller, self.object)
def <API key>(self):
self.object.set_redis_service(self.redis)
self.assertEquals(self.object.redis, self.redis)
def <API key>(self):
self.object.set_couch_service(self.couch)
self.assertEquals(self.object.couch, self.couch)
def test_set_logger(self):
self.object.set_logger(self.logger)
self.assertEquals(self.object.logger, self.logger)
def test_set_<TwitterConsumerkey>(self):
self.object.set_<TwitterConsumerkey>(login)
self.assertIsInstance(self.object.twitter_conn, TwitterMock)
def <API key>(self):
tweetid = 123456789
self.redis.set_response(tweetid)
self.object.set_redis_service(self.redis)
result = self.object._get_oldest_tweet()
self.assertEqual(result, tweetid)
def <API key>(self):
tweetid = 123456789
self.redis.set_response(tweetid)
self.object.set_redis_service(self.redis)
result = self.object._get_newest_tweet()
self.assertEqual(result, tweetid)
def <API key>(self):
tweetid = 123456789
self.redis.set_response(tweetid)
self.object.set_redis_service(self.redis)
result = self.object._get_starting_tweet(True)
self.assertEqual(result, tweetid)
# false case
tweetid2 = 1234566543
self.redis.set_response(tweetid2)
self.object.set_redis_service(self.redis)
result = self.object._get_starting_tweet(False)
self.assertEqual(result, tweetid2)
# Null recent case
tweetid = 123456789
self.redis.set_response(tweetid)
self.object.set_redis_service(self.redis)
result = self.object._get_starting_tweet('')
self.assertEqual(result, None)
def <API key>(self):
bad = 12234
good = 1234567
tweet = {'id_str': good, '_id': bad}
result = self.object._handle_id_field(tweet)
self.assertEqual(result, {'id_str': good, '_id': good})
def <API key>(self):
tag = 'testtag'
limittweet = 987665
self.object.set_<TwitterConsumerkey>(login)
self.object.limitTweet = limittweet
result = self.object._search_twitter(tag, True)
self.assertEqual(result[0], {'query': tag, 'count': 100, 'since_id': limittweet, 'max_id': None})
result = self.object._search_twitter(tag, False)
self.assertEqual(result[0], {'query': tag, 'count': 100, 'since_id': None, 'max_id': limittweet})
def <API key>(self):
bad = 12234
good = 1234567
tweet1 = {'id_str': good, '_id': bad}
tweet2 = {'id_str': good, '_id': bad}
goodtweet = {'id_str': good, '_id': good}
search_results = {'crap': ['sltuff'], 'statuses': [tweet1, tweet2]}
result = self.object.<API key>(search_results)
self.assertEquals(result, [goodtweet, goodtweet])
# def <API key>(self):
# search_results = {'taco': 78}
# with self.assertRaises(SearchError):
# self.object.<API key>(search_results)
if __name__ == '__main__':
unittest.main() |
//! \file ImageFCB.cs
//! \date Thu Aug 11 04:21:02 2016
//! \brief Caramel BOX compressed image format.
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// all copies or substantial portions of the Software.
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
using System.ComponentModel.Composition;
using System.IO;
using System.Windows.Media;
using GameRes.Compression;
using GameRes.Utility;
namespace GameRes.Formats.CaramelBox
{
internal class FcbMetaData : ImageMetaData
{
public int Method;
}
[Export(typeof(ImageFormat))]
public class FcbFormat : ImageFormat
{
public override string Tag { get { return "FCB"; } }
public override string Description { get { return "Caramel BOX image format"; } }
public override uint Signature { get { return 0x31626366; } } // 'fcb1'
public override ImageMetaData ReadMetaData (IBinaryStream stream)
{
var header = stream.ReadHeader (0x10);
return new FcbMetaData
{
Width = header.ToUInt32 (4),
Height = header.ToUInt32 (8),
Method = header.ToInt32 (12),
BPP = 32,
};
}
public override ImageData Read (IBinaryStream stream, ImageMetaData info)
{
var meta = (FcbMetaData)info;
byte[] input;
if (1 == meta.Method)
{
stream.Position = 0x14;
int unpacked_size = Binary.BigEndian (stream.ReadInt32());
stream.ReadInt32(); // packed_size
input = new byte[unpacked_size];
using (var z = new ZLibStream (stream.AsStream, CompressionMode.Decompress, true))
if (unpacked_size != z.Read (input, 0, unpacked_size))
throw new <API key>();
}
else if (0 == meta.Method)
{
stream.Position = 0x10;
using (var tz = new TzCompression (stream.AsStream))
input = tz.Unpack();
}
else
throw new <API key>();
var pixels = Unpack (input, info);
return ImageData.Create (info, PixelFormats.Bgra32, null, pixels);
}
public override void Write (Stream file, ImageData image)
{
throw new System.<API key> ("FcbFormat.Write not implemented");
}
byte[] Unpack (byte[] input, ImageMetaData info)
{
byte[] ref_pixel = { 0x80, 0x80, 0x80, 0xFF };
var pixel = new byte[4];
var delta = new int[4];
var output = new byte[info.Width * info.Height * 4];
int src = 0;
int dst = 0;
for (uint y = 0; y < info.Height; ++y)
{
pixel[0] = ref_pixel[0];
pixel[1] = ref_pixel[1];
pixel[2] = ref_pixel[2];
pixel[3] = ref_pixel[3];
for (uint x = 0; x < info.Width; ++x)
{
int v = input[src++];
if (0 != (v & 0x80))
{
if (0 != (v & 0x40))
{
if (0 != (v & 0x20))
{
if (0 != (v & 0x10))
{
if (0 != (v & 0x08))
{
if (v == 0xFE)
{
delta[0] = input[src++] - 128;
delta[1] = input[src++] - 128;
delta[2] = input[src++] - 128;
delta[3] = 0;
}
else
{
delta[0] = input[src++] - 128;
delta[1] = input[src++] - 128;
delta[2] = input[src++] - 128;
delta[3] = input[src++] - 128;
}
}
else
{
v = input[src++] | v << 8;
v = input[src++] | v << 8;
v = input[src++] | v << 8;
delta[0] = ((v >> 20) & 0x7F) - 64;
delta[1] = ((v >> 14) & 0x3F) - 32;
delta[2] = ((v >> 8) & 0x3F) - 32;
delta[3] = v - 128;
}
}
else
{
v = input[src++] | v << 8;
v = input[src++] | v << 8;
delta[0] = ((v >> 14) & 0x3F) - 32;
delta[1] = ((v >> 10) & 0x0F) - 8;
delta[2] = ((v >> 6) & 0x0F) - 8;
delta[3] = (v & 0x3F) - 32;
}
}
else
{
v = input[src++] | v << 8;
v = input[src++] | v << 8;
delta[0] = ((v >> 13) & 0xFF) - 128;
delta[1] = ((v >> 7) & 0x3F) - 32;
delta[2] = (v & 0x7F) - 64;
delta[3] = 0;
}
}
else
{
v = input[src++] | v << 8;
delta[0] = ((v >> 8) & 0x3F) - 32;
delta[1] = ((v >> 4) & 0x0F) - 8;
delta[2] = (v & 0xf) - 8;
delta[3] = 0;
}
}
else
{
delta[0] = ((v >> 4) & 7) - 4;
delta[1] = ((v >> 2) & 3) - 2;
delta[2] = (v & 3) - 2;
delta[3] = 0;
}
pixel[0] += (byte)(delta[0] + delta[1]);
pixel[1] += (byte)delta[0];
pixel[2] += (byte)(delta[0] + delta[2]);
pixel[3] += (byte)delta[3];
output[dst++] = pixel[0];
output[dst++] = pixel[1];
output[dst++] = pixel[2];
output[dst++] = pixel[3];
if (0 == x)
{
ref_pixel[0] = pixel[0];
ref_pixel[1] = pixel[1];
ref_pixel[2] = pixel[2];
ref_pixel[3] = pixel[3];
}
}
}
return output;
}
}
} |
'use strict';
let Observable = require('data/observable').Observable;
class AccountViewModel extends Observable {
constructor() {
super();
this.title = 'Account';
}
}
module.exports = {
AccountViewModel: AccountViewModel,
defaultInstance: new AccountViewModel()
}; |
layout: default
title: "404: Page not found"
permalink: 404.html
<div class="page">
<h1 class="page-title">404: Page not found</h1>
<p class="lead">
<h1>404 error</h1>
<a href="{{ site.baseurl }}"></a>
</p>
</div> |
(function() {
'use strict';
angular
.module('plagUiApp')
.controller('<API key>', <API key>);
<API key>.$inject = ['$stateParams', 'Auth', 'LoginService'];
function <API key> ($stateParams, Auth, LoginService) {
var vm = this;
Auth.activateAccount({key: $stateParams.key}).then(function () {
vm.error = null;
vm.success = 'OK';
}).catch(function () {
vm.success = null;
vm.error = 'ERROR';
});
vm.login = LoginService.open;
}
})(); |
class Person
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Versioning
# include Mongoid::Paranoia
extend Mongorder
attr_accessor :relationship
field :name_pfx, type: String, default: ""
field :name_first, type: String
field :name_middle, type: String, default: ""
field :name_last, type: String
field :name_sfx, type: String, default: ""
field :name_full, type: String
field :alternate_name, type: String, default: ""
field :updated_by, type: String, default: "system_service"
field :job_title, type: String, default: ""
field :department, type: String, default: ""
field :is_active, type: Boolean, default: true
# We've moved to a many-to-many
# field :family, type: Moped::BSON::ObjectId
# TODO: reference authority member by Mongo ID
# field :family, type: Moped::BSON::ObjectId
field :authority_member_id, type: String, default: nil
index({"authority_member_id" => 1})
# field :auth_member, type: Moped::BSON::ObjectId
# index({auth_member: 1})
before_create :<API key>
before_save :<API key>
before_save :<API key>
<API key> :name_first, :name_last
index({name_last: 1})
index({name_first: 1})
index({name_last:1, name_first: 1})
index({name_first: 1, name_last:1})
index({name_first: 1, name_last:1, "members.dob"=> 1})
index({name_last:1, name_first: 1, "members.dob" => 1})
index({name_first: 1, name_last:1, "emails.email_address" => 1})
index({name_last: 1, name_first:1, "emails.email_address" => 1})
index({"emails.email_address" => 1})
#TODO - create authority member index (use Mongo indexing method that expects many empty values)
# <API key> :employers, class_name: "Employer", inverse_of: :employees
belongs_to :employer, class_name: "Employer", inverse_of: :employees, index: true
embeds_many :addresses, :inverse_of => :person
<API key> :addresses, reject_if: proc { |attribs| attribs['address_1'].blank? }, allow_destroy: true
embeds_many :phones, :inverse_of => :person
<API key> :phones, reject_if: proc { |attribs| attribs['phone_number'].blank? }, allow_destroy: true
embeds_many :emails, :inverse_of => :person
<API key> :emails, reject_if: proc { |attribs| attribs['email_address'].blank? }, allow_destroy: true
# embeds_many :members, after_add: :<API key>
embeds_many :members, cascade_callbacks: true
embeds_many :<API key>
<API key> :<API key>
embeds_many :responsible_parties
# <API key> :responsible_parties, reject_if: :all_blank, allow_destroy: true
embeds_many :comments
<API key> :comments, reject_if: proc { |attribs| attribs['content'].blank? }, allow_destroy: true
index({"members.hbx_member_id" =>1})
index({"members.ssn" => 1})
index({"members.dob" => 1})
<API key> :members, reject_if: :all_blank, allow_destroy: true
scope :<API key>, ->{ gt(:'members.dob' => (Date.today - 26.years))}
scope :<API key>, ->{lte(:'members.dob' => (Date.today - 26.years))}
# TODO: Add scope that accepts age range
# scope :<API key>, ->(range) {}
scope :<API key>, ->(age) {lte(:'members.dob' => (Date.today - age.years))}
scope :<API key>, ->(age) {gte(:'members.dob' => (Date.today - age.years))}
scope :<API key>, exists({ :'members.1' => true })
scope :by_name, order_by(name_last: 1, name_first: 1)
def families
Family.where(:family_members.person_id => self.id).to_a
end
def <API key>(props = {})
old_record = self.find(self.id)
self.assign_attributes(props)
delta = self.<API key>
return false unless self.valid?
# As long as we call right here, whatever needs to be notified,
# with the following three arguments:
# - the old record
# - the properties to update ("props")
# - the delta ("delta")
# We have everything we need to construct whatever messages care about that data.
# E.g. (again, ignore the naming as it is terrible)
#Protocols::Notifier.update_notification(old_record, props, delta)
Protocols::Notifier.update_notification(old_record, delta) #The above statement was giving error with 3 params
# Then we proceed normally
self.update_attributes(props)
end
def is_authoritative?
self.members.any?{|m| m.authority?}
end
def is_authority_member?(m_id)
return true if self.members.length < 2
m_id == self.authority_member_id
end
def <API key>
self.members.each do |m|
Policy.<API key>(m.hbx_member_id).each do |pol|
self.policies << pol
self.employers << pol.employer
self.brokers << pol.broker
end
end
save!
end
def self.find_for_members(member_ids)
Queries::PersonMemberQuery.new(member_ids).execute
end
def self.<API key>
# Return set of People > 26 years old and listed on policies as child relationship code
Person.<API key>.find_all { |p| p.<API key>? }
end
def <API key>?
members.any? { |m| m.<API key>.size > 0 }
end
def <API key>
errors.add(:base, "members may not be deleted if they are the authority") if (members.any? { |m| m.authority && !m.deleted_at.blank? } )
end
def <API key>
members.each do |m|
Rails.cache.delete("Person/find/members.hbx_member_id.#{m.hbx_member_id}")
end
true
end
def self.<API key>
[
["name_last", 1],
["name_first", 1]
]
end
def self.search_hash(s_str)
clean_str = s_str.strip
s_rex = Regexp.new(Regexp.escape(clean_str), true)
additional_exprs = []
if clean_str.include?(" ")
parts = clean_str.split(" ").compact
first_re = Regexp.new(Regexp.escape(parts.first), true)
last_re = Regexp.new(Regexp.escape(parts.last), true)
additional_exprs << {:name_first => first_re, :name_last => last_re}
end
{
"$or" => ([
{"name_first" => s_rex},
{"name_middle" => s_rex},
{"name_last" => s_rex},
{"members.hbx_member_id" => s_rex},
{"members.ssn" => s_rex}
] + additional_exprs)
}
end
def self.match_for_ssn(m_ssn, nf, nl, d_of_b)
Queries::ExistingPersonQuery.new(m_ssn, nf, d_of_b).find
end
def self.find_for_member_id(m_id)
Queries::PersonByHbxIdQuery.new(m_id).execute
end
def policies
query_proxy.policies
end
def authority_member=(hbx_id)
self.authority_member_id = hbx_id
self.authority_member
end
def authority_member
return self.members.first if members.length < 2
members.detect { |m| m.hbx_member_id == self.authority_member_id }
end
def full_name
[name_pfx, name_first, name_middle, name_last, name_sfx].reject(&:blank?).join(' ').downcase.gsub(/\b\w/) {|first| first.upcase }
end
def merge_member(m_member)
found_member = self.members.detect { |m| m.hbx_member_id == m_member.hbx_member_id }
if !found_member.nil?
found_member.merge_member(m_member)
else
self.members << m_member
#<API key> #Don't allow merge to wipe authority member id's
end
end
def <API key>
self.authority_member_id = (self.members.length > 1) ? nil : self.members.first.hbx_member_id
end
def merge_address(m_address)
unless (self.addresses.any? { |p| p.match(m_address) })
self.addresses << m_address
end
end
def update_address(m_address)
existing_address = self.addresses.select { |p| p.address_type == m_address.address_type }
existing_address.each do |ep|
self.addresses.delete(ep)
end
self.addresses << m_address
self.touch
end
def remove_phone_of(phone_type)
existing_phone = self.phones.select { |p| p.phone_type == phone_type }
existing_phone.each do |em|
self.phones.delete(em)
end
self.touch
end
def remove_email_of(email_type)
existing_email = self.emails.select { |p| p.email_type == email_type }
existing_email.each do |em|
self.emails.delete(em)
end
self.touch
end
def remove_address_of(address_type)
existing_address = self.addresses.select { |p| p.address_type == address_type }
existing_address.each do |em|
self.addresses.delete(em)
end
self.touch
end
def merge_email(m_email)
unless (self.emails.any? { |p| p.match(m_email) })
self.emails << m_email
end
end
def update_email(m_email)
existing_email = self.emails.select { |p| p.email_type == m_email.email_type }
existing_email.each do |ep|
self.emails.delete(ep)
end
self.emails << m_email
self.touch
end
def merge_phone(m_phone)
unless (self.phones.any? { |p| p.match(m_phone) })
self.phones << m_phone
end
end
def update_phone(m_phone)
existing_phones = self.phones.select { |p| p.phone_type == m_phone.phone_type }
existing_phones.each do |ep|
self.phones.delete(ep)
end
self.phones << m_phone
self.touch
end
# Assimilate person doc into this instance
def merge(person_id)
end
# Extract list of members into new, separate Person doc
def split(member_id_list)
end
def unsafe_save!
Person.skip_callback(:save, :before, :revise)
save(validate: false)
Person.set_callback(:save, :before, :revise)
end
def addresses_match?(other_person)
my_home_addresses = addresses.select(&:home?)
<API key> = other_person.addresses.select(&:home?)
return(false) if (my_home_addresses.length != <API key>.length)
my_home_addresses.all? do |m_addy|
<API key>.any? { |o_addy| o_addy.match(m_addy) }
end
end
def home_address
addresses.detect { |adr| adr.address_type == "home" }
end
def mailing_address
addresses.detect { |adr| adr.address_type == "mailing"} || home_address
end
def home_phone
phones.detect { |adr| adr.phone_type == "home" }
end
def home_email
emails.detect { |adr| adr.email_type == "home" }
end
def <API key>
self.name_full = full_name
end
def <API key>?
associated_ids = <API key>
return(true) if associated_ids.length < 2
Person.find(associated_ids).combination(2).all? do |addr_set|
addr_set.first.addresses_match?(addr_set.last)
end
end
def active_policies
Policy.<API key>(self.members.map(&:hbx_member_id), Date.today, Date.today)
end
def <API key>
<API key> = []
member_ids = self.members.map(&:hbx_member_id)
member_ids.each do |member_id|
<API key>.concat(policies.select { |p| p.future_active_for?(member_id) })
end
<API key>
end
def <API key>
other_ids = policies.map(&:enrollees).flatten.map(&:person).map(&:_id)
([self._id] + other_ids).uniq
end
def families
query_proxy.families
end
def <API key>
group = families.first
group.<API key>.select { |r| r.object_person == id }
end
def employee_roles
<API key> = policies.select { |p| !p.employer_id.nil? && !p.canceled? }
enrollees = []
<API key>.each do |p|
enrollees << p.enrollees.detect { |e| self.members.map(&:hbx_member_id).include?(e.m_id) }
end
enrollees
end
def billing_address
billing_addr = addresses.detect { |adr| adr.address_type == "billing" }
if (billing_addr.nil?)
home_address
else
billing_addr
end
end
def address_of(location)
addresses.detect { |a| a.address_type == location }
end
def self.find_by_id(id)
where(id: id).first
end
def self.find_by_member_id(member_id)
Person.find_for_members([member_id]).first
end
def set_address(new_address)
address_collection = self.addresses.reject { |p| p.address_type == new_address.address_type }
full_addresses = address_collection + (new_address.nil? ? [] : [new_address])
self.addresses = full_addresses
self.touch
end
def set_phone(new_phone)
phone_collection = self.phones.reject { |p| p.phone_type == new_phone.phone_type}
full_phones = phone_collection + [new_phone]
self.phones = full_phones
self.touch
end
def set_email(new_email)
email_collection = self.emails.reject { |p| p.email_type == new_email.email_type }
full_emails = email_collection + [new_email]
self.emails = full_emails
self.touch
end
def merge_relationship(new_rel)
old_relationships = self.<API key>.select do |rel|
rel.relative_id == new_rel.relative_id
end
old_relationships.each do |old_rel|
self.<API key>.delete(old_rel)
end
relationship = self.<API key>.build({relative: new_rel.relative, kind: new_rel.kind})
relationship.save
self.save
self.touch
self.reload
end
def <API key>(other_person)
relationship = <API key>.detect do |person_relationship|
person_relationship.relative_id == other_person.id
end
if relationship
return relationship.kind
else
return nil
end
end
private
def <API key>
self.authority_member = members.first.hbx_member_id if members.count == 1
end
def query_proxy
@query_proxy ||= Queries::PersonAssociations.new(self)
end
end |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ms_MY" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About EverGreenCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>EverGreenCoin</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 © 2015-2017 The EverGreenCoin 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:
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http:
<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>Klik dua kali untuk mengubah alamat atau label</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Cipta alamat baru</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Salin alamat terpilih ke dalam sistem papan klip</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your EverGreenCoin 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 an EverGreenCoin 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 EverGreenCoin 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>&Padam</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>Fail yang dipisahkan dengan koma</translation>
</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>Alamat</translation>
</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 password</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>Unlock for staking only (not sending).</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new password 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 password to unlock your EverGreenCoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Unlock EverGreenCoin</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 password</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new password 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>EverGreenCoin 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 your EverGreenCoin balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Browse your EverGreenCoin 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 your stored EverGreenCoin 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 your list of EverGreenCoin 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 EverGreenCoin</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>Pilihan</translation>
</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></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 EverGreenCoins to an EverGreenCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Modify configuration options for EverGreenCoin</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>EverGreenCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+180"/>
<source>&About EverGreenCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Unlock EverGreenCoin</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>EverGreenCoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+75"/>
<source>%n active connection(s) to the EverGreenCoin network</source>
<translation type="unfinished"><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></translation>
</message>
<message>
<location line="-312"/>
<source>About EverGreenCoin card</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about EverGreenCoin 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></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><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 EverGreenCoin 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></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><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. EverGreenCoin 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>Alamat</translation>
</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>Alamat</translation>
</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>Alamat</translation>
</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 EverGreenCoin 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>EverGreenCoin-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 EverGreenCoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start EverGreenCoin 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 EverGreenCoin 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 EverGreenCoin 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 EverGreenCoin.</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 EverGreenCoin 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 EverGreenCoin.</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 EverGreenCoin 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 EverGreenCoin-Qt help message to get a list with possible EverGreenCoin 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>EverGreenCoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>EverGreenCoin 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 EverGreenCoin 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 EverGreenCoin 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 EGC</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>Baki</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 EGC</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 an EverGreenCoin address (e.g. <API key>)</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 EverGreenCoin 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. <API key>)</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 an EverGreenCoin address (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name><API key></name>
<message>
<location filename="../forms/<API key>.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. <API key>)</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 EverGreenCoin 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. <API key>)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified EverGreenCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../<API key>.cpp" line="+27"/>
<location line="+3"/>
<source>Enter an EverGreenCoin address (e.g. <API key>)</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 EverGreenCoin 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></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></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></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 60 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><API key></name>
<message>
<location filename="../forms/<API key>.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><API key></name>
<message>
<location filename="../<API key>.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>Alamat</translation>
</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></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>Fail yang dipisahkan dengan koma</translation>
</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>Alamat</translation>
</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>EverGreenCoin 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 evergreencoind</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: evergreencoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: evergreencoind.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 EverGreenCoin 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=evergreencoinrpc
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 "EverGreenCoin 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. EverGreenCoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>EverGreenCoin</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 EverGreenCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart EverGreenCoin 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. EverGreenCoin 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> |
package nl.dekkr.feedfrenzy.backend.extractor.action
import nl.dekkr.feedfrenzy.backend.model.Regex
class RegexAction extends BaseAction {
def execute(vars: VariableMap, a: Regex): List[String] =
getVariable(a.inputVariable, vars) map { input =>
a.regex.r.findFirstMatchIn(input) match {
case Some(found) => found.matched
case None => ""
}
}
} |
#if !FEZENGINE
using System;
using System.Collections;
using System.Collections.Generic;
using FezEngine;
using FezEngine.Structure.Geometry;
using FezEngine.Structure.Input;
#if XNA
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
#elif UNITY
using UnityEngine;
#else
#warning FmbLib slim XNA still WIP.
#endif
namespace FezEngine.Structure {
public class PathSegment {
public Vector3 Destination;
public Quaternion Orientation;
public TimeSpan WaitTimeOnStart;
public TimeSpan WaitTimeOnFinish;
public TimeSpan Duration;
public float Acceleration;
public float Deceleration;
public float JitterFactor;
public bool Bounced;
//public SoundEffect Sound; //TODO
public ICloneable CustomData;
public PathSegment() {
Duration = TimeSpan.FromSeconds(1.0);
#if !UNITY
Orientation = Quaternion.Identity;
#else
Orientation = Quaternion.identity;
#endif
}
}
}
#endif |
<script type="text/javascript">
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
$(document).ready(function(){
$('.parallax').parallax();
});
</script> |
# Microsoft.Network/applicationGateways template reference
API Version: 2015-06-15
## Template format
To create a Microsoft.Network/applicationGateways resource, add the following JSON to the resources section of your template.
json
{
"type": "Microsoft.Network/applicationGateways",
"apiVersion": "2015-06-15",
"id": "string",
"location": "string",
"tags": {},
"properties": {
"sku": {
"name": "string",
"tier": "Standard",
"capacity": "integer"
},
"<API key>": [
{
"id": "string",
"properties": {
"subnet": {
"id": "string"
},
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"sslCertificates": [
{
"id": "string",
"properties": {
"data": "string",
"password": "string",
"publicCertData": "string",
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"<API key>": [
{
"id": "string",
"properties": {
"privateIPAddress": "string",
"<API key>": "string",
"subnet": {
"id": "string"
},
"publicIPAddress": {
"id": "string"
},
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"frontendPorts": [
{
"id": "string",
"properties": {
"port": "integer",
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"probes": [
{
"id": "string",
"properties": {
"protocol": "string",
"host": "string",
"path": "string",
"interval": "integer",
"timeout": "integer",
"unhealthyThreshold": "integer",
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"backendAddressPools": [
{
"id": "string",
"properties": {
"<API key>": [
{
"id": "string"
}
],
"backendAddresses": [
{
"fqdn": "string",
"ipAddress": "string"
}
],
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"<API key>": [
{
"id": "string",
"properties": {
"port": "integer",
"protocol": "string",
"cookieBasedAffinity": "string",
"requestTimeout": "integer",
"probe": {
"id": "string"
},
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"httpListeners": [
{
"id": "string",
"properties": {
"<API key>": {
"id": "string"
},
"frontendPort": {
"id": "string"
},
"protocol": "string",
"hostName": "string",
"sslCertificate": {
"id": "string"
},
"<API key>": boolean,
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"urlPathMaps": [
{
"id": "string",
"properties": {
"<API key>": {
"id": "string"
},
"<API key>": {
"id": "string"
},
"pathRules": [
{
"id": "string",
"properties": {
"paths": [
"string"
],
"backendAddressPool": {
"id": "string"
},
"backendHttpSettings": {
"id": "string"
},
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"requestRoutingRules": [
{
"id": "string",
"properties": {
"ruleType": "string",
"backendAddressPool": {
"id": "string"
},
"backendHttpSettings": {
"id": "string"
},
"httpListener": {
"id": "string"
},
"urlPathMap": {
"id": "string"
},
"provisioningState": "string"
},
"name": "string",
"etag": "string"
}
],
"resourceGuid": "string",
"provisioningState": "string"
},
"etag": "string"
}
## Property values
The following tables describe the values you need to set in the schema.
<a id="Microsoft.Network/applicationGateways" />
Microsoft.Network/applicationGateways object
| Name | Type | Required | Value |
|
| type | enum | Yes | Microsoft.Network/applicationGateways |
| apiVersion | enum | Yes | 2015-06-15 |
| id | string | No | Resource Id |
| location | string | No | Resource location |
| tags | object | No | Resource tags |
| properties | object | Yes | [<API key> object](#<API key>) |
| etag | string | No | Gets a unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| sku | object | No | Gets or sets sku of application gateway resource - [<API key> object](#<API key>) |
| <API key> | array | No | Gets or sets subnets of application gateway resource - [<API key> object](#<API key>) |
| sslCertificates | array | No | Gets or sets ssl certificates of application gateway resource - [<API key> object](#<API key>) |
| <API key> | array | No | Gets or sets frontend IP addresses of application gateway resource - [<API key> object](#<API key>) |
| frontendPorts | array | No | Gets or sets frontend ports of application gateway resource - [<API key> object](#<API key>) |
| probes | array | No | Gets or sets probes of application gateway resource - [<API key> object](#<API key>) |
| backendAddressPools | array | No | Gets or sets backend address pool of application gateway resource - [<API key> object](#<API key>) |
| <API key> | array | No | Gets or sets backend http settings of application gateway resource - [<API key> object](#<API key>) |
| httpListeners | array | No | Gets or sets HTTP listeners of application gateway resource - [<API key> object](#<API key>) |
| urlPathMaps | array | No | Gets or sets URL path map of application gateway resource - [<API key> object](#<API key>) |
| requestRoutingRules | array | No | Gets or sets request routing rules of application gateway resource - [<API key> object](#<API key>) |
| resourceGuid | string | No | Gets or sets resource guid property of the ApplicationGateway resource |
| provisioningState | string | No | Gets or sets Provisioning state of the ApplicationGateway resource Updating/Deleting/Failed |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| name | enum | No | Gets or sets name of application gateway SKU. - Standard_Small, Standard_Medium, Standard_Large |
| tier | enum | No | Gets or sets tier of application gateway. - Standard |
| capacity | integer | No | Gets or sets capacity (instance count) of application gateway |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| subnet | object | No | Gets or sets the reference of the subnet resource.A subnet from where appliation gateway gets its private address - [SubResource object](#SubResource) |
| provisioningState | string | No | Gets or sets Provisioning state of the application gateway subnet resource Updating/Deleting/Failed |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| data | string | No | Gets or sets the certificate data |
| password | string | No | Gets or sets the certificate password |
| publicCertData | string | No | Gets or sets the certificate public data |
| provisioningState | string | No | Gets or sets Provisioning state of the ssl certificate resource Updating/Deleting/Failed |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| privateIPAddress | string | No | Gets or sets the privateIPAddress of the Network Interface IP Configuration |
| <API key> | enum | No | Gets or sets PrivateIP allocation method (Static/Dynamic). - Static or Dynamic |
| subnet | object | No | Gets or sets the reference of the subnet resource - [SubResource object](#SubResource) |
| publicIPAddress | object | No | Gets or sets the reference of the PublicIP resource - [SubResource object](#SubResource) |
| provisioningState | string | No | Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| port | integer | No | Gets or sets the frontend port |
| provisioningState | string | No | Gets or sets Provisioning state of the frontend port resource Updating/Deleting/Failed |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| protocol | enum | No | Gets or sets the protocol. - Http or Https |
| host | string | No | Gets or sets the host to send probe to |
| path | string | No | Gets or sets the relative path of probe |
| interval | integer | No | Gets or sets probing interval in seconds |
| timeout | integer | No | Gets or sets probing timeout in seconds |
| unhealthyThreshold | integer | No | Gets or sets probing unhealthy threshold |
| provisioningState | string | No | Gets or sets Provisioning state of the backend http settings resource Updating/Deleting/Failed |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| <API key> | array | No | Gets or sets <API key> of application gateway - [SubResource object](#SubResource) |
| backendAddresses | array | No | Gets or sets the backend addresses - [<API key> object](#<API key>) |
| provisioningState | string | No | Gets or sets Provisioning state of the backend address pool resource Updating/Deleting/Failed |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| port | integer | No | Gets or sets the port |
| protocol | enum | No | Gets or sets the protocol. - Http or Https |
| cookieBasedAffinity | enum | No | Gets or sets the cookie affinity. - Enabled or Disabled |
| requestTimeout | integer | No | Gets or sets request timeout |
| probe | object | No | Gets or sets probe resource of application gateway - [SubResource object](#SubResource) |
| provisioningState | string | No | Gets or sets Provisioning state of the backend http settings resource Updating/Deleting/Failed |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| <API key> | object | No | Gets or sets frontend IP configuration resource of application gateway - [SubResource object](#SubResource) |
| frontendPort | object | No | Gets or sets frontend port resource of application gateway - [SubResource object](#SubResource) |
| protocol | enum | No | Gets or sets the protocol. - Http or Https |
| hostName | string | No | Gets or sets the host name of http listener |
| sslCertificate | object | No | Gets or sets ssl certificate resource of application gateway - [SubResource object](#SubResource) |
| <API key> | boolean | No | Gets or sets the <API key> of http listener |
| provisioningState | string | No | Gets or sets Provisioning state of the http listener resource Updating/Deleting/Failed |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| <API key> | object | No | Gets or sets default backend address pool resource of URL path map - [SubResource object](#SubResource) |
| <API key> | object | No | Gets or sets default backend http settings resource of URL path map - [SubResource object](#SubResource) |
| pathRules | array | No | Gets or sets path rule of URL path map resource - [<API key> object](#<API key>) |
| provisioningState | string | No | Gets or sets Provisioning state of the backend http settings resource Updating/Deleting/Failed |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| ruleType | enum | No | Gets or sets the rule type. - Basic or PathBasedRouting |
| backendAddressPool | object | No | Gets or sets backend address pool resource of application gateway - [SubResource object](#SubResource) |
| backendHttpSettings | object | No | Gets or sets frontend port resource of application gateway - [SubResource object](#SubResource) |
| httpListener | object | No | Gets or sets http listener resource of application gateway - [SubResource object](#SubResource) |
| urlPathMap | object | No | Gets or sets url path map resource of application gateway - [SubResource object](#SubResource) |
| provisioningState | string | No | Gets or sets Provisioning state of the request routing rule resource Updating/Deleting/Failed |
<a id="SubResource" />
SubResource object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| fqdn | string | No | Gets or sets the dns name |
| ipAddress | string | No | Gets or sets the ip address |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| id | string | No | Resource Id |
| properties | object | No | [<API key> object](#<API key>) |
| name | string | No | Gets name of the resource that is unique within a resource group. This name can be used to access the resource |
| etag | string | No | A unique read-only string that changes whenever the resource is updated |
<a id="<API key>" />
<API key> object
| Name | Type | Required | Value |
|
| paths | array | No | Gets or sets the path rules of URL path map - string |
| backendAddressPool | object | No | Gets or sets backend address pool resource of URL path map - [SubResource object](#SubResource) |
| backendHttpSettings | object | No | Gets or sets backend http settings resource of URL path map - [SubResource object](#SubResource) |
| provisioningState | string | No | Gets or sets path rule of URL path map resource Updating/Deleting/Failed | |
import Tag from './Tag'
function createTemplateTag (tag, options = {}) {
return (strings, ...values) => {
return new Tag(tag, options, strings, values)
}
}
export {default as Tag} from './Tag'
export const state = createTemplateTag('state', {
isStateDependency: true
})
const inputTemplateTag = createTemplateTag('input')
export const input = function (...args) {
console.warn('DEPRECATION: The INPUT template tag is deprecated, use props')
return inputTemplateTag(...args)
}
export const signal = createTemplateTag('signal')
export const props = createTemplateTag('props')
export const string = createTemplateTag('string', {
hasValue: false
}) |
#pragma config(Hubs, S1, HTMotor, HTMotor, HTMotor, HTMotor)
#pragma config(Sensor, S1, , <API key>)
#pragma config(Sensor, S2, lightR, sensorLightActive)
#pragma config(Sensor, S3, lightL, sensorLightActive)
#pragma config(Motor, mtr_S1_C1_1, fr, tmotorTetrix, openLoop, reversed)
#pragma config(Motor, mtr_S1_C1_2, fl, tmotorTetrix, openLoop, reversed)
#pragma config(Motor, mtr_S1_C2_1, bl, tmotorTetrix, openLoop, reversed)
#pragma config(Motor, mtr_S1_C2_2, br, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C3_1, liftA, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C3_2, liftB, tmotorTetrix, openLoop, reversed)
#pragma config(Motor, mtr_S1_C4_1, holder, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C4_2, flagspinner, tmotorTetrix, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
while(true){
motor[motorB] = 25;
motor[motorA] = -50;
<API key>(1, "%d", SensorRaw[lightL]);
}
} |
var galleriesCtrl = function ($scope, galleriesResource) {
$scope.categories = galleriesResource.query();
};
galleriesCtrl.$inject = ['$scope', 'galleriesResource'];
module.exports = galleriesCtrl; |
# Tools used
- [Adobe Ink stylus](https:
- [iPad Air 2](https://en.wikipedia.org/wiki/IPad_Air_2)
- [Procreate](https://procreate.art/) |
#include <_apex_send_trans.hpp>
START_ATF_NAMESPACE
int _apex_send_trans::size()
{
using org_ptr = int (WINAPIV*)(struct _apex_send_trans*);
return (org_ptr(0x140410c30L))(this);
};
END_ATF_NAMESPACE |
import { <API key> } from 'redux/constants';
const SHOW_ALL = 'ALL';
function publisherFilter (state = SHOW_ALL, action) {
switch (action.type) {
case <API key>:
return action.filter;
default:
return state;
}
}
export default publisherFilter; |
bf.constant('Errors', {
email: '',
required: ''
}); |
#!/usr/bin/env node
// Load Jii Framework
global.Jii = require('jii');
require('jii-urlmanager');
require('jii-httpserver');
require('jii-comet');
// Load other packages
var request = require('request');
// Load custom config
var customPath = __dirname + '/../../config.js';
var custom = require('fs').existsSync(customPath) ? require(customPath) : {};
require('jii-workers')
.setEnvironment(custom.env || 'development')
.application('comet', Jii.mergeConfigs(
{
application: {
basePath: __dirname,
inlineActions: {
// From php to comet
'api': function(context) {
var channel = context.request.post('channel');
var data = context.request.post('data');
if (context.request.post('method') === 'publish' && channel && data) {
Jii.app.comet.sendToChannel(channel, JSON.parse(data));
return 'ok';
} else {
context.response.setStatusCode(400);
return 'Wrong api method.';
}
}
},
components: {
http: {
className: 'Jii.httpServer.HttpServer',
port: 5200
},
comet: {
className: 'Jii.comet.server.Server',
port: 5210,
host: '127.0.0.1',
transport: {
className: 'Jii.comet.server.transport.SockJs',
urlPrefix: '/comet'
}
},
neat: {
className: 'Jii.comet.server.NeatServer',
configFileName: __dirname + '/bindings.json',
// From comet to php
dataLoadHandler: function(params) {
var url = Jii.app.params.phpLoadDataUrl;
return new Promise(function(resolve) {
request({
method: 'POST',
uri: url,
form: { msg: JSON.stringify(params) }
}, function(error, response, body) {
if (error || !response || response.statusCode >= 400) {
throw new Jii.exceptions.<API key>('Request to server `' + url + '` failed: ' + error);
}
var data = null;
try {
data = JSON.parse(body);
} catch(e) {
Jii.error('Cannot parse PHP response (url ' + url + '): ' + body);
}
if (data) {
resolve(data);
}
});
});
}
},
urlManager: {
className: 'Jii.urlManager.UrlManager'
}
}
},
params: {
phpLoadDataUrl: ''
}
},
custom
)); |
layout: tagpage
title: "Tag: python"
tag: python
robots: noindex
exclude_from_search: true
tagline: '"Creative Active Individuals can only grow up in a society that emphasizes learning instead of teaching." - Chris Alexander' |
require('dotenv').load();
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(require('./middleware/headers'));
app.use(require('./middleware/add-user-to-request'));
app.use('/api/v1/notes', require('./routes/notes-routes'));
app.use('/api/v1/users', require('./routes/users'));
app.use('/api/v1/sessions', require('./routes/sessions'));
app.listen(3000, function() {
console.log('Listening on http://localhost:3000');
}); |
<span class="article-title">
<a href="{{article.url}}">{{article.title}}</a>
</span>
<div class="click-items">
<a ng-click="articlesAPI.removeArticle($index)" class="delete-article clickable" title="Remove article">
<span>✖</span>
</a>
<a ng-click="articlesAPI.toggleShare(article)" class="share-article clickable">
<span class="plus-sign" title="Share">✖</span>
<div social-share ng-show="article.socialShare" class="social-share arrow-down">
<!--social-share template here
</div>
</a>
</div>
<!
<ul>
<li ng-repeat="category in article.categories">{{category.title}}</li>
</ul>
<div class"article-extract">{{article.extract}}</div> |
<div class="" data-ng-controller="<API key>">
<h1>Testing: Example view from your new awesome package</h1>
<h2>Package: {{package.name}}</h2>
<ol>
<li>
<a href="/api/roadtriphomepage/example/anyone" target="_self">Server route that anyone can access</a>
</li>
<li>
<a href="/api/roadtriphomepage/example/auth" target="_self">Server route that requires authentication</a>
</li>
<li>
<a href="/api/roadtriphomepage/example/admin" target="_self">Server route that requires admin user</a>
</li>
<li>
<a href="/api/roadtriphomepage/example/render" target="_self">Raw Html rendering example from using swig</a>
</li>
</ol>
<h3><img src="/roadtriphomepage/assets/img/logo.png" /></h3>
</br>
<p class="alert alert-info">You can find your package in /packages/roadtriphomepage</p>
</br>
<p class="alert alert-warning">MEAN versions prior to 0.3.2 will be in /node_modules/roadtriphomepage</p>
</br>
<h3><a href="http://learn.mean.io">Documentation</a></h3>
</br>
</div> |
package com.comp490.studybuddy.models;
import android.util.Log;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
@DatabaseTable(tableName="Calendar")
public class CalendarEvent {
//static are for the DB Table queries, if you change these, things break.
public static final String <API key> = "startDate";
@DatabaseField(generatedId = true)
private int id;
@DatabaseField
private String eventName;
@DatabaseField(columnName = <API key>)
private String startDate;
@DatabaseField
private String endDate;
@DatabaseField
private String description;
@DatabaseField
private String color;
private final String TAG = "EventModel";
CalendarEvent() {
}
//require both a name and a start time, others are optional.
public CalendarEvent(String name, String start) {
this.startDate = start;
this.eventName = name;
}
public CalendarEvent(int id, String name, String start, String end) {
this.id = id;
this.startDate = start;
this.eventName = name;
this.endDate = end;
}
public CalendarEvent(String name, String start, String end,
String desc, String color) {
this.startDate = start;
this.eventName = name;
this.endDate = end;
this.description = desc;
this.color = color;
}
public int getId() {
return id;
}
public boolean setId(int id) {
try {
this.id = id;
return true;
}
catch(Exception e) {
Log.d(TAG, "Setting id failed\n"+e);
return false;
}
}
public String getName() {
return eventName;
}
public boolean setName(String name) {
try {
eventName = name;
return true;
}
catch(Exception e) {
Log.d(TAG, "Setting name failed\n"+e);
return false;
}
}
public String getStart() {
return startDate;
}
public boolean setStart(String start) {
try {
startDate = start;
return true;
}
catch(Exception e) {
Log.d(TAG, "Setting start time failed\n"+e);
return false;
}
}
public String getEnd() {
return endDate;
}
public boolean setEnd(String end) {
try {
endDate = end;
return true;
}
catch(Exception e) {
Log.d(TAG, "Setting end time failed\n"+e);
return false;
}
}
public String getDesc() {
return description;
}
public boolean setDesc(String desc) {
try {
description = desc;
return true;
}
catch(Exception e) {
Log.d(TAG, "Setting description failed\n"+e);
return false;
}
}
public String getColor() {
return color;
}
public boolean setColor(String color) {
try {
this.color = color;
return true;
}
catch(Exception e) {
Log.d(TAG, "Setting color failed\n"+e);
return false;
}
}
} |
// MTFTestApplicants.h
// Motif
@import Foundation;
@import CoreGraphics;
@import Motif;
@interface <API key> : NSObject
@property (nonatomic) char charValue;
@property (nonatomic) int intValue;
@property (nonatomic) short shortValue;
@property (nonatomic) long longValue;
@property (nonatomic) long long longLongValue;
@property (nonatomic) unsigned char unsignedCharValue;
@property (nonatomic) unsigned int unsignedIntValue;
@property (nonatomic) unsigned short unsignedShortValue;
@property (nonatomic) unsigned long unsignedLongValue;
@property (nonatomic) unsigned long long <API key>;
@property (nonatomic) float floatValue;
@property (nonatomic) float doubleValue;
@property (nonatomic) bool boolValue;
@property (nonatomic) CGSize sizeValue;
@property (nonatomic) CGPoint pointValue;
@end
@interface <API key> : NSObject
@property (nonatomic, copy) NSString *stringValue;
@property (nonatomic, copy) NSNumber *numberValue;
@end
@interface <API key> : NSObject
@property (nonatomic, copy) NSNumber *superclassProperty;
@end
@interface <API key> : <API key>
@end
@interface <API key> : NSObject
@property (nonatomic) MTFThemeClass *themeClass;
@end
@interface <API key> : NSObject
@property (nonatomic) <API key> *nestedApplicant;
@end
typedef NS_ENUM(NSInteger, MTFTestEnumeration) {
MTFTestEnumeration1,
MTFTestEnumeration2,
MTFTestEnumeration3
};
@interface <API key> : NSObject
@property (nonatomic) MTFTestEnumeration enumeration;
@end
@interface <API key> : NSObject
@property (readonly, nonatomic) NSInteger applications;
@property (nonatomic, copy) NSString *stringValue;
@end |
#!/bin/sh
# CYBERWATCH SAS - 2017
# Security fix for DLA-326-1
# Operating System: Debian 6 (Squeeze)
# Architecture: i386
# - zendframework:1.10.6-1squeeze6
# Last versions recommanded by security team:
# - zendframework:1.10.6-1squeeze6
# CVE List:
# - CVE-2015-7695
# More details:
sudo apt-get install --only-upgrade zendframework=1.10.6-1squeeze6 -y |
require "jquery_notify_bar/version"
require "jquery_notify_bar/engine" if defined? Rails |
#include "overviewpage.h"
#include "ui_overviewpage.h"
#include "util.h"
#include "clientmodel.h"
#include "darksend.h"
#include "darksendconfig.h"
#include "walletmodel.h"
#include "bitcoinunits.h"
#include "optionsmodel.h"
#include "<API key>.h"
#include "<API key>.h"
#include "guiutil.h"
#include "guiconstants.h"
#include <<API key>>
#include <QPainter>
#include <QScrollArea>
#include <QScroller>
#include <QSettings>
#include <QTimer>
#define DECORATION_SIZE 64
#define ICON_OFFSET 16
#define NUM_ITEMS 6
class TxViewDelegate : public <API key>
{
Q_OBJECT
public:
TxViewDelegate(): <API key>(), unit(BitcoinUnits::BTC)
{
}
inline void paint(QPainter *painter, const <API key> &option,
const QModelIndex &index ) const
{
painter->save();
QIcon icon = qvariant_cast<QIcon>(index.data(Qt::DecorationRole));
QRect mainRect = option.rect;
mainRect.moveLeft(ICON_OFFSET);
QRect decorationRect(mainRect.topLeft(), QSize(DECORATION_SIZE, DECORATION_SIZE));
int xspace = DECORATION_SIZE + 8;
int ypad = 6;
int halfheight = (mainRect.height() - 2*ypad)/2;
QRect amountRect(mainRect.left() + xspace, mainRect.top()+ypad, mainRect.width() - xspace - ICON_OFFSET, halfheight);
QRect addressRect(mainRect.left() + xspace, mainRect.top()+ypad+halfheight, mainRect.width() - xspace, halfheight);
icon.paint(painter, decorationRect);
QDateTime date = index.data(<API key>::DateRole).toDateTime();
QString address = index.data(Qt::DisplayRole).toString();
qint64 amount = index.data(<API key>::AmountRole).toLongLong();
bool confirmed = index.data(<API key>::ConfirmedRole).toBool();
QVariant value = index.data(Qt::ForegroundRole);
QColor foreground = option.palette.color(QPalette::Text);
if(qVariantCanConvert<QColor>(value))
{
foreground = qvariant_cast<QColor>(value);
}
painter->setPen(foreground);
QRect boundingRect;
painter->drawText(addressRect, Qt::AlignLeft|Qt::AlignVCenter, address, &boundingRect);
if (index.data(<API key>::WatchonlyRole).toBool())
{
QIcon iconWatchonly = qvariant_cast<QIcon>(index.data(<API key>::<API key>));
QRect watchonlyRect(boundingRect.right() + 5, mainRect.top()+ypad+halfheight, 16, halfheight);
iconWatchonly.paint(painter, watchonlyRect);
}
if(amount < 0)
{
foreground = COLOR_NEGATIVE;
}
else if(!confirmed)
{
foreground = COLOR_UNCONFIRMED;
}
else
{
foreground = option.palette.color(QPalette::Text);
}
painter->setPen(foreground);
QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true);
if(!confirmed)
{
amountText = QString("[") + amountText + QString("]");
}
painter->drawText(amountRect, Qt::AlignRight|Qt::AlignVCenter, amountText);
painter->setPen(option.palette.color(QPalette::Text));
painter->drawText(amountRect, Qt::AlignLeft|Qt::AlignVCenter, GUIUtil::dateTimeStr(date));
painter->restore();
}
inline QSize sizeHint(const <API key> &option, const QModelIndex &index) const
{
return QSize(DECORATION_SIZE, DECORATION_SIZE);
}
int unit;
};
#include "overviewpage.moc"
OverviewPage::OverviewPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::OverviewPage),
clientModel(0),
walletModel(0),
currentBalance(-1),
currentStake(-1),
<API key>(-1),
<API key>(-1),
<API key>(-1),
<API key>(-1),
<API key>(-1),
<API key>(-1),
txdelegate(new TxViewDelegate()),
filter(0)
{
ui->setupUi(this);
// Recent transactions
ui->listTransactions->setItemDelegate(txdelegate);
ui->listTransactions->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE));
ui->listTransactions->setMinimumHeight(NUM_ITEMS * (DECORATION_SIZE + 2));
ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false);
ui->listTransactions->setMinimumWidth(300);
connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(<API key>(QModelIndex)));
// init "out of sync" warning labels
ui->labelWalletStatus->setText("(" + tr("out of sync") + ")");
ui-><API key>->setText("(" + tr("out of sync") + ")");
ui-><API key>->setText("(" + tr("out of sync") + ")");
fLiteMode = GetBoolArg("-litemode", false);
if(fLiteMode) {
ui->frameDarksend->setVisible(false);
} else {
if(fMasterNode) {
ui->toggleDarksend->setText("(" + tr("Disabled") + ")");
ui->darksendAuto->setText("(" + tr("Disabled") + ")");
ui->darksendReset->setText("(" + tr("Disabled") + ")");
ui->frameDarksend->setEnabled(false);
} else {
if(!fEnableDarksend) {
ui->toggleDarksend->setText(tr("Start Darksend Mixing"));
} else {
ui->toggleDarksend->setText(tr("Stop Darksend Mixing"));
}
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(darkSendStatus()));
if(!GetBoolArg("-reindexaddr", false))
timer->start(60000);
}
}
// start with displaying the "out of sync" warnings
<API key>(true);
}
void OverviewPage::<API key>(const QModelIndex &index)
{
if(filter)
emit transactionClicked(filter->mapToSource(index));
}
OverviewPage::~OverviewPage()
{
if(!fLiteMode && !fMasterNode) disconnect(timer, SIGNAL(timeout()), this, SLOT(darkSendStatus()));
delete ui;
}
void OverviewPage::setBalance(const CAmount& balance, const CAmount& stake, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& anonymizedBalance, const CAmount& watchOnlyBalance, const CAmount& watchOnlyStake, const CAmount& watchUnconfBalance, const CAmount& <API key>)
{
currentBalance = balance;
currentStake = stake;
<API key> = unconfirmedBalance;
<API key> = immatureBalance;
<API key> = anonymizedBalance;
<API key> = watchOnlyBalance;
<API key> = watchOnlyStake;
<API key> = watchUnconfBalance;
<API key> = <API key>;
ui->labelBalance->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, balance));
ui->labelStake->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, stake));
ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, unconfirmedBalance));
ui->labelImmature->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, immatureBalance));
ui->labelAnonymized->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, anonymizedBalance));
ui->labelTotal->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, balance + stake + unconfirmedBalance + immatureBalance));
ui->labelWatchAvailable->setText(BitcoinUnits::floorWithUnit(nDisplayUnit, watchOnlyBalance));
ui->labelWatchStake->setText(BitcoinUnits::floorWithUnit(nDisplayUnit, watchOnlyStake));
ui->labelWatchPending->setText(BitcoinUnits::floorWithUnit(nDisplayUnit, watchUnconfBalance));
ui->labelWatchImmature->setText(BitcoinUnits::floorWithUnit(nDisplayUnit, <API key>));
ui->labelWatchTotal->setText(BitcoinUnits::floorWithUnit(nDisplayUnit, watchOnlyBalance + watchOnlyStake + watchUnconfBalance + <API key>));
// only show immature (newly mined) balance if it's non-zero, so as not to complicate things
// for the non-mining users
bool showImmature = immatureBalance != 0;
bool <API key> = <API key> != 0;
// for symmetry reasons also show immature label when the watch-only one is shown
ui->labelImmature->setVisible(showImmature || <API key>);
ui->labelImmatureText->setVisible(showImmature || <API key>);
ui->labelWatchImmature->setVisible(<API key>); // show watch-only immature balance
<API key>();
static int cachedTxLocks = 0;
if(cachedTxLocks != nCompleteTXLocks) {
cachedTxLocks = nCompleteTXLocks;
ui->listTransactions->update();
}
}
// show/hide watch-only labels
void OverviewPage::<API key>(bool showWatchOnly)
{
ui->labelSpendable->setVisible(showWatchOnly); // show spendable label (only when watch-only is active)
ui->labelWatchonly->setVisible(showWatchOnly); // show watch-only label
ui->lineWatchBalance->setVisible(showWatchOnly); // show watch-only balance separator line
ui->labelWatchStake->setVisible(showWatchOnly); // show watch-only balance separator line
ui->labelWatchAvailable->setVisible(showWatchOnly); // show watch-only available balance
ui->labelWatchPending->setVisible(showWatchOnly); // show watch-only pending balance
ui->labelWatchTotal->setVisible(showWatchOnly); // show watch-only total balance
if (!showWatchOnly) {
ui->labelWatchImmature->hide();
}
else {
ui->labelBalance->setIndent(20);
ui->labelStake->setIndent(20);
ui->labelUnconfirmed->setIndent(20);
ui->labelImmature->setIndent(20);
ui->labelTotal->setIndent(20);
}
}
void OverviewPage::setClientModel(ClientModel *model)
{
this->clientModel = model;
if(model)
{
// Show warning if this is a prerelease version
connect(model, SIGNAL(alertsChanged(QString)), this, SLOT(updateAlerts(QString)));
updateAlerts(model-><API key>());
}
}
void OverviewPage::setWalletModel(WalletModel *model)
{
this->walletModel = model;
if(model && model->getOptionsModel())
{
// Set up transaction list
filter = new <API key>();
filter->setSourceModel(model-><API key>());
filter->setLimit(NUM_ITEMS);
filter-><API key>(true);
filter->setSortRole(Qt::EditRole);
filter->setShowInactive(false);
filter->sort(<API key>::Status, Qt::DescendingOrder);
ui->listTransactions->setModel(filter);
ui->listTransactions->setModelColumn(<API key>::ToAddress);
// Keep up to date with wallet
setBalance(model->getBalance(), model->getStake(), model-><API key>(), model->getImmatureBalance(), model-><API key>(),
model->getWatchBalance(), model->getWatchStake(), model-><API key>(), model-><API key>());
connect(model, SIGNAL(balanceChanged(CAmount, CAmount, CAmount, CAmount, CAmount, CAmount, CAmount, CAmount, CAmount)), this, SLOT(setBalance(CAmount, CAmount, CAmount, CAmount, CAmount, CAmount, CAmount, CAmount, CAmount)));
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
connect(ui->darksendAuto, SIGNAL(clicked()), this, SLOT(darksendAuto()));
connect(ui->darksendReset, SIGNAL(clicked()), this, SLOT(darksendReset()));
connect(ui->toggleDarksend, SIGNAL(clicked()), this, SLOT(toggleDarksend()));
<API key>(model->haveWatchOnly());
connect(model, SIGNAL(<API key>(bool)), this, SLOT(<API key>(bool)));
}
// update the display unit, to not use the default ("BTC")
updateDisplayUnit();
}
void OverviewPage::updateDisplayUnit()
{
if(walletModel && walletModel->getOptionsModel())
{
nDisplayUnit = walletModel->getOptionsModel()->getDisplayUnit();
if(currentBalance != -1)
setBalance(currentBalance, currentStake, <API key>, <API key>, <API key>,
<API key>, <API key>, <API key>, <API key>);
// Update txdelegate->unit with the current unit
txdelegate->unit = nDisplayUnit;
ui->listTransactions->update();
}
}
void OverviewPage::updateAlerts(const QString &warnings)
{
this->ui->labelAlerts->setVisible(!warnings.isEmpty());
this->ui->labelAlerts->setText(warnings);
}
void OverviewPage::<API key>(bool fShow)
{
ui->labelWalletStatus->setVisible(fShow);
ui-><API key>->setVisible(fShow);
ui-><API key>->setVisible(fShow);
}
void OverviewPage::<API key>()
{
if(!darkSendPool.IsBlockchainSynced() || ShutdownRequested()) return;
if(!pwalletMain) return;
QString strAmountAndRounds;
QString <API key> = BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, nAnonymizeIonAmount * COIN, false, BitcoinUnits::separatorAlways);
if(currentBalance == 0)
{
ui->darksendProgress->setValue(0);
ui->darksendProgress->setToolTip(tr("No inputs detected"));
// when balance is zero just show info from settings
<API key> = <API key>.remove(<API key>.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1);
strAmountAndRounds = <API key> + " / " + tr("%n Rounds", "", nDarksendRounds);
ui->labelAmountRounds->setToolTip(tr("No inputs detected"));
ui->labelAmountRounds->setText(strAmountAndRounds);
return;
}
CAmount <API key>;
CAmount <API key>;
CAmount <API key>;
CAmount <API key>;
double <API key>;
{
TRY_LOCK(cs_main, lockMain);
if(!lockMain) return;
<API key> = pwalletMain-><API key>();
<API key> = pwalletMain-><API key>(true);
<API key> = pwalletMain-><API key>();
<API key> = pwalletMain-><API key>();
<API key> = pwalletMain-><API key>();
}
//Get the anon threshold
CAmount nMaxToAnonymize = <API key> + <API key> + <API key>;
// If it's more than the anon threshold, limit to that.
if(nMaxToAnonymize > nAnonymizeIonAmount*COIN) nMaxToAnonymize = nAnonymizeIonAmount*COIN;
if(nMaxToAnonymize == 0) return;
if(nMaxToAnonymize >= nAnonymizeIonAmount * COIN) {
ui->labelAmountRounds->setToolTip(tr("Found enough compatible inputs to anonymize %1")
.arg(<API key>));
<API key> = <API key>.remove(<API key>.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1);
strAmountAndRounds = <API key> + " / " + tr("%n Rounds", "", nDarksendRounds);
} else {
QString strMaxToAnonymize = BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, nMaxToAnonymize, false, BitcoinUnits::separatorAlways);
ui->labelAmountRounds->setToolTip(tr("Not enough compatible inputs to anonymize <span style='color:red;'>%1</span>,<br>"
"will anonymize <span style='color:red;'>%2</span> instead")
.arg(<API key>)
.arg(strMaxToAnonymize));
strMaxToAnonymize = strMaxToAnonymize.remove(strMaxToAnonymize.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1);
strAmountAndRounds = "<span style='color:red;'>" +
QString(BitcoinUnits::factor(nDisplayUnit) == 1 ? "" : "~") + strMaxToAnonymize +
" / " + tr("%n Rounds", "", nDarksendRounds) + "</span>";
}
ui->labelAmountRounds->setText(strAmountAndRounds);
// calculate parts of the progress, each of them shouldn't be higher than 1
// progress of denominating
float denomPart = 0;
// mixing progress of denominated balance
float anonNormPart = 0;
// completeness of full amount anonimization
float anonFullPart = 0;
CAmount denominatedBalance = <API key> + <API key>;
denomPart = (float)denominatedBalance / nMaxToAnonymize;
denomPart = denomPart > 1 ? 1 : denomPart;
denomPart *= 100;
anonNormPart = (float)<API key> / nMaxToAnonymize;
anonNormPart = anonNormPart > 1 ? 1 : anonNormPart;
anonNormPart *= 100;
anonFullPart = (float)<API key> / nMaxToAnonymize;
anonFullPart = anonFullPart > 1 ? 1 : anonFullPart;
anonFullPart *= 100;
// apply some weights to them ...
float denomWeight = 1;
float anonNormWeight = nDarksendRounds;
float anonFullWeight = 2;
float fullWeight = denomWeight + anonNormWeight + anonFullWeight;
// ... and calculate the whole progress
float denomPartCalc = ceilf((denomPart * denomWeight / fullWeight) * 100) / 100;
float anonNormPartCalc = ceilf((anonNormPart * anonNormWeight / fullWeight) * 100) / 100;
float anonFullPartCalc = ceilf((anonFullPart * anonFullWeight / fullWeight) * 100) / 100;
float progress = denomPartCalc + anonNormPartCalc + anonFullPartCalc;
if(progress >= 100) progress = 100;
ui->darksendProgress->setValue(progress);
QString strToolPip = ("<b>" + tr("Overall progress") + ": %1%</b><br/>" +
tr("Denominated") + ": %2%<br/>" +
tr("Mixed") + ": %3%<br/>" +
tr("Anonymized") + ": %4%<br/>" +
tr("Denominated inputs have %5 of %n rounds on average", "", nDarksendRounds))
.arg(progress).arg(denomPart).arg(anonNormPart).arg(anonFullPart)
.arg(<API key>);
ui->darksendProgress->setToolTip(strToolPip);
}
void OverviewPage::darkSendStatus()
{
static int64_t <API key> = 0;
int nBestHeight = pindexBest->nHeight;
// we we're processing more then 1 block per second, we'll just leave
if(((nBestHeight - darkSendPool.cachedNumBlocks) / (GetTimeMillis() - <API key> + 1) > 1)) return;
<API key> = GetTimeMillis();
if(!fEnableDarksend) {
if(nBestHeight != darkSendPool.cachedNumBlocks)
{
darkSendPool.cachedNumBlocks = nBestHeight;
<API key>();
ui->darksendEnabled->setText(tr("Disabled"));
ui->darksendStatus->setText("");
ui->toggleDarksend->setText(tr("Start Darksend Mixing"));
}
return;
}
// check darksend status and unlock if needed
if(nBestHeight != darkSendPool.cachedNumBlocks)
{
// Balance and number of transactions might have changed
darkSendPool.cachedNumBlocks = nBestHeight;
<API key>();
ui->darksendEnabled->setText(tr("Enabled"));
}
QString strStatus = QString(darkSendPool.GetStatus().c_str());
QString s = tr("Last Darksend message:\n") + strStatus;
if(s != ui->darksendStatus->text())
LogPrintf("Last Darksend message: %s\n", strStatus.toStdString());
ui->darksendStatus->setText(s);
if(darkSendPool.sessionDenom == 0) {
ui->labelSubmittedDenom->setText(tr("N/A"));
} else {
std::string out;
darkSendPool.<API key>(darkSendPool.sessionDenom, out);
QString s2(out.c_str());
ui->labelSubmittedDenom->setText(s2);
}
// Get DarkSend Denomination Status
}
void OverviewPage::darksendAuto() {
darkSendPool.<API key>();
}
void OverviewPage::darksendReset() {
darkSendPool.Reset();
darkSendStatus();
QMessageBox::warning(this, tr("Darksend"),
tr("Darksend was successfully reset."),
QMessageBox::Ok, QMessageBox::Ok);
}
void OverviewPage::toggleDarksend() {
QSettings settings;
// Popup some information on first mixing
QString hasMixed = settings.value("hasMixed").toString();
if(hasMixed.isEmpty()) {
QMessageBox::information(this, tr("Darksend"),
tr("If you don't want to see internal Darksend fees/transactions select \"Received By\" as Type on the \"Transactions\" tab."),
QMessageBox::Ok, QMessageBox::Ok);
settings.setValue("hasMixed", "hasMixed");
}
if(!fEnableDarksend) {
int64_t balance = currentBalance;
float minAmount = 1.49 * COIN;
if(balance < minAmount) {
QString strMinAmount(BitcoinUnits::formatWithUnit(nDisplayUnit, minAmount));
QMessageBox::warning(this, tr("Darksend"),
tr("Darksend requires at least %1 to use.").arg(strMinAmount),
QMessageBox::Ok, QMessageBox::Ok);
return;
}
// if wallet is locked, ask for a passphrase
if (walletModel->getEncryptionStatus() == WalletModel::Locked)
{
WalletModel::UnlockContext ctx(walletModel->requestUnlock());
if(!ctx.isValid())
{
//unlock was cancelled
darkSendPool.cachedNumBlocks = std::numeric_limits<int>::max();
QMessageBox::warning(this, tr("Darksend"),
tr("Wallet is locked and user declined to unlock. Disabling Darksend."),
QMessageBox::Ok, QMessageBox::Ok);
if (fDebug) LogPrintf("Wallet is locked and user declined to unlock. Disabling Darksend.\n");
return;
}
}
}
fEnableDarksend = !fEnableDarksend;
darkSendPool.cachedNumBlocks = std::numeric_limits<int>::max();
if(!fEnableDarksend) {
ui->toggleDarksend->setText(tr("Start Darksend Mixing"));
darkSendPool.UnlockCoins();
} else {
ui->toggleDarksend->setText(tr("Stop Darksend Mixing"));
/* show darksend configuration if client has defaults set */
if(nAnonymizeIonAmount == 0) {
DarksendConfig dlg(this);
dlg.setModel(walletModel);
dlg.exec();
}
}
} |
// CCIStepsManager.h
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// all copies or substantial portions of the Software.
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
@class CCIStep;
/**
CCIStepsManager is a singleton class and its main purpose is to manage all step definitions and execute steps.
*/
@interface CCIStepsManager : NSObject
/**
A set containing all the steps that are not defined when dry run is enabled
*/
@property (nonatomic, strong) NSMutableSet<CCIStep *> *undefinedSteps;
/**
The step that is being executed
*/
@property (nonatomic, strong) CCIStep * currentStep;
/**
Returns the singleton class of CCIStepsManager
*/
+ (instancetype)instance;
/**
Executes the passed step if it matches any previously defined implementation. Or throw an error if there is no matching definiton.
@param step the to be executed
@param testCase the test case that is being executed when this step implementation is being called
*/
- (void)executeStep:(CCIStep *)step inTestCase:(id)testCase;
- (BOOL)executeStepInDryRun:(CCIStep *)step inTestCase:(id)testCase;
@end |
{% extends 'base.html' %}
{% block content %}
<div class="column">
<h1 class="title is-1">ListedMaths</h1>
<h2 class="subtitle is-2">A list of books from different fields of Mathematics </h2>
</div>
<section class="section">
<div class="container">
<div class="heading">
<h3 class="title is-3">Some Tags</h3>
<p><div class="chip"><a href="/shelf/4893445031/1">Algebra</a></div>
<div class="chip"><a href="/shelf/4893447031/1">Geometry</a></div>
<div class="chip"><a href="/shelf/1349980031/1">Mathematics</a></div>
<div class="chip"><a href="/shelf/4893446031/1">Calculus</a></div>
<div class="chip"><a href="/shelf/1350061031/1">Economy</a></div>
<div class="chip"><a href="/shelf/903448031/1">Computer science</a></div>
<div class="chip"><a href="/shelf/1349978031/1">Physics</a></div>
<div class="chip"><a href="/shelf/903454031/1">Computer security</a></div>
<div class="chip"><a href="/shelf/1350116031/1">Databases</a></div>
<div class="chip"><a href="/shelf/4893442031/1">Electricity and magnetism</a></div>
<div class="chip"><a href="/shelf/4893440031/1">Applied physics</a></div>
<div class="chip"><a href="/shelf/4893541031/1">Space Science</a></div>
<div class="chip"><a href="/shelf/4893532031/1">Civil engineering</a></div>
<div class="chip"><a href="/shelf/1349975031/1">Astronomy</a></div>
</p>
</div>
</div>
</section>
<h4>Random books</h4>
<div class="row">
{%for book in books%}
<div class="col s4">
{% include 'book_card.html' %}
</div>
{%endfor%}
</div>
{% endblock %} |
#! /usr/bin/env python
#-*-coding:utf-8-*-
import BeautifulSoup
import urllib2
import codecs
import os
URL='http:
html=urllib2.urlopen(URL).read()
soup=BeautifulSoup.BeautifulSoup(html)
f=codecs.open('Traininfopy.cache','w','utf-8')
trableinfo=soup.findAll(id='hokai-1')[0].find('img').get('alt')
if(trableinfo!=u""):
#f.write(u':')
f.write(' ')
f.write(soup.findAll(id='hokai-1')[0].findAll('td')[1].contents[0].contents[0])
f.write('=')
f.write(soup.findAll(id='hokai-1')[0].find('img').get('alt'))
f.write(' ')
f.close()
os.system("cat Traininfopy.cache") |
layout: post
title: itemize,enumerate,description LaTeX
modified:
categories: blog
excerpt: itemizeenumeratedescription LaTeX
tags: [latex, emacs]
image:
feature:
date: 2014-02-24 Mon 23:26
## itemizeenumeratedescription LaTeX
itemize
{% highlight tex %}
\begin{itemize}
\item[*] a
\item[*] b
\end{itemize}
{% endhighlight %}
* a
* b
item-+
enumerate
{% highlight tex %}
\begin{enumerate}[1)]
\item a
\item b
\end{enumerate}
{% endhighlight %}
1 a
2 b
[step 1],[(i)]LaTeX\usepackage{enumerate}.
description
{% highlight tex %}
\begin{description}
\item[item a] a
\item[item b] b
\end{description}
{% endhighlight %}
=item a= a
=item b= b
item |
/* eslint no-console: 0 */
// Run this example by adding <%= javascript_pack_tag 'hello_vue' %> (and
// <%= stylesheet_pack_tag 'hello_vue' %> if you have styles in your component)
// to the head of your layout file,
// like app/views/layouts/application.html.erb.
// All it does is render <div>Hello Vue</div> at the bottom of the page.
// import Vue from 'vue'
// import App from '../app.vue'
// document.addEventListener('DOMContentLoaded', () => {
// document.body.appendChild(document.createElement('hello'))
// const app = new Vue({
// render: h => h(App)
// }).$mount('hello')
// console.log(app)
// The above code uses Vue without the compiler, which means you cannot
// use Vue to target elements in your existing html templates. You would
// need to always use single file components.
// To be able to target elements in your existing html/erb templates,
// comment out the above code and uncomment the below
// Add <%= javascript_pack_tag 'hello_vue' %> to your layout
// Then add this markup to your html template:
// <div id='hello'>
// {{message}}
// <app></app>
// </div>
import Vue from 'vue/dist/vue.esm'
// import * as VueGoogleMaps from 'vue2-google-maps'
import SocialSharing from 'vue-social-sharing'
import App from '../app.vue'
import GoogleMap from '../google-map.vue'
var VueGoogleMaps = require('vue2-google-maps');
// var SocialSharing = require('vue-social-sharing');
Vue.use(SocialSharing);
Vue.use(GoogleMap);
document.addEventListener('DOMContentLoaded', () => {
const app = new Vue({
el: '#main-vue',
data: {
message: "Can you say hello?"
},
components: { GoogleMap }
})
})
// If the using turbolinks, install 'vue-turbolinks':
// yarn add 'vue-turbolinks'
// Then uncomment the code block below:
// import TurbolinksAdapter from 'vue-turbolinks';
// import Vue from 'vue/dist/vue.esm'
// import App from '../app.vue'
// Vue.use(TurbolinksAdapter)
// document.addEventListener('turbolinks:load', () => {
// const app = new Vue({
// el: '#hello',
// data: {
// message: "Can you say hello?"
// components: { App } |
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:
<html xmlns="http:
<head>
<title>Rails::Engine::Rake</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<span>Ruby on Rails 4.2.2</span><br />
<h1>
<span class="type">Module</span>
Rails::Engine::Rake
</h1>
<ul class="files">
<li><a href="../../../files/__/_rvm/gems/ruby-2_2_2/gems/railties-4_2_2/lib/rails/engine_rb.html">/Users/benfreeman/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/engine.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Methods -->
</div>
</div>
</body>
</html> |
#include <string>
#include <iostream>
#include <iomanip>
#include <time.h>
#include <vector>
#include <fstream>
#include <tvmet/Vector.h>
#include <limits>
#include "Node.h"
#include "Model.h"
#include "Lbfgsb.h"
#include "OPSBody.h"
#include "OPSBrownianKick.h"
#include "<API key>.h"
#include <vtkPolyData.h>
#include <vtkPolyDataReader.h>
#include <vtkSmartPointer.h>
#include <vtkSphereSource.h>
#include "HelperFunctions.h"
#include <Eigen/Dense>
using namespace voom;
int main(int argc, char* argv[])
{
clock_t t1, t2, t3;
t1 = clock();
if (argc != 2) {
cout << "usage: " << argv[0] << " <filename>\n";
return -1;
}
string inputFileName = argv[1];
string fname = inputFileName.substr(0, inputFileName.find("."));
string rName;
std::stringstream sstm;
//For Morse material
double D_e=1.0, re=1.0, s=7.0, b=1.0;
double alpha=1.0, beta=1.0, gamma=1.0;
double percentStrain = 10;
double initialSearchRad = 1.0, finalSearchRad = 1.2, searchRadFactor = 1.3;
//int lat_res=100, long_res=101;
int viterMax = 1000;
int nameSuffix = 0;
double dt = 9.76e-4;
bool volumeConstraintOn = false;
//Read epsilon and percentStrain from input file. percentStrain is
//calculated so as to set the inflection point of Morse potential
//at a fixed distance relative to the equilibrium separation
//e.g. 1.1*R_eq, 1.5*R_eq etc.
std::ifstream miscInpFile("miscInp.dat");
assert(miscInpFile);
string temp;
miscInpFile
>> temp >> D_e
>> temp >> re
>> temp >> b
>> temp >> initialSearchRad
>> temp >> finalSearchRad
>> temp >> searchRadFactor
>> temp >> volumeConstraintOn;
miscInpFile.close();
s = (100 / (re*percentStrain))*log(2.0);
struct OPSParams props = {D_e, re, s, b, alpha, beta, gamma};
vtkSmartPointer<vtkPolyDataReader> reader =
vtkSmartPointer<vtkPolyDataReader>::New();
vtkSmartPointer<vtkPolyData> mesh;
reader->SetFileName(inputFileName.c_str());
reader->Update();
mesh = reader->GetOutput();
// create vector of nodes
int numNodes, dof = 0;
std::vector<OPSNode* > nodes;
std::vector<NodeBase*> baseNodes;
double Ravg = 0.0;
// read in points
for (int i = 0; i < mesh->GetNumberOfPoints(); i++) {
int id = i;
NodeBase::DofIndexMap idx(6);
Vector3D X;
OPSNode* n;
for (int j = 0; j < 6; j++) idx[j] = dof++;
mesh->GetPoint(i, &(X[0]));
n = new OPSNode(id, idx, X);
Ravg += tvmet::norm2(X);
nodes.push_back(n);
baseNodes.push_back(n);
}
assert(nodes.size() != 0);
numNodes = nodes.size();
int numSolverDOFs = numNodes*6;
Ravg /= numNodes;
std::cout << "Number of nodes: " << numNodes << endl
<< "Initial radius: " << Ravg << endl;
//OPSBody* bd = new OPSBody( nodes, props, initialSearchRad );
OPSBody* bd = new OPSBody( nodes, props, initialSearchRad );
// Calculate side lengths average of the imaginary equilateral triangles
double EdgeLength = bd-><API key>();
// Rescale size of the capsid by the average equilateral edge length
for (int i = 0; i < numNodes; i++) {
Vector3D X;
X = nodes[i]->referencePosition();
X *= 1.0 / EdgeLength;
nodes[i]-><API key>(X);
nodes[i]-><API key>(X);
}
//Recalculate edge lengths and capsid radius
bd->updateSearchRadius(finalSearchRad);
EdgeLength = bd-><API key>();
bd->updateSearchRadius(searchRadFactor*EdgeLength);
bd-><API key>();
bd->updateNeighbors();
//
double volConstraint = 0.0;
if(volumeConstraintOn){
volConstraint = bd->calcAvgVolume();
cout << "Prescribed Volume = "<< volConstraint << std::endl;
NodeBase::DofIndexMap idx(1);
idx[0] = dof++;
MultiplierNode *pressNode = new MultiplierNode(numNodes,idx,1.0);
baseNodes.push_back( pressNode );
bd->setVolumeConstraint( pressNode, volConstraint);
numSolverDOFs++;
}
Ravg = bd->getAverageRadius();
std::cout << "Radius of capsid after rescaling = " << Ravg << endl;
// Prepare Eigen matrices
Eigen::Matrix3Xd initialPositions(3, numNodes),
currentPositions(3, numNodes), <API key>(3, numNodes);
//Fill in matrix of the initial state for Kabsch algorithm
for (int col = 0; col < numNodes; col++) {
Vector3D coord = nodes[col]->deformedPosition();
for (int row = 0; row < 3; row++) {
initialPositions(row, col) = coord(row);
}
}
//Prepare output data file
std::string dataOutputFile;
sstm << fname << "-DetailOutput.dat";
dataOutputFile = sstm.str();
sstm.str("");
sstm.clear();
ofstream innerLoopFile;
innerLoopFile.open(dataOutputFile.c_str());
innerLoopFile << "#Step" << "\t"
<<"ParaviewStep" << "\t"
<< "Alpha" << "\t"
<< "Beta" << "\t"
<< "Gamma" << "\t"
<< "Asphericity" << "\t"
<< "Radius" << "\t"
<< "Volume" << "\t"
<< "MorseEnergy" << "\t"
<< "NormalityEn" << "\t"
<< "CircularityEn" << "\t"
<< "BrownianEnergy" << "\t"
<< "ViscosityEnergy" << "\t"
<< "PressureVolEn" << "\t"
<< "TotalFunctional" <<"\t"
<< "MSD" << "\t"
<< "Neighbors"
<< std::endl;
ofstream outerLoopFile;
sstm << fname << "-AverageOutput.dat";
dataOutputFile = sstm.str();
sstm.str("");
sstm.clear();
outerLoopFile.open(dataOutputFile.c_str());
outerLoopFile << "#BigStep" <<"\t"
<< "PercentStrain" <<"\t"
<< "Alpha" << "\t"
<< "Beta" << "\t"
<< "Gamma" << "\t"
<< "Radius" <<"\t"
<< "Asphericity"
<< std::endl;
// Update the Morse parameters
s = (100 / (EdgeLength*percentStrain))*log(2.0);
bd->updateProperty( OPSBody::r, EdgeLength );
bd->updateProperty( OPSBody::av, s );
//Create a l-BFGS-b solver
int m = 7;
int maxIter = 1e5;
double factr = 10.0;
double pgtol = 1e-7;
int iprint = 10000;
Lbfgsb solver(numSolverDOFs, m, factr, pgtol, iprint, maxIter, false);
double brownCoeff = beta*D_e/(alpha*EdgeLength) ;
double viscosity = brownCoeff/(alpha*EdgeLength);
// Create OPSBrownianKick element
OPSBrownianKick *bk = new OPSBrownianKick(nodes, brownCoeff);
bd->addElement( bk );
// Create ViscousRegularizer element
<API key> *vr = new <API key>(nodes,viscosity);
bd->addElement( vr );
//Create Model
Model::BodyContainer bdc;
bdc.push_back(bd);
Model model(bdc, baseNodes);
int printStep, stepCount = 0;
int paraviewStep = -1;
/*
bool checkConsistency = true;
if (checkConsistency) {
std::cout << "Checking consistency......" << std::endl;
bk->updateParallelKick();
//bd->checkConsistency(true);
model.checkConsistency(true, false);
//exit(EXIT_SUCCESS);
}
*/
//
std::vector<Vector3D> averagePosition( numNodes, Vector3D(0.0) );
for (int viter = 0; viter < viterMax; viter++) {
//Ensure only next nearest neighbor interactions
EdgeLength = bd-><API key>();
bd->updateSearchRadius(searchRadFactor*EdgeLength);
cout << endl
<< "VISCOUS ITERATION: " << viter + stepCount
<< endl
<< endl;
bk->updateParallelKick();
solver.solve(&model);
//Fill-in Matrix for new state for Kabsch algorithm
for (int col = 0; col < numNodes; col++) {
Vector3D coord, normal, pseudoNormal;
coord = nodes[col]->deformedPosition();
/*
*To rotate the normals properly we need to preserve the
* relative position between the particle and another
* imaginary particle sitting at the tip of the unit
* normal associated with the particle
*/
normal = OPSNode::<API key>(
nodes[col]-><API key>());
pseudoNormal = coord + normal;
for (int row = 0; row < 3; row++) {
currentPositions(row, col) = coord(row);
<API key>(row, col) = pseudoNormal(row);
}
}
//
Eigen::Affine3d A;
Eigen::Matrix3Xd newPositions(3, numNodes),
newRotVecs(3, numNodes), newPseudoNormal(3,1);
A = <API key>(currentPositions, initialPositions);
for (int col = 0; col < currentPositions.cols(); col++) {
newPositions.col(col) = A.linear() * currentPositions.col(col)
+ A.translation();
newPseudoNormal.col(0) = A.linear() * <API key>.col(col)
+ A.translation();
Vector3D currRotVec(0.0), currTvmetNormal(0.0);
//Convert the pseudoNormal to normal by subtracting particle position
currTvmetNormal[0] = newPseudoNormal(0,0) - newPositions(0,col);
currTvmetNormal[1] = newPseudoNormal(1,0) - newPositions(1,col);
currTvmetNormal[2] = newPseudoNormal(2,0) - newPositions(2,col);
//Convert the new normal to a rotation vector
currRotVec = OPSNode::<API key>( currTvmetNormal );
newRotVecs(0,col) = currRotVec[0];
newRotVecs(1,col) = currRotVec[1];
newRotVecs(2,col) = currRotVec[2];
}
//Update the Kabsch transformed positions as new current
//configuration in the node container
for (int i = 0; i < numNodes; i++) {
tvmet::Vector<double,6> kabschPoint(0.0);
for (int j = 0; j < 3; j++) {
averagePosition[i][j] += newPositions(j, i);
kabschPoint(j) = newPositions(j, i);
kabschPoint(j+3) = newRotVecs(j, i);
}
nodes[i]->setDeformedDOFs(kabschPoint);
}
bd-><API key>();
bd->updateNeighbors();
EdgeLength = bd-><API key>();
//We will print only after every currPrintStep iterations
if (viter % printStep == 0) {
paraviewStep++;
sstm << fname << "-relaxed-" << nameSuffix++ <<".vtk";
rName = sstm.str();
bd->printParaview(rName.c_str());
sstm.str("");
sstm.clear();
}
int paraviewStepPrint;
paraviewStepPrint = (viter % printStep == 0) ? paraviewStep : -1;
double msd = bd->msd();
innerLoopFile << step++ << "\t"
<< paraviewStepPrint <<"\t"
<< currAlpha <<"\t"
<< currBeta << "\t"
<< currGamma << "\t"
<< bd->getAsphericity() << "\t"
<< bd->getAverageRadius() << "\t"
<< bd->calcVolume() << "\t"
<< bd->getMorseEnergy() << "\t"
<< bd->getNormalityEnergy() << "\t"
<< bd-><API key>() << "\t"
<< bk->energy() << "\t"
<< vr->energy() << "\t"
<< bd->getPVEnergy() << "\t"
<< solver.function() << "\t"
<< msd << "\t"
<< bd->getAvgNumNeighbors()
<< endl;
// step forward in "time", relaxing viscous energy & forces
vr->step();
bk->brownianStep();
} // INNER SOLUTION LOOP ENDS
// Calculate the average particle positions
double avgShapeRad = 0.0, avgShapeasph = 0.0;
vtkSmartPointer<vtkPoints> avgPos =
vtkSmartPointer<vtkPoints>::New();
for(int av=0; av < numNodes; av++){
Vector3D tempPos;
tempPos = averagePosition[av] / viterMax;
averagePosition[av] = tempPos;
avgShapeRad += tvmet::norm2( tempPos );
avgPos->InsertNextPoint( &(tempPos[0]) );
}
avgShapeRad /= numNodes;
sstm << fname << "-AvgShape-"<< z << ".vtk";
dataOutputFile = sstm.str();
sstm.str("");
sstm.clear();
// Print the average shape
delaunay3DSurf(avgPos, dataOutputFile);
// Calculate the asphericity of the average shape
for(int av=0; av < numNodes; av++){
Vector3D tempPos;
tempPos = averagePosition[av];
double currRad = tvmet::norm2(tempPos);
avgShapeasph += (currRad - avgShapeRad)*(currRad - avgShapeRad);
}
avgShapeasph /= (numNodes*avgShapeRad*avgShapeRad);
outerLoopFile << z <<"\t"
<< percentStrain << "\t"
<< currAlpha << "\t"
<< currBeta << "\t"
<< currGamma << "\t"
<< avgShapeRad << "\t"
<< avgShapeasph
<< std::endl;
} // SOLUTION LOOP ENDS
innerLoopFile.close();
outerLoopFile.close();
t2 = clock();
float diff((float)t2 - (float)t1);
std::cout << "Solution loop execution time: " << diff / CLOCKS_PER_SEC
<< " seconds" << std::endl;
//Release the dynamically allocated memory
delete vr;
delete bk;
delete bd;
for(vector<OPSNode*>::const_iterator i=nodes.begin(); i!=nodes.end(); ++i){
delete *i;
}
nodes.clear();
} |
<?
class LTChatTplParser
{
var $LTChartCore;
var $language_config;
var $room;
var $private_id;
var $title;
function LTChatTplParser($room = NULL, $private_id = -1)
{
if($private_id >= 0)
$room = '';
$this->private_id = $private_id;
$this->room = $room;
session_start();
//geen cache
header("Expires: Mon, 26 Jul 1990 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
$this->LTChartCore = new LTChatCore();
$this->language_config = $GLOBALS['language_config'];
if(isset($_POST['login']) || isset($_POST['userlogin']))
{
$this->login_err = $this->LTChartCore->login_user();
}
}
function get_tpl($tpl_name, $replace = array(), $recurrent = false)
{
if($recurrent == false)
{
$replace['#header#'] = $this->get_tpl("_header.tpl", $replace, true);
$replace['#footer#'] = $this->get_tpl("_footer.tpl", $replace, true);
}
$replace['#LTChatRoomChangeMsg#'] = str_replace("'","\'",LTChatRoomChangeMsg);
$replace['#css_link#'] = LTTpl_css_link;
$replace['#room#'] = $this->room;
$replace['#private_id#'] = $this->private_id;
$replace['#LTChatTemplatePath#'] = LTChatTemplatePath;
$replace['#PageEncoding#'] = ChPageEncoding;
$replace['#refresh_after#'] = get_ConfVar("ChRefreshAfter");
$replace['#title#'] = $this->title;
$tpl_ar = file(<API key>.$tpl_name);
if(is_array($tpl_ar))
$tpl = implode(null, $tpl_ar);
if(is_array($replace))
$tpl = strtr($tpl, $replace);
if(is_array($this->language_config[$tpl_name]))
$tpl = strtr($tpl, $this->language_config[$tpl_name]);
return $tpl;
}
function <API key>()
{
return $this->get_tpl("frame_users_list.tpl",array("#datatype#" => "users_list"));
}
function get_prv_chat_frame()
{
return $this->get_tpl("frame_prv_talk.tpl",array("#datatype#" => "msg"));
}
function get_talk_frame()
{
return $this->get_tpl("frame_talk.tpl",array("#datatype#" => "msg"));
}
function <API key>()
{
return $this->get_tpl("frame_talk_shoutbox.tpl",array("#datatype#" => "msg"));
}
function get_login_form()
{
$replace = array('#info#' => '', '#post_login#' => $_POST['login'], '#password#' => '');
$info = $this->login_err;
if($info === true)
{
$replace['#ChLoginError#'] = '#info_user_added#';
$replace['#post_login#'] = '';
}
elseif($info !== false)
$replace['#ChLoginError#'] = ($info != '') ? str_replace(array("#info#","#LTChatTemplatePath#"), array($info,LTChatTemplatePath), ChLoginError) : '';
$replace['#show_online#'] = 'Not Found Any Users Now';
$replace['#java#'] = '';
$status = $this->LTChartCore->get_statistics();
define("<API key>","<a onMouseOver=\"stickyTip.show('#mylink#')\" onMouseOut=\"stickyTip.hide()\"><font color='#level_color#'>#value#</font></a>, ");
define("<API key>",", ");
define("<API key>","#value#");
if (is_array($status['online'])){
foreach ($status['online'] as $info){
$color = $this->LTChartCore->get_user_color($info['level']);
$java .= "tips.$info[nick] = new Array(5, 5, 100, 'nick name: $info[nick]<br>Posted msg: $info[posted_msg]<br>Room: $info[room]<br>Status: Online'); \n";
$show_online .= str_replace(array("#mylink#","#level_color#","#value#"), array($info['nick'], $color, $info['nick']), <API key>);
}
$replace['#show_online#'] = $show_online;
$replace['#java#'] = $java;
}
$rooms = "";
foreach ($status['rooms']['defined'] as $room)
if(!$rooms) $rooms .= $room->room_name;
else $rooms .= <API key>.$room->room_name;
if($rooms)
$items .= str_replace(array("#item_name#","#value#"), array(<API key>, $rooms), <API key>);
$optgroup_tpl = <API key>;
$option_tpl = <API key>;
$data = $this->LTChartCore->get_all_rooms();
$select_data = array();
if(is_array($data['rooms']['defined']))
foreach ($data['rooms']['defined'] as $room)
$select_data[$room->room_cat][] = array('room_name' => $room->room_name, 'users_online' => count($room->users_online), 'room_id' => $room->id, 'default' => $room->default);
foreach ($select_data as $room_cat => $rooms)
{
$options = "";
foreach ($rooms as $room_info)
{
if($room_info['default'] == 1){
$default = ChFun_croom_Default;
$selected = 'selected';
}else{
$default = "";
$selected = "";
}
$options .= str_replace(array("#name#","#value#", "#users_online#", "#default#", "#selected#"), array($room_info['room_name'], $room_info['room_name'], $room_info['users_online'], $default, $selected), $option_tpl);
}
$select_data_str .= str_replace(array("#options#","#label#"),array($options, $room_cat), $optgroup_tpl);
}
if($select_data_str)
$replace['#rooms#'] = str_replace(array("#rooms#","#seltext#"),array($select_data_str,LTTpl_login_selroom),ChLoginRooms);
else
$replace['#rooms#'] = "";
$replace['#last_members#'] = $status['stats']['last_members'];
$replace['#top_members#'] = $status['stats']['top_members'];
$replace['#active_members#'] = $status['stats']['active_members'];
if(get_ConfVar("<API key>") == true)
$replace['#guest_login#'] = ChLoginGuestTrue;
else
$replace['#guest_login#'] = ChLoginGuest;
return $this->get_tpl('login_form.tpl', $replace);
}
function <API key>($values)
{
if(is_array($reg_fields = $this->LTChartCore-><API key>()))
{
$fields['integer'] = ChFieldInteger;
$fields['float'] = ChFieldFloat;
$fields['date'] = ChFieldDate;
$fields['text'] = ChFielText;
$fields['textarea'] = ChFielTextarea;
$fields['radio'] = ChFieldRadio;
$fields['radio_option'] = ChFieldRadioOption;
$fields['select'] = ChFielSelect;
$fields['select_option'] = ChFielSelectOption;
$post_fields_data = array();
foreach ($reg_fields as $field)
if(isset($fields[$field->var_type]))
{
$rep_name = $field->var_name;
$rep_var_name = "form{$field->id}";
$rep_value = $values[$rep_var_name];
$post_fields_data[$field->id]['value'] = stripslashes($values[$rep_var_name]);
$post_fields_data[$field->id]['required'] = $field->required;
$required="";
if($field->required == 1)
{
$replace['#required_desc#'] = <API key>;
$required = <API key>;
}
switch ($field->var_type)
{
case 'radio':
case 'select':
$select = "";
$option_tpl = $fields["{$field->var_type}_option"];
$option_ex = explode("|", $field->options);
$options_out = "";
$opt_counter = 0;
foreach ($option_ex as $opt)
{
$select = ""; $opt_counter++;
if($rep_value == $opt_counter)
if($field->var_type == 'radio') $select = " checked ";
elseif($field->var_type == 'select') $select = " selected ";
$options_out .= str_replace(array("#var_name#", "#text#", "#val#","#select#"), array($rep_var_name, $opt, $opt_counter++, $select), $option_tpl);
}
$other_fields .= str_replace(array("#required#","#name#","#var_name#", "#options#"), array($required , $rep_name,$rep_var_name, $options_out), $fields[$field->var_type]);
break;
default:
$rep_length = $field->var_lenght;
$other_fields .= str_replace(array("#required#","#name#","#var_name#","#value#", "#length#"), array($required, $rep_name, $rep_var_name, $rep_value, $rep_length), $fields[$field->var_type]);
break;
}
}
}
return array('post_fields_data' => $post_fields_data, 'other_fields' => $other_fields);
}
function pass_params_via_tpl($template, $params)
{
$other_vars = urlencode(serialize($params));
return "./command_tpl.php?load_template={$template}&other_vars={$other_vars}";
}
function groups_commands($command, $id){
$g_command = $this->LTChartCore->whois_have_commands($id);
if($g_command !== false){
$g_command_filtred = array_filter($g_command);
if(array_key_exists($command, $g_command_filtred))
return 1;
}else{
return NULL;
}
}
function check_view_external($template)
{
$help_info = $this->language_config['help'];
foreach ($help_info as $command_help)
{
if ($command_help['load_template'] == $template){
$check = substr($command_help['commands'][0], 1);
$in_group = $this->groups_commands($check, $this->LTChartCore->get_user_id());
if($in_group !== 1 && $command_help[$this->LTChartCore->get_user_level()] !== true)
return 1;
}
}
if($this->LTChartCore->whois_have_action($this->LTChartCore->get_user_id(), 'disable') == 1){
return 1;
}
}
function get_command_tpl($template, $other_vars)
{
if(!$this->LTChartCore->user_logged_in()) return LTTpl_fullhelp_desc;
switch ($template)
{
case "command_configrooms.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
if(count($_POST) > 0)
{
if($_POST['type'] == "add")
{
$inf = $this->LTChartCore->add_room($_POST);
if($inf === <API key>) $info = ChFun_croom_TxtRc;
elseif($inf === <API key>) $info = ChFun_croom_TxtRn;
elseif($inf === <API key>) $info = str_replace("#max_room_cat_name#",<API key>, ChFun_croom_TxtLRc);
elseif($inf === <API key>) $info = str_replace("#max_room_name#",LTChat_MaxRoomName, ChFun_croom_TxtLRn);
elseif($inf === <API key>) $info = <API key>;
else $info = <API key>;
}
elseif ($_POST['type'] == "del")
{
if(<API key> === $this->LTChartCore->delete_room($_POST['selected_channel'])) $info = <API key>;
else $info = <API key>;
}
elseif ($_POST['type'] == "def")
{
if(<API key> === $this->LTChartCore->set_default_room($_POST['selected_channel'])) $info = <API key>;
else $info = <API key>;
}
}
$replace['#add_room_text#'] = <API key>;
$replace['#category_name_text#'] = <API key>;
$replace['#room_name_text#'] =<API key>;
$replace['#rooms_list_text#'] = <API key>;
$replace['#submit#'] = <API key>;
$replace['#delete_text#'] = <API key>;
$replace['#set_default_text#'] = <API key>;
/* pobranie dodatkowych informacji z klasy LTChatCoreFunctions */
$data = $this->LTChartCore->command_tpl_params($template);
$optgroup_tpl = <API key>;
$option_tpl = <API key>;
$select_data = array();
if(is_array($data['rooms']['defined']))
foreach ($data['rooms']['defined'] as $room)
$select_data[$room->room_cat][] = array('room_name' => $room->room_name, 'users_online' => count($room->users_online), 'room_id' => $room->id, 'default' => $room->default);
foreach ($select_data as $room_cat => $rooms)
{
$options = "";
foreach ($rooms as $room_info)
{
if($room_info['default'] == 1) $default = ChFun_croom_Default;
else $default = "";
$options .= str_replace(array("#name#","#value#", "#users_online#", "#default#"), array($room_info['room_name'], $room_info['room_id'], $room_info['users_online'], $default), $option_tpl);
}
$select_data .= str_replace(array("#options#","#label#"),array($options, $room_cat), $optgroup_tpl);
}
$replace['#rooms_list#'] = $select_data;
$replace['#info#'] = $info;
break;
}
case "command_actionlogs.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$this->title = <API key>;
$actions = $this->LTChartCore->get_logs();
$i = 0;
if(!is_array($actions)) return 'not found any reason';
foreach ($actions as $value) {
$replace['#html#'] .= '<tr>';
$action_time = date('l F Y h:i:s A', $value[action_time]);
$replace['#html#'] .= "<td>$value[reason] <font face='arial' size='2'>in room - $value[room] $action_time</font></td>";
$replace['#html#'] .= '</tr>';
$i++;
}
$replace['#lines#'] = "$i";
break;
}
case "command_actionstop.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$this->title = <API key>;
$stoped = $this->LTChartCore->get_stoped_logs();
$i = 0;
if(!is_array($stoped)) return 'not found any reason';
foreach ($stoped as $value) {
$replace['#html#'] .= '<tr>';
$action_time = date('l F Y h:i:s A', $value[action_time]);
$replace['#html#'] .= "<td>$value[reason] <font face='arial' size='2'>in room - $value[room] $action_time</font></td>";
$replace['#html#'] .= '</tr>';
$i++;
}
$replace['#lines#'] = "$i";
break;
}
case "command_apply.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$user_name = $this->LTChartCore->get_user_name();
$user_data = $this->LTChartCore->get_user_by_nick($user_name);
$date = date('l F Y', time());
$replace = array('#required#'=> <API key>,
'#info#' => '',
'#post_login#' => stripslashes($_POST['create']),
'#password#' => '',
'#room#' => $this->room);
//$registration_fields = $this-><API key>($_POST);
//$replace['#other_fields#'] = $registration_fields['other_fields'];
//$post_fields_data = $registration_fields['post_fields_data'];
$replace['#required_desc#'] = <API key>;
if($user_data->level >= 50){
$replace['#level_select#'] .= '<select name=\'thelevel\'>';
foreach (range('1', '50') as $letter){
$replace['#level_select#'] .= "<option value=\"$letter\">Rank $letter</option>";
}
$replace['#level_select#'] .= "</select>";
}else{
$replace['#level_select#'] = '<input type=\'hidden\' name=\'thelevel\' value=\'1\'>Rank 1 (Default)';
}
$info = $this->LTChartCore->add_user($post_fields_data);
if(<API key> === $info) $replace['#info#'] = '#<API key>#';
if(<API key> === $info) $replace['#info#'] = '#<API key>#';
if(<API key> === $info) $replace['#info#'] = '#ERROR_user_exists#';
if(<API key> === $info) $replace['#info#'] = '#<API key>#';
if(<API key> == $info) $replace['#info#'] = '#<API key>#';
if(<API key> == $info) $replace['#info#'] = '#ERROR_bad_email#';
if($info === true){
$email_status = email_send($_POST['create'], $_POST['password'], $_POST['email']);
//create apply logs
$msg = str_replace(array("#created#","#created_level#","#creating_level#","#created_time#","#created_by#"),
array($_POST['create'], $_POST['thelevel'], $user_data->level, $date, $user_data->nick),
LTChatCreateOpMsg);
//post the apply logs
$this->LTChartCore->post_logs($msg, FALSE, 'apply', FALSE);
$replace['#info#'] = LTTpl_user_added;
$replace['#info#'] .= "<br> $email_status";
}
break;
}
case "command_applylogs.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$this->title = <API key>;
$apply_logs = $this->LTChartCore->get_apply_logs();
$i = 0;
if(!is_array($apply_logs)) return 'not found any reason';
foreach ($apply_logs as $value) {
$replace['#html#'] .= '<tr>';
$action_time = date('l F Y h:i:s A', $value[action_time]);
$replace['#html#'] .= "<td>$value[reason] <font face='arial' size='2'></font></td>";
$replace['#html#'] .= '</tr>';
$i++;
}
$replace['#lines#'] = "$i";
break;
}
case "command_list.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$this->title = <API key>;
$online_list = $this->LTChartCore-><API key>();
$i = 0;
if(!is_array($online_list)) return 'not found any users';
foreach ($online_list as $value) {
$color = $this->LTChartCore->get_user_color($value['level']);
$replace['#html#'] .= str_replace(
array("#id#","#nickname#","#room#","#ip_address#","#comment#","#mycolor#"),
array($i + 1,$value['nick'],$value['room'],$value['last_ip'],$value['comment'],$color), ChFun_list);
$i++;
}
$replace['#lines#'] = "$i";
break;
}
case "command_updologs.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$this->title = <API key>;
$check = $this->LTChartCore->get_updologs();
$i = 0;
//check is array and not empty
if(is_array($check)){
foreach ($check as $value) {
$replace['#html#'] .= '<tr>';
$replace['#html#'] .= "<td>$value[reason]</td>";
$replace['#html#'] .= '</tr>';
$i++;
}
$replace['#lines#'] = "$i";
}else{
$replace['#html#'] = 'not found any upgrade or downgrade saved logs';
}
break;
}
case "command_trace.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$row = 1;
$handle = fopen(ROOT_LOGS_PATH."trace.html", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
for ($c=0; $c < $num; $c++) {
$replace['#html#'] .= $data[$c];
}
}
fclose($handle);
$replace['#lines#'] = "$row";
$this->title = "Number Lines $row !";
break;
}
case "command_trace2.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$row = 1;
$handle = fopen(ROOT_LOGS_PATH."trace2.html", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
for ($c=0; $c < $num; $c++) {
$replace['#html#'] .= $data[$c];
}
}
fclose($handle);
$replace['#lines#'] = "$row";
$this->title = "Number Lines $row !";
break;
}
case "command_trace4.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$row = 1;
$handle = fopen(ROOT_LOGS_PATH."trace4.html", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
for ($c=0; $c < $num; $c++) {
$replace['#html#'] .= $data[$c];
}
}
fclose($handle);
$replace['#lines#'] = "$row";
$this->title = "Number Lines $row !";
break;
}
case "command_check.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$this->title = <API key>;
$check = $this->LTChartCore->check_saved();
$i = 0;
foreach ($check as $value) {
$replace['#html#'] .= '<tr>';
$action_time = date('l F Y h:i:s A', $value['action_time']);
$my_info = $this->LTChartCore->get_user_by_nick($value['action_by']); //get users info
if ($value['type'] == 'abuse'){
$replace['
}else{
$replace['#html#'] .= "<td>$value[reason] <font face='arial' size='2'>in room - $value[room] $action_time</font> <a href='./loggers/saved/$my_info->id$value[action_time].html' target='_new'>(check)</a></td>";
}
$replace['#html#'] .= '</tr>';
$i++;
}
$replace['#lines#'] = "$i";
break;
}
case "command_register.tpl":
{
$this->title = <API key>;
$replace['#info#'] = "";
$replace['#admin#'] = 'This area only for admin';
$user = new User();
if($_POST['submitted'] == TRUE){
$replace['#info#'] = $this->LTChartCore->register($_POST);
}
if($this->LTChartCore->get_user_level() == 50){
$replace['#admin#'] = $user->show_signup();
}
break;
}
case "command_showops.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$show = $this->LTChartCore->showops();
$i = 0;
foreach ($show as $value) {
$rights = $this->LTChartCore->get_rights_by_level($value->level);
$color = $this->LTChartCore->get_user_color($value->level);
$registered = ($value->registered != 0)?date('l F Y h:i:s A', $value->registered):"No data";
$last_seen = ($value->last_seen != 0)?date('l F Y h:i:s A', $value->last_seen):"No data";
$replace['#members_info#'] .= str_replace(
array("#id#","#Nick#","#Status#","#level#","#Start#","#lastlogin#","#color#", "#nickfont#"),
array($value->id, $value->nick, $rights, $value->level, $registered, $last_seen, $color, $value->nickfont),
ChFun_showops);
$i++;
}
$replace['#lines#'] = "$i";
$this->title = "Total Members On The Database $i !";
break;
}
case "command_showforward.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$row = 1;
$handle = fopen(ROOT_LOGS_PATH."forward.html", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
for ($c=0; $c < $num; $c++) {
$replace['#html#'] .= $data[$c];
}
}
fclose($handle);
$replace['#lines#'] = "$row";
$this->title = "Number Lines $row !";
break;
}
case "command_showclear.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$row = 1;
$handle = fopen(ROOT_LOGS_PATH."clear.html", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
for ($c=0; $c < $num; $c++) {
$replace['#html#'] .= $data[$c];
}
}
fclose($handle);
$replace['#lines#'] = "$row";
$this->title = "Number Lines $row !";
break;
}
case "command_showsus.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$show = $this->LTChartCore->showsus(); //get list of suspanded opreators
$my_info = $this->LTChartCore->get_user_by_nick($this->LTChartCore->get_user_name()); //get my info
$help_info = $this->language_config['help']['unsus'];
$replace['#error#'] = 'What ?';
$replace['#html#'] = '';
//check is array and not empty
if(is_array($show)){
$i = 0;
foreach ($show as $value) { //foreach and while
//get info the user in loop
$user_data = $this->LTChartCore->get_user_by_id($value->users_id);
//get the color
$color = $this->LTChartCore->get_user_color($value->level);
//get the date for action
$date = ($value->action_time != 0)?date('l F Y', $value->action_time):"No data";
//get the time for action
$time = ($value->action_time != 0)?date('h:i:s A', $value->action_time):"No data";
//create the link
$checked = str_replace(
array("#reason_id#","#users_id#","#link_title#"),
array($value->id, $value->users_id ,'Active'), <API key>);
if($my_info->level >= $user_data->level && $help_info[$this->LTChartCore->get_user_level()] == true){
$link = $checked;
}else{
$link = 'disabled';
}
//create the reason in showsus
$replace['#html#'] .= str_replace(
array("#id#","#sus_user#","#sus_by#","#level#","#reason#","#date#","#time#", "#stop_disabling#"),
array($value->id, $value->action_on, $value->action_by, $user_data->level, $value->reason, $date, $time, $link), ChFun_showsus);
$i++;
}##end foreach
}else{
$replace['#error#'] = 'not found any users in sus list';
}
//sum the lines or the line number eq 0
$replace['#lines#'] = ($i != '')? $i :"0";
//check isset for reason and users (id)
if (isset($_GET['reason_id'], $_GET['users_id']) && $_GET['reason_id'] > 0 && $_GET['users_id'] > 0) {
//check command for unsus high level
$user = $this->LTChartCore->get_user_by_id($_GET['users_id']);
if($my_info->level >= $user->level && $help_info[$this->LTChartCore->get_user_level()] == true){
//delete sus && create logs and post in logs table
$how_delete = $this->LTChartCore->delete_sus($_GET['users_id']);
if($how_delete == TRUE){
$replace['#error#'] = str_replace(array("#user#","#reason_id#"),
array($my_info->nick, $_GET['reason_id']), ChFun_un_sused_msg);
}
}else{
$replace['#error#'] = 'dont have premssion to stop this sus';
}
}
break;
}
case "command_showban.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$show = $this->LTChartCore->showban();
$my_info = $this->LTChartCore->get_user_by_nick($this->LTChartCore->get_user_name()); //get my info
$replace['#error#'] = 'What ?';
$replace['#html#'] = '';
if($show){
$i = 0;
foreach ($show as $value) {
//get info the do action
$user_data = $this->LTChartCore->get_user_by_nick($value->action_by);
//get color the do action
$color = $this->LTChartCore->get_user_color($value->level);
//get date the action
$date = ($value->action_time != 0)?date('l F Y', $value->action_time):"No data";
//get time the action
$time = ($value->action_time != 0)?date('h:i:s A', $value->action_time):"No data";
//check while and type
if($value->type == 'banuser'){
$checked = str_replace(
array("#reason_id#","#users_id#","#link_title#"),
array($value->id, $user_data->id ,'Active'), <API key>);
$link = ($my_info->level >= $user_data->level) ? $checked :"disable";
$nick_ip = $value->banip;
}elseif($value->type == 'banip'){
$checked = str_replace(
array("#reason_id#","#users_id#","#link_title#"),
array($value->id, $user_data->id ,'Active'), <API key>);
$link = ($my_info->level >= $user_data->level) ? $checked :"disable";
$nick_ip = $value->banip;
}##end check type
//create the final link
$replace['#html#'] .= str_replace(
array("#id#","#nick/ip#","#banned_By#","#level#","#reason#","#date#","#time#", "#stop_disabling#"),
array($value->id, $nick_ip, $user_data->nick, $user_data->level, $value->reason, $date, $time, $link), ChFun_showban);
$i++;
}##end foreach
}else{
$replace['#error#'] = 'not found any nick/ip in list';
}##end if show
$replace['#lines#'] = ($i != '')? $i :"0";
//check reason_id && users_id -> and value > 0
if (isset($_GET['reason_id'], $_GET['users_id']) && $_GET['reason_id'] > 0 && $_GET['users_id'] > 0) {
//check the user level try to unbanned -> the action
$user = $this->LTChartCore->get_user_by_id($_GET['users_id']);
if($my_info->level >= $user->level){
//drop the check the row by id in actions table
$how_delete = $this->LTChartCore->delete_ban($_GET['reason_id']);
if($how_delete){
$replace['#error#'] = str_replace(array("#user#","#reason_id#"),
array($my_info->nick, $_GET['reason_id']), ChFun_un_banned_msg);
}
}else{
$replace['#error#'] = 'dont have premssion to stop this ban';
}
}##end if isset
break;
}
case "command_showbanpc.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$show = $this->LTChartCore->showbanpc();
$my_info = $this->LTChartCore->get_user_by_nick($this->LTChartCore->get_user_name()); //get my info
$replace['#error#'] = 'What ?';
$replace['#html#'] = '';
if($show){
$i = 0;
foreach ($show as $value) {
//get info the do action
$user_data = $this->LTChartCore->get_user_by_nick($value->action_by);
//get color the do action
$color = $this->LTChartCore->get_user_color($value->level);
//get date the action
$date = ($value->action_time != 0)?date('l F Y', $value->action_time):"No data";
//get time the action
$time = ($value->action_time != 0)?date('h:i:s A', $value->action_time):"No data";
//check while and type
if($value->type == 'banpcuser'){
$checked = str_replace(
array("#reason_id#","#users_id#","#link_title#"),
array($value->id, $user_data->id ,'Active'), <API key>);
$link = ($my_info->level >= $user_data->level) ? $checked :"disable";
$nick_ip = $value->banip;
}elseif($value->type == 'banpcip'){
$checked = str_replace(
array("#reason_id#","#users_id#","#link_title#"),
array($value->id, $user_data->id ,'Active'), <API key>);
$link = ($my_info->level >= $user_data->level) ? $checked :"disable";
$nick_ip = $value->banip;
}##end check type
//create the final link
$replace['#html#'] .= str_replace(
array("#id#","#nick/ip#","#banned_By#","#level#","#reason#","#date#","#time#", "#stop_disabling#"),
array($value->id, $nick_ip, $user_data->nick, $user_data->level, $value->reason, $date, $time, $link), ChFun_showban);
$i++;
}##end foreach
}else{
$replace['#error#'] = 'not found any nick/ip in list';
}##end if show
$replace['#lines#'] = ($i != '')? $i :"0";
//check reason_id && users_id -> and value > 0
if (isset($_GET['reason_id'], $_GET['users_id']) && $_GET['reason_id'] > 0 && $_GET['users_id'] > 0) {
//check the user level try to unbanned -> the action
$user = $this->LTChartCore->get_user_by_id($_GET['users_id']);
if($my_info->level >= $user->level){
//drop the check the row by id in actions table
$how_delete = $this->LTChartCore->delete_ban($_GET['reason_id']);
if($how_delete){
$replace['#error#'] = str_replace(array("#user#","#reason_id#"),
array($my_info->nick, $_GET['reason_id']), ChFun_un_banned_msg);
}
}else{
$replace['#error#'] = 'dont have premssion to stop this ban';
}
}##end if isset
break;
}
case "command_showdisable.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$show = $this->LTChartCore->showdisable();
$my_info = $this->LTChartCore->get_user_by_nick($this->LTChartCore->get_user_name()); //get my info
$replace['#error#'] = 'What ?';
$replace['#html#'] = '';
if($show){
$i = 0;
foreach ($show as $value) {
$user_data = $this->LTChartCore->get_user_by_id($value->users_id);
$color = $this->LTChartCore->get_user_color($value->level);
$date = ($value->action_time != 0)?date('l F Y', $value->action_time):"No data";
$time = ($value->action_time != 0)?date('h:i:s A', $value->action_time):"No data";
$checked = str_replace(
array("#reason_id#","#users_id#","#link_title#"),
array($value->id, $value->users_id ,'Active'), <API key>);
$help_info = $this->language_config['help']['enable'];
if($my_info->level >= $user_data->level && $help_info[$this->LTChartCore->get_user_level()] == true){
$link = $checked;
}else{
$link = 'disabled';
}
$replace['#html#'] .= str_replace(
array("#id#","#nick#","#disabled_by#","#level#","#reason#","#date#","#time#", "#stop_disabling#"),
array($value->id, $value->action_on, $value->action_by, $user_data->level, $value->reason, $date, $time, $link), ChFun_showdisable);
$i++;
}##end foreach
}else{
$replace['#error#'] = 'not found any users in disable list';
}
$replace['#lines#'] = ($i != '')? $i :"0";
if (isset($_GET['reason_id'], $_GET['users_id']) && $_GET['reason_id'] > 0 && $_GET['users_id'] > 0) {
//check command for stop enabled high level
$user = $this->LTChartCore->get_user_by_id($_GET['users_id']);
if($my_info->level >= $user->level){
$how_delete = $this->LTChartCore->delete_disable($_GET['users_id']);
if($how_delete){
$replace['#error#'] = str_replace(array("#user#","#reason_id#"),
array($my_info->nick, $_GET['reason_id']), <API key>);
}
}else{
$replace['#error#'] = 'dont have premssion to stop this disable';
}
}
break;
}
case "command_configreg.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$this->title = <API key>;
if(isset($other_vars['delete_id']))
$info = $this->LTChartCore->del_reg_field($other_vars['delete_id']);
if(count($_POST) > 0)
$this->LTChartCore->add_reg_field($_POST);
$data = $this->LTChartCore->command_tpl_params($template);
$replace['#options_text#'] = <API key>;
$replace['#add_text#'] = <API key>;
$replace['#field_name_text#'] = <API key>;
$replace['#field_name#'] = 'f_name';
$replace['#items_text#'] = <API key>;
$replace['#required_text#'] = <API key>;
$replace['#length_text#'] = <API key>;
$replace['#item_name#'] = 'item';
$replace['#required_name#'] = 'required';
$replace['#length_name#'] = 'lenght';
$replace['#options_name#'] = 'options';
$replace['#submit#'] = <API key>;
foreach (explode(",",<API key>) as $item)
$items .= str_replace("#name#",$item, <API key>);
$replace['#items#'] = $items;
$fields_desc = str_replace(array("#var_name#","#var_type#","#var_length#","#required#","#delete#"),
array(<API key>, <API key>, <API key>, <API key>,<API key>), <API key>);
if(is_array($data['reg_fields']))
foreach($data['reg_fields'] as $field)
{
$del_link = $this->pass_params_via_tpl($template, array('delete_id' => $field->id));
$fields .= str_replace(array("#var_name#","#var_type#","#var_length#","#required#","#delete#","#del_link#"),
array($field->var_name, $field->var_type,$field->var_length, $field->required, <API key>, $del_link),<API key>);
}
$replace["#fields_desc#"] = $fields_desc;
$replace['#fields#'] = $fields;
$replace['#add#'] = $add;
break;
}
case "command_config.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$data = $this->LTChartCore->command_tpl_params($template);
include_once(LTChart_path."/include/LTChatModVars.inc.php");
if(count($_POST) > 0)
$this->LTChartCore->set_chat_variable($_POST);
$config = array();
foreach ($GLOBALS['ConfigVarsInfo'] as $var_name => $info)
if($info['type'] == "int")
{
$config[$info['category']] .= str_replace(array("#description#", "#value#", "#name#", "#submit#"), array($info['description'], get_ConfVar($var_name), $var_name, LTTpl_config_submit), <API key>);
}
elseif($info['type'] == "boolean")
{
if(get_ConfVar($var_name)) $value = ChTPL_ENABLED;
else $value = ChTPL_Disabled;
$config[$info['category']] .= str_replace(array("#description#", "#value#", "#name#", "#submit#"), array($info['description'], $value, $var_name, LTTpl_config_submit), <API key>);
}
foreach ($config as $c_name => $content)
$out .= str_replace(array("#name#","#items#"), array($c_name, $content), <API key>);
$this->title = LTTpl_config_title;
$replace['#config#'] = $out;
break;
}
case "command_avatar.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
if($other_vars['file_name'] != "")
$this->LTChartCore->set_avatar($other_vars['file_name']);
$data = $this->LTChartCore->command_tpl_params($template);
$avatars_array = array_chunk($data['avatars'], <API key> * <API key>);
$page = 0;
if(is_numeric($other_vars['page']))
$page = (int)$other_vars['page'];
$avatars_rows = array_chunk($avatars_array[$page], <API key>);
foreach ($avatars_rows as $row_items)
{
$rows = "";
foreach ($row_items as $file_info)
{
$select_link = $this->pass_params_via_tpl($template, array('file_name' => $file_info['link'], 'page' => $page));
if($file_info['owner'])
$item = str_replace(array("#link#", "#user#","#LTChatTemplatePath#"), array($file_info['link'], $file_info['owner'], LTChatTemplatePath), <API key>);
else
$item = str_replace(array("#link#", "#user#","#select_link#","#LTChatTemplatePath#"), array($file_info['link'], $file_info['owner'], $select_link, LTChatTemplatePath), <API key>);
$rows .= str_replace("#item#",$item,<API key>);
}
$out .= str_replace("#rows#",$rows, <API key>);
}
$out = str_replace("#data#", $out, ChFun_avatar_table);
$replace['#avatars#'] = $out;
for($i = 0; $i < count($avatars_rows); $i++)
{
$link = $this->pass_params_via_tpl($template, array('page' => $i));
if($page == $i)
$pages .= str_replace(array("#nr#","#link#"), array($i+1, $link), <API key>);
else
$pages .= str_replace(array("#nr#","#link#"), array($i+1, $link), <API key>);
}
$pages = str_replace("#items#", $pages, <API key>);
$replace['#avatars_pages#'] = $pages;
$this->title = LTTpl_avatar_title;
break;
}
case "command_fullhelp.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
/* pobranie dodatkowych informacji z klasy LTChatCoreFunctions */
$data = $this->LTChartCore->command_tpl_params($template);
$level = $this->LTChartCore->get_user_level();
$item_tpl = $this->get_tpl("<API key>.tpl");
if(is_array($data['functions']))
foreach ($data['functions'] as $command)
$items .= str_replace("#item#", $command, $item_tpl);
$replace['#items#'] = $items;
$this->title = <API key>;
$replace['#description#'] = LTTpl_fullhelp_desc;
$replace['#you_level#'] = "You in level $level and have premssion to use this command";
break;
}
case "command_bug_form.tpl":
{
if($this->check_view_external($template)) return ChFunNoRights;
$data = $this->LTChartCore->command_tpl_params($template);
$replace['#ver#'] = Ch_VER;
$replace['#submit#'] = LTTpl_bug_send;
$this->title = LTTpl_bug_title;
break;
}
case "command_info.tpl":
if($this->check_view_external($template)) return ChFunNoRights;
/* pobranie dodatkowych informacji z klasy LTChatCoreFunctions */
$data = $this->LTChartCore->command_tpl_params($template);
$user_name = $other_vars['login'];
$replace['#error
$user_data = $this->LTChartCore->get_user_by_nick($user_name);
$post_s = array();
if(is_array($user_data->other_fields))
foreach ($user_data->other_fields as $field)
{
eval("\$post_s[\"form{\$field->".LTChat_Main_prefix."users_var_names_id}\"] = \$field->value;");
}
$registration_fields = $this-><API key>($post_s);
$replace['#other_fields#'] = $registration_fields['other_fields'];
define(LTTpl_me_reg_date, "Y-m-d G:i:s");
define(<API key>, "Y-m-d G:i:s");
$replace['#registration_date#'] = ($user_data->registered != 0)?date(LTTpl_me_reg_date,$user_data->registered):"No data";
$replace['#registration_text#'] = LTTpl_me_reg_text;
$replace['#last_seen_value#'] = ($user_data->last_seen != 0)?date(<API key>,$user_data->last_seen):"No data";
$replace['#last_seen_text#'] = <API key>;
$replace['#posted_msg_text#'] = <API key>;
$replace['#posted_msg_value#'] = $user_data->posted_msg;
$replace['#last_host_text#'] = <API key>;
$replace['#last_host_value#'] = $user_data->last_host;
$replace['#last_ip_text#'] = <API key>;
$replace['#last_ip_value#'] = $user_data->last_ip;
$replace['#colorvalue#'] = $user_data->color;
$replace['#nickcolorvalue#'] = $user_data->nickcolor;
$replace['#fontvalue#'] = $user_data->font;
$replace['#nickfontvalue#'] = $user_data->nickfont;
if(!$user_data->picture_url)
$replace['#picture_url#'] = "./img/avatars/noavatar.gif";
else
$replace['#picture_url#'] = $user_data->picture_url;
$this->title = str_replace("#user#",$user_data->nick, LTTpl_me_title);
$replace['#login#'] = $user_data->nick;
$replace['#submit#'] = "";
break;
case "command_me.tpl":
if($this->check_view_external($template)) return ChFunNoRights;
/* pobranie dodatkowych informacji z klasy LTChatCoreFunctions */
$data = $this->LTChartCore->command_tpl_params($template);
$user_name = $this->LTChartCore->get_user_name();
$id = $this->LTChartCore->get_user_id();
if($this->LTChartCore->get_user_name() == $user_name)
if(count($_POST) > 0){
$err_info = $this->LTChartCore->update_other_fields($_POST);
$this->LTChartCore->update_style_fields($_POST, $id);
if($err_info === <API key>)
$error = <API key>;
elseif ($err_info === <API key>)
$error = <API key>;
}
$replace['#error#'] = $error;
$user_data = $this->LTChartCore->get_user_by_nick($user_name);
$post_s = array();
if(is_array($user_data->other_fields))
foreach ($user_data->other_fields as $field)
{
eval("\$post_s[\"form{\$field->".LTChat_Main_prefix."users_var_names_id}\"] = \$field->value;");
}
$registration_fields = $this-><API key>($post_s);
$replace['#other_fields#'] = $registration_fields['other_fields'];
define(LTTpl_me_reg_date, "Y-m-d G:i:s");
define(<API key>, "Y-m-d G:i:s");
$replace['#registration_date#'] = ($user_data->registered != 0)?date(LTTpl_me_reg_date,$user_data->registered):"No data";
$replace['#registration_text#'] = LTTpl_me_reg_text;
$replace['#last_seen_value#'] = ($user_data->last_seen != 0)?date(<API key>,$user_data->last_seen):"No data";
$replace['#last_seen_text#'] = <API key>;
$replace['#posted_msg_text#'] = <API key>;
$replace['#posted_msg_value#'] = $user_data->posted_msg;
$replace['#last_host_text#'] = <API key>;
$replace['#last_host_value#'] = $user_data->last_host;
$replace['#last_ip_text#'] = <API key>;
$replace['#last_ip_value#'] = $user_data->last_ip;
$replace['#colorvalue#'] = $user_data->color;
$replace['#nickcolorvalue#'] = $user_data->nickcolor;
$replace['#fontvalue#'] = $user_data->font;
$replace['#nickfontvalue#'] = $user_data->nickfont;
if(!$user_data->picture_url)
$replace['#picture_url#'] = "./img/avatars/noavatar.gif";
else
$replace['#picture_url#'] = $user_data->picture_url;
$this->title = str_replace("#user#",$user_data->nick, LTTpl_me_title);
$replace['#login#'] = $user_data->nick;
$replace['#submit#'] = str_replace('#send#',LTTpl_me_send,ChFun_me_submit);
break;
default:
{
exit;
}
}
return $this->get_tpl($template, $replace);
}
function get_chat()
{
if(!$this->LTChartCore->user_action($this->room)){
return $this->get_login_form();
}
if(isset($_POST['get_login']) && ($_POST['get_login']) == '1'){
return $this->get_login();
}
if(isset($_POST['get_chat_view']) && ($_POST['get_chat_view']) == '1'){
$replace['#chat_title#'] = 'SpecialChat';
$replace['#user_name#'] = $this->LTChartCore->get_user_name();
$replace['#date#'] = date("F j, Y");
return $this->get_tpl('chat_view.tpl',$replace);
}
if($_SESSION['LTChart_user_id']){
$replace['#chat_title#'] = 'SpecialChat';
$replace['#user_name#'] = $this->LTChartCore->get_user_name();
$replace['#date#'] = date("F j, Y");
return $this->get_tpl('chat_view.tpl',$replace);
}else{
return $this->get_login_form();
}
}
function get_login()
{
global $autoup;
$user_name = $this->LTChartCore->get_user_name();
$this->title = $user_name;
$replace['#user_name#'] = $user_name;
$replace['#user_id#'] = $_SESSION['LTChart_user_id'];
$replace['#user_rights#'] = $_SESSION['LTChart_user_rights'];
$replace['#user_level#'] = $_SESSION['LTChart_user_level'];
$user_data = $this->LTChartCore->get_user_by_nick($user_name);
define(LTTpl_me_reg_date, "Y-m-d h:i:s");
define(<API key>, "Y-m-d h:i:s");
$replace['#registration_date#'] = ($user_data->registered != 0)?date(LTTpl_me_reg_date,$user_data->registered):"No data";
$replace['#last_seen_value#'] = ($user_data->last_seen != 0)?date(<API key>,$user_data->last_seen):"No data";
$replace['#last_ip_value#'] = $user_data->last_ip;
## Start Rooms dropdown
$optgroup_tpl = <API key>;
$option_tpl = <API key>;
$data = $this->LTChartCore->get_all_rooms();
$select_data = array();
if(is_array($data['rooms']['defined']))
foreach ($data['rooms']['defined'] as $room)
$select_data[$room->room_cat][] = array('room_name' => $room->room_name, 'users_online' => count($room->users_online), 'room_id' => $room->id, 'default' => $room->default);
$replace['#users_online#'] = count($room->users_online);
foreach ($select_data as $room_cat => $rooms)
{
$options = "";
foreach ($rooms as $room_info)
{
if($room_info['default'] == 1) $default = ChFun_croom_Default;
else $default = "";
$options .= str_replace(array("#name#","#value#", "#users_online#", "#default#"), array($room_info['room_name'], $room_info['room_name'], $room_info['users_online'], $default), $option_tpl);
}
$select_data_str .= str_replace(array("#options#","#label#"),array($options, $room_cat), $optgroup_tpl);
}
if($select_data_str)
$replace['#rooms#'] = str_replace(array("#rooms#","#seltext#"),array($select_data_str,LTTpl_login_selroom),ChLoginRooms);
else
$replace['#rooms#'] = "";
## end Rooms dropdown
if($_POST['guest'] == '1')$guest = 1;
else $guest = 0;
$level = $_SESSION['LTChart_user_level'];
$color = $this->LTChartCore->get_user_color($level);
$range = range(from_level, to_level);
$ttime = $this->LTChartCore->get_total_time();
$myhour = $ttime / 3600;
if($level >= from_level && $level <= to_level){
if(is_array($range))
if(in_array($level, $range))
$limitaz = $autoup[$level];
$dopercent = ( $myhour / $limitaz ) * 100;
$percent = ceil($dopercent);
$monthly_percent = ceil($this->LTChartCore->get_total_monthly());
$monthlybar = str_replace(array("#monthlypercent#","#LTChatTemplatePath#"), array($monthly_percent, LTChatTemplatePath), monthlybar);
$timerbar = str_replace(array("#percent#","#LTChatTemplatePath#"), array($percent, LTChatTemplatePath), timerbar);
}else{
$timerbar = str_replace(array("#LTChatTemplatePath#"), array(LTChatTemplatePath), not_in_timerbar);
$monthlybar = str_replace(array("#LTChatTemplatePath#"), array(LTChatTemplatePath), not_in_monthlybar);
}
$replace['#timerbar#'] = $timerbar;
$replace['#monthlybar#'] = $monthlybar;
$replace['#color#'] = $color;
$replace['#new_cmail#'] = $this->LTChartCore->get_new_cmail();
if($level >= 0 && $guest == 0){
$output = $this->get_tpl('chat_login_member.tpl', $replace, true);
}else{
$output = $this->get_tpl('chat_login_guest.tpl', $replace, true);
}
return $output;
}
function get_shoutbox($sbox_id)
{
$sbox_id = (int)$sbox_id;
return $this->get_tpl('shoutbox_view.tpl', array('#send#' => <API key>, '#message#' => LTTpl_shoutbox_msg, '#login#' => LTTpl_shoutbox_nick, '#sbox_id#' => $sbox_id));
}
function show_private_chat()
{
if(!$this->LTChartCore->user_action($this->room))
return $this->get_login_form();
else
{
$this->title = ChFun_prv_Title;
$user_data = $this->LTChartCore->get_user_by_id($_GET['private_id']);
$replace['#user#'] = $user_data->nick;
return $this->get_tpl('<API key>.tpl', $replace, true);
}
}
}
?> |
/*
* gcenv.os.cpp
*
* GCToOSInterface implementation
*
*
*/
#include "common.h"
#include "gcenv.h"
#ifndef FEATURE_PAL
#include <Psapi.h>
#endif
#define MAX_PTR ((uint8_t*)(~(ptrdiff_t)0))
// Initialize the interface implementation
// Return:
// true if it has succeeded, false if it has failed
bool GCToOSInterface::Initialize()
{
<API key>;
return true;
}
// Shutdown the interface implementation
void GCToOSInterface::Shutdown()
{
<API key>;
}
// Get numeric id of the current thread if possible on the
// current platform. It is indended for logging purposes only.
// Return:
// Numeric id of the current thread or 0 if the
uint32_t GCToOSInterface::<API key>()
{
<API key>;
return ::GetCurrentThreadId();
}
// Get id of the process
// Return:
// Id of the current process
uint32_t GCToOSInterface::GetCurrentProcessId()
{
<API key>;
return ::GetCurrentProcessId();
}
// Set ideal affinity for the current thread
// Parameters:
// affinity - ideal processor affinity for the thread
// Return:
// true if it has succeeded, false if it has failed
bool GCToOSInterface::<API key>(GCThreadAffinity* affinity)
{
<API key>;
bool success = true;
#if !defined(FEATURE_CORESYSTEM)
<API key>(GetCurrentThread(), (DWORD)affinity->Processor);
#elif !defined(FEATURE_PAL)
PROCESSOR_NUMBER proc;
if (affinity->Group != -1)
{
proc.Group = (WORD)affinity->Group;
proc.Number = (BYTE)affinity->Processor;
proc.Reserved = 0;
success = !!<API key>(GetCurrentThread(), &proc, NULL);
}
else
{
if (<API key>(GetCurrentThread(), &proc))
{
proc.Number = (BYTE)affinity->Processor;
success = !!<API key>(GetCurrentThread(), &proc, NULL);
}
}
#endif
return success;
}
// Get the number of the current processor
uint32_t GCToOSInterface::<API key>()
{
<API key>;
_ASSERTE(<API key>());
return ::<API key>();
}
// Check if the OS supports getting current processor number
bool GCToOSInterface::<API key>()
{
<API key>;
#ifdef FEATURE_PAL
return <API key>();
#else
// on all Windows platforms we support this API exists
return true;
#endif
}
// Flush write buffers of processors that are executing threads of the current process
void GCToOSInterface::<API key>()
{
<API key>;
::<API key>();
}
// Break into a debugger
void GCToOSInterface::DebugBreak()
{
<API key>;
::DebugBreak();
}
// Get number of logical processors
uint32_t GCToOSInterface::GetLogicalCpuCount()
{
<API key>;
return ::GetLogicalCpuCount();
}
// Causes the calling thread to sleep for the specified number of milliseconds
// Parameters:
// sleepMSec - time to sleep before switching to another thread
void GCToOSInterface::Sleep(uint32_t sleepMSec)
{
<API key>;
__SwitchToThread(sleepMSec, 0);
}
// Causes the calling thread to yield execution to another thread that is ready to run on the current processor.
// Parameters:
// switchCount - number of times the YieldThread was called in a loop
void GCToOSInterface::YieldThread(uint32_t switchCount)
{
<API key>;
__SwitchToThread(0, switchCount);
}
// Reserve virtual memory range.
// Parameters:
// address - starting virtual address, it can be NULL to let the function choose the starting address
// size - size of the virtual memory range
// alignment - requested memory alignment
// flags - flags to control special settings like write watching
// Return:
// Starting virtual address of the reserved range
void* GCToOSInterface::VirtualReserve(void* address, size_t size, size_t alignment, uint32_t flags)
{
<API key>;
DWORD memFlags = (flags & VirtualReserveFlags::WriteWatch) ? (MEM_RESERVE | MEM_WRITE_WATCH) : MEM_RESERVE;
if (alignment == 0)
{
return ::ClrVirtualAlloc(0, size, memFlags, PAGE_READWRITE);
}
else
{
return ::<API key>(0, size, memFlags, PAGE_READWRITE, alignment);
}
}
// Release virtual memory range previously reserved using VirtualReserve
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// Return:
// true if it has succeeded, false if it has failed
bool GCToOSInterface::VirtualRelease(void* address, size_t size)
{
<API key>;
<API key>(size);
return !!::ClrVirtualFree(address, 0, MEM_RELEASE);
}
// Commit virtual memory range. It must be part of a range reserved using VirtualReserve.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// Return:
// true if it has succeeded, false if it has failed
bool GCToOSInterface::VirtualCommit(void* address, size_t size)
{
<API key>;
return ::ClrVirtualAlloc(address, size, MEM_COMMIT, PAGE_READWRITE) != NULL;
}
// Decomit virtual memory range.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// Return:
// true if it has succeeded, false if it has failed
bool GCToOSInterface::VirtualDecommit(void* address, size_t size)
{
<API key>;
return !!::ClrVirtualFree(address, size, MEM_DECOMMIT);
}
// Reset virtual memory range. Indicates that data in the memory range specified by address and size is no
// longer of interest, but it should not be decommitted.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// unlock - true if the memory range should also be unlocked
// Return:
// true if it has succeeded, false if it has failed
bool GCToOSInterface::VirtualReset(void * address, size_t size, bool unlock)
{
<API key>;
bool success = ::ClrVirtualAlloc(address, size, MEM_RESET, PAGE_READWRITE) != NULL;
#ifndef FEATURE_PAL
if (success && unlock)
{
// Remove the page range from the working set
::VirtualUnlock(address, size);
}
#endif // FEATURE_PAL
return success;
}
// Check if the OS supports write watching
bool GCToOSInterface::SupportsWriteWatch()
{
<API key>;
bool writeWatchSupported = false;
// check if the OS supports write-watch.
// Drawbridge does not support write-watch so we still need to do the runtime detection for them.
// Otherwise, all currently supported OSes do support write-watch.
void* mem = VirtualReserve (0, g_SystemInfo.<API key>, 0, VirtualReserveFlags::WriteWatch);
if (mem != NULL)
{
VirtualRelease (mem, g_SystemInfo.<API key>);
writeWatchSupported = true;
}
return writeWatchSupported;
}
// Reset the write tracking state for the specified virtual memory range.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
void GCToOSInterface::ResetWriteWatch(void* address, size_t size)
{
<API key>;
::ResetWriteWatch(address, size);
}
// Retrieve addresses of the pages that are written to in a region of virtual memory
// Parameters:
// resetState - true indicates to reset the write tracking state
// address - starting virtual address
// size - size of the virtual memory range
// pageAddresses - buffer that receives an array of page addresses in the memory region
// pageAddressesCount - on input, size of the lpAddresses array, in array elements
// on output, the number of page addresses that are returned in the array.
// Return:
// true if it has succeeded, false if it has failed
bool GCToOSInterface::GetWriteWatch(bool resetState, void* address, size_t size, void** pageAddresses, uintptr_t* pageAddressesCount)
{
<API key>;
uint32_t flags = resetState ? 1 : 0;
ULONG granularity;
bool success = ::GetWriteWatch(flags, address, size, pageAddresses, (ULONG_PTR*)pageAddressesCount, &granularity) == 0;
_ASSERTE (granularity == OS_PAGE_SIZE);
return success;
}
// Get size of the largest cache on the processor die
// Parameters:
// trueSize - true to return true cache size, false to return scaled up size based on
// the processor architecture
// Return:
// Size of the cache
size_t GCToOSInterface::<API key>(bool trueSize)
{
<API key>;
return ::<API key>(trueSize);
}
// Get affinity mask of the current process
// Parameters:
// processMask - affinity mask for the specified process
// systemMask - affinity mask for the system
// Return:
// true if it has succeeded, false if it has failed
// Remarks:
// A process affinity mask is a bit vector in which each bit represents the processors that
// a process is allowed to run on. A system affinity mask is a bit vector in which each bit
// represents the processors that are configured into a system.
// A process affinity mask is a subset of the system affinity mask. A process is only allowed
// to run on the processors configured into a system. Therefore, the process affinity mask cannot
// specify a 1 bit for a processor when the system affinity mask specifies a 0 bit for that processor.
bool GCToOSInterface::<API key>(uintptr_t* processMask, uintptr_t* systemMask)
{
<API key>;
#ifndef FEATURE_CORECLR
return !!::<API key>(GetCurrentProcess(), (PDWORD_PTR)processMask, (PDWORD_PTR)systemMask);
#else
return false;
#endif
}
// Get number of processors assigned to the current process
// Return:
// The number of processors
uint32_t GCToOSInterface::<API key>()
{
<API key>;
return ::<API key>();
}
#ifndef FEATURE_PAL
typedef BOOL (WINAPI *<API key>)(HANDLE handle, <API key>* memCounters, uint32_t cb);
static <API key> <API key> = 0;
typedef BOOL (WINAPI *PIS_PROCESS_IN_JOB)(HANDLE processHandle, HANDLE jobHandle, BOOL* result);
typedef BOOL (WINAPI *<API key>)(HANDLE jobHandle, JOBOBJECTINFOCLASS jobObjectInfoClass, void* lpJobObjectInfo, DWORD <API key>, LPDWORD lpReturnLength);
#endif
#if defined(FEATURE_CORECLR) && !defined(FEATURE_PAL)
// For coresys we need to look for an API in some apiset dll on win8 if we can't find it
// in the traditional dll.
HINSTANCE LoadDllForAPI(WCHAR* dllTraditional, WCHAR* dllApiSet)
{
HINSTANCE hinst = WszLoadLibrary(dllTraditional);
if (!hinst)
{
if(RunningOnWin8())
hinst = WszLoadLibrary(dllApiSet);
}
return hinst;
}
#endif
// If the process's memory is restricted (ie, beyond what's available on the machine), return that limit.
// Return:
// 0 if it has failed for some reason, the real value if it has succeeded
// Remarks:
// If a process runs with a restricted memory limit, and we are successful at getting
// that limit, it returns the limit. If there's no limit specified, or there's an error
// at getting that limit, it returns 0.
uint64_t GCToOSInterface::<API key>()
{
#ifdef FEATURE_PAL
return 0;
#else
size_t <API key> = (size_t)MAX_PTR;
BOOL in_job_p = FALSE;
#ifdef FEATURE_CORECLR
HINSTANCE <API key> = 0;
// these 2 modules will need to be freed no matter what as we only use them locally in this method.
HINSTANCE <API key> = 0;
HINSTANCE <API key> = 0;
#else
HINSTANCE hinstPsapi = 0;
#endif
PIS_PROCESS_IN_JOB GCIsProcessInJob = 0;
<API key> <API key> = 0;
#ifdef FEATURE_CORECLR
<API key> = LoadDllForAPI(L"kernel32.dll", L"<API key>.dll");
if (!<API key>)
goto exit;
GCIsProcessInJob = (PIS_PROCESS_IN_JOB)GetProcAddress(<API key>, "IsProcessInJob");
if (!GCIsProcessInJob)
goto exit;
#else
GCIsProcessInJob = &(::IsProcessInJob);
#endif
if (!GCIsProcessInJob(GetCurrentProcess(), NULL, &in_job_p))
goto exit;
if (in_job_p)
{
#ifdef FEATURE_CORECLR
<API key> = LoadDllForAPI(L"kernel32.dll", L"<API key>");
if (!<API key>)
goto exit;
<API key> = (<API key>)GetProcAddress(<API key>, "<API key>");
#else
// We need a way to get the working set in a job object and <API key>
// is the way to get that. According to MSDN, we should use <API key> In order to
// compensate for the incompatibility that psapi.dll introduced we are getting this dynamically.
hinstPsapi = WszLoadLibrary(L"psapi.dll");
if (!hinstPsapi)
return 0;
<API key> = (<API key>)GetProcAddress(hinstPsapi, "<API key>");
#endif
if (!<API key>)
goto exit;
#ifdef FEATURE_CORECLR
<API key> = LoadDllForAPI(L"kernel32.dll", L"<API key>");
if (!<API key>)
goto exit;
<API key> = (<API key>)GetProcAddress(<API key>, "<API key>");
#else
<API key> = &(::<API key>);
#endif
if (!<API key>)
goto exit;
<API key> limit_info;
if (<API key> (NULL, <API key>, &limit_info,
sizeof(limit_info), NULL))
{
size_t job_memory_limit = (size_t)MAX_PTR;
size_t <API key> = (size_t)MAX_PTR;
size_t <API key> = (size_t)MAX_PTR;
// Notes on the NT job object:
// You can specific a bigger process commit or working set limit than
// job limit which is pointless so we use the smallest of all 3 as
// to calculate our "physical memory load" or "available physical memory"
// when running inside a job object, ie, we treat this as the amount of physical memory
// our process is allowed to use.
// The commit limit is already reflected by default when you run in a
// job but the physical memory load is not.
if ((limit_info.<API key>.LimitFlags & <API key>) != 0)
job_memory_limit = limit_info.JobMemoryLimit;
if ((limit_info.<API key>.LimitFlags & <API key>) != 0)
<API key> = limit_info.ProcessMemoryLimit;
if ((limit_info.<API key>.LimitFlags & <API key>) != 0)
<API key> = limit_info.<API key>.<API key>;
<API key> = min (job_memory_limit, <API key>);
<API key> = min (<API key>, <API key>);
}
}
exit:
#ifdef FEATURE_CORECLR
if (<API key>)
FreeLibrary(<API key>);
if (<API key>)
FreeLibrary(<API key>);
#endif
if (<API key> == (size_t)MAX_PTR)
{
<API key> = 0;
#ifdef FEATURE_CORECLR
FreeLibrary(<API key>);
#else
FreeLibrary(hinstPsapi);
#endif
}
return <API key>;
#endif
}
// Get the current physical memory this process is using.
// Return:
// 0 if it has failed, the real value if it has succeeded
size_t GCToOSInterface::<API key>()
{
#ifndef FEATURE_PAL
<API key> pmc;
if (<API key>(GetCurrentProcess(), &pmc, sizeof(pmc)))
return pmc.WorkingSetSize;
#endif
return 0;
}
// Get global memory status
// Parameters:
// ms - pointer to the structure that will be filled in with the memory status
void GCToOSInterface::GetMemoryStatus(GCMemoryStatus* ms)
{
<API key>;
MEMORYSTATUSEX msEx;
msEx.dwLength = sizeof(MEMORYSTATUSEX);
::<API key>(&msEx);
// Convert Windows struct to abstract struct
ms->dwMemoryLoad = msEx.dwMemoryLoad;
ms->ullTotalPhys = msEx.ullTotalPhys;
ms->ullAvailPhys = msEx.ullAvailPhys;
ms->ullTotalPageFile = msEx.ullTotalPageFile;
ms->ullAvailPageFile = msEx.ullAvailPageFile;
ms->ullTotalVirtual = msEx.ullTotalVirtual;
ms->ullAvailVirtual = msEx.ullAvailVirtual;
}
// Get a high precision performance counter
// Return:
// The counter value
int64_t GCToOSInterface::<API key>()
{
<API key>;
LARGE_INTEGER ts;
if (!::<API key>(&ts))
{
DebugBreak();
_ASSERTE(!"Fatal Error - cannot query performance counter.");
<API key>(<API key>); // TODO: fatal error
}
return ts.QuadPart;
}
// Get a frequency of the high precision performance counter
// Return:
// The counter frequency
int64_t GCToOSInterface::<API key>()
{
<API key>;
LARGE_INTEGER frequency;
if (!::<API key>(&frequency))
{
DebugBreak();
_ASSERTE(!"Fatal Error - cannot query performance counter.");
<API key>(<API key>); // TODO: fatal error
}
return frequency.QuadPart;
}
// Get a time stamp with a low precision
// Return:
// Time stamp in milliseconds
uint32_t GCToOSInterface::<API key>()
{
<API key>;
return ::GetTickCount();
}
// Parameters of the GC thread stub
struct GCThreadStubParam
{
GCThreadFunction GCThreadFunction;
void* GCThreadParam;
};
// GC thread stub to convert GC thread function to an OS specific thread function
static DWORD GCThreadStub(void* param)
{
WRAPPER_NO_CONTRACT;
GCThreadStubParam *stubParam = (GCThreadStubParam*)param;
GCThreadFunction function = stubParam->GCThreadFunction;
void* threadParam = stubParam->GCThreadParam;
delete stubParam;
function(threadParam);
return 0;
}
// Create a new thread
// Parameters:
// function - the function to be executed by the thread
// param - parameters of the thread
// affinity - processor affinity of the thread
// Return:
// true if it has succeeded, false if it has failed
bool GCToOSInterface::CreateThread(GCThreadFunction function, void* param, GCThreadAffinity* affinity)
{
<API key>;
uint32_t thread_id;
NewHolder<GCThreadStubParam> stubParam = new (nothrow) GCThreadStubParam();
if (stubParam == NULL)
{
return false;
}
stubParam->GCThreadFunction = function;
stubParam->GCThreadParam = param;
HANDLE gc_thread = Thread::CreateUtilityThread(Thread::StackSize_Medium, GCThreadStub, stubParam, CREATE_SUSPENDED, (DWORD*)&thread_id);
if (!gc_thread)
{
return false;
}
stubParam.SuppressRelease();
SetThreadPriority(gc_thread, /* <API key> );*/ <API key> );
#ifndef FEATURE_CORECLR
if (affinity->Group != -1)
{
_ASSERTE(affinity->Processor != -1);
GROUP_AFFINITY ga;
ga.Group = (WORD)affinity->Group;
ga.Reserved[0] = 0; // reserve must be filled with zero
ga.Reserved[1] = 0; // otherwise call may fail
ga.Reserved[2] = 0;
ga.Mask = 1 << affinity->Processor;
CPUGroupInfo::<API key>(gc_thread, &ga, NULL);
}
else if (affinity->Processor != -1)
{
<API key>(gc_thread, 1 << affinity->Processor);
}
#endif // !FEATURE_CORECLR
ResumeThread(gc_thread);
CloseHandle(gc_thread);
return true;
}
// Initialize the critical section
void CLRCriticalSection::Initialize()
{
WRAPPER_NO_CONTRACT;
<API key>(&m_cs);
}
// Destroy the critical section
void CLRCriticalSection::Destroy()
{
WRAPPER_NO_CONTRACT;
<API key>(&m_cs);
}
// Enter the critical section. Blocks until the section can be entered.
void CLRCriticalSection::Enter()
{
WRAPPER_NO_CONTRACT;
<API key>(&m_cs);
}
// Leave the critical section
void CLRCriticalSection::Leave()
{
WRAPPER_NO_CONTRACT;
<API key>(&m_cs);
} |
namespace CompareSimpleMaths
{
using System;
using System.Diagnostics;
public class TimeLogger
{
private const long ExecutionTimes = (long)1e7;
public static void LogExecutionTime(string numberType, Action action)
{
var stopWatch = Stopwatch.StartNew();
for (var i = 0; i < ExecutionTimes; i++)
{
action();
}
ResultsLogger.LogResultTime(stopWatch.Elapsed.ToString(), numberType);
}
}
} |
<div
class="task"
ng-class="{completed:completed}"
ng-init="completed = task.status == 'completed'; disabled = completed"
>
<label>
<input
type="checkbox"
class="uk-checkbox"
ng-model="completed"
/>
<span class="caption">
<span class="label" ng-bind-html="taskline(task) | taskline"></span>
<span class="controls">
<a ng-click="remove(task)"><i class="uk-icon-remove"></i></a>
</span>
</span>
</label>
</div> |
// TextureProvider.h
// Chilli Source
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// all copies or substantial portions of the Software.
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef <API key>
#define <API key>
#include <ChilliSource/ChilliSource.h>
#include <ChilliSource/Core/Resource/ResourceProvider.h>
namespace ChilliSource
{
namespace Rendering
{
Factory loader for creating texture resources
from file. This loader is responsible for loading the
image data and building the texture.
@author S Downie
class TextureProvider final : public Core::ResourceProvider
{
public:
<API key>(TextureProvider);
Called when the system is initialised. Retrieves the image providers
to delegate image loading to
@author S Downie
void PostCreate();
@author S Downie
@param Interface to compare
@return Whether the object implements the given interface
bool IsA(Core::InterfaceIDType in_interfaceId) const override;
@author S Downie
@return The resource type this provider loads
Core::InterfaceIDType GetResourceType() const override;
@author S Downie
@param Extension to compare
@return Whether the object can create a resource with the given extension
bool <API key>(const std::string& in_extension) const override;
Loads the image and generate the texture via the output resource.
Check the resource load state for success or failure.
@author S Downie
@param Location to load from
@param File path
@param Options to customise the creation
@param [Out] Resource object
void <API key>(Core::StorageLocation in_location, const std::string& in_filePath, const Core::<API key>& in_options, const Core::ResourceSPtr& out_resource) override;
Loads the image on a background thread and generate the texture via the output resource.
Delegate is called on completion. Check the resource load state for success or failure
@author S Downie
@param Location to load from
@param File path
@param Options to customise the creation
@param Completion delegate
@param [Out] Resource object
void <API key>(Core::StorageLocation in_location, const std::string& in_filePath, const Core::<API key>& in_options, const Core::ResourceProvider::AsyncLoadDelegate& in_delegate, const Core::ResourceSPtr& out_resource) override;
@author S Downie
@retrun Default options for texture loading
Core::<API key> GetDefaultOptions() const;
private:
friend class Core::Application;
Factory method
@author S Downie
@return New provider with ownership transferred
static TextureProviderUPtr Create();
Private constructor to force use of factory method
@author S Downie
TextureProvider() = default;
Does the heavy lifting for the 2 create methods. The building of the texture
is always done on the main thread
@author S Downie
@param Location to load from
@param File path
@param Options to customise the creation
@param Completion delegate
@param [Out] Resource object
void LoadTexture(Core::StorageLocation in_location, const std::string& in_filePath, const Core::<API key>& in_options, const Core::ResourceProvider::AsyncLoadDelegate& in_delegate, const Core::ResourceSPtr& out_resource);
private:
std::vector<Core::ResourceProvider*> m_imageProviders;
static const Core::<API key> s_defaultOptions;
};
}
}
#endif |
<?php
namespace SDispatcher\Common;
/**
* Used to read resource option in a more declarative way.
*/
final class <API key> extends <API key>
{
/**
* Used to read private method/property.
* @var \ReflectionObject
*/
private $reflector;
/**
* The target object to read.
* @var mixed
*/
private $classOrObj;
/**
* The optional prefix for reading option.
* @var string
*/
private $prefix = '';
/**
* Used to cache the options.
* @var array
*/
private $cache = array();
/**
* {@inheritdoc}
*/
public function setTarget($classOrObj, $method = null)
{
$this->classOrObj = $classOrObj;
if (is_string($classOrObj) && class_exists($classOrObj)) {
$this->reflector = new \ReflectionClass($classOrObj);
} elseif (is_object($classOrObj)) {
$this->reflector = new \ReflectionObject($classOrObj);
}
}
/**
* Sets the prefix of all option attribute.
* @param string $prefix
*/
public function setPrefix($prefix)
{
$this->prefix = $prefix;
}
/**
* {@inheritdoc}
*/
protected function tryReadOption($name, &$out, $default = null)
{
$success = false;
$name = $this->prefix . $name;
$out = $default;
if (!$this->classOrObj) {
return false;
}
if (isset($this->cache[$name])
|| array_key_exists($name, $this->cache)
) {
$out = $this->cache[$name];
$success = true;
} elseif ($this->reflector->hasProperty($name)) {
$out = $this->readFromProperty($name);
$success = true;
$this->cache[$name] = $out;
} elseif ($this->reflector->hasMethod($name)) {
$out = $this->readFromMethod($name);
$success = true;
$this->cache[$name] = $out;
}
return $success;
}
/**
* {@inheritdoc}
*/
protected function tryWriteOption($name, $value)
{
$name = $this->prefix . $name;
$this->cache[$name] = $value;
}
private function readFromProperty($name)
{
$prop = $this->reflector->getProperty($name);
$prop->setAccessible(true);
return $prop->getValue($this->classOrObj);
}
private function readFromMethod($name)
{
$method = $this->reflector->getMethod($name);
$method->setAccessible(true);
return $method->invoke($this->classOrObj);
}
} |
# -*- coding:utf-8 -*-
from . import view
from flask import render_template
@view.app_errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
@view.app_errorhandler(500)
def <API key>(e):
return render_template('500.html'), 500 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Chapter 6. Summary and Examples</title>
<link rel="stylesheet" href="gettingStarted.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
<link rel="start" href="index.html" title="Getting Started with Berkeley DB Transaction Processing" />
<link rel="up" href="index.html" title="Getting Started with Berkeley DB Transaction Processing" />
<link rel="prev" href="logconfig.html" title="Configuring the Logging Subsystem" />
<link rel="next" href="txnexample_java.html" title="Base API Transaction Example" />
</head>
<body>
<div xmlns="" class="navheader">
<div class="libver">
<p>Library Version 11.2.5.3</p>
</div>
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Chapter 6. Summary and Examples</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="logconfig.html">Prev</a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="txnexample_java.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="chapter" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title"><a id="wrapup"></a>Chapter 6. Summary and Examples</h2>
</div>
</div>
</div>
<div class="toc">
<p>
<b>Table of Contents</b>
</p>
<dl>
<dt>
<span class="sect1">
<a href="wrapup.html#anatomy">Anatomy of a Transactional Application</a>
</span>
</dt>
<dt>
<span class="sect1">
<a href="txnexample_java.html">Base API Transaction Example</a>
</span>
</dt>
<dd>
<dl>
<dt>
<span class="sect2">
<a href="txnexample_java.html#txnguideexample">TxnGuide.java</a>
</span>
</dt>
<dt>
<span class="sect2">
<a href="txnexample_java.html#payloaddata">PayloadData.java</a>
</span>
</dt>
<dt>
<span class="sect2">
<a href="txnexample_java.html#dbwriter">DBWriter.java</a>
</span>
</dt>
</dl>
</dd>
<dt>
<span class="sect1">
<a href="txnexample_dpl.html">DPL Transaction Example</a>
</span>
</dt>
<dd>
<dl>
<dt>
<span class="sect2">
<a href="txnexample_dpl.html#txnguideexample_dpl">TxnGuide.java</a>
</span>
</dt>
<dt>
<span class="sect2">
<a href="txnexample_dpl.html#payloaddataentity">PayloadDataEntity.java</a>
</span>
</dt>
<dt>
<span class="sect2">
<a href="txnexample_dpl.html#storewriter">StoreWriter.java</a>
</span>
</dt>
</dl>
</dd>
<dt>
<span class="sect1">
<a href="<API key>.html">Base API In-Memory Transaction Example</a>
</span>
</dt>
</dl>
</div>
<p>
Throughout this manual we have presented the concepts and
mechanisms that you need to provide transactional protection for
your application. In this chapter, we summarize these
mechanisms, and we provide a complete example of a multi-threaded
transactional DB application.
</p>
<div class="sect1" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="anatomy"></a>Anatomy of a Transactional Application</h2>
</div>
</div>
</div>
<p>
Transactional applications are characterized by performing the
following activities:
</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>
Create your environment handle.
</p>
</li>
<li>
<p>
Open your environment, specifying that the following
subsystems be used:
</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>
Transactional Subsystem (this also initializes the
logging subsystem).
</p>
</li>
<li>
<p>
Memory pool (the in-memory cache).
</p>
</li>
<li>
<p>
Logging subsystem.
</p>
</li>
<li>
<p>
Locking subsystem (if your application is multi-process or multi-threaded).
</p>
</li>
</ul>
</div>
<p>
It is also highly recommended that you run normal recovery
upon first environment open. Normal recovery examines only those logs required
to ensure your database files are consistent relative to the information found in your
log files.
</p>
</li>
<li>
<p>
Optionally spawn off any utility threads that you might need. Utility
threads can be used to run checkpoints periodically, or to
periodically run a deadlock detector if you do not want to
use DB's built-in deadlock detector.
</p>
</li>
<li>
<p>
If you are using the base API, open whatever database handles
that you need. Otherwise, open your store such that it is
configured for transactions.
</p>
</li>
<li>
<p>
Spawn off worker threads. How many of these you need and
how they split their DB workload is entirely up to your
application's requirements. However, any worker threads
that perform write operations will do the following:
</p>
<div class="orderedlist">
<ol type="a">
<li>
<p>
Begin a transaction.
</p>
</li>
<li>
<p>
Perform one or more read and write
operations.
</p>
</li>
<li>
<p>
Commit the transaction if all goes well.
</p>
</li>
<li>
<p>
Abort and retry the operation if a deadlock is
detected.
</p>
</li>
<li>
<p>
Abort the transaction for most other errors.
</p>
</li>
</ol>
</div>
</li>
<li>
<p>
On application shutdown:
</p>
<div class="orderedlist">
<ol type="a">
<li>
<p>
Make sure there are no opened cursors.
</p>
</li>
<li>
<p>
Make sure there are no active transactions. Either
abort or commit all transactions before shutting
down.
</p>
</li>
<li>
<p>
Close your databases or store.
</p>
</li>
<li>
<p>
Close your environment.
</p>
</li>
</ol>
</div>
</li>
</ol>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
Robust DB applications should monitor their worker threads to
make sure they have not died unexpectedly. If a thread does
terminate abnormally, you must shutdown all your worker threads
and then run normal recovery (you will have to reopen your
environment to do this). This is the only way to clear any
resources (such as a lock or a mutex) that the abnormally
exiting worker thread might have been holding at the time that
it died.
</p>
<p>
Failure to perform this recovery can cause your
still-functioning worker threads to eventually block forever
while waiting for a lock that will never be released.
</p>
</div>
<p>
In addition to these activities, which are all entirely handled by
code within your application, there are some administrative
activities that you should perform:
</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>
Periodically checkpoint your application. Checkpoints will
reduce the time to run recovery in the event that one is
required. See <a class="xref" href="filemanagement.html#checkpoints" title="Checkpoints">Checkpoints</a>
for details.
</p>
</li>
<li>
<p>
Periodically back up your database and log files. This is
required in order to fully obtain the durability guarantee
made by DB's transaction ACID support. See
<a class="xref" href="backuprestore.html" title="Backup Procedures">Backup Procedures</a>
for more information.
</p>
</li>
<li>
<p>
You may want to maintain a hot failover if 24x7 processing
with rapid restart in the face of a disk hit is important
to you. See <a class="xref" href="hotfailover.html" title="Using Hot Failovers">Using Hot Failovers</a>
for more information.
</p>
</li>
</ul>
</div>
</div>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="logconfig.html">Prev</a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="txnexample_java.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Configuring the Logging Subsystem </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> Base API Transaction Example</td>
</tr>
</table>
</div>
</body>
</html> |
namespace AjLanguage.Commands
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AjLanguage.Expressions;
using AjLanguage.Language;
[Serializable]
public class <API key> : ICommand
{
private string name;
private string[] parameterNames;
private ICommand body;
private bool isdefault;
private bool <API key>;
public <API key>(string name, string[] parameterNames, ICommand body, bool isdefault)
: this(name, parameterNames, body, isdefault, false)
{
}
public <API key>(string name, string[] parameterNames, ICommand body, bool isdefault, bool <API key>)
{
this.name = name;
this.parameterNames = parameterNames;
this.body = body;
this.isdefault = isdefault;
this.<API key> = <API key>;
}
public string FunctionName { get { return this.name; } }
public string[] ParameterNames { get { return this.parameterNames; } }
public ICommand Body { get { return this.body; } }
public bool IsDefault { get { return this.isdefault; } }
public bool <API key> { get { return this.<API key>; } }
public void Execute(IBindingEnvironment environment)
{
Machine.Current.Environment.SetValue(this.name, new Function(this.parameterNames, this.body, null, this.isdefault, this.<API key>));
}
}
} |
# keyclic_sdk_api.model.Publication
## Load the model package
dart
import 'package:keyclic_sdk_api/api.dart';
## Properties
Name | Type | Description | Notes
**embedded** | [**PublicationEmbedded**](PublicationEmbedded.md) | | [optional] [default to null]
**links** | [**PublicationLinks**](PublicationLinks.md) | | [optional] [default to null]
**createdAt** | [**DateTime**](DateTime.md) | | [optional] [default to null]
**id** | **String** | | [optional] [default to null]
**message** | **String** | | [default to null]
**read** | **int** | | [default to null]
**title** | **String** | | [default to null]
**type** | **String** | | [optional] [default to null]
**updatedAt** | [**DateTime**](DateTime.md) | | [optional] [default to null]
[[Back to Model list]](../README.md#<API key>) [[Back to API list]](../README.md#<API key>) [[Back to README]](../README.md) |
#include "stdafx.h"
#include "MathUtils.h"
#include "Vector.h"
#include "Matrix4x4.h"
Matrix4x4 Matrix4x4::Identity(
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
Matrix4x4::Matrix4x4(float InF) :
Matrix4x4(
InF, InF, InF, InF,
InF, InF, InF, InF,
InF, InF, InF, InF,
InF, InF, InF, InF)
{
}
Matrix4x4::Matrix4x4(float InM11, float InM12, float InM13, float InM14, float InM21, float InM22, float InM23, float InM24, float InM31, float InM32, float InM33, float InM34, float InM41, float InM42, float InM43, float InM44)
{
M[0][0] = InM11; M[0][1] = InM12; M[0][2] = InM13; M[0][3] = InM14;
M[1][0] = InM21; M[1][1] = InM22; M[1][2] = InM23; M[1][3] = InM24;
M[2][0] = InM31; M[2][1] = InM32; M[2][2] = InM33; M[2][3] = InM34;
M[3][0] = InM41; M[3][1] = InM42; M[3][2] = InM43; M[3][3] = InM44;
}
Matrix4x4::Matrix4x4(const Matrix4x4& InM) :
Matrix4x4(
InM.M[0][0], InM.M[0][1], InM.M[0][2], InM.M[0][3],
InM.M[1][0], InM.M[1][1], InM.M[1][2], InM.M[1][3],
InM.M[2][0], InM.M[2][1], InM.M[2][2], InM.M[2][3],
InM.M[3][0], InM.M[3][1], InM.M[3][2], InM.M[3][3])
{
}
Matrix4x4& Matrix4x4::operator=(float Bias)
{
M[0][0] = M[0][1] = M[0][2] = M[0][3] = Bias;
M[1][0] = M[1][1] = M[1][2] = M[1][3] = Bias;
M[2][0] = M[2][1] = M[2][2] = M[2][3] = Bias;
M[3][0] = M[3][1] = M[3][2] = M[3][3] = Bias;
return *this;
}
Matrix4x4& Matrix4x4::operator=(const Matrix4x4& InM)
{
M[0][0] = InM.M[0][0]; M[0][1] = InM.M[0][1]; M[0][2] = InM.M[0][2]; M[0][3] = InM.M[0][3];
M[1][0] = InM.M[1][0]; M[1][1] = InM.M[1][1]; M[1][2] = InM.M[1][2]; M[1][3] = InM.M[1][3];
M[2][0] = InM.M[2][0]; M[2][1] = InM.M[2][1]; M[2][2] = InM.M[2][2]; M[2][3] = InM.M[2][3];
M[3][0] = InM.M[3][0]; M[3][1] = InM.M[3][1]; M[3][2] = InM.M[3][2]; M[3][3] = InM.M[3][3];
return *this;
}
Matrix4x4 Matrix4x4::operator+(float Bias) const
{
Matrix4x4 Mat(*this);
Mat.M[0][0] += Bias; Mat.M[0][1] += Bias; Mat.M[0][2] += Bias; Mat.M[0][3] += Bias;
Mat.M[1][0] += Bias; Mat.M[1][1] += Bias; Mat.M[1][2] += Bias; Mat.M[1][3] += Bias;
Mat.M[2][0] += Bias; Mat.M[2][1] += Bias; Mat.M[2][2] += Bias; Mat.M[2][3] += Bias;
Mat.M[3][0] += Bias; Mat.M[3][1] += Bias; Mat.M[3][2] += Bias; Mat.M[3][3] += Bias;
return Mat;
}
Matrix4x4 Matrix4x4::operator+(const Matrix4x4& InM) const
{
Matrix4x4 Mat(*this);
Mat.M[0][0] += InM.M[0][0]; Mat.M[0][1] += InM.M[0][1]; Mat.M[0][2] += InM.M[0][2]; Mat.M[0][3] += InM.M[0][3];
Mat.M[1][0] += InM.M[1][0]; Mat.M[1][1] += InM.M[1][1]; Mat.M[1][2] += InM.M[1][2]; Mat.M[1][3] += InM.M[1][3];
Mat.M[2][0] += InM.M[2][0]; Mat.M[2][1] += InM.M[2][1]; Mat.M[2][2] += InM.M[2][2]; Mat.M[2][3] += InM.M[2][3];
Mat.M[3][0] += InM.M[3][0]; Mat.M[3][1] += InM.M[3][1]; Mat.M[3][2] += InM.M[3][2]; Mat.M[3][3] += InM.M[3][3];
return Mat;
}
Matrix4x4 Matrix4x4::operator-(float Bias) const
{
Matrix4x4 Mat(*this);
Mat.M[0][0] -= Bias; Mat.M[0][1] -= Bias; Mat.M[0][2] -= Bias; Mat.M[0][3] -= Bias;
Mat.M[1][0] -= Bias; Mat.M[1][1] -= Bias; Mat.M[1][2] -= Bias; Mat.M[1][3] -= Bias;
Mat.M[2][0] -= Bias; Mat.M[2][1] -= Bias; Mat.M[2][2] -= Bias; Mat.M[2][3] -= Bias;
Mat.M[3][0] -= Bias; Mat.M[3][1] -= Bias; Mat.M[3][2] -= Bias; Mat.M[3][3] -= Bias;
return Mat;
}
Matrix4x4 Matrix4x4::operator-(const Matrix4x4& InM) const
{
Matrix4x4 Mat(*this);
Mat.M[0][0] -= InM.M[0][0]; Mat.M[0][1] -= InM.M[0][1]; Mat.M[0][2] -= InM.M[0][2]; Mat.M[0][3] -= InM.M[0][3];
Mat.M[1][0] -= InM.M[1][0]; Mat.M[1][1] -= InM.M[1][1]; Mat.M[1][2] -= InM.M[1][2]; Mat.M[1][3] -= InM.M[1][3];
Mat.M[2][0] -= InM.M[2][0]; Mat.M[2][1] -= InM.M[2][1]; Mat.M[2][2] -= InM.M[2][2]; Mat.M[2][3] -= InM.M[2][3];
Mat.M[3][0] -= InM.M[3][0]; Mat.M[3][1] -= InM.M[3][1]; Mat.M[3][2] -= InM.M[3][2]; Mat.M[3][3] -= InM.M[3][3];
return Mat;
}
Matrix4x4 Matrix4x4::operator*(float Scale) const
{
Matrix4x4 Mat(*this);
Mat.M[0][0] *= Scale; Mat.M[0][1] *= Scale; Mat.M[0][2] *= Scale; Mat.M[0][3] *= Scale;
Mat.M[1][0] *= Scale; Mat.M[1][1] *= Scale; Mat.M[1][2] *= Scale; Mat.M[1][3] *= Scale;
Mat.M[2][0] *= Scale; Mat.M[2][1] *= Scale; Mat.M[2][2] *= Scale; Mat.M[2][3] *= Scale;
Mat.M[3][0] *= Scale; Mat.M[3][1] *= Scale; Mat.M[3][2] *= Scale; Mat.M[3][3] *= Scale;
return Mat;
}
Vector4 Matrix4x4::operator*(const Vector4& InV) const
{
Vector4 Vector;
Vector.X = (M[0][0] * InV.X) + (M[0][1] * InV.Y) + (M[0][2] * InV.Z) + (M[0][3] * InV.W);
Vector.Y = (M[1][0] * InV.X) + (M[1][1] * InV.Y) + (M[1][2] * InV.Z) + (M[1][3] * InV.W);
Vector.Z = (M[2][0] * InV.X) + (M[2][1] * InV.Y) + (M[2][2] * InV.Z) + (M[2][3] * InV.W);
Vector.W = (M[3][0] * InV.X) + (M[3][1] * InV.Y) + (M[3][2] * InV.Z) + (M[3][3] * InV.W);
return Vector;
}
Matrix4x4 Matrix4x4::operator*(const Matrix4x4& InM) const
{
Matrix4x4 Mat;
Mat.M[0][0] = (M[0][0] * InM.M[0][0]) + (M[0][1] * InM.M[1][0]) + (M[0][2] * InM.M[2][0]) + (M[0][3] * InM.M[3][0]);
Mat.M[0][1] = (M[0][0] * InM.M[0][1]) + (M[0][1] * InM.M[1][1]) + (M[0][2] * InM.M[2][1]) + (M[0][3] * InM.M[3][1]);
Mat.M[0][2] = (M[0][0] * InM.M[0][2]) + (M[0][1] * InM.M[1][2]) + (M[0][2] * InM.M[2][2]) + (M[0][3] * InM.M[3][2]);
Mat.M[0][3] = (M[0][0] * InM.M[0][3]) + (M[0][1] * InM.M[1][3]) + (M[0][2] * InM.M[2][3]) + (M[0][3] * InM.M[3][3]);
Mat.M[1][0] = (M[1][0] * InM.M[0][0]) + (M[1][1] * InM.M[1][0]) + (M[1][2] * InM.M[2][0]) + (M[1][3] * InM.M[3][0]);
Mat.M[1][1] = (M[1][0] * InM.M[0][1]) + (M[1][1] * InM.M[1][1]) + (M[1][2] * InM.M[2][1]) + (M[1][3] * InM.M[3][1]);
Mat.M[1][2] = (M[1][0] * InM.M[0][2]) + (M[1][1] * InM.M[1][2]) + (M[1][2] * InM.M[2][2]) + (M[1][3] * InM.M[3][2]);
Mat.M[1][3] = (M[1][0] * InM.M[0][3]) + (M[1][1] * InM.M[1][3]) + (M[1][2] * InM.M[2][3]) + (M[1][3] * InM.M[3][3]);
Mat.M[2][0] = (M[2][0] * InM.M[0][0]) + (M[2][1] * InM.M[1][0]) + (M[2][2] * InM.M[2][0]) + (M[2][3] * InM.M[3][0]);
Mat.M[2][1] = (M[2][0] * InM.M[0][1]) + (M[2][1] * InM.M[1][1]) + (M[2][2] * InM.M[2][1]) + (M[2][3] * InM.M[3][1]);
Mat.M[2][2] = (M[2][0] * InM.M[0][2]) + (M[2][1] * InM.M[1][2]) + (M[2][2] * InM.M[2][2]) + (M[2][3] * InM.M[3][2]);
Mat.M[2][3] = (M[2][0] * InM.M[0][3]) + (M[2][1] * InM.M[1][3]) + (M[2][2] * InM.M[2][3]) + (M[2][3] * InM.M[3][3]);
Mat.M[3][0] = (M[3][0] * InM.M[0][0]) + (M[3][1] * InM.M[1][0]) + (M[3][2] * InM.M[2][0]) + (M[3][3] * InM.M[3][0]);
Mat.M[3][1] = (M[3][0] * InM.M[0][1]) + (M[3][1] * InM.M[1][1]) + (M[3][2] * InM.M[2][1]) + (M[3][3] * InM.M[3][1]);
Mat.M[3][2] = (M[3][0] * InM.M[0][2]) + (M[3][1] * InM.M[1][2]) + (M[3][2] * InM.M[2][2]) + (M[3][3] * InM.M[3][2]);
Mat.M[3][3] = (M[3][0] * InM.M[0][3]) + (M[3][1] * InM.M[1][3]) + (M[3][2] * InM.M[2][3]) + (M[3][3] * InM.M[3][3]);
return Mat;
}
Matrix4x4 Matrix4x4::operator/(float Scale) const
{
Matrix4x4 Mat(*this);
Mat.M[0][0] /= Scale; Mat.M[0][1] /= Scale; Mat.M[0][2] /= Scale; Mat.M[0][3] /= Scale;
Mat.M[1][0] /= Scale; Mat.M[1][1] /= Scale; Mat.M[1][2] /= Scale; Mat.M[1][3] /= Scale;
Mat.M[2][0] /= Scale; Mat.M[2][1] /= Scale; Mat.M[2][2] /= Scale; Mat.M[2][3] /= Scale;
Mat.M[3][0] /= Scale; Mat.M[3][1] /= Scale; Mat.M[3][2] /= Scale; Mat.M[3][3] /= Scale;
return Mat;
}
Matrix4x4 Matrix4x4::CreateTransition(float X, float Y, float Z)
{
return Matrix4x4(
1.0f, 0.0f, 0.0f, X,
0.0f, 1.0f, 0.0f, Y,
0.0f, 0.0f, 1.0f, Z,
0.0f, 0.0f, 0.0f, 1.0f);
}
Matrix4x4 Matrix4x4::CreateTransition(const Vector3& InV)
{
return Matrix4x4(
1.0f, 0.0f, 0.0f, InV.X,
0.0f, 1.0f, 0.0f, InV.Y,
0.0f, 0.0f, 1.0f, InV.Z,
0.0f, 0.0f, 0.0f, 1.0f);
}
Matrix4x4 Matrix4x4::CreateRotationX(float Angle)
{
float Sin = DEGREE_SIN(Angle);
float Cos = DEGREE_COS(Angle);
return Matrix4x4(
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, Cos, -Sin, 0.0f,
0.0f, Sin, Cos, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
}
Matrix4x4 Matrix4x4::CreateRotationY(float Angle)
{
float Sin = DEGREE_SIN(Angle);
float Cos = DEGREE_COS(Angle);
return Matrix4x4(
Cos, 0.0f, -Sin, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
Sin, 0.0f, Cos, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
}
Matrix4x4 Matrix4x4::CreateRotationZ(float Angle)
{
float Sin = DEGREE_SIN(Angle);
float Cos = DEGREE_COS(Angle);
return Matrix4x4(
Cos, -Sin, 0.0f, 0.0f,
Sin, Cos, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
}
Matrix4x4 Matrix4x4::CreateRotation(float XAngle, float YAngle, float ZAngle)
{
Matrix4x4 RotX;
Matrix4x4 RotY;
Matrix4x4 RotZ;
float Cos = DEGREE_COS(XAngle);
float Sin = DEGREE_SIN(XAngle);
RotX.M[0][0] = 1.0f; RotX.M[0][1] = 0.0f; RotX.M[0][2] = 0.0f; RotX.M[0][3] = 0.0f;
RotX.M[1][0] = 0.0f; RotX.M[1][1] = Cos; RotX.M[1][2] = -Sin; RotX.M[1][3] = 0.0f;
RotX.M[2][0] = 0.0f; RotX.M[2][1] = Sin; RotX.M[2][2] = Cos; RotX.M[2][3] = 0.0f;
RotX.M[3][0] = 0.0f; RotX.M[3][1] = 0.0f; RotX.M[3][2] = 0.0f; RotX.M[3][3] = 1.0f;
Cos = DEGREE_COS(YAngle);
Sin = DEGREE_SIN(YAngle);
RotY.M[0][0] = Cos; RotY.M[0][1] = 0.0f; RotY.M[0][2] = -Sin; RotY.M[0][3] = 0.0f;
RotY.M[1][0] = 0.0f; RotY.M[1][1] = 1.0f; RotY.M[1][2] = -0.0f; RotY.M[1][3] = 0.0f;
RotY.M[2][0] = Sin; RotY.M[2][1] = 0.0f; RotY.M[2][2] = Cos; RotY.M[2][3] = 0.0f;
RotY.M[3][0] = 0.0f; RotY.M[3][1] = 0.0f; RotY.M[3][2] = 0.0f; RotY.M[3][3] = 1.0f;
Cos = DEGREE_COS(ZAngle);
Sin = DEGREE_SIN(ZAngle);
RotZ.M[0][0] = Cos; RotZ.M[0][1] = -Sin; RotZ.M[0][2] = 0.0f; RotZ.M[0][3] = 0.0f;
RotZ.M[1][0] = Sin; RotZ.M[1][1] = Cos; RotZ.M[1][2] = 0.0f; RotZ.M[1][3] = 0.0f;
RotZ.M[2][0] = 0.0f; RotZ.M[2][1] = 0.0f; RotZ.M[2][2] = 1.0f; RotZ.M[2][3] = 0.0f;
RotZ.M[3][0] = 0.0f; RotZ.M[3][1] = 0.0f; RotZ.M[3][2] = 0.0f; RotZ.M[3][3] = 1.0f;
return (RotZ * (RotY * RotX));
}
Matrix4x4 Matrix4x4::CreateScale(float Scale)
{
return Matrix4x4(
Scale, 0.0f, 0.0f, 0.0f,
0.0f, Scale, 0.0f, 0.0f,
0.0f, 0.0f, Scale, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
}
Matrix4x4 Matrix4x4::CreateScale(float X, float Y, float Z)
{
return Matrix4x4(
X, 0.0f, 0.0f, 0.0f,
0.0f, Y, 0.0f, 0.0f,
0.0f, 0.0f, Z, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
}
Matrix4x4 Matrix4x4::CreateScale(const Vector3& InV)
{
return Matrix4x4(
InV.X, 0.0f, 0.0f, 0.0f,
0.0f, InV.Y, 0.0f, 0.0f,
0.0f, 0.0f, InV.Z, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
}
Matrix4x4 Matrix4x4::CreateScreenSpace(float HalfWidth, float HalfHeight)
{
return Matrix4x4(
HalfWidth, 0.0f, 0.0f, HalfWidth,
0.0f, -HalfHeight, 0.0f, HalfHeight,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
}
Matrix4x4 Matrix4x4::<API key>(float FOV, float AspectRatio, float ZMin, float ZMax)
{
float TanOfHalfFOV = DEGREE_TAN(FOV * 0.5);
float FocalLength = 1.0f / TanOfHalfFOV;
float ZRange = (ZMin - ZMax);
return Matrix4x4(
FocalLength / AspectRatio, 0.0f, 0.0f, 0.0f,
0.0f, FocalLength, 0.0f, 0.0f,
0.0f, 0.0f, (-ZMin -ZMax) / ZRange, (2.0f * ZMin * ZMax) / ZRange,
0.0f, 0.0f, 1.0f, 0.0f);
}
std::ostream& operator<<(std::ostream& Os, const Matrix4x4& InM)
{
Os << InM.M[0][0] << ' ' << InM.M[0][1] << ' ' << InM.M[0][2] << ' ' << InM.M[0][3] << std::endl;
Os << InM.M[1][0] << ' ' << InM.M[1][1] << ' ' << InM.M[1][2] << ' ' << InM.M[1][3] << std::endl;
Os << InM.M[2][0] << ' ' << InM.M[2][1] << ' ' << InM.M[2][2] << ' ' << InM.M[2][3] << std::endl;
Os << InM.M[3][0] << ' ' << InM.M[3][1] << ' ' << InM.M[3][2] << ' ' << InM.M[3][3] << std::endl;
return Os;
}
std::string Matrix4x4::ToString() const
{
using namespace std;
string Result =
to_string(M[0][0]) + " " + to_string(M[0][1]) + " " + to_string(M[0][2]) + " " + to_string(M[0][3]) + "\n"
+ to_string(M[1][0]) + " " + to_string(M[1][1]) + " " + to_string(M[1][2]) + " " + to_string(M[1][3]) + "\n"
+ to_string(M[2][0]) + " " + to_string(M[2][1]) + " " + to_string(M[2][2]) + " " + to_string(M[2][3]) + "\n"
+ to_string(M[3][0]) + " " + to_string(M[3][1]) + " " + to_string(M[3][2]) + " " + to_string(M[3][3]) + "\n";
return Result;
} |
h3.<API key> {
margin-top: 2px;
}
.ui-widget select {
font-size: 11px;
}
.speasyforms-wizard .ms-formbody {
background: transparent;
border-top: 0px;
}
.ui-tabs-nav {
width: 99% !important;
}
.ui-tabs .ui-tabs-panel {
padding: .7em .7em;
}
.<API key> .ms-long {
width: 225px;
}
.<API key> .ms-rtefield {
width: 250px;
min-width: 250px;
}
.<API key> .<API key>,
.<API key> .<API key>,
.<API key> .ms-usereditor {
width: 250px;
}
.<API key> select[multiple='multiple'] {
width: 136px !important;
}
table.speasyforms-columns, table.speasyforms-columns h3.ms-standardheader, table.speasyforms-columns td.ms-formbody {
margin: 0;
padding: 0;
}
.<API key> {
margin-bottom: 5px;
padding-bottom: 0;
font-weight: bold;
}
table.speasyforms-columns td {
vertical-align: top;
}
a.<API key> {
border-top: 2px dashed red !important;
border-left: 2px dashed red !important;
border-right: 2px dashed red !important;
}
h3.<API key> {
border: 2px dashed red !important;
}
.ms-formlabel {
padding: 0;
}
.ms-formbody {
padding: .1em;
}
#<API key>,
#<API key> {
width: 800px;
}
.speasyforms-stars {
width: 110px;
height: 20px;
background-image: url(images/stars.png);
background-position: left top;
}
.<API key> {
width: 110px;
height: 20px;
background: transparent;
border: none;
}
.<API key> .ui-slider {
background: transparent;
border: none;
}
.<API key> .ui-widget-header {
background: transparent;
}
.<API key> .ui-state-default {
border: none;
background: transparent;
height: 0;
width: 0;
}
.ms-error, .ms-formvalidation {
font-family: Lucida Grande,Lucida Sans,Arial,sans-serif;
font-size: 0.8rem;
}
div.<API key> {
margin: 10px;
}
h3.speasyforms-wizard {
padding: 5px;
}
div.speasyforms-wizard {
padding: 10px;
}
table.<API key> {
border-spacing: 5px;
width: 100%;
}
table.<API key> td {
padding: 3px 0 !important;
}
.<API key> .<API key>{
width: 98%;
margin: 0 auto;
}
div.speasyforms-tabs,
div.<API key> {
width: 98%;
margin: 10px auto 20px auto;
}
.ui-dialog {
z-index: 101;
} |
package de.avalax.mtg_insight.presentation.tasks;
import android.os.AsyncTask;
import android.util.Log;
import android.widget.ProgressBar;
import java.util.Collections;
import de.avalax.mtg_insight.domain.model.card.Card;
import de.avalax.mtg_insight.domain.model.deck.StandardDeck;
import de.avalax.mtg_insight.domain.model.deck.Deck;
import de.avalax.mtg_insight.domain.model.deck.DeckService;
import de.avalax.mtg_insight.domain.model.deck.Deckname;
import de.avalax.mtg_insight.domain.model.deck.JobProgressListener;
import de.avalax.mtg_insight.domain.model.exception.<API key>;
public class DeckServiceTask extends AsyncTask<String, Integer, Deck> implements JobProgressListener {
private DeckService deckService;
private ProgressBar progressBar;
private DeckServiceResponse delegate;
public DeckServiceTask(DeckServiceResponse delegate, DeckService deckService, ProgressBar progressBar) {
this.delegate = delegate;
this.deckService = deckService;
this.progressBar = progressBar;
}
@Override
protected Deck doInBackground(String... params) {
try {
return deckService.deckFromDeckname(new Deckname(params[0]), this);
} catch (<API key> e) {
Log.d("deck not found", e.getMessage(), e);
return new StandardDeck(new Deckname(e.getMessage()), Collections.<Card>emptyList(), Collections.<Card>emptyList());
}
}
@Override
protected void onPreExecute() {
progressBar.setVisibility(ProgressBar.VISIBLE);
}
@Override
protected void onPostExecute(Deck deck) {
delegate.processFinish(deck);
progressBar.setVisibility(ProgressBar.GONE);
}
@Override
protected void onProgressUpdate(Integer... values) {
progressBar.setProgress(values[0]);
}
@Override
public void publishProgress(int progress) {
super.publishProgress(progress);
}
} |
# We borrow heavily from the kernel build setup, though we are simpler since
# we don't have Kconfig tweaking settings on us.
# The implicit make rules have it looking for RCS files, among other things.
# We instead explicitly write all the rules we care about.
# It's even quicker (saves ~200ms) to pass -r on the command line.
MAKEFLAGS=-r
# The source directory tree.
srcdir := ..
abs_srcdir := $(abspath $(srcdir))
# The name of the builddir.
builddir_name ?= .
# The V=1 flag on command line makes us verbosely print command lines.
ifdef V
quiet=
else
quiet=quiet_
endif
# Specify BUILDTYPE=Release on the command line for a release build.
BUILDTYPE ?= Release
# Directory all our build output goes into.
# Note that this must be two directories beneath src/ for unit tests to pass,
# as they reach into the src/ directory for data with relative paths.
builddir ?= $(builddir_name)/$(BUILDTYPE)
abs_builddir := $(abspath $(builddir))
depsdir := $(builddir)/.deps
# Object output directory.
obj := $(builddir)/obj
abs_obj := $(abspath $(obj))
# We build up a list of every single one of the targets so we can slurp in the
# generated dependency rule Makefiles in one pass.
all_deps :=
# C++ apps need to be linked with g++.
# Note: flock is used to seralize linking. Linking is a memory-intensive
# process so running parallel links can often lead to thrashing. To disable
# the serialization, override LINK via an envrionment variable as follows:
# export LINK=g++
# This will allow make to invoke N linker processes as specified in -jN.
LINK ?= flock $(builddir)/linker.lock $(CXX.target)
CC.target ?= $(CC)
CFLAGS.target ?= $(CFLAGS)
CXX.target ?= $(CXX)
CXXFLAGS.target ?= $(CXXFLAGS)
LINK.target ?= $(LINK)
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
# to replicate this environment fallback in make as well.
CC.host ?= gcc
CFLAGS.host ?=
CXX.host ?= g++
CXXFLAGS.host ?=
LINK.host ?= g++
LDFLAGS.host ?=
AR.host ?= ar
# Define a dir function that can handle spaces.
# "leading spaces cannot appear in the text of the first argument as written.
# These characters can be put into the argument value by variable substitution."
empty :=
space := $(empty) $(empty)
replace_spaces = $(subst $(space),?,$1)
unreplace_spaces = $(subst ?,$(space),$1)
dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))
# Flags to make gcc output dependency info. Note that you need to be
# careful here to use the flags that ccache and distcc can understand.
# We write to a dep file on the side first and then rename at the end
# so we can't end up with a broken dep file.
depfile = $(depsdir)/$(call replace_spaces,$@).d
DEPFLAGS = -MMD -MF $(depfile).raw
# We have to fixup the deps output in a few ways.
# (1) the file output should mention the proper .o file.
# ccache or distcc lose the path to the target, so we convert a rule of
# the form:
# foobar.o: DEP1 DEP2
# into
# path/to/foobar.o: DEP1 DEP2
# (2) we want missing files not to cause us to fail to build.
# We want to rewrite
# foobar.o: DEP1 DEP2 \
# DEP3
# DEP1:
# DEP2:
# DEP3:
# so if the files are missing, they're just considered phony rules.
# We have to do some pretty insane escaping to get those backslashes
# and dollar signs past make, the shell, and sed at the same time.
# Doesn't work with spaces, but that's fine: .d files have spaces in
# their names replaced with other characters.
define fixup_dep
# The depfile may not exist if the input file didn't have any #includes.
touch $(depfile).raw
# Fixup path as in (1).
sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
# Add extra rules as in (2).
# We remove slashes and replace spaces with new lines;
# remove blank lines;
# delete the first line and append a colon to the remaining lines.
sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\
grep -v '^$$' |\
sed -e 1d -e 's|$$|:|' \
>> $(depfile)
rm $(depfile).raw
endef
# Command definitions:
# - cmd_foo is the actual command to run;
# - quiet_cmd_foo is the brief-output summary of the command.
quiet_cmd_cc = CC($(TOOLSET)) $@
cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_cxx = CXX($(TOOLSET)) $@
cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_touch = TOUCH $@
cmd_touch = touch $@
quiet_cmd_copy = COPY $@
# send stderr to /dev/null to ignore messages when linking directories.
cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@")
quiet_cmd_alink = AR($(TOOLSET)) $@
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
<API key> = AR($(TOOLSET)) $@
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
# Due to circular dependencies between libraries :(, we wrap the
# special "figure out circular dependencies" flags around the entire
# input list during linking.
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
# We support two kinds of shared objects (.so):
# 1) shared_library, which is just bundling together many dependent libraries
# into a link line.
# 2) loadable_module, which is generating a module intended for dlopen().
# They differ only slightly:
# In the former case, we want to package all dependent code into the .so.
# In the latter case, we want to package just the API exposed by the
# outermost module.
# This means shared_library uses --whole-archive, while loadable_module doesn't.
# (Note that --whole-archive is incompatible with the --start-group used in
# normal linking.)
# Other shared-object link notes:
# - Set SONAME to the library filename so our binaries don't reference
# the local, absolute paths used on the link command-line.
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)
<API key> = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
# Define an escape_quotes function to escape single quotes.
# This allows us to handle quotes properly as long as we always use
# use single quotes and escape_quotes.
escape_quotes = $(subst ','\'',$(1))
# This comment is here just to include a ' to unconfuse syntax highlighting.
# Define an escape_vars function to escape '$' variable syntax.
# This allows us to read/write command lines with shell variables (e.g.
# $LD_LIBRARY_PATH), without triggering make substitution.
escape_vars = $(subst $$,$$$$,$(1))
# Helper that expands to a shell command to echo a string exactly as it is in
# make. This uses printf instead of echo because printf's behaviour with respect
# to escape sequences is more portable than echo's across different shells
# (e.g., dash, bash).
exact_echo = printf '%s\n' '$(call escape_quotes,$(1))'
# Helper to compare the command we're about to run against the command
# we logged the last time we ran the command. Produces an empty
# string (false) when the commands match.
# Tricky point: Make has no string-equality test function.
# The kernel uses the following, but it seems like it would have false
# positives, where one string reordered its arguments.
# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
# $(filter-out $(cmd_$@), $(cmd_$(1))))
# We instead substitute each for the empty string into the other, and
# say they're equal if both substitutions produce the empty string.
# .d files contain ? instead of spaces, take that into account.
command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\
$(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))
# Helper that is non-empty when a prerequisite changes.
# Normally make does this implicitly, but we force rules to always run
# so we can check their command lines.
# $? -- new prerequisites
# $| -- order-only dependencies
prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))
# Helper that executes all postbuilds until one fails.
define do_postbuilds
@E=0;\
for p in $(POSTBUILDS); do\
eval $$p;\
E=$$?;\
if [ $$E -ne 0 ]; then\
break;\
fi;\
done;\
if [ $$E -ne 0 ]; then\
rm -rf "$@";\
exit $$E;\
fi
endef
# do_cmd: run a command via the above cmd_foo names, if necessary.
# Should always run for a given target to handle command-line changes.
# Second argument, if non-zero, makes it do asm/C/C++ dependency munging.
# Third argument, if non-zero, makes it do POSTBUILDS processing.
# Note: We intentionally do NOT call dirx for depfile, since it contains ? for
# spaces already and dirx strips the ? characters.
define do_cmd
$(if $(or $(command_changed),$(prereq_changed)),
@$(call exact_echo, $($(quiet)cmd_$(1)))
@mkdir -p "$(call dirx,$@)" "$(dir $(depfile))"
$(if $(findstring flock,$(word 1,$(cmd_$1))),
@$(cmd_$(1))
@echo " $(quiet_cmd_$(1)): Finished",
@$(cmd_$(1))
)
@$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile)
@$(if $(2),$(fixup_dep))
$(if $(and $(3), $(POSTBUILDS)),
$(call do_postbuilds)
)
)
endef
# Declare the "all" target first so it is the default,
# even though we don't have the deps yet.
.PHONY: all
all:
# make looks for ways to re-generate included makefiles, but in our case, we
# don't have a direct way. Explicitly telling make that it has nothing to do
# for them makes it go faster.
%.d: ;
# Use FORCE_DO_CMD to force a target to run. Should be coupled with
# do_cmd.
.PHONY: FORCE_DO_CMD
FORCE_DO_CMD:
TOOLSET := target
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
$(findstring $(join ^,$(prefix)),\
$(join ^,epoll.target.mk)))),)
include epoll.target.mk
endif
<API key> = ACTION Regenerating $@
cmd_regen_makefile = /usr/bin/gyp -fmake --ignore-environment "--toplevel-dir=." -I/var/www/html/node_modules/onoff/node_modules/epoll/build/config.gypi -I/usr/lib/node_modules/node-gyp/addon-rpm.gypi -I/usr/share/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/usr/share/node" "-Dmodule_root_dir=/var/www/html/node_modules/onoff/node_modules/epoll" binding.gyp
Makefile: $(srcdir)/../../../../../../../usr/lib/node_modules/node-gyp/addon-rpm.gypi $(srcdir)/../../../../../../../usr/share/node/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp
$(call do_cmd,regen_makefile)
# "all" is a concatenation of the "all" targets from all the included
# sub-makefiles. This is just here to clarify.
all:
# Add in dependency-tracking rules. $(all_deps) is the list of every single
# target in our tree. Only consider the ones with .d (dependency) info:
d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))
ifneq ($(d_files),)
include $(d_files)
endif |
from __future__ import division
balance = 9999999
annualInterestRate = 0.18
min_pay = 10
def pay(m, min_pay):
if m == 1:
ub = (balance - min_pay) * (1 + annualInterestRate / 12)
return ub
else:
last_ub = pay(m - 1, min_pay)
ub = (last_ub - min_pay) * (1 + annualInterestRate / 12)
return ub
ub = pay(12, min_pay)
while ub > 0:
min_pay += 10
ub = pay(12, min_pay)
print('Lowest Payment: %d' % min_pay) |
layout: post
category: Java
title:
tags: Java
[](https:
>
**1**
java
public class Main2 {
public static void main(String[] args) {
Class c1 = new ArrayList<Integer>().getClass();
Class c2 = new ArrayList<String>().getClass();
System.out.print(c1 == c2);
}
}
/* output
true
*/
List<String> Integer List<Sring>List<Integer>
**2**
java
public class Table {
}
public class Room {
}
public class House<Q> {
}
public class Particle<POSITION, MOMENTUM> {
}
public class Main {
public static void main(String[] args) {
List<Table> tableList = new ArrayList<Table>();
Map<Room, Table> maps = new HashMap<Room, Table>();
House<Room> house = new House<Room>();
Particle<Long, Double> particle = new Particle<Long, Double>();
System.out.println(Arrays.toString(tableList.getClass().getTypeParameters()));
System.out.println(Arrays.toString(maps.getClass().getTypeParameters()));
System.out.println(Arrays.toString(house.getClass().getTypeParameters()));
System.out.println(Arrays.toString(particle.getClass().getTypeParameters()));
}
}
/** output
[E]
[K, V]
[Q]
[POSITION, MOMENTUM]
*/
‘’
**3**
java
List<String> stringList=new ArrayList<String>();
stringList.add("wakaka");
//stringList.add(new Integer(0));
//List.java
public interface List<E> extends Collection<E> {
boolean add(E e);
}
ListEaddEIntegerstringList
extends
ObjectTHasF
**4**
java
// HasF.java
public interface HasF {
void f();
}
//Manipulator.java
public class Manipulator<T extends HasF> {
T obj;
public T getObj() {
return obj;
}
public void setObj(T obj) {
this.obj = obj;
}
}
extend
## Java
JavaJava
SimpleHolderGenericHolder
java
// SimpleHolder.java
public class SimpleHolder {
private Object obj;
public Object getObj() {
return obj;
}
public void setObj(Object obj) {
this.obj = obj;
}
public static void main(String[] args) {
SimpleHolder holder = new SimpleHolder();
holder.setObj("Item");
String s = (String) holder.getObj();
}
}
// SimpleHolder.class
public class SimpleHolder {
public SimpleHolder();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public java.lang.Object getObj();
Code:
0: aload_0
1: getfield #2 // Field obj:Ljava/lang/Object;
4: areturn
public void setObj(java.lang.Object);
Code:
0: aload_0
1: aload_1
2: putfield #2 // Field obj:Ljava/lang/Object;
5: return
public static void main(java.lang.String[]);
Code:
0: new #3 // class SimpleHolder
3: dup
4: invokespecial #4 // Method "<init>":()V
7: astore_1
8: aload_1
9: ldc #5 // String Item
11: invokevirtual #6 // Method setObj:(Ljava/lang/Object;)V
14: aload_1
15: invokevirtual #7 // Method getObj:()Ljava/lang/Object;
18: checkcast #8 // class java/lang/String
21: astore_2
22: return
}
//GenericHolder.java
public class GenericHolder<T> {
T obj;
public T getObj() {
return obj;
}
public void setObj(T obj) {
this.obj = obj;
}
public static void main(String[] args) {
GenericHolder<String> holder = new GenericHolder<>();
holder.setObj("Item");
String s = holder.getObj();
}
}
//GenericHolder.class
public class GenericHolder<T> {
T obj;
public GenericHolder();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public T getObj();
Code:
0: aload_0
1: getfield #2 // Field obj:Ljava/lang/Object;
4: areturn
public void setObj(T);
Code:
0: aload_0
1: aload_1
2: putfield #2 // Field obj:Ljava/lang/Object;
5: return
public static void main(java.lang.String[]);
Code:
0: new #3 // class GenericHolder
3: dup
4: invokespecial #4 // Method "<init>":()V
7: astore_1
8: aload_1
9: ldc #5 // String Item
11: invokevirtual #6 // Method setObj:(Ljava/lang/Object;)V
14: aload_1
15: invokevirtual #7 // Method getObj:()Ljava/lang/Object;
18: checkcast #8 // class java/lang/String
21: astore_2
22: return
}
setgetObject‘’getGenericHolder.classmain18
instanceof new
java
public class Erased<T> {
private final int SIZE = 100;
public static void f(Object arg) {
if (arg instanceof T) {
}
T var = new T();
T[] array = new T[SIZE];
T[] array = (T) new Object[SIZE];
}
}
1.
java
class Building {}
class House extends Building {}
public class ClassTypeCapture<T> {
Class<T> kind;
public ClassTypeCapture(Class<T> kind) {
this.kind = kind;
}
public boolean f(Object arg) {
return kind.isInstance(arg);
}
public static void main(String[] args) {
ClassTypeCapture<Building> ctt1 = new ClassTypeCapture<Building>(Building.class);
System.out.println(ctt1.f(new Building()));
System.out.println(ctt1.f(new House()));
ClassTypeCapture<House> ctt2 = new ClassTypeCapture<House>(House.class);
System.out.println(ctt2.f(new Building()));
System.out.print(ctt2.f(new House()));
}
}
//output
//true
//true
//false
//true
instanceof
2.
Erased.javanew T()T
java
interface IFactory<T> {
T create();
}
class Foo2<T> {
private T x;
public <F extends IFactory<T>> Foo2(F factory) {
x = factory.create();
}
}
class IntegerFactory implements IFactory<Integer> {
@Override
public Integer create() {
return new Integer(0);
}
}
class Widget {
public static class Factory implements IFactory<Widget> {
@Override
public Widget create() {
return new Widget();
}
}
}
public class FactoryConstraint {
public static void main(String[] args) {
new Foo2<Integer>(new IntegerFactory());
new Foo2<Widget>(new Widget.Factory());
}
}
3.
ArrayList
java
public class <API key><T> {
private T[] array;
@SuppressWarnings("unchecked")
public <API key>(Class<T> type, int sz) {
array = (T[]) Array.newInstance(type, sz);
}
public void put(int index, T item) {
array[index] = item;
}
public T[] rep() {
return array;
}
public static void main(String[] args) {
<API key><Integer> gai = new <API key><Integer>(Integer.class, 10);
Integer[] ia = gai.rep();
}
}
newInstance
Java extends
java
interface HasColor {
Color getColor();
}
class Colored<T extends HasColor> {
T item;
public Colored(T item) {
this.item = item;
}
public T getItem() {
return item;
}
public Color color() {
return item.getColor();
}
}
class Dimension {
public int x, y, z;
}
class ColoredDemension<T extends HasColor & Dimension> {
T item;
public ColoredDemension(T item) {
this.item = item;
}
public T getItem() {
return item;
}
Color color() {
return item.getColor();
}
int getX() {
return item.x;
}
int getY() {
return item.y;
}
int getZ() {
return item.z;
}
}
interface Weight {
int weight();
}
class Solid<T extends Dimension & HasColor & Weight> {
T item;
public Solid(T item) {
this.item = item;
}
public T getItem() {
return item;
}
Color color() {
return item.getColor();
}
int getX() {
return item.x;
}
int getY() {
return item.y;
}
int getZ() {
return item.z;
}
int weight() {
return item.weight();
}
}
class Bounded extends Dimension implements HasColor, Weight {
@Override
public Color getColor() {
return null;
}
@Override
public int weight() {
return 0;
}
}
public class BasicBound {
public static void main(String[] args) {
Solid<Bounded> solid = new Solid<Bounded>(new Bounded());
solid.color();
solid.weight();
solid.getZ();
}
}
extends
-
-
java
public class Holder<T> {
private T value;
public Holder(T apple) {
}
public T getValue() {
return value;
}
public void setValue(T value) {
this.value = value;
}
@Override
public boolean equals(Object o) {
return value != null && value.equals(o);
}
public static void main(String[] args) {
Holder<Apple> appleHolder = new Holder<Apple>(new Apple());
Apple d = new Apple();
appleHolder.setValue(d);
// Holder<Fruit> fruitHolder=appleHolder;
// extends
Holder<? extends Fruit> fruitHolder = appleHolder;
// Fruit ? extends Fruit,
// Apple
d = (Apple) fruitHolder.getValue();
//FruitFruit
Fruit fruit = fruitHolder.getValue();
Object obj = fruitHolder.getValue();
try {
Orange c = (Orange) fruitHolder.getValue();
} catch (Exception e) {
System.out.print(e);
}
// fruitHolder.setValue(new Apple());
// fruitHolder.setValue(new Orange());
//equalsObject ? extends Fruit
System.out.print(fruitHolder.equals(d));
}
}
Javajava?
Holder<? extends Fruit>```Fruit
```Holder<? extends Fruit>```FruitholderObjectFruit
java
package wildcard;
import java.util.ArrayList;
import java.util.List;
public class GenericWriting {
static <T> void writeExact(List<T> list, T item) {
list.add(item);
}
static List<Apple> apples = new ArrayList<Apple>();
static List<Fruit> fruits = new ArrayList<Fruit>();
static void f1() {
writeExact(apples, new Apple());
//this cannot be compile,said in Thinking in Java
writeExact(fruits, new Apple());
}
static <T> void writeWithWildcard(List<? super T> list, T item) {
list.add(item);
}
static void f2() {
writeWithWildcard(apples, new Apple());
writeWithWildcard(fruits, new Apple());
}
static <T> readWithWildcard(List<? super T> list, int index) {
//Compile Error, required T but found Object
return list.get(index);
}
public static void main(String[] args) {
f1();
f2();
}
}
```List<? super Integer>, List<? super T> list```
List<T super MyClass>
writeExact(fruits,new Apple());JavaJava1.6Java1.71.5
‘’getObjectTObjectlist.get(index)Object
```<?>``` ```List<?>```Object, ListObject
[](https:
[2](https://zhuanlan.zhihu.com/p/28242753)
java
public static void printList(List<?> list) {
for (Object o : list) {
System.out.println(o);
}
}
public static void main(String[] args) {
List<String> l1 = new ArrayList<>();
l1.add("aa");
l1.add("bb");
l1.add("cc");
printList(l1);
List<Integer> l2 = new ArrayList<>();
l2.add(11);
l2.add(22);
l2.add(33);
printList(l2);
>
printListpublic static void printList(List<Object> list)
**List<?>addgetList**
List, addget
java
public static void addTest(List<?> list) {
Object o = new Object();
// list.add(o); //
// list.add(1); //
// list.add("ABC"); //
list.add(null);
// String s = list.get(0); //
// Integer i = list.get(1); //
Object o = list.get(2);
}
List<Number>List<String>
List<Interger>list.add(o)list.("ABC") |
public class Precedence // direction a
{
public static void main(String[] args) // main
{
int iAmFour = 4, iAmTwo = 2, iAmSeven = 7, iAmFourteen = 14, iAmEightteen = 18, iAmFive = 5, iAmOne = 1, iAmTwentyEight = 28, iAmTwenty = 20, iAmThree = 3; // direction a
double iAmPointTwo = 0.2; // direction a
System.out.println( iAmFour + " + " + iAmSeven + " * " + iAmFour + " = " + (iAmFour+iAmSeven*iAmFour) ); // comp 1
System.out.println( iAmFour + " / " + iAmTwo + " * " + iAmFourteen + " = " + (iAmFour/iAmTwo*iAmFourteen) ); // comp 2
System.out.println( iAmEightteen + " / " + iAmTwo + " + " + iAmFourteen + " / " + iAmTwo + " = " + (iAmEightteen/iAmTwo+iAmFourteen/iAmTwo) ); // comp 3
System.out.println( iAmFour + " + " + iAmTwo + " / " + iAmFour + " - " + iAmTwo + " = " + (iAmFour+iAmTwo/iAmFour-iAmTwo) ); // comp 4
System.out.println( iAmFive + " % " + iAmTwo + " * " + iAmFour + " / " + iAmOne + " + " + iAmFive + " = " + (iAmFive%iAmTwo*iAmFour/iAmOne+iAmFive) ); // comp 5
System.out.println( iAmTwentyEight + " / " + iAmFive + " = " + (iAmTwentyEight/iAmFive) ); // comp 6
System.out.println( iAmTwentyEight + " % " + iAmFive + " = " + (iAmTwentyEight%iAmFive) ); // comp 7
System.out.println( iAmTwenty + " / ( " + iAmFour + " + " + iAmOne + " ) = " + (iAmTwenty/(iAmFour+iAmOne)) ); // comp 8
System.out.println( "( " + iAmTwo + " + " + iAmThree + " ) * " + iAmFour + " = " + ((iAmTwo+iAmThree)*iAmFour) ); // comp 9
System.out.println( "24 / " + iAmPointTwo + " = " + (24/iAmPointTwo) ); // comp 10
System.out.println( "
System.out.println( "Order of Precedence:" ); // direction c
System.out.println( "1) Parentheses." );
System.out.println( "2) Multiplication, Division, Modulo - Left to Right." );
System.out.println( "3) Addition, Subtraction - Left to Right." );
System.out.println( "4) Assignment - Right to Left." );
System.out.println( "Multiplicative Operators are assosciated from Left to Right" ); // direction d
System.out.println( "Addative Operators are assosciated from Left to Right" );
System.out.println( "Assignment Operators are assosciated from Right to Left" );
}
} |
#{extends 'listAll.html' /}
#{set title:'Protocols and Structures for Inference - All Relations' /}
#{list items:resourceNames, as:'name' }
<li><a href="@{Data.describe(name)}" title="${name}">${name}</a></li>
#{/list} |
module MobileDevicePool
class IoStream
class << self
def <API key>(cmd, &blk)
begin
output = IO.popen(cmd)
while (line = output.gets)
blk.call(line)
end
rescue Exception => e
puts e.message
puts e.backtrace.inspect
end
end
def <API key>(cmd)
begin
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
out, err = '', ''
stdout.each_line {|line| out += line}
stderr.each_line {|line| err += line}
exit_status = wait_thr.value
if exit_status.success?
result = [true, {out: out, err: err}]
else
if exit_status.signaled?
termsig = exit_status.termsig
termsig = "Null" if termsig.nil?
result = [false, {out: out, err: "Terminated because of an uncaught signal: #{termsig}"}]
else
result = [false, {out: out, err: err}]
end
end
rescue Exception => e
puts e.message
puts e.backtrace.inspect
ensure
[stdin, stdout, stderr].each {|io| io.close}
end
result
end
end
<API key> :new
end
end |
<?php
namespace Behat\BehatBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\Config\FileLocator;
use Behat\Behat\DependencyInjection\BehatExtension as BaseExtension;
/**
* Behat extension for DIC.
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class BehatExtension extends BaseExtension
{
/**
* {@inheritdoc}
*/
protected function loadDefaults($container)
{
$<API key> = new \ReflectionClass('Behat\Behat\Console\BehatApplication');
$<API key> = new \ReflectionClass('Behat\Gherkin\Parser');
$behatLibPath = realpath(dirname($<API key>->getFilename()) . '/../../../../');
$gherkinLibPath = realpath(dirname($<API key>->getFilename()) . '/../../../');
$loader = new XmlFileLoader($container, new FileLocator($behatLibPath . '/src/Behat/Behat/DependencyInjection/config'));
$loader->load('behat.xml');
$loader->load(__DIR__ . '/../Resources/config/behat_bundle.xml');
$container->setParameter('gherkin.paths.lib', $gherkinLibPath);
$container->setParameter('behat.paths.lib', $behatLibPath);
}
} |
Ext.provide('Phlexible.users.edit.Password');
Phlexible.users.edit.Password = Ext.extend(Ext.form.FormPanel, {
strings: Phlexible.users.Strings,
title: Phlexible.users.Strings.password,
iconCls: '<API key>',
border: false,
bodyStyle: 'padding:5px',
hideMode: 'offsets',
defaultType: 'textfield',
defaults: {
msgTarget: 'under'
},
initComponent: function() {
this.items = [{
xtype: 'checkbox',
boxLabel: this.strings.add_optin,
hideLabel: true,
checked: true,
name: 'optin',
border: false,
disabled: this.mode !== 'add',
hidden: this.mode !== 'add',
listeners: {
check: function(c, checked) {
this.<API key>().getComponent(2).setDisabled(checked);
},
scope: this
}
},{
xtype: 'checkbox',
boxLabel: this.strings.edit_optin,
hideLabel: true,
checked: false,
name: 'optin',
border: false,
disabled: this.mode === 'add',
hidden: this.mode === 'add',
listeners: {
check: function(c, checked) {
this.<API key>().getComponent(2).setDisabled(checked);
},
scope: this
}
},{
xtype: 'fieldset',
text: this.strings.password,
title: this.strings.password,
autoHeight: true,
disabled: this.mode === 'add',
items: [{
xtype: 'passwordfield',
name: 'password',
hideLabel: true,
inputType: "password",
minLength: Phlexible.Config.get('system.password_min_length'),
width: 200,
showStrengthMeter: true,
showCapsWarning: true
},{
xtype: 'panel',
border: false,
bodyStyle: 'padding-bottom: 10px;',
html: this.strings.<API key>
},{
xtype: 'textfield',
emptyText: this.strings.generated_password,
hideLabel: true,
readOnly: true,
width: 200,
append: [
{
xtype: 'button',
text: this.strings.generate,
iconCls: '<API key>',
handler: function (btn) {
btn.setIconClass('x-tbar-loading');
btn.disable();
Ext.Ajax.request({
url: Phlexible.Router.generate('users_password'),
success: function (response) {
var data = Ext.decode(response.responseText);
var panel = this.<API key>();
if (data.success) {
panel.getComponent(2).getComponent(0).setValue(data.password);
panel.getComponent(2).getComponent(2).setValue(data.password);
}
btn.setIconClass('<API key>');
btn.enable();
},
scope: this
});
},
scope: this
}
]
}]
}];
Phlexible.users.edit.Password.superclass.initComponent.call(this);
},
loadUser: function(user) {
this.getForm().loadRecord(user);
},
isValid: function() {
if (!this.getForm().isValid()) {
Ext.MessageBox.alert('Validation failed', 'Check the password tab for details.');
return false;
}
return true;
},
getData: function() {
var values = this.getForm().getValues();
return {
optin: values.optin,
password: values.password
};
}
});
Ext.reg('user_edit_password', Phlexible.users.edit.Password);
Phlexible.PluginRegistry.prepend('userEditPanels', {
xtype: 'user_edit_password'
}); |
<?php
namespace Gos\Component\WebSocketClient\Wamp;
trigger_deprecation('gos/websocket-client', '1.2', 'The package is deprecated, use "ratchet/pawl" instead.');
/**
* @deprecated the package is deprecated, use "ratchet/pawl" instead.
*/
final class Protocol
{
public const MSG_WELCOME = 0;
public const MSG_PREFIX = 1;
public const MSG_CALL = 2;
public const MSG_CALL_RESULT = 3;
public const MSG_CALL_ERROR = 4;
public const MSG_SUBSCRIBE = 5;
public const MSG_UNSUBSCRIBE = 6;
public const MSG_PUBLISH = 7;
public const MSG_EVENT = 8;
private function __construct()
{
}
} |
#import <UIKit/UIKit.h>
#import "<API key>.h"
@interface <API key> : NSObject <<API key>, ElementsDataSource>
{
}
@end |
var GetHtmlService = require('./../Services/GetHtmlService');
var M3U8File = require('./M3u8File');
module.exports = function () {
var self = this;
this.sourceLink;
this.id = '';
this.m3u8 = '';
this.m3u8Content;
this._m3u8 = '';
this.lastM3u8;
this.<API key> = 0;
this.setM3u8Content = function (val) {
console.log(val);
if (this.m3u8Content != val) {
this.m3u8Content = val;
this.createM3u8File();
}
}
this.createM3u8File = function () {
var m3u8 = new M3U8File();
m3u8.sourceLink = this.lastM3u8;
m3u8.liveId = this.id;
m3u8.from = 'gametv';
m3u8.setM3u8Content(this.m3u8Content);
}
this.setM3u8 = function (val) {
if (val != this.m3u8) {
this.m3u8 = val;
this.lastM3u8 = undefined;
this._m3u8 = this.m3u8;
this.getLastM3u8();
}
}
this.getLastM3u8 = function () {
if (!this._m3u8) this._m3u8 = this.m3u8;
GetHtmlService.getHtml(this._m3u8)
.then(rs => {
if (rs.indexOf('.m3u8') > 0) {
console.log('co file m3 u8 o ben trong');
console.log(rs);
var end = rs.indexOf('.m3u8');
var start = rs.lastIndexOf("\n", end) + 1;
var m3u8 = rs.substr(start, end - start + 5);
self._m3u8 = self.m3u8.substring(0, self.m3u8.lastIndexOf('/') + 1) + m3u8;
self.getLastM3u8();
} else {
console.log('get m3u8 thanh cong');
console.log(self._m3u8);
self.lastM3u8 = self._m3u8;
}
self.<API key> = 0;
})
.catch(err => {
console.log(err);
self.<API key>++;
self._m3u8 = undefined;
if(self.<API key>>10){
clearInterval(self.intervalCopy);
}
})
}
this.copy = function () {
console.log(this.lastM3u8);
if (this.lastM3u8) {
GetHtmlService.getHtml(this.lastM3u8)
.then(rs => {
if (rs.indexOf('.ts') > 0) {
if (self.setM3u8Content(rs));
}
})
.catch(err => {
})
} else if (!this._m3u8) {
this.getLastM3u8();
}
}
this.startCopy = function () {
this.intervalCopy = setInterval(function () {
console.log('start')
self.copy();
}, 15000);
}
} |
using System.Configuration;
namespace Kafka.Client.Cfg
{
public class <API key> : <API key>
{
[<API key>("addressList")]
public string AddressList
{
get => (string) this["addressList"];
set => this["addressList"] = value;
}
[<API key>("sessionTimeout", IsRequired = false,
DefaultValue = <API key>.<API key>)]
public int SessionTimeout => (int) this["sessionTimeout"];
[<API key>("connectionTimeout", IsRequired = false,
DefaultValue = <API key>.<API key>)]
public int ConnectionTimeout => (int) this["connectionTimeout"];
[<API key>("syncTime", IsRequired = false, DefaultValue = <API key>.DefaultSyncTime)]
public int SyncTime => (int) this["syncTime"];
[<API key>("servers", IsRequired = false, IsDefaultCollection = false)]
[<API key>(typeof(<API key>),
AddItemName = "add",
ClearItemsName = "clear",
RemoveItemName = "remove")]
public <API key> Servers =>
(<API key>) this["servers"];
}
} |
// Annotations
//@TestFile
//@Require('Class')
//@Require('bugcli.CliAction')
//@Require('bugcli.CliActionInstance')
//@Require('bugcli.CliOptionInstance')
//@Require('bugcli.<API key>')
//@Require('bugmeta.BugMeta')
//@Require('bugunit.TestTag')
// Context
require('bugpack').context("*", function(bugpack) {
// BugPack
var Class = bugpack.require('Class');
var CliAction = bugpack.require('bugcli.CliAction');
var CliActionInstance = bugpack.require('bugcli.CliActionInstance');
var CliOptionInstance = bugpack.require('bugcli.CliOptionInstance');
var <API key> = bugpack.require('bugcli.<API key>');
var BugMeta = bugpack.require('bugmeta.BugMeta');
var TestTag = bugpack.require('bugunit.TestTag');
// Simplify References
var bugmeta = BugMeta.context();
var test = TestTag.test;
// Declare Tests
var <API key> = {
// Setup Test
setup: function() {
this.testCliActionObject = {
command: "test-command",
executeMethod: function() {}
};
this.testCliAction = CliAction.alloc().initWithObject(this.testCliActionObject);
this.<API key> = CliActionInstance.alloc().initWithCliAction(this.testCliAction);
},
// Run Test
test: function(test) {
test.assertTrue(Class.doesExtend(this.<API key>, CliActionInstance),
"Assert instance of CliActionInstance");
test.assertEqual(this.<API key>.getCliAction(), this.testCliAction,
"Assert CliActionInstance.cliAction was set correctly");
test.assertTrue(this.<API key>.<API key>().isEmpty(),
"Assert CliActionInstance.<API key> is empty");
test.assertTrue(this.<API key>.<API key>().isEmpty(),
"Assert CliActionInstance.<API key> is empty");
test.assertEqual(this.<API key>.getCommand(), this.testCliActionObject.command,
"Assert CliActionInstance#getCommand method correctly returns command value");
}
};
var <API key> = {
// Setup Test
setup: function() {
this.testCliActionObject = {
command: "test-command",
default: true,
parameters: [
{
name: "testParameter"
}
],
executeMethod: function() {},
validateMethod: function() {}
};
this.<API key> = "<API key>";
this.testCliAction = CliAction.alloc().initWithObject(this.testCliActionObject);
this.<API key> = CliActionInstance.alloc().initWithCliAction(this.testCliAction);
var cliParameter = this.testCliAction.<API key>(this.testCliActionObject.parameters[0].name);
this.<API key> = <API key>.alloc().<API key>(cliParameter, this.<API key>);
this.<API key>.<API key>(this.<API key>);
},
// Run Test
test: function(test) {
test.assertTrue(Class.doesExtend(this.<API key>, CliActionInstance),
"Assert instance of CliActionInstance");
var <API key> = this.<API key>.<API key>(this.testCliActionObject.parameters[0].name);
test.assertEqual(<API key>, this.<API key>,
"Assert CliActionInstance.<API key> returned the newly added <API key>");
}
};
// BugMeta
bugmeta.tag(<API key>).with(
test().name("CliActionInstance - instantiation test")
);
bugmeta.tag(<API key>).with(
test().name("CliActionInstance - #<API key> test")
);
}); |
var fs = require('fs'),
_ = require('underscore')._,
sys = require('sys'),
exec = require('child_process').exec;
var commands = function(dbot) {
var noChangeConfig = [ 'servers', 'name', 'moduleNames' ];
var getCurrentConfig = function(configKey) {
var defaultConfigPath = dbot.config;
var userConfigPath = dbot.db.config;
if(configKey) {
var configKey = configKey.split('.');
for(var i=0;i<configKey.length-1;i++) {
if(_.has(defaultConfigPath, configKey[i])) {
if(!_.has(userConfigPath, configKey[i])) {
userConfigPath[configKey[i]] = {};
}
userConfigPath = userConfigPath[configKey[i]];
defaultConfigPath = defaultConfigPath[configKey[i]];
} else {
return false;
}
}
}
var currentOption;
if(configKey && configKey.length != 1) {
configKey = _.last(configKey);
if(_.has(userConfigPath, configKey) && !_.isUndefined(userConfigPath[configKey])) {
currentOption = userConfigPath[configKey];
} else if(_.has(defaultConfigPath, configKey)) {
currentOption = defaultConfigPath[configKey];
}
} else {
currentOption = defaultConfigPath[configKey];
}
return {
'user': userConfigPath,
'default': defaultConfigPath,
'value': currentOption
};
};
var commands = {
// Join a channel
'join': function(event) {
var channel = event.params[1];
if(_.has(event.allChannels, channel)) {
event.reply(dbot.t('already_in_channel', {'channel': channel}));
} else {
dbot.instance.join(event, channel);
event.reply(dbot.t('join', {'channel': channel}));
}
},
// Leave a channel
'part': function(event) {
var channel = event.params[1];
if(!_.has(event.allChannels, channel)) {
event.reply(dbot.t('not_in_channel', {'channel': channel}));
} else {
event.instance.part(event, channel);
event.reply(dbot.t('part', {'channel': channel}));
}
},
// Op admin caller in given channel
'opme': function(event) {
var channel = event.params[1];
// If given channel isn't valid just op in current one.
if(!_.has(event.allChannels, channel)) {
channel = event.channel.name;
}
dbot.instance.mode(event, channel, ' +o ' + event.user);
},
// Do a git pull and reload
'greload': function(event) {
exec("git pull", function (error, stdout, stderr) {
exec("git submodule update", function (error, stdout, stderr) {
event.reply(dbot.t('gpull'));
commands.reload(event);
event.message = 'version';
event.action = 'PRIVMSG';
event.params = event.message.split(' ');
dbot.instance.emit(event);
}.bind(this));
}.bind(this));
},
// Display commit information for part of dbot
'version': function(event){
var cmd = "git log --pretty=format:'%h (%s): %ar' -n 1
if(event.params[1]){
var input = event.params[1].trim();
if(_.has(dbot.modules, input.split("/")[0])){
cmd += "modules/"+input;
}
else{
cmd += input;
}
}
exec(cmd, function(error, stdout, stderr){
if(stdout.length > 0){
event.reply(stdout);
}
else{
event.reply(dbot.t("no_version"));
}
}.bind(this));
},
'status': function(event) {
var moduleName = event.params[1];
if(_.has(dbot.status, moduleName)) {
var status = dbot.status[moduleName];
if(status === true) {
event.reply(dbot.t("status_good",{"module":moduleName, "reason": status}));
} else {
event.reply(dbot.t("status_bad",{"module":moduleName, "reason": status}));
}
} else {
event.reply(dbot.t("status_unloaded"));
}
},
// Reload DB, translations and modules.
'reload': function(event) {
dbot.db = JSON.parse(fs.readFileSync('db.json', 'utf-8'));
dbot.reloadModules();
event.reply(dbot.t('reload'));
},
// Say something in a channel
'say': function(event) {
var channel = event.params[1];
if(event.params[1] === "@") {
channel = event.channel.name;
}
var message = event.params.slice(2).join(' ');
dbot.say(event.server, channel, message);
},
// Load new module
'load': function(event) {
var moduleName = event.params[1];
if(!_.include(dbot.config.moduleNames, moduleName)) {
dbot.config.moduleNames.push(moduleName);
dbot.reloadModules();
if(dbot.status[moduleName] === true) {
event.reply(dbot.t('load_module', {'moduleName': moduleName}));
} else {
event.reply(dbot.t("load_failed",{"module": moduleName}));
}
} else {
if(moduleName == 'web') {
event.reply(dbot.t('already_loaded_web'));
} else {
event.reply(dbot.t('already_loaded', {'moduleName': moduleName}));
}
}
},
// Unload a loaded module
'unload': function(event) {
var moduleNames = dbot.config.moduleNames;
var moduleName = event.params[1];
if(_.include(moduleNames, moduleName)) {
var moduleDir = '../' + moduleName + '/';
try {
var cacheKey = require.resolve(moduleDir + moduleName);
delete require.cache[cacheKey];
} catch(err) { }
dbot.config.moduleNames = _.without(dbot.config.moduleNames, moduleName);
dbot.reloadModules();
event.reply(dbot.t('unload_module', {'moduleName': moduleName}));
} else {
event.reply(dbot.t('unload_error', {'moduleName': moduleName}));
}
},
/*** Config options ***/
'setconfig': function(event) {
var configPathString = event.params[1],
configKey = _.last(configPathString.split('.')),
newOption = event.params[2];
if(!_.include(noChangeConfig, configKey)) {
var configPath = getCurrentConfig(configPathString);
if(configPath == false || _.isUndefined(configPath.value)) {
event.reply(dbot.t("no_config_key"));
return;
}
var currentOption = configPath.value;
// Convert to boolean type if config item boolean
if(_.isBoolean(currentOption)) {
newOption = (newOption == "true");
}
if(_.isArray(currentOption)) {
event.reply(dbot.t("config_array",{"alternate": "pushconfig"}));
}
event.reply(configPathString + ": " + currentOption + " -> " + newOption);
configPath['user'][configKey] = newOption;
dbot.reloadModules();
} else {
event.reply(dbot.t("config_lock"));
}
},
'pushconfig': function(event) {
var configPathString = event.params[1],
configKey = _.last(configPathString.split('.')),
newOption = event.params[2];
if(!_.include(noChangeConfig, configKey)) {
var configPath = getCurrentConfig(configPathString);
if(configPath == false || _.isUndefined(configPath.value)) {
event.reply(dbot.t("no_config_key"));
return;
}
var currentArray = configPath.value;
if(!_.isArray(currentArray)) {
event.reply(dbot.t("config_array",{"alternate": "setconfig"}));
return;
}
event.reply(configPathString + ": " + currentArray + " << " + newOption);
currentArray.push(newOption);
dbot.reloadModules();
}
},
'showconfig': function(event) {
var configPathString = event.params[1];
var configPath = getCurrentConfig(configPathString);
if(configPathString) {
var configKey = _.last(configPathString.split('.'));
if(configKey) {
event.reply(dbot.t("no_config_path"));
return;
}
if(_.isArray(configPath.value)) {
event.reply(configKey + ': ' + configPath.value);
} else if(_.isObject(configPath.value)) {
event.reply(dbot.t("<API key>",{"path":configPathString,"value":Object.keys(configPath.value)}));
} else {
event.reply(configKey + ': ' + configPath.value);
}
} else {
event.reply(dbot.t("<API key>",{"path":"root","value":Object.keys(configPath['default'])}));
}
}
};
_.each(commands, function(command) {
command.access = 'admin';
});
commands['showconfig'].access = 'moderator';
commands['join'].access = 'moderator';
commands['part'].access = 'moderator';
commands['opme'].access = 'moderator';
commands['say'].access = 'moderator';
return commands;
};
exports.fetch = function(dbot) {
return commands(dbot);
} |
\subsection{Homology theory}
Let's remind ourselves of the First Isomorphism Theorem
\begin{thm}
(First Isomorphism Theorem) Let $G$, $H$ be groups, and let $\phi:G\to H$
be a homomorphism, then\end{thm}
\begin{enumerate}
\item $\text{Img}(\phi)\cong G/\ker(\phi)$,
\item $\ker(\psi)$ is a normal subgroup of $G$,
\item $\text{Img}(\psi)$ is a subgroup of $H$,
\end{enumerate}
In particular if $\phi$ is onto (surjective) then $H\cong G/\ker(\psi)$.
\begin{defn}
The standard $p$-simplex is
\begin{align*}
\Delta^{p} & =\{(t_{0},\dots,t_{p})\in\mathbb{R}^{p+1}\mid t_{i}\geqslant0,\sum_{i}t_{i}=1\}.
\end{align*}
\end{defn}
\begin{defn}
Let $X$ be a topological space. A singular $p$-simplex is a continuous
map $\sigma:\Delta^{p}\to X$.
\end{defn}
\begin{defn}
A $p$-chain is denoted $C_{p}(X)=\{\text{singular \ensuremath{p}-simplesx in \ensuremath{X}}\}=\text{free Abelian group generated by all singular \ensuremath{p}-simplexes in \ensuremath{X}.}$
So a $p$-chain is a formal sum
\begin{align*}
C_{p}(X)=\sum_{i}n_{i}\sigma_{i}
\end{align*}
where each $\sigma_{i}$ is a signular $p$-simplex in $X$ (and all
but finitely-many $n_{i}$ are $0$.)
\end{defn}
\begin{defn}
(Boundaries)
The $i$th face map for the standard $p$-simplex is the affine map
\begin{align*}
[e_{0},\dots,\hat{e}_{i},\dots,e_{p}] & :\Delta^{p-1}\to\Delta^{p}
\end{align*}
(where the hat means we \emph{omit} this vertex.) Let $\sigma^{(i)}:\Delta^{p-1}\to X$
be given by
\begin{align*}
\sigma^{(i)} & =\sigma\circ[e_{0},\dots,\hat{e}_{i},\dots,e_{p}]
\end{align*}
then defined the boundary of $\sigma$, $\partial\sigma$ as
\begin{align*}
\partial\sigma & =\sum_{i=0}^{p}(-1)^{i}\sigma^{(i)}
\end{align*}
and we have $\partial\sigma\in C_{p-1}(X)$. So extend by linearity
to get a homeomorphism $\partial=\partial_{p}:C_{p}(X)\to C_{p-1}(X)$.
Say $C_{p}(X)=0$ for $p<0$, and that $\partial\sigma=0$ for an
singular $0$-chain.\end{defn}
\begin{lem}
$\partial\circ\partial=0$. (Proof by linearity, doing the sums, separating
and noting that they cancel.)\end{lem}
\begin{defn}
Cycles and boundaries\end{defn}
\begin{itemize}
\item $\alpha\in C_{p}(X)$ is a $p$-cycle if $\partial\alpha=0$.
\item $\alpha$ is a $p$-boundary if $\alpha=\partial\beta$ for $\beta\in C_{p+1}(X)$
\item Let $Z_{p}=\{\text{\ensuremath{p}-cycles in \ensuremath{X}}\}=\ker(\partial_{p})$
\item $B_{p}(X)=\{\text{\ensuremath{p}-boundaries in \ensuremath{X}}\}=\text{Img}(\partial_{p+1})$.
\end{itemize}
Then $B_{p}(X)\leq Z_{p}(X)$ (subgroup) since $\partial\circ\partial=0$.
\begin{defn}
The $p$th singular homology group of $X$ is
\begin{align*}
H_{P}(X) & =\frac{Z_{p}(X)}{B_{p}(X)}\\
& =\frac{\ker(\partial_{p})}{\text{Img}(\partial_{p+1})}.
\end{align*}
Geometrically, the elements of $H_{p}(X)$ are equivalence classes
of $p$-cycles where $\alpha\sim\alpha'$ if $\alpha'=\alpha+\partial\beta$,
$\beta\in C_{p+1}(X)$. We write $[\alpha]$ for the homology class
of a $p$-cycle $\alpha\in C_{p}(X)$.\end{defn}
\begin{lem}
If $\{X_{\alpha}\}$ are the path connected components of $X$, then
$C_{p}(X)=\bigoplus_{\alpha}C_{p}(X_{\alpha})$ and $\partial:C_{p}(X_{\alpha})\to C_{p-1}(X_{\alpha})$,
hence $H_{p}(X)=\bigoplus_{\alpha}H_{p}(X_{\alpha})$.\end{lem}
\begin{defn}
The singular chain complex of $X$
\begin{align*}
C_{p}\to C_{p-1}\to\dots\to C_{0}\to0
\end{align*}
is a sequence of Abelian groups and homomorphisms such that $\partial_{p-1}\circ\partial_{p}=0$.\end{defn}
\begin{thm}
(Interpretation of $H_{0}$)
If $X$ is non-empty and path connected, then $H_{0}(X)\cong\mathbb{Z}$.\end{thm}
\begin{cor}
If $X$ has $k$ path components, then $H_{0}(X)\cong\mathbb{Z}^{k}$.\end{cor}
\begin{thm}
(Interpretation of $H_{1}$) If $X$ is path connected, $x_{0}\in H$,
then $H_{1}(X)$ is the Abelianisation of $\pi_{1}(X,x_{0})$.
\end{thm}
\subsubsection{Effects of continuous maps}
If $f:X\to Y$ is continuous and $\sigma:\Delta^{p}\to X$ is a singular
$p$-simplex in $X$ then $f\circ\sigma:\Delta^{p}\to Y$ is a singular
$p$-simplex in $Y$. Then there exists an induced homomorphism $f_{\#}:C_{p}(X)\to C_{p}(Y)$
with $f_{\#}\left(\sum n_{i}\sigma_{i}\right)=\sum n_{i}(f\circ\sigma_{i})$.
\begin{lem}
$\partial\circ f_{\#}=f_{\#}\circ\partial$.\end{lem}
\begin{thm}
There are induced homomorphisms $f_{*}=H_{p}(f):H_{p}(X)\to H_{p}(Y)$,
where $f_{*}([c])=[f_{\#}c]$.\end{thm}
\begin{cor}
If $f:X\to Y$ is a homeomorphism, then $f_{*}:H_{p}(X)\to H_{p}(Y)$
is an isomorphism. Therefore $H_{p}$ are topological invariants.
\end{cor}
\subsubsection{Homotopy invariance of homology}
\begin{thm}
If $f,g$ are two homotopic maps $f,g:X\to Y$, then $f_{*}=g_{*}:H_{p}(X)\to H_{p}(Y),$
$p\geqslant0$.\end{thm}
\begin{cor}
If $f:X\to Y$ is a homotopy equivalence, then $f_{*}:H_{p}(X)\to H_{p}(Y)$
is an isomorphism.\end{cor}
\begin{defn}
(Simplicial homology)
A $\Delta$-complex is a topological space $X$ obtained from the
disjoint uninion of simplies, with ordered vertices glued together
by affine homeomorphisms.
\end{defn}
Define $C_{n}=C_{n}^{\Delta}(X)=\left\{ \sum n_{i}\sigma_{i}\mid n_{i}\in\mathbb{Z},\,\sigma_{i}\,\text{geometric \ensuremath{n}-simplices in \ensuremath{X}}\right\} $.
Then define $\partial:C_{n}\to C_{n-1}$ as before. Then we define
simplicial homology
\begin{align*}
H_{n}^{\Delta}(X) & =\frac{\ker(\partial_{n})}{\text{Img}(\partial_{n+1})}
\end{align*}
\begin{thm}
If $X$ is a $\Delta$-complex then $H_{n}^{\Delta}(X)\cong H_{n}(X)$.
(I.e. ``simplicial homology'' = ``singular homology'').\end{thm}
\begin{defn}
(Reduced homology) If $X=\emptyset$ then we can define an augmented
singular chain complex
\begin{align*}
\cdots\to C_{n}\to^{\partial_{n}}\partial_{n-1}\to^{\partial_{n-1}}\cdots\partial_{1}\to^{\partial_{1}}C_{0}\to^{\epsilon}\mathbb{Z}\to0
\end{align*}
where we let $\epsilon\left(\sum n_{x}x\right)=\sum n_{x}$. Now $\tilde{H}_{n}(X)=0$
if $X$ is contractible.
\end{defn}
\subsubsection{Exact sequences}
\begin{defn}
A sequence (finite or infinite) of Abelian groups and homomorphisms
\begin{align*}
\xymatrix{\cdots\ar[r] & A_{n}\ar[r]^{\alpha_{n}} & A_{n-1}\ar[r]^{\alpha_{n-1}} & \cdots}
\end{align*}
is called \emph{exact} if the image of each homomorphism is the kernal
of the next. I.e. $\text{Img}(\alpha_{n})=\ker(\alpha_{n-1})$ $\forall n$.
\end{defn}
\paragraph{Examples}
\begin{enumerate}
\item $0\to A\to^{f}B$ exact $\Leftrightarrow\ker(f)=\{0\}\Leftrightarrow f$
is 1-1 (injective)
\item $A\to^{f}B\to^{0}0$ exact $\Leftrightarrow\text{Img}(f)=\ker(B)=0$
$\Leftrightarrow f$ is onto (surjective).
\item $0\to^{0}A\to^{f}B\to^{0}0$ exact $\Leftrightarrow$ $f$ is an isomorphism.
\item $0\to^{0}A\to^{f}B\to^{g}C\to^{0}0$ exact $\Leftrightarrow$ $f$
is 1-1, $g$ is onto, $C=\text{Img}(g)\cong B/\ker(g)=B/\text{Img}(f)$\end{enumerate}
\begin{defn}
A short exact sequence $0\to A\to^{f}B\to^{g}C\to0$ splits if there
exists a homomorphism such that $g\circ h=1_{C}$ ($h:C\to B$). Then
$B=f(A)\oplus h(C)\cong A\oplus B$. The sequence splits if, for example,
$C$ is a free Abelian group.
\end{defn}
\paragraph{Mayer-Vietoris sequence}
An analogue to SvK. Let $X=X_{1}\cup X_{2}$ be a topological space,
where $X_{1},X_{2},X_{0}=X_{1}\cap X_{2}$ are open sets in $X$,
then we have inclusion maps
\begin{align*}
\xymatrix{ & X_{1}\ar[dr]_{j_{1}}\\
X_{0}\ar[ur]^{i_{1}}\ar[dr]_{i_{2}} & & X\\
& X_{2}\ar[ur]_{j_{2}}
}
\end{align*}
then we have
\begin{align*}
\xymatrix{ & H_{p}(X_{1})\ar[dr]_{j_{1*}}\\
H_{P}(X_{0})\ar[ur]^{i_{1*}}\ar[dr]_{i_{2*}} & & H_{p}(X)\\
& H_{p}(X_{2})\ar[ur]_{j_{2*}}
}
\end{align*}
\begin{thm}
(Mayer-Vietoris theorem) There is a long exact sequence in Homology
\begin{align*}
\xymatrix{\cdots\ar[r] & H_{p}(X_{0})\ar[r]^{i_{1*}\oplus i_{2*}} & H_{p}(X_{1})\oplus H_{p}(X_{2})\ar[r]^{j_{1*}-j_{2*}} & H_{p}(X)\ar[r]^{\partial_{*}} & H_{p-1}(X_{0})}
\end{align*}
\end{thm}
From this we can calculate the homotopy of the $n$-sphere as
\begin{align*}
\tilde{H}_{p}(S^{n}) & =\begin{cases}
\mathbb{Z} & p=n\\
0 & \text{otherwise}
\end{cases}
\end{align*}
\begin{thm}
(Topological invariance of dimension) If $\mathbb{R}^{n}\approx\mathbb{R}^{m}$,
then $n=m$. \end{thm}
\begin{proof}
If $f:\mathbb{R}^{n}\to\mathbb{R}^{m}$ is a homeomorphism then we
also have an induced homeomorphism $\mathbb{R}^{n}-\{pt\}\to\mathbb{R}^{m}-\{pt\}$
so we have a homotopy $S^{n-1}\simeq S^{m-1}$ so $\tilde{H}_{*}(S^{n-1})\cong\tilde{H}_{*}(S^{m-1})$
so $n=m$.\end{proof}
\begin{defn}
A continous map $f:S^{n}\to S^{n}$ has degree $d$ if $f_{*}=H_{n}(f):\tilde{H}_{n}(S^{n})\to\tilde{H}_{n}(S^{n})$
is multiplication be the integer $d$.\end{defn}
\begin{rem}
$f\simeq g\implies\deg(f)=\deg(g)$. $\deg(f\circ g)=\deg(f)\times\deg(g)$.\end{rem}
\begin{thm}
(Subdivision theorem) Let $U=\{U_{j}\}$ be an open cover of $X$
(or a collection of subsets of $X$ whose inteiors cover $X$.). Then
let $C_{p}^{U}(X)$ be the subgroup of $C_{p}(X)$ consisting of singular
$p$-chains $\sum n_{i}\sigma_{i}$ such that the image $\sigma_{i}(\Delta^{p})$
of each $\sigma_{i}$ lies in one of the sets in $U$.
Then $\partial:C_{p}^{U}(X)\to C_{p-1}^{U}(X)$, so we get a chain
complex $C_{*}^{U}(X)$ with homology $H_{*}^{U}(X)$.
The inclusion $C_{*}^{U}(X)\to C_{*}(U)$ induces an isomorphism $H_{p}^{U}(X)\to H_{p}(X)$
for all $p$.\end{thm}
\begin{defn}
(Relative homotopy) Let $(X,A)$ be a pair of topological spaces with
$A\leq X$ ($A$ is a subspace.) The inclusion $A\hookrightarrow X$
induces the inclusions $C_{p}(A)\to C_{p}(X)$ for all $p$ and we
can define
\begin{align*}
C_{p}(X,A) & =\frac{C_{p}(X)}{C_{p}(A)}.
\end{align*}
\end{defn}
Then $\partial:C_{p}(X)\to C_{p-1}(X)$ takes $C_{p}(A)\to C_{p-1}(A)$
so induces a homomorphism $\bar{\partial}:C_{p}(X,A)\to C_{p-1}(X,A)$
and $\bar{\partial}\circ\bar{\partial}=0$. This gives a chain complex
with homology $H_{p}(X,A)=\frac{\ker(\bar{\partial}_{p})}{\text{Img}(\bar{\partial}_{p+1})}$
called the ``relative homology of $X$ mod $A$.'' |
.animated {
-<API key>: 200ms;
animation-duration: 200ms;
-<API key>: both;
animation-fill-mode: both;
}
.position-absolute {
top: 0;
left: 0;
right: 0;
bottom: 0;
position: absolute;
}
popup {
display: block;
top: 0;
left: 0;
right: 0;
bottom: 0;
position: absolute;
}
.popup-backdrop {
top: 0;
left: 0;
right: 0;
bottom: 0;
position: absolute;
-<API key>: 200ms;
animation-duration: 200ms;
-<API key>: both;
animation-fill-mode: both;
z-index: 1500;
background-color: rgba(0, 0, 0, 0.5);
}
.popup-container {
top: 0;
left: 0;
right: 0;
bottom: 0;
position: absolute;
z-index: 1501;
}
.popup-container .popup {
-<API key>: 200ms;
animation-duration: 200ms;
-<API key>: both;
animation-fill-mode: both;
top: 40%;
left: 50%;
color: black;
max-height: 50%;
border-radius: 0;
position: absolute;
width: 250px;
padding: 0 8px 7px 8px;
background-color: #ffffff;
margin-left: -125px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.popup-container .popup-body {
margin-bottom: 10px;
}
.popup-container .popup-title {
margin: 0;
text-align: center;
padding: 13px 5px 10px 5px;
}
@-webkit-keyframes zoomIn {
0% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
50% {
opacity: 1;
}
}
@keyframes zoomIn {
0% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
50% {
opacity: 1;
}
}
.zoomIn {
-<API key>: zoomIn;
animation-name: zoomIn;
}
@-webkit-keyframes zoomOut {
0% {
opacity: 1;
}
50% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
100% {
opacity: 0;
}
}
@keyframes zoomOut {
0% {
opacity: 1;
}
50% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
100% {
opacity: 0;
}
}
.zoomOut {
-<API key>: zoomOut;
animation-name: zoomOut;
}
@-webkit-keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.fadeIn {
-<API key>: fadeIn;
animation-name: fadeIn;
}
@-webkit-keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
.fadeOut {
-<API key>: fadeOut;
animation-name: fadeOut;
} |
package com.p_v.flexiblecalendar.view;
import android.content.Context;
import android.support.annotation.IntDef;
import android.util.AttributeSet;
import android.widget.TextView;
import com.p_v.flexiblecalendar.entity.Event;
import com.p_v.fliexiblecalendar.R;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @author p-v
*/
public abstract class BaseCellView extends TextView {
public static final int TODAY = 0;
public static final int SELECTED = 1;
public static final int REGULAR = 3;
public static final int SELECTED_TODAY = 4;
public static final int OUTSIDE_MONTH = 5;
public static final int STATE_TODAY = R.attr.state_date_today;
public static final int STATE_REGULAR = R.attr.state_date_regular;
public static final int STATE_SELECTED = R.attr.state_date_selected;
public static final int STATE_OUTSIDE_MONTH = R.attr.<API key>;
private Set<Integer> stateSet;
public BaseCellView(Context context) {
super(context);
stateSet = new HashSet<>(3);
}
public BaseCellView(Context context, AttributeSet attrs) {
super(context, attrs);
stateSet = new HashSet<>(3);
}
public BaseCellView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
stateSet = new HashSet<>(3);
}
public void addState(int state) {
stateSet.add(state);
}
public void clearAllStates() {
stateSet.clear();
}
@Override
protected int[] <API key>(int extraSpace) {
if (stateSet == null) stateSet = new HashSet<>(3);
if (!stateSet.isEmpty()) {
final int[] drawableState = super.<API key>(extraSpace + stateSet.size());
int[] states = new int[stateSet.size()];
int i = 0;
for (Integer s : stateSet) {
states[i++] = s;
}
mergeDrawableStates(drawableState, states);
return drawableState;
} else {
return super.<API key>(extraSpace);
}
}
public abstract void setEvents(List<? extends Event> colorList);
public Set<Integer> getStateSet() {
return stateSet;
}
@IntDef({TODAY, SELECTED, REGULAR, SELECTED_TODAY, OUTSIDE_MONTH})
@Retention(RetentionPolicy.SOURCE)
public @interface CellType {
}
} |
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2018_07_13_091108) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "account_ayahs", force: :cascade do |t|
t.bigint "account_id"
t.bigint "ayah_id"
t.boolean "bookmarked", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "<API key>"
t.index ["ayah_id"], name: "<API key>"
end
create_table "<API key>", force: :cascade do |t|
t.bigint "account_id"
t.boolean "general", default: true
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "daily_ayah", default: false
t.index ["account_id"], name: "<API key>"
end
create_table "<API key>", force: :cascade do |t|
t.bigint "account_id"
t.string "customer_token"
t.string "subscription_token"
t.string "status"
t.string "payment_brand"
t.string "payment_last4"
t.string "current_period_end"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "<API key>"
end
create_table "account_surahs", force: :cascade do |t|
t.bigint "account_id"
t.bigint "surah_id"
t.boolean "bookmarked", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "<API key>"
t.index ["surah_id"], name: "<API key>"
end
create_table "<API key>", force: :cascade do |t|
t.bigint "account_id"
t.bigint "translation_id"
t.integer "order", default: 0
t.boolean "primary", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "<API key>"
t.index ["translation_id"], name: "<API key>"
end
create_table "accounts", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "<API key>"
t.datetime "<API key>"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.inet "current_sign_in_ip"
t.inet "last_sign_in_ip"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "<API key>"
t.string "unconfirmed_email"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "role", default: "validating"
t.index ["email"], name: "<API key>", unique: true
t.index ["<API key>"], name: "<API key>", unique: true
end
create_table "<API key>", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.index ["blob_id"], name: "<API key>"
t.index ["record_type", "record_id", "name", "blob_id"], name: "<API key>", unique: true
end
create_table "<API key>", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.bigint "byte_size", null: false
t.string "checksum", null: false
t.datetime "created_at", null: false
t.index ["key"], name: "<API key>", unique: true
end
create_table "ayahs", force: :cascade do |t|
t.integer "number"
t.integer "character_length"
t.bigint "surah_id"
t.bigint "page_id"
t.bigint "juz_id"
t.index ["juz_id"], name: "<API key>"
t.index ["page_id"], name: "<API key>"
t.index ["surah_id"], name: "<API key>"
end
create_table "ayahs_content_posts", id: false, force: :cascade do |t|
t.bigint "ayah_id", null: false
t.bigint "content_post_id", null: false
t.index ["ayah_id", "content_post_id"], name: "<API key>"
t.index ["content_post_id", "ayah_id"], name: "<API key>"
end
create_table "charges", force: :cascade do |t|
t.bigint "account_id"
t.integer "amount_in_cents"
t.string "payment_brand"
t.string "payment_last4"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "<API key>"
end
create_table "cities", force: :cascade do |t|
t.string "name"
t.string "code"
t.bigint "state_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["state_id"], name: "<API key>"
end
create_table "connections", force: :cascade do |t|
t.string "name"
t.string "provider"
t.string "provider_uid"
t.string "token"
t.string "secret"
t.bigint "account_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "last_ayah_id", default: 0
t.boolean "active", default: false
t.bigint "translation_id"
t.string "hashtags"
t.integer "frequency"
t.string "nickname"
t.string "image"
t.string "description"
t.index ["account_id"], name: "<API key>"
t.index ["provider_uid", "provider"], name: "<API key>", unique: true
t.index ["translation_id"], name: "<API key>"
end
create_table "content_categories", force: :cascade do |t|
t.string "name"
t.string "permalink"
t.string "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["permalink"], name: "<API key>", unique: true
end
create_table "content_comments", force: :cascade do |t|
t.text "body"
t.bigint "account_id"
t.bigint "content_post_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "<API key>"
t.index ["content_post_id"], name: "<API key>"
end
create_table "content_posts", force: :cascade do |t|
t.string "title"
t.string "permalink"
t.text "body"
t.integer "visibility", default: 0
t.bigint "account_id"
t.bigint "content_category_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "summary"
t.index ["account_id"], name: "<API key>"
t.index ["content_category_id"], name: "<API key>"
t.index ["permalink"], name: "<API key>", unique: true
end
create_table "contests", force: :cascade do |t|
t.string "title"
t.string "permalink"
t.text "description"
t.integer "prize_amount"
t.date "start_at"
t.date "end_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["permalink"], name: "<API key>", unique: true
end
create_table "countries", force: :cascade do |t|
t.string "name"
t.string "code"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "daily_ayahs", force: :cascade do |t|
t.bigint "ayah_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["ayah_id"], name: "<API key>"
end
create_table "entries", force: :cascade do |t|
t.bigint "account_id"
t.bigint "contest_id"
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "<API key>"
t.index ["contest_id"], name: "<API key>"
end
create_table "facebook_shares", force: :cascade do |t|
t.bigint "ayah_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["ayah_id"], name: "<API key>"
end
create_table "friendly_id_slugs", force: :cascade do |t|
t.string "slug", null: false
t.integer "sluggable_id", null: false
t.string "sluggable_type", limit: 50
t.string "scope"
t.datetime "created_at"
t.index ["slug", "sluggable_type", "scope"], name: "<API key>", unique: true
t.index ["slug", "sluggable_type"], name: "<API key>"
t.index ["sluggable_id"], name: "<API key>"
t.index ["sluggable_type"], name: "<API key>"
end
create_table "juzs", force: :cascade do |t|
t.integer "character_length"
end
create_table "languages", force: :cascade do |t|
t.string "name"
t.string "direction"
end
create_table "memories", force: :cascade do |t|
t.integer "<API key>"
t.integer "<API key>"
t.bigint "account_id"
t.string "memorable_type"
t.bigint "memorable_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "<API key>"
t.index ["memorable_type", "memorable_id"], name: "<API key>"
end
create_table "menu_links", force: :cascade do |t|
t.string "name"
t.string "path"
t.bigint "menu_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["menu_id"], name: "<API key>"
end
create_table "menus", force: :cascade do |t|
t.string "name"
t.string "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "mosques", force: :cascade do |t|
t.string "name"
t.string "phone"
t.string "email"
t.string "street"
t.string "city"
t.string "state"
t.string "country"
t.string "zip_code"
t.string "website"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "city_id"
t.index ["city_id"], name: "<API key>"
end
create_table "pages", force: :cascade do |t|
t.integer "character_length"
t.bigint "juz_id"
t.index ["juz_id"], name: "<API key>"
end
create_table "policies", force: :cascade do |t|
t.string "title"
t.string "content"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "permalink"
end
create_table "profiles", force: :cascade do |t|
t.string "name"
t.string "username"
t.text "bio"
t.bigint "account_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "<API key>"
end
create_table "shares", force: :cascade do |t|
t.bigint "ayah_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["ayah_id"], name: "<API key>"
end
create_table "states", force: :cascade do |t|
t.string "name"
t.string "code"
t.bigint "country_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["country_id"], name: "<API key>"
end
create_table "stats_views", force: :cascade do |t|
t.string "path"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "referer"
t.string "user_agent"
end
create_table "subscriptions", force: :cascade do |t|
t.bigint "account_id"
t.string "customer_token"
t.string "subscription_token"
t.string "status"
t.string "payment_brand"
t.string "payment_last4"
t.string "current_period_end"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "<API key>"
end
create_table "surahs", force: :cascade do |t|
t.integer "number_of_ayahs"
t.integer "order_of_revelation"
t.integer "revelation_type"
t.string "permalink"
t.string "transliterated_name"
t.string "arabic_name"
t.string "english_name"
t.integer "character_length"
end
create_table "taggings", id: :serial, force: :cascade do |t|
t.integer "tag_id"
t.string "taggable_type"
t.integer "taggable_id"
t.string "tagger_type"
t.integer "tagger_id"
t.string "context", limit: 128
t.datetime "created_at"
t.index ["context"], name: "<API key>"
t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true
t.index ["tag_id"], name: "<API key>"
t.index ["taggable_id", "taggable_type", "context"], name: "<API key>"
t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy"
t.index ["taggable_id"], name: "<API key>"
t.index ["taggable_type"], name: "<API key>"
t.index ["tagger_id", "tagger_type"], name: "<API key>"
t.index ["tagger_id"], name: "<API key>"
end
create_table "tags", id: :serial, force: :cascade do |t|
t.string "name"
t.integer "taggings_count", default: 0
t.index ["name"], name: "index_tags_on_name", unique: true
end
create_table "texts", force: :cascade do |t|
t.text "content"
t.bigint "translation_id"
t.bigint "ayah_id"
t.index ["ayah_id"], name: "<API key>"
t.index ["translation_id"], name: "<API key>"
end
create_table "translations", force: :cascade do |t|
t.string "name"
t.string "description"
t.bigint "language_id"
t.index ["language_id"], name: "<API key>"
end
add_foreign_key "account_ayahs", "accounts"
add_foreign_key "account_ayahs", "ayahs"
add_foreign_key "<API key>", "accounts"
add_foreign_key "<API key>", "accounts"
add_foreign_key "account_surahs", "accounts"
add_foreign_key "account_surahs", "surahs"
add_foreign_key "<API key>", "accounts"
add_foreign_key "<API key>", "translations"
add_foreign_key "ayahs", "juzs"
add_foreign_key "ayahs", "pages"
add_foreign_key "ayahs", "surahs"
add_foreign_key "charges", "accounts"
add_foreign_key "cities", "states"
add_foreign_key "connections", "accounts"
add_foreign_key "connections", "translations"
add_foreign_key "content_comments", "accounts"
add_foreign_key "content_comments", "content_posts"
add_foreign_key "content_posts", "accounts"
add_foreign_key "content_posts", "content_categories"
add_foreign_key "daily_ayahs", "ayahs"
add_foreign_key "entries", "accounts"
add_foreign_key "entries", "contests"
add_foreign_key "facebook_shares", "ayahs"
add_foreign_key "memories", "accounts"
add_foreign_key "menu_links", "menus"
add_foreign_key "mosques", "cities"
add_foreign_key "pages", "juzs"
add_foreign_key "profiles", "accounts"
add_foreign_key "shares", "ayahs"
add_foreign_key "states", "countries"
add_foreign_key "subscriptions", "accounts"
add_foreign_key "texts", "ayahs"
add_foreign_key "texts", "translations"
add_foreign_key "translations", "languages"
end |
class SchoolsController < <API key>
skip_before_action :check_school
before_action :set_school, only: [:show, :edit, :update, :destroy]
# GET /schools
# GET /schools.json
def index
@schools = School.all
end
# GET /schools/1
# GET /schools/1.json
def show
end
# GET /schools/new
def new
@school = School.new
end
# GET /schools/1/edit
def edit
end
# POST /schools
# POST /schools.json
def create
@school = School.new(school_params)
respond_to do |format|
if @school.save
format.html { redirect_to @school, notice: 'School was successfully created.' }
format.json { render :show, status: :created, location: @school }
else
format.html { render :new }
format.json { render json: @school.errors, status: :<API key> }
end
end
end
# PATCH/PUT /schools/1
# PATCH/PUT /schools/1.json
def update
respond_to do |format|
if @school.update(school_params)
format.html { redirect_to @school, notice: 'School was successfully updated.' }
format.json { render :show, status: :ok, location: @school }
else
format.html { render :edit }
format.json { render json: @school.errors, status: :<API key> }
end
end
end
# DELETE /schools/1
# DELETE /schools/1.json
def destroy
@school.destroy
respond_to do |format|
format.html { redirect_to schools_url, notice: 'School was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_school
@school = School.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def school_params
params.require(:school).permit(:name, :slug, :comment, :is_active)
end
end |
#!/bin/sh
# create a file with a large amount of text pasted in and check to ensure file contains information
echo "FRom faireſt creatures we deſire increaſe,
> That thereby beauties Roſe might neuer die,
> But as the riper ſhould by time deceaſe,
> His tender heire might beare his memory:
> But thou contracted to thine owne bright eyes,
> Feed’ſt thy lights flame with ſelfe ſubſtantiall fewell,
> Making a famine where aboundance lies,
> Thy ſelfe thy foe,to thy ſweet ſelfe too cruell:
> Thou that art now the worlds freſh ornament,
> And only herauld to the gaudy ſpring,
> Within thine owne bud burieſt thy content,
> And tender chorle makſt waſt in niggarding:
> Pitty the world,or elſe this glutton be,
> To eate the worlds due,by the graue and thee." > sonnet_1_complete.txt
cat sonnet_1_complete.txt |
# <API key>: true
require File.expand_path("../../../../lib/awesome_xml.rb", __FILE__)
RSpec.describe AwesomeXML::Duration::Format::StaticChunk do
let(:static_chunk) { described_class.new }
let(:format_chars) { 'abdef'.chars }
before { static_chunk.format_chars = format_chars }
describe '#to_s' do
subject { static_chunk.to_s }
it { is_expected.to eq 'abdef' }
end
describe '#parse_length' do
subject { static_chunk.parse_length }
it { is_expected.to eq 5 }
end
describe '#dynamic?' do
subject { static_chunk.dynamic? }
it { is_expected.to eq false }
end
end |
function carou2() {
$('[data-ride="carou"]').each(function () {
$(this).carousel();
});
}
$(document).on('turbolinks:load', carou2); |
#include "pihm.h"
#if defined(_NOAH_)
void InitSoil(const soiltbl_struct *soiltbl, const noahtbl_struct *noahtbl, const calib_struct *calib,
elem_struct elem[])
#else
void InitSoil(const soiltbl_struct *soiltbl, const calib_struct *calib, elem_struct elem[])
#endif
{
int i;
#if defined(_OPENMP)
# pragma omp parallel for
#endif
for (i = 0; i < nelem; i++)
{
int soil_ind;
if (elem[i].attrib.soil > soiltbl->number)
{
pihm_printf(VL_ERROR, "Error: Soil type %d for Element %d is not in the soil file.",
elem[i].attrib.soil, i + 1);
pihm_exit(EXIT_FAILURE);
}
soil_ind = elem[i].attrib.soil - 1;
elem[i].soil.dinf = soiltbl->dinf;
elem[i].soil.depth = elem[i].topo.zmax - elem[i].topo.zmin;
elem[i].soil.ksath = calib->ksath * soiltbl->ksath[soil_ind];
elem[i].soil.ksatv = calib->ksatv * soiltbl->ksatv[soil_ind];
elem[i].soil.kinfv = calib->kinfv * soiltbl->kinfv[soil_ind];
elem[i].soil.smcmin = calib->porosity * soiltbl->smcmin[soil_ind];
elem[i].soil.smcmax = calib->porosity * soiltbl->smcmax[soil_ind];
elem[i].soil.porosity = elem[i].soil.smcmax - elem[i].soil.smcmin;
if (elem[i].soil.porosity > 1.0 || elem[i].soil.porosity <= 0.0)
{
pihm_printf(VL_ERROR, "Error: Porosity value out of bounds for Element %d", i + 1);
pihm_exit(EXIT_FAILURE);
}
elem[i].soil.alpha = calib->alpha * soiltbl->alpha[soil_ind];
elem[i].soil.beta = calib->beta * soiltbl->beta[soil_ind];
// Calculate field capacity and wilting point following Chan and Dudhia 2001 MWR, but replacing Campbell with
// van Genuchten
elem[i].soil.smcwlt = calib->porosity * soiltbl->smcwlt[soil_ind];
#if defined(_NOAH_)
elem[i].soil.smcwlt *= calib->smcwlt;
#endif
elem[i].soil.smcref = calib->porosity * soiltbl->smcref[soil_ind];
#if defined(_NOAH_)
elem[i].soil.smcref *= calib->smcref;
#endif
elem[i].soil.dmac = calib->dmac * soiltbl->dmac[soil_ind];
elem[i].soil.dmac = MIN(elem[i].soil.dmac, elem[i].soil.depth);
elem[i].soil.areafh = calib->areafh * soiltbl->areafh[soil_ind];
elem[i].soil.areafv = calib->areafv * soiltbl->areafv[soil_ind];
elem[i].soil.kmacv = calib->kmacv * soiltbl->kmacv_ro * soiltbl->kinfv[soil_ind];
elem[i].soil.kmach = calib->kmach * soiltbl->kmach_ro * soiltbl->ksath[soil_ind];
#if defined(_NOAH_)
elem[i].soil.csoil = noahtbl->csoil;
elem[i].soil.quartz = soiltbl->qtz[soil_ind];
elem[i].soil.smcdry = elem[i].soil.smcwlt;
#endif
}
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>JS Clock</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="clock">
<div class="clock-face">
<div class="hand hour-hand"></div>
<div class="hand min-hand"></div>
<div class="hand second-hand"></div>
</div>
</div>
<script src="main.js"></script>
</body>
</html> |
<?php
namespace Rollbar\Truncation;
use Rollbar\Payload\EncodedPayload;
class StringsStrategyTest extends \<API key>
{
/**
* @dataProvider executeProvider
*/
public function testExecute($data, $expected)
{
$truncation = new Truncation();
$strategy = new StringsStrategy($truncation);
$data = new EncodedPayload($data);
$data->encode();
$result = $strategy->execute($data);
$this->assertEquals($expected, $result->data());
}
public function executeProvider()
{
$data = array();
$data["truncate nothing"] = array(
$this-><API key>(str_repeat("A", 10)),
$this-><API key>(str_repeat("A", 10))
);
$thresholds = StringsStrategy::getThresholds();
foreach ($thresholds as $threshold) {
$data['truncate strings to ' . $threshold] = $this-><API key>($threshold);
}
return $data;
}
public function <API key>($threshold)
{
$stringLengthToTrim = $threshold+1;
$payload = $this-><API key>(array());
$expected = $this-><API key>(array());
while (strlen(json_encode($payload)) < Truncation::MAX_PAYLOAD_SIZE) {
$payload['data']['body']['message']['body']['value'] []=
str_repeat('A', $stringLengthToTrim);
$expected['data']['body']['message']['body']['value'] []=
str_repeat('A', $threshold);
}
return array($payload,$expected);
}
public function <API key>($message)
{
return array(
"data" => array(
"body" => array(
"message" => array(
"body" => array(
"value" => $message
)
)
)
)
);
}
} |
import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import MySpinner from '../../components/Spinner/Spinner'
import { smallSpinnerRight } from '../../utils/SpinnerConfig'
import LessonList from './LessonList'
export class TeacherGroupInfo extends React.Component {
constructor(props) {
super(props)
this.state = { activeTab: 'dates' }
this.changeActiveTab = this.changeActiveTab.bind(this)
}
changeActiveTab(tab) {
this.setState({activeTab: tab})
}
render () {
return (
<div className="col-md-5 col-sm-6">
<div className="panel panel-info">
<div className="panel-heading">
Group Info
<div className="pull-right">
{this.props.loaded ? "" : <MySpinner opts={smallSpinnerRight}/>}
</div>
</div>
<div className="panel-body">
{this.props.loaded && this.props.activeGroup ?
<table className="table">
<thead>
<tr><th>Group name: {this.props.activeGroup.name}</th></tr>
<tr>
<th>
<ul className="nav nav-tabs">
<li role="presentation"
className={this.state.activeTab == "dates" ? "active" : ""}
onClick = {() => {this.changeActiveTab('dates')}}
id="lessonDates">
<a style={{cursor: 'pointer'}}>Dates</a>
</li>
<li role="presentation"
className={this.state.activeTab == "students" ? "active" : ""}
onClick = {() => {this.changeActiveTab('students')}}
id="studentList">
<a style={{cursor: 'pointer'}}>Students</a>
</li>
</ul>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<LessonList
lessons={this.props.activeGroup.lessons}
activeTab={this.state.activeTab}/>
</td>
</tr>
</tbody>
</table>
: "loading..."}
</div>
</div>
</div>
)
}
}
const mapStateToProps = (state) => {
return {
activeGroup: state.teacherGroups.activeGroup,
loaded: state.teacherGroups.loaded
}
}
export default connect(mapStateToProps, null)(TeacherGroupInfo) |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FactorioModBuilder.Build.Messages
{
public class ErrorMessage : CompilerMessage
{
public ErrorMessage(string msg)
: base(MessageType.Error, msg)
{
}
public ErrorMessage(string format, params object[] args)
: base(MessageType.Error, format, args)
{
}
}
} |
module.exports = {
"files": ["../wwwroot*.{html,htm,css,js}"],
"server": { "baseDir": "../wwwroot/" }
}; |
package au.com.sealink.printing.ticket_printer.exceptions;
public class <API key> extends Exception {
private static final long serialVersionUID = 1L;
public <API key>(String message) {
super(message);
}
} |
#ifndef BipBuffer_H
#define BipBuffer_H
/*
Changed header gaurd from pragma once to ifndef BipBuffer_H.
Chaning types to fixed width integers.
Removed destructor, AllocateBuffer, FreeBuffer.
Constructor expects array and size to be passed in.
Including stddef for NULL
Matthew Piccoli, 4/1/2016
*/
#include <stddef.h>
class BipBuffer
{
private:
uint8_t* pBuffer; // Pointer to the data buffer
uint16_t ixa; // Starting index of region A
uint16_t sza; // Size of region A
uint16_t ixb; // Starting index of region B
uint16_t szb; // Size of region B
uint16_t buflen; // Length of full buffer
uint16_t ixResrv; // Starting index of reserved region
uint16_t szResrv; // Size of the reserved region
public:
BipBuffer() : pBuffer(NULL), ixa(0), sza(0), ixb(0), szb(0), buflen(0), ixResrv(0), szResrv(0)
{
}
BipBuffer(uint8_t* buffer_in, uint16_t buffer_length_in) : ixa(0), sza(0), ixb(0), szb(0), ixResrv(0), szResrv(0)
{
pBuffer = buffer_in;
buflen = buffer_length_in;
}
\brief Clears the buffer of any allocations.
Clears the buffer of any allocations or reservations. Note; it
does not wipe the buffer memory; it merely resets all pointers,
returning the buffer to a completely empty state ready for new
allocations.
void Clear()
{
ixa = sza = ixb = szb = ixResrv = szResrv = 0;
}
// Reserve
// Reserves space in the buffer for a memory write operation
// Parameters:
// int size amount of space to reserve
// uint16_t& reserved size of space actually reserved
// Returns:
// uint8_t* pointer to the reserved block
// Notes:
// Will return NULL for the pointer if no space can be allocated.
// Can return any value from 1 to size in reserved.
// Will return NULL if a previous reservation has not been committed.
uint8_t* Reserve(uint16_t size, uint16_t& reserved)
{
// We always allocate on B if B exists; this means we have two blocks and our buffer is filling.
if (szb)
{
uint16_t freespace = GetBFreeSpace();
if (size < freespace) freespace = size;
if (freespace == 0) return NULL;
szResrv = freespace;
reserved = freespace;
ixResrv = ixb + szb;
return pBuffer + ixResrv;
}
else
{
// Block b does not exist, so we can check if the space AFTER a is bigger than the space
// before A, and allocate the bigger one.
uint16_t freespace = GetSpaceAfterA();
if (freespace >= ixa) // If space after A > space before
{
if (freespace == 0) return NULL;
if (size < freespace) freespace = size;
szResrv = freespace;
reserved = freespace;
ixResrv = ixa + sza;
return pBuffer + ixResrv;
}
else // space before A > space after A
{
if (ixa == 0) return NULL;
if (ixa < size) size = ixa;
szResrv = size;
reserved = size;
ixResrv = 0;
return pBuffer;
}
}
}
// Commit
// Commits space that has been written to in the buffer
// Parameters:
// uint16_t size number of bytes to commit
// Notes:
// Committing a size > than the reserved size will cause an assert in a debug build;
// in a release build, the actual reserved size will be used.
// Committing a size < than the reserved size will commit that amount of data, and release
// the rest of the space.
// Committing a size of 0 will release the reservation.
void Commit(uint16_t size)
{
if (size == 0)
{
// decommit any reservation
szResrv = ixResrv = 0;
return;
}
CommitPartial(size);
// Decommit rest of reservation
ixResrv = 0;
szResrv = 0;
}
// CommitPartial
// Commits space that has been written to in the buffer, but does not cancel the rest of the reservation
// Parameters:
// uint16_t size number of bytes to commit
// Returns:
// uint16_t number of bytes actually committed
// Notes:
// Committing a size > than the reserved size will cause an assert in a debug build;
// in a release build, the actual reserved size will be used.
// Committing a size < than the reserved size will commit that amount of data, but will not realese the remaining reservation
// Committing a size of 0 does nothing (space is still reserved)
uint16_t CommitPartial(uint16_t size)
{
// If we try to commit more space than we asked for, clip to the size we asked for.
if (size > szResrv)
{
size = szResrv;
}
// If we have no blocks being used currently, we create one in A.
if (sza == 0 && szb == 0)
{
ixa = ixResrv;
}
// If the reserve index is at the end of block A
if (ixResrv == sza + ixa)
{
sza += size; // Grow A by committed size
}
else
{
szb += size; // Otherwise grow B by committed size
}
// Advance the reserved index
ixResrv += size;
// Update reserved size
szResrv -= size;
return size;
}
// GetContiguousBlock
// Gets a pointer to the first contiguous block in the buffer, and returns the size of that block.
// Parameters:
// uint16_t & size returns the size of the first contiguous block
// Returns:
// uint8_t* pointer to the first contiguous block, or NULL if empty.
uint8_t* GetContiguousBlock(uint16_t& size)
{
if (sza == 0)
{
size = 0;
return NULL;
}
size = sza;
return pBuffer + ixa;
}
// DecommitBlock
// Decommits space from the first contiguous block
// Parameters:
// int size amount of memory to decommit
// Returns:
// nothing
void DecommitBlock(uint16_t size)
{
if (size >= sza)
{
ixa = ixb;
sza = szb;
ixb = 0;
szb = 0;
}
else
{
sza -= size;
ixa += size;
}
}
// GetCommittedSize
// Queries how much data (in total) has been committed in the buffer
// Parameters:
// none
// Returns:
// uint16_t total amount of committed data in the buffer
uint16_t GetCommittedSize() const
{
return sza + szb;
}
// GetReservationSize
// Queries how much space has been reserved in the buffer.
// Parameters:
// none
// Returns:
// uint16_t number of bytes that have been reserved
// Notes:
// A return value of 0 indicates that no space has been reserved
uint16_t GetReservationSize() const
{
return szResrv;
}
// GetBufferSize
// Queries the maximum total size of the buffer
// Parameters:
// none
// Returns:
// uint16_t total size of buffer
uint16_t GetBufferSize() const
{
return buflen;
}
// IsInitialized
// Queries whether or not the buffer has been allocated
// Parameters:
// none
// Returns:
// uint8_t true if the buffer has been allocated
uint8_t IsInitialized() const
{
return pBuffer != NULL;
}
private:
uint16_t GetSpaceAfterA() const
{
return buflen - ixa - sza;
}
uint16_t GetBFreeSpace() const
{
return ixa - ixb - szb;
}
};
#endif // BipBuffer_H |
import unittest
import sys
import os
from Infrastructure.FileUtilities import FileUtilities
from Infrastructure.TipsManager import TipsManager
class TestsTipsManage(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.fileUtilities = FileUtilities()
def <API key>(self):
seed = 0
dirname = os.path.dirname(__file__)
path = self.fileUtilities.go_up_dirs(dirname, 2) + "\\Tips"
tips_manager = TipsManager(seed, path)
result = tips_manager.get_random_tip()
self.assertEqual(result, 'TestTips2.txt: Words\n')
def <API key>(self):
seed = 1
dirname = os.path.dirname(__file__)
path = self.fileUtilities.go_up_dirs(dirname, 2) + "\\Tips"
tips_manager = TipsManager(seed, path)
result = tips_manager.get_random_tip()
self.assertEqual(result, 'TestTips.txt: Customer collaboration over contract negotiation\n')
def <API key>(self):
seed = 1
dirname = os.path.dirname(__file__)
path = self.fileUtilities.go_up_dirs(dirname, 2) + "\\Tips"
path = path.replace("\\", "/")
tips_manager = TipsManager(seed, path)
result = tips_manager.get_random_tip()
self.assertEqual(result, 'TestTips.txt: Customer collaboration over contract negotiation\n')
if __name__ == '__main__':
unittest.main() |
<nav class="navbar navbar-default" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#<API key>">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">ng-news</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div ng-controller="NavController" class="collapse navbar-collapse" id="<API key>">
<form class="navbar-form navbar-left" role="search" ng-submit="submitPost()">
<div class="form-group">
<input type="text" class="form-control" placeholder="Title" ng-model="post.title">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Link" ng-model="post.url">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div><!-- /.navbar-collapse -->
</nav> |
var assert=require('assert'), teselecta=require('../');
require('colors');
describe('terminal mode', function() {
it('should make numbers magenta', function() {
assert.equal(teselecta(42), '42'.magenta);
});
it('should make strings cyan', function() {
assert.equal(teselecta('foo'), '"'.grey+'foo'.cyan+'"'.grey);
});
it('should handle "special" strings', function() {
assert.equal(teselecta('"\\"\n\"'), '"'.grey+'\\"\\\\\\"\\n\\\"'.cyan+'"'.grey);
});
it('should make true green', function() {
assert.equal(teselecta(true), 'true'.green);
});
it('should make false red', function() {
assert.equal(teselecta(false), 'false'.red);
});
it('should colorize basic object', function() {
var res='{\n';
res+=' '+'"'.grey+'foo'.blue.bold+'"'.grey+': '+'1'.magenta+',\n';
res+=' '+'"'.grey+'bar'.blue.bold+'"'.grey+': '+'"'.grey+'baz'.cyan+'"'.grey+'\n';
res+='}';
assert.equal(teselecta({foo:1, bar:'baz'}), res);
});
it('should render an array', function() {
var res='{\n';
res+=' '+'"'.grey+'arr'.blue.bold+'"'.grey+': [\n';
res+=' '+'1'.magenta+',\n';
res+=' '+'"'.grey+'2,3'.cyan+'"'.grey+',\n';
res+=' '+'true'.green+',\n';
res+=' '+'false'.red+',\n';
res+=' '+'"'.grey+'"'.grey+'\n';
res+=' ]\n';
res+='}';
assert.equal(teselecta({arr:[1,"2,3",true,false,""]}), res);
});
it('should work with empty arrays and objects', function() {
var res='{\n';
res+=' '+'"'.grey+'foo'.blue.bold+'"'.grey+': [],\n';
res+=' '+'"'.grey+'bar'.blue.bold+'"'.grey+': {}\n';
res+='}';
assert.equal(teselecta({foo:[], bar:{}}), res);
res='{\n';
res+=' '+'"'.grey+'foo'.blue.bold+'"'.grey+': {},\n';
res+=' '+'"'.grey+'bar'.blue.bold+'"'.grey+': []\n';
res+='}';
assert.equal(teselecta({foo:{}, bar:[]}), res);
});
it('should use "spacing" option', function() {
var res=' {\n';
res+=' '+'"'.grey+'foo'.blue.bold+'"'.grey+': '+'1'.magenta+',\n';
res+=' '+'"'.grey+'bar'.blue.bold+'"'.grey+': '+'"'.grey+'baz'.cyan+'"'.grey+'\n';
res+=' }';
assert.equal(teselecta({foo:1, bar:'baz'}, {spacing:2}), res);
});
it('should use "prepend" option', function() {
var res=' XXX{\n';
res+=' '+'"'.grey+'foo'.blue.bold+'"'.grey+': '+'7'.magenta+',\n';
res+=' '+'"'.grey+'bar'.blue.bold+'"'.grey+': '+'"'.grey+'baz'.cyan+'"'.grey+'\n';
res+=' }';
assert.equal(teselecta({foo:7, bar:'baz'}, {spacing:2, prepend:'XXX'}), res);
});
it('should use custom colors', function() {
teselecta.FALSE='yellow';
assert.equal(teselecta(false), 'false'.yellow);
teselecta.FALSE='red';
});
});
describe('html mode with classes', function() {
before(function() {
teselecta.html=true;
});
it('should use json-number for numbers', function() {
assert.equal(teselecta(42), span('class', 'number', 42));
});
it('should use json-string for strings ', function() {
assert.equal(teselecta('foo'), quot(span('class', 'string', 'foo')));
});
it('should use json-true for true', function() {
assert.equal(teselecta(true), span('class', 'true', 'true'));
});
it('should use json-false for false', function() {
assert.equal(teselecta(false), span('class', 'false', 'false'));
});
it('should colorize basic object', function() {
var br='<br />', res='{'+br;
res+=' '+quot(span('class', 'key', 'foo'))+': '+span('class', 'number', 7)+','+br;
res+=' '+quot(span('class', 'key', 'bar'))+': '+quot(span('class', 'string', 'baz'))+br;
res+='}';
assert.equal(teselecta({foo:7, bar:'baz'}), res);
});
it('should use spacing', function() {
assert.equal(teselecta(23, {spacing:2}), ' '+span('class', 'number', 23));
});
it('should use custom prefix', function() {
teselecta.cssPrefix='teselecta';
assert.equal(teselecta(23), span('class', 'number', 23, 'teselecta'));
});
});
describe('html mode with inline css', function() {
before(function() {
teselecta.css='inline';
});
it('should make numbers purple', function() {
assert.equal(teselecta(42), span('style', 'purple', 42));
});
it('should make strings darkblue ', function() {
assert.equal(teselecta('foo'), quot(span('style', 'darkblue', 'foo'), true));
});
it('should make true green', function() {
assert.equal(teselecta(true), span('style', 'green', 'true'));
});
it('should make false red', function() {
assert.equal(teselecta(false), span('style', 'red', 'false'));
});
it('should colorize basic object', function() {
var br='<br />', res='{'+br;
res+=' '+quot(span('style', 'blue', 'foo'), true)+': '+span('style', 'purple', 7)+','+br;
res+=' '+quot(span('style', 'blue', 'bar'), true)+': '+quot(span('style', 'darkblue', 'baz'), true)+br;
res+='}';
assert.equal(teselecta({foo:7, bar:'baz'}), res);
});
it('should use custom colors', function() {
teselecta.FALSE='yellow';
assert.equal(teselecta(false), span('style', 'yellow', 'false'));
});
it('should allow to use terminal default color', function() {
teselecta.STRING='cyan';
assert.equal(teselecta('foo'), quot(span('style', 'cyan', 'foo'), true));
});
});
describe('exports', function() {
it('should call amd define if available', function(done) {
global.define=function(name, func) {
delete global.define;
assert.equal(name, 'teselecta');
assert.equal(func(), teselecta);
done();
};
global.define.amd=true;
teselecta.init();
});
it('should export to window otherwise', function() {
global.window={};
global.window.window=global.window;
teselecta.init();
assert.equal(global.window.teselecta, teselecta);
delete global.window;
});
});
function quot(val, inl) {
var quotation=span((inl ? 'style' : 'class'), (inl ? 'grey' : 'quotation'), '"');
return quotation+val+quotation;
}
function span(prop, val, content, prefix) {
if (prop==='class') {
val=(prefix || 'json')+'-'+val;
} else {
val='color:'+val+';';
}
return '<span '+prop+'="'+val+'">'+content+'</span>';
} |
/* global describe, it, beforeEach, expect, spyOn, jasmine */
/* eslint camelcase: 0, no-invalid-this: 0 */
const Player = require('../../../server/game/player.js');
const DrawCard = require('../../../server/game/drawcard.js');
describe('Player', function() {
beforeEach(function() {
this.gameSpy = jasmine.createSpyObj('game', ['raiseEvent', 'getOtherPlayer', 'playerDecked']);
this.player = new Player('1', 'Player 1', true, this.gameSpy);
this.player.deck = {};
this.player.initialise();
this.player.phase = 'marshal';
this.attachmentOwner = new Player('2', 'Player 2', false, this.gameSpy);
this.attachmentOwner.initialise();
this.attachment = new DrawCard(this.attachmentOwner, {});
this.card = new DrawCard(this.player, {});
this.player.cardsInPlay.push(this.card);
this.player.attach(this.player, this.attachment, this.card.uuid);
});
describe('removeAttachment', function() {
beforeEach(function() {
spyOn(this.attachment, 'leavesPlay');
spyOn(this.attachment, 'isTerminal');
});
describe('when the attachment has a duplicate', function() {
beforeEach(function() {
this.dupe = new DrawCard(this.attachmentOwner, {});
this.attachment.addDuplicate(this.dupe);
this.player.removeAttachment(this.attachment);
});
it('should remove the dupe', function() {
expect(this.attachment.dupes).not.toContain(this.dupe);
});
it('should place the dupe in the owners discard pile', function() {
expect(this.attachmentOwner.discardPile).toContain(this.dupe);
});
it('should not remove the attachment', function() {
expect(this.card.attachments).toContain(this.attachment);
});
it('should not have the attachment leave play', function() {
expect(this.attachment.leavesPlay).not.toHaveBeenCalled();
});
it('should not move the attachment', function() {
expect(this.attachment.parent).toBe(this.card);
expect(this.attachmentOwner.hand).not.toContain(this.attachment);
expect(this.attachmentOwner.discardPile).not.toContain(this.attachment);
});
});
describe('when the attachment has no duplicates', function() {
describe('when the attachment is terminal', function() {
beforeEach(function() {
this.attachment.isTerminal.and.returnValue(true);
this.player.removeAttachment(this.attachment);
});
it('should leave play', function() {
expect(this.attachment.leavesPlay).toHaveBeenCalled();
});
it('should remove the attachment from its parent', function() {
expect(this.card.attachments).not.toContain(this.attachment);
});
it('should unset its parent property', function() {
expect(this.attachment.parent).toBeUndefined();
});
it('should return the attachment to its owners discard pile', function() {
expect(this.attachmentOwner.hand).not.toContain(this.attachment);
expect(this.attachmentOwner.discardPile).toContain(this.attachment);
});
});
describe('when the attachment is not terminal', function() {
beforeEach(function() {
this.attachment.isTerminal.and.returnValue(false);
this.player.removeAttachment(this.attachment);
});
it('should leave play', function() {
expect(this.attachment.leavesPlay).toHaveBeenCalled();
});
it('should remove the attachment from its parent', function() {
expect(this.card.attachments).not.toContain(this.attachment);
});
it('should unset its parent property', function() {
expect(this.attachment.parent).toBeUndefined();
});
it('should return the attachment to its owners hand', function() {
expect(this.attachmentOwner.hand).toContain(this.attachment);
expect(this.attachmentOwner.discardPile).not.toContain(this.attachment);
});
});
});
describe('when the removal cannot be saved', function() {
beforeEach(function() {
this.dupe = new DrawCard(this.attachmentOwner, {});
this.dupe2 = new DrawCard(this.attachmentOwner, {});
this.attachment.addDuplicate(this.dupe);
this.attachment.addDuplicate(this.dupe2);
this.player.removeAttachment(this.attachment, false);
});
it('should remove all dupes', function() {
expect(this.attachment.dupes.size()).toBe(0);
});
it('should place all dupes in the owners discard pile', function() {
expect(this.attachmentOwner.discardPile).toContain(this.dupe);
expect(this.attachmentOwner.discardPile).toContain(this.dupe2);
});
it('should leave play', function() {
expect(this.attachment.leavesPlay).toHaveBeenCalled();
});
it('should remove the attachment from its parent', function() {
expect(this.card.attachments).not.toContain(this.attachment);
});
it('should unset its parent property', function() {
expect(this.attachment.parent).toBeUndefined();
});
it('should return the attachment to its owners hand', function() {
expect(this.attachmentOwner.hand).toContain(this.attachment);
expect(this.attachmentOwner.discardPile).not.toContain(this.attachment);
});
});
});
}); |
<?php
global $env;
global $cacheDriver;
$env->required('DB')->allowedValues(['mysql', 'pgsql', 'sqlite'])->notEmpty();
$env->required('TWIG_CACHE')->allowedValues([true, false])->notEmpty();
$env->required('DEBUG')->allowedValues([true, false])->notEmpty();
$env->required('CACHE_DRIVER')->allowedValues(
['Memcache', 'Memcached', 'Redis', 'Predis', 'false', ])->notEmpty();
switch (strtolower(getenv('CACHE_DRIVER'))) {
case 'memcache':
if (!class_exists('Memcache')) {
die('Memcache is not installed! Please install required extension.');
}
$memcache = new Memcache();
if (!$memcache->connect(getenv('MC_HOST'), getenv('MC_PORT')))
{
die('Memcache: Connection failed. Please check your settings.');
}
$cacheDriver = new Doctrine\Common\Cache\MemcacheCache();
$cacheDriver->setMemcache($memcache);
break;
case 'memcached':
if (!class_exists('Memcached')) {
die('Memcached is not installed! Please install required extension.');
}
$memcached = new Memcached();
if (!$memcached->addServer(getenv('MD_HOST'), getenv('MD_PORT')))
{
die('Memcached: Connection failed. Please check your settings.');
}
$cacheDriver = new Doctrine\Common\Cache\MemcachedCache();
$cacheDriver->setMemcached($memcached);
break;
case 'redis':
if (!class_exists('Redis')) {
die('PHPRedis is not installed! Please install required extension.');
}
$redis = new Redis();
if (!$redis->connect(getenv('RD_HOST'), getenv('RD_PORT'))) {
die('Redis: Connection failed. Please check your settings.');
}
if (!getenv('RD_PWD') === '') {
$redis->auth(getenv('RD_PWD'));
}
$cacheDriver = new Doctrine\Common\Cache\RedisCache();
$cacheDriver->setRedis($redis);
break;
case 'predis':
if ($predis = new Predis\Client(['host' => getenv('RD_HOST'), 'port' => getenv('RD_PORT')]))
{
die('Redis: Connection refused. Please check your settings.');
}
$cacheDriver = new \Doctrine\Common\Cache\PredisCache($predis);
break;
case 'false':
$cacheDriver = false;
break;
default:
\FW\Core\Errors\httpErrorClass::<API key>('Error!', '.env is missing Cache Driver.');
} |
/** @exports helpers
* Various helpers for non KoC specific stuff */
var helpers = {};
/**
* Simple e-mail validation with RegEx
* @param {String} email E-Mail address to validate
* @return {Boolean} whether or not this is a valid e-mail address
*/
helpers.validateEmail = function(email) {
var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
};
helpers.createTrRegExp = function(header, content) {
return "<tr>\\s*<td>\\s*<b>" + header + "<\\/b>\\s*<\\/td>\\s*<td>\\s*" + content + "\\s*<\\/td>\\s*<\\/tr>";
};
helpers.<API key> = function(header, content1, content2) {
return "<tr>\\s*<td([^<]*)>\\s*" + header + "\\s*<\\/td>\\s*<td([^<]*)>\\s*" + content1 + "\\s*<\\/td>\\s*<td([^<]*)>\\s*" + content2 + "\\s*<\\/td>\\s*<\\/tr>";
};
helpers.createTableRegExp = function(keyPairValues) {
var l = keyPairValues.length;
var keyPairValuesRegExp = [];
for (var i=0; i<l; i++) {
keyPairValuesRegExp[i] = this.createTrRegExp(keyPairValues[i].Key, keyPairValues[i].Value);
}
return keyPairValuesRegExp.join("\\s*");
};
helpers.<API key> = function(keyPairValues) {
var l = keyPairValues.length;
var keyPairValuesRegExp = [];
for (var i=0; i<l; i++) {
keyPairValuesRegExp[i] = this.<API key>(keyPairValues[i].Key, keyPairValues[i].Value1, keyPairValues[i].Value2);
}
return keyPairValuesRegExp.join("\\s*");
};
helpers.stripHtml = function(html) {
return html.replace(/<(?:.|\n)*?>/gm, '').trim();
};
// Tries to parse a number (comma separated)
// If fails, just return the original string
// Or a defaultValue if specified
helpers.quantityFromString = function( quantityStr, defaultValue ) {
var reQty = /([\+\-]*)([0-9,.M]+)/;
var mQty = reQty.exec(quantityStr);
if(defaultValue===undefined)
defaultValue = quantityStr;
return mQty !== null ? Number(mQty[0].replace(/,/g, '').replace(/M/g, '000000')) : defaultValue;
};
// Tries to parse a user link on form:
// <a href="stats.php?id=4503936">AndyRock</a>
// returning:
// username: AndyRock
// userid: 4503936
// or returns the input if such link is not found, nested under 'username':
// username: html
helpers.parseUser = function(html) {
var reStatsLink = /stats\.php\?id=([0-9]+)">([^<]+)/;
var mEnemy = reStatsLink.exec(html);
var user;
if(mEnemy!==null) {
user = {
username: mEnemy[2],
userid: this.quantityFromString(mEnemy[1]),
};
}
else {
user = {
username: helpers.stripHtml(html),
// no userid (probably inactive)
};
}
return user;
};
helpers.parseBuddyStatus = function(html) {
var reBuddyStatus = /<img class="buddy_type".*alt="([^"]+)".*src="([^"]+)">/;
var mBuddyStatus = reBuddyStatus.exec(html);
if(mBuddyStatus!==null) {
return {
status: mBuddyStatus[1],
image: mBuddyStatus[2],
};
}
return {};
};
helpers.parseIntelFile = function(html){
var reReconFile = /<a href="\/intelfile\.php\?asset_id=([0-9]+)"><img alt="([^"]+)".*src="([^"]+)/;
var mReconFile = reReconFile.exec(html);
if(mReconFile!==null) {
return {
assetId: mReconFile[1],
title: mReconFile[2],
image: mReconFile[3],
};
}
return {};
};
module.exports = helpers; |
.modal-content {
background-color: white;
display: flex;
flex-direction: column;
align-items: stretch;
z-index: 999;
}
.modal-footer {
display: flex;
flex-direction: row-reverse;
}
.confirm-modal {
display: none;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
justify-content: center;
align-items: center;
background-color:rgba(0, 0, 0, 0.6);
z-index: 998;
}
.confirm-modal.show {
display: flex;
} |
package com.flickr.api.entities;
import org.json.JSONException;
import org.json.JSONObject;
/**
*
* @author Fabien Barbero
*/
public class PhotosetsResponse extends PaginatedResponse<Photoset> {
@Override
protected Photoset unmarshall(JSONObject json) throws JSONException {
return new Photoset(json);
}
} |
namespace Orleans.Providers.MongoDB.Configuration
{
public enum <API key>
{
SingleDocument,
Muiltiple,
MultipleDeprecated
}
} |
#pragma once
#include <world.h>
#include "world_allocator.h"
#include "world_hashtable.h"
#include "<API key>.h"
struct world_replica {
struct world_allocator allocator;
const struct world_replicaconf conf;
struct world_hashtable hashtable;
struct <API key> thread;
}; |
from Elements.G.Populators.Base.IElementPopulator import IElementPopulator
class <API key>(IElementPopulator):
def __init__(self, sectionName, templates, settingsObject):
super(<API key>, self).__init__(sectionName, templates, settingsObject)
self.separator = "\n|\n"
self.mainName = self.templateName.split('-')[1]
def getType(self):
return "<API key>"
def openClause(self, name):
return self.parameters["ModulePrefix"] + "_" + name.lower() + ":\n"
def closeClause(self):
return "\n;\n"
def populate(self):
<API key> = []
result = self.openClause(self.mainName)
for parameterListName, parameterList in self.parameters.iteritems():
if parameterListName.find("Parameters") != -1:
filledTemplatesList = []
for parameterName, parameters in parameterList.iteritems():
self.<API key>([ self.<API key> ], parameters)
filledTemplatesList.append(self.templateResolver.fill(self.expandParameters(parameters)))
self.restoreDefault()
if len(filledTemplatesList) > 0:
<API key>.append(self.separator.join(filledTemplatesList))
result += self.separator.join(<API key>)
result += self.closeClause()
return result |
[ unit test framework. We'll use the
Proof `okay` function to assert out statements in the readme. A Proof unit test
generally looks like this.
javascript
//{ "code": { "tests": 4 }, "text": { "tests": 4 } }
require('proof')(%(tests)d, async okay => {
//{ "include": "test", "mode": "code" }
//{ "include": "proof" }
})
javascript
//{ "name": "proof", "mode": "text" }
okay('always okay')
okay(true, 'okay if true')
okay(1, 1, 'okay if equal')
okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')
You can run this unit test yourself to see the output from the various
code sections of the readme.
text
//{ "mode": "text" }
git clone git@github.com:bigeasy/avenue.git
cd avenue
npm install --no-package-lock --no-save
node test/readme.t.js
## Overview
Avenue implements a queue as a disintegrating linked-list.
Avenue provides a `Queue` class. When you push onto the head of the `Queue` a
new element is added to the head of the list. The queue itself does not maintain
a pointer to the tail.
To remove items from the queue you must first create a `Shifter` by calling
`Queue.shifter()`. This will be created with a reference to the current head of
the list, in order to reference the next item in the list. At this point if you
where to call the synchronous `Shifter.shift()` you would get a `null` return
value because the next value of the head of the list is `null`.
When you push a new element onto the head of the `Queue`, it will become visible
to the `Shifter`. A call to the synchronous `Shifter.shift()` will return the
item. After the shifter returns the item it advances its tail node to the next
node that contained the value returned. The previous node is no longer
referenced by the `Queue` nor the `Shifter` so it is garbage collected.
You can have multiple `Shifter`s for a single `Queue` garbage collection occurs
when the all the `Shifter`s `shift` past a node in the `Queue`.
If there are no `Shifter`s for a queue, then any push onto the `Queue` is
effectively a no-op. The element is discarded the next time item an item is
pushed.
The `'avenue'` module exports a single `Queue` object.
javascript
//{ "name": "displayedRequire", "mode": "text" }
const { Queue } = require('avenue')
javascript
//{ "name": "test", "mode": "code" }
const { Queue } = require('..')
If you want to stream a shifter into a queue with back-pressure you can the
`Shifter.async.push()` method.
javascript
//{ "unblock": true, "name": "test" }
{
const from = new Queue
const to = new Queue
const shifter = to.shifter()
const promise = from.shifter().push(value => to.push(value))
await from.enqueue([ 1, 2, 3, null ])
await promise
okay(shifter.sync.splice(4), [ 1, 2, 3 ], 'pushed')
okay(shifter.destroyed, 'pumped received terminator')
}
If you want to stream a shifter into a queue without terminating the queue you
use `Queue.consume`.
javascript
//{ "unblock": true, "name": "test" }
{
const from = new Queue
const to = new Queue
const shifter = to.shifter()
const promise = to.consume(from.shifter())
await from.enqueue([ 1, 2, 3, null ])
await promise
okay(shifter.sync.splice(4), [ 1, 2, 3 ], 'pushed')
okay(!shifter.destroyed, 'consumed did not receive terminator')
}
**TODO** Incomplete. |
Disk scheme replacement when making live disk
use alloc::sync::Arc;
use alloc::collections::BTreeMap;
use core::{slice, str};
use core::sync::atomic::{AtomicUsize, Ordering};
use spin::RwLock;
use syscall::data::Stat;
use syscall::error::*;
use syscall::flag::{MODE_DIR, MODE_FILE};
use syscall::scheme::{<API key>, Scheme};
use crate::memory::Frame;
use crate::paging::{ActivePageTable, Page, PageFlags, PhysicalAddress, TableKind, VirtualAddress};
use crate::paging::mapper::PageFlushAll;
static mut LIST: [u8; 2] = [b'0', b'\n'];
struct Handle {
path: &'static [u8],
data: Arc<RwLock<&'static mut [u8]>>,
mode: u16,
seek: usize
}
pub struct DiskScheme {
next_id: AtomicUsize,
list: Arc<RwLock<&'static mut [u8]>>,
data: Arc<RwLock<&'static mut [u8]>>,
handles: RwLock<BTreeMap<usize, Handle>>
}
impl DiskScheme {
pub fn new() -> Option<DiskScheme> {
let mut phys = 0;
let mut size = 0;
for line in str::from_utf8(unsafe { crate::INIT_ENV }).unwrap_or("").lines() {
let mut parts = line.splitn(2, '=');
let name = parts.next().unwrap_or("");
let value = parts.next().unwrap_or("");
if name == "DISK_LIVE_ADDR" {
phys = usize::from_str_radix(value, 16).unwrap_or(0);
}
if name == "DISK_LIVE_SIZE" {
size = usize::from_str_radix(value, 16).unwrap_or(0);
}
}
if phys > 0 && size > 0 {
// Map live disk pages
let virt = phys + crate::PHYS_OFFSET;
unsafe {
let mut active_table = ActivePageTable::new(TableKind::Kernel);
let flush_all = PageFlushAll::new();
let start_page = Page::containing_address(VirtualAddress::new(virt));
let end_page = Page::containing_address(VirtualAddress::new(virt + size - 1));
for page in Page::range_inclusive(start_page, end_page) {
let frame = Frame::containing_address(PhysicalAddress::new(page.start_address().data() - crate::PHYS_OFFSET));
let flags = PageFlags::new().write(true);
let result = active_table.map_to(page, frame, flags);
flush_all.consume(result);
}
flush_all.flush();
}
Some(DiskScheme {
next_id: AtomicUsize::new(0),
list: Arc::new(RwLock::new(unsafe { &mut LIST })),
data: Arc::new(RwLock::new(unsafe {
slice::from_raw_parts_mut(virt as *mut u8, size)
})),
handles: RwLock::new(BTreeMap::new())
})
} else {
None
}
}
}
impl Scheme for DiskScheme {
fn open(&self, path: &str, _flags: usize, _uid: u32, _gid: u32) -> Result<usize> {
let path_trimmed = path.trim_matches('/');
match path_trimmed {
"" => {
let id = self.next_id.fetch_add(1, Ordering::SeqCst);
self.handles.write().insert(id, Handle {
path: b"",
data: self.list.clone(),
mode: MODE_DIR | 0o755,
seek: 0
});
Ok(id)
},
"0" => {
let id = self.next_id.fetch_add(1, Ordering::SeqCst);
self.handles.write().insert(id, Handle {
path: b"0",
data: self.data.clone(),
mode: MODE_FILE | 0o644,
seek: 0
});
Ok(id)
}
_ => Err(Error::new(ENOENT))
}
}
fn read(&self, id: usize, buffer: &mut [u8]) -> Result<usize> {
let mut handles = self.handles.write();
let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
let data = handle.data.read();
let mut i = 0;
while i < buffer.len() && handle.seek < data.len() {
buffer[i] = data[handle.seek];
i += 1;
handle.seek += 1;
}
Ok(i)
}
fn write(&self, id: usize, buffer: &[u8]) -> Result<usize> {
let mut handles = self.handles.write();
let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
let mut data = handle.data.write();
let mut i = 0;
while i < buffer.len() && handle.seek < data.len() {
data[handle.seek] = buffer[i];
i += 1;
handle.seek += 1;
}
Ok(i)
}
fn seek(&self, id: usize, pos: isize, whence: usize) -> Result<isize> {
let mut handles = self.handles.write();
let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
let data = handle.data.read();
let new_offset = <API key>(handle.seek, pos, whence, data.len())?;
handle.seek = new_offset as usize;
Ok(new_offset)
}
fn fcntl(&self, id: usize, _cmd: usize, _arg: usize) -> Result<usize> {
let handles = self.handles.read();
let _handle = handles.get(&id).ok_or(Error::new(EBADF))?;
Ok(0)
}
fn fpath(&self, id: usize, buf: &mut [u8]) -> Result<usize> {
let handles = self.handles.read();
let handle = handles.get(&id).ok_or(Error::new(EBADF))?;
//TODO: Copy scheme part in kernel
let mut i = 0;
let scheme_path = b"disk/live:";
while i < buf.len() && i < scheme_path.len() {
buf[i] = scheme_path[i];
i += 1;
}
let mut j = 0;
while i < buf.len() && j < handle.path.len() {
buf[i] = handle.path[j];
i += 1;
j += 1;
}
Ok(i)
}
fn fstat(&self, id: usize, stat: &mut Stat) -> Result<usize> {
let handles = self.handles.read();
let handle = handles.get(&id).ok_or(Error::new(EBADF))?;
let data = handle.data.read();
stat.st_mode = handle.mode;
stat.st_uid = 0;
stat.st_gid = 0;
stat.st_size = data.len() as u64;
Ok(0)
}
fn fsync(&self, id: usize) -> Result<usize> {
let handles = self.handles.read();
let _handle = handles.get(&id).ok_or(Error::new(EBADF))?;
Ok(0)
}
fn close(&self, id: usize) -> Result<usize> {
self.handles.write().remove(&id).ok_or(Error::new(EBADF)).and(Ok(0))
}
} |
/**
* Parse the body
*
* @param attributes
* @param children
*/
const body = (attributes, children) => {
return Object.assign({
'backgroundColor': '#ffffff',
'class': '',
'padding': '0px',
'margin': '0px',
}, attributes, {
children,
});
};
// xml tag
body.tag = 'mmm-body';
// Not allowed children
body.allowedChildren = [];
export default body; |
package jd
type PathElement interface{}
type Path []PathElement
func (p1 Path) clone() Path {
p2 := make(Path, len(p1), len(p1)+1)
copy(p2, p1)
return p2
} |
<?php
require_once 'ohana.php';
hardReset();
$tests = array(
/*
array(
'mint', 'description',
'type', 'year', 'collection', 'expected accession number',
),
*/
array(
'mint', 'first interview',
'test', '1900', 'a', '1900test001_a001',
),
array(
'mint', 'second interview - same inputs',
'test', '1900', 'a', '1900test002_a002',
),
array(
'mint', 'new type gets its own counters',
'oh', '1900', 'a', '1900oh001_a001',
),
array(
'mint', 'collection and year counters are tracked separately',
'oh', '1900', 'b', '1900oh002_b001',
),
array(
'mint', 'second interview in a collection',
'oh', '1900', 'b', '1900oh003_b002',
),
array(
'mint', 'new year and collection',
'oh', '1901', 'c', '1901oh001_c001',
),
array(
'mint', 'reusing collection and year that had not been used together',
'oh', '1901', 'a', '1901oh002_a002',
),
array(
'mint', 'back to an old collection-year combination',
'oh', '1900', 'a', '1900oh004_a003',
),
/*
array(
'record', 'description',
'accession number', array(expected result),
),
*/
array(
'record', "can't reuse a year counter even if other parts change",
'1900test001_a003', array('error' => 'The year and collection counters cannot be reused.'),
),
array(
'record', 'can record a number that could be minted',
'1902test002_a004', array('canonical' => '1902test002_a004'),
),
array(
'mint', 'minting skips past all used counter values',
'test', '1902', 'a', '1902test003_a005',
),
array(
'record', 'canonicalization works',
'1899 OH/ 151 AB 9 Sess 3', array(
'canonical' => '1899oh151_ab009',
'as_submitted' => '1899 OH/ 151 AB 9 Sess 3',
),
),
array(
'record', '5-digit years are not truncated',
'11902test004_d001', array(
'canonical' => '11902test004_d001',
'as_submitted' => '11902test004_d001',
),
),
array(
'revoke', 'revoking works',
'1902test002_a004', array('circulating' => 0),
),
array(
'revoke', 'revoking twice works',
'1902test002_a004', array('circulating' => 0),
),
array(
'revoke', 'revoking a nonexistent identifier returns an error',
'1900test001_a003', array('error' => 'No such accession number exists.'),
),
array(
'circulate', 'circulating a nonexistent identifier returns an error',
'1900test001_a003', array('error' => 'No such accession number exists.'),
),
array(
'circulate', 'circulating works',
'1899oh151_ab009', array('circulating' => 1),
),
array(
'circulate', 'circulating twice works',
'1899oh151_ab009', array('circulating' => 1),
),
);
foreach ($tests as $test)
{
if ($test[0] === 'mint') {
$description = $test[1];
$options = array(
'type' => $test[2],
'year' => $test[3],
'collection' => $test[4],
);
$expected = array(
'canonical' => $test[5],
);
performMintTest($description, $options, $expected);
}
elseif ($test[0] === 'record') {
$description = $test[1];
$accessionNumber = $test[2];
$expected = $test[3];
performRecordTest($description, $accessionNumber, $expected);
}
elseif ($test[0] === 'revoke') {
$description = $test[1];
$accessionNumber = $test[2];
$expected = $test[3];
performRevokeTest($description, $accessionNumber, $expected);
}
elseif ($test[0] === 'circulate') {
$description = $test[1];
$accessionNumber = $test[2];
$expected = $test[3];
<API key>($description, $accessionNumber, $expected);
}
} |
namespace Facility.Definition;
<summary>
An error set.
</summary>
public sealed class ServiceErrorSetInfo : ServiceMemberInfo
{
<summary>
Creates an error set.
</summary>
public ServiceErrorSetInfo(string name, IEnumerable<ServiceErrorInfo> errors, IEnumerable<<API key>>? attributes, string? summary, IEnumerable<string>? remarks, params ServicePart[] parts)
: base(name, attributes, summary, remarks, parts)
{
Errors = errors.ToReadOnlyList();
<API key>(Errors, "error");
}
<summary>
The errors of the error set.
</summary>
public IReadOnlyList<ServiceErrorInfo> Errors { get; }
private protected override IEnumerable<ServiceElementInfo> <API key>() => Attributes.AsEnumerable<ServiceElementInfo>().Concat(Errors);
} |
package coop.rchain.syntax.rholang.Absyn; // Java Package generated by the BNF Converter.
public class PPtVal extends PPattern {
public final ValPattern valpattern_;
public PPtVal(ValPattern p1) { valpattern_ = p1; }
public <R,A> R accept(coop.rchain.syntax.rholang.Absyn.PPattern.Visitor<R,A> v, A arg) { return v.visit(this, arg); }
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof coop.rchain.syntax.rholang.Absyn.PPtVal) {
coop.rchain.syntax.rholang.Absyn.PPtVal x = (coop.rchain.syntax.rholang.Absyn.PPtVal)o;
return this.valpattern_.equals(x.valpattern_);
}
return false;
}
public int hashCode() {
return this.valpattern_.hashCode();
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.