code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
function Get-DbaService {
<#
.SYNOPSIS
Uses WMI/CIM to scan for the existance of a specific windows services.
.DESCRIPTION
Uses WMI/CIM to scan for the existance of a specific windows services.
Use Get-DbaSqlService if you are interested in scanning for sql server services exclusively.
.PARAMETER ComputerName
The computer to target. Uses localhost by default.
.PARAMETER Name
The name of the service to search for.
.PARAMETER DisplayName
The display-name of the service to search for.
.PARAMETER Credential
The credentials to use when connecting to the computer.
.PARAMETER DoNotUse
Connection Protocols that should not be used when retrieving the information.
.PARAMETER EnableException
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
.EXAMPLE
Get-DbaService -Name LanmanServer
Returns information on the LanmanServer service from localhost.
.EXAMPLE
Get-ADComputer -Filter * | Get-DbaService -Name Browser
First retrieves all computer accounts from active directory, then scans all of those computers for the browser service.
Note: THis may take seriously long time, you may also want to filter out computers that are offline before scanning for services.
.EXAMPLE
Get-DbaService -ComputerName "server1","server2","server3" -Name Lanman%
Scans the servers server1, server2 and server3 for all services whose name starts with 'lanman'
#>
[CmdletBinding()]
param (
[string[]]
$Name,
[string[]]
$DisplayName,
[Parameter(ValueFromPipeline = $true)]
[Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]]
$ComputerName = $env:COMPUTERNAME,
[System.Management.Automation.PSCredential]
$Credential,
[Sqlcollaborative.Dbatools.Connection.ManagementConnectionType[]]
$DoNotUse,
[switch]
[Alias('Silent')]$EnableException
)
begin {
Write-Message -Level InternalComment -Message "Starting"
Write-Message -Level System -Message "Bound parameters: $($PSBoundParameters.Keys -join ", ")"
if (-not (Test-Bound "Name") -and -not (Test-Bound "DisplayName")) {
$Name = "%"
}
}
process {
:main foreach ($computer in $ComputerName) {
Write-Message -Level VeryVerbose -Message "Processing queries to $($computer.ComputerName)" -Target $computer.ComputerName
foreach ($serviceName in $Name) {
Write-Message -Level Verbose -Message "Searching for services with name: $serviceName" -Target $computer.ComputerName
try {
if (Test-Bound "Credential") { Get-DbaCmObject -Query "SELECT * FROM Win32_Service WHERE Name LIKE '$serviceName'" -ComputerName $computer.ComputerName -Credential $Credential -EnableException -DoNotUse $DoNotUse }
else { Get-DbaCmObject -Query "SELECT * FROM Win32_Service WHERE Name LIKE '$serviceName'" -ComputerName $computer.ComputerName -EnableException -DoNotUse $DoNotUse }
}
catch {
if ($_.CategoryInfo.Category -eq "OpenError") {
Stop-Function -Message "Failed to access computer $($computer.ComputerName)" -ErrorRecord $_ -Target $computer.ComputerName -Continue -ContinueLabel main
}
else {
Stop-Function -Message "Failed to retrieve service" -ErrorRecord $_ -Target $computer.ComputerName -Continue
}
}
}
foreach ($serviceDisplayName in $DisplayName) {
Write-Message -Level Verbose -Message "Searching for services with display name: $serviceDisplayName" -Target $computer.ComputerName
try {
if (Test-Bound "Credential") { Get-DbaCmObject -Query "SELECT * FROM Win32_Service WHERE DisplayName LIKE '$serviceDisplayName'" -ComputerName $computer.ComputerName -Credential $Credential -EnableException -DoNotUse $DoNotUse }
else { Get-DbaCmObject -Query "SELECT * FROM Win32_Service WHERE DisplayName LIKE '$serviceDisplayName'" -ComputerName $computer.ComputerName -EnableException -DoNotUse $DoNotUse }
}
catch {
if ($_.CategoryInfo.Category -eq "OpenError") {
Stop-Function -Message "Failed to access computer $($computer.ComputerName)" -ErrorRecord $_ -Target $computer.ComputerName -Continue -ContinueLabel main
}
else {
Stop-Function -Message "Failed to retrieve service" -ErrorRecord $_ -Target $computer.ComputerName -Continue
}
}
}
}
}
end {
Write-Message -Level InternalComment -Message "Ending"
}
}
|
SirCaptainMitch/dbatools
|
internal/functions/Get-DbaService.ps1
|
PowerShell
|
mit
| 5,316 |
{% extends 'teachers/base.html'|pjax:request %}
{% load i18n %}
{% block content %}
<script src="site_media/static/js/sorttable.js"></script>
<style type="text/css">
/* Sortable tables */
table.sortable thead {
background-color:#eee;
color:#666666;
font-weight: bold;
cursor: default;
}</style>
<script type="text/javascript">
var stIsIE = /*@cc_on!@*/false;
sorttable = {
init: function() {
if (arguments.callee.done) return;
arguments.callee.done = true;
if (_timer) clearInterval(_timer);
if (!document.createElement || !document.getElementsByTagName) return;
sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
forEach(document.getElementsByTagName('table'), function(table) {
if (table.className.search(/\bsortable\b/) != -1) {
sorttable.makeSortable(table);
}
});
},
makeSortable: function(table) {
if (table.getElementsByTagName('thead').length == 0) {
the = document.createElement('thead');
the.appendChild(table.rows[0]);
table.insertBefore(the,table.firstChild);
}
if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
if (table.tHead.rows.length != 1) return;
sortbottomrows = [];
for (var i=0; i<table.rows.length; i++) {
if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
sortbottomrows[sortbottomrows.length] = table.rows[i];
}
}
if (sortbottomrows) {
if (table.tFoot == null) {
tfo = document.createElement('tfoot');
table.appendChild(tfo);
}
for (var i=0; i<sortbottomrows.length; i++) {
tfo.appendChild(sortbottomrows[i]);
}
delete sortbottomrows;
}
headrow = table.tHead.rows[0].cells;
for (var i=0; i<headrow.length; i++) {
if (!headrow[i].className.match(/\bsorttable_nosort\b/)) {
mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/);
if (mtch) { override = mtch[1]; }
if (mtch && typeof sorttable["sort_"+override] == 'function') {
headrow[i].sorttable_sortfunction = sorttable["sort_"+override];
} else {
headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
}
headrow[i].sorttable_columnindex = i;
headrow[i].sorttable_tbody = table.tBodies[0];
dean_addEvent(headrow[i],"click", sorttable.innerSortFunction = function(e) {
if (this.className.search(/\bsorttable_sorted\b/) != -1) {
sorttable.reverse(this.sorttable_tbody);
this.className = this.className.replace('sorttable_sorted',
'sorttable_sorted_reverse');
this.removeChild(document.getElementById('sorttable_sortfwdind'));
sortrevind = document.createElement('span');
sortrevind.id = "sorttable_sortrevind";
sortrevind.innerHTML = stIsIE ? ' <font face="webdings">5</font>' : ' ▴';
this.appendChild(sortrevind);
return;
}
if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
sorttable.reverse(this.sorttable_tbody);
this.className = this.className.replace('sorttable_sorted_reverse',
'sorttable_sorted');
this.removeChild(document.getElementById('sorttable_sortrevind'));
sortfwdind = document.createElement('span');
sortfwdind.id = "sorttable_sortfwdind";
sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾';
this.appendChild(sortfwdind);
return;
}
theadrow = this.parentNode;
forEach(theadrow.childNodes, function(cell) {
if (cell.nodeType == 1) { // an element
cell.className = cell.className.replace('sorttable_sorted_reverse','');
cell.className = cell.className.replace('sorttable_sorted','');
}
});
sortfwdind = document.getElementById('sorttable_sortfwdind');
if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
sortrevind = document.getElementById('sorttable_sortrevind');
if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }
this.className += ' sorttable_sorted';
sortfwdind = document.createElement('span');
sortfwdind.id = "sorttable_sortfwdind";
sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾';
this.appendChild(sortfwdind);
row_array = [];
col = this.sorttable_columnindex;
rows = this.sorttable_tbody.rows;
for (var j=0; j<rows.length; j++) {
row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]];
}
row_array.sort(this.sorttable_sortfunction);
tb = this.sorttable_tbody;
for (var j=0; j<row_array.length; j++) {
tb.appendChild(row_array[j][1]);
}
delete row_array;
});
}
}
},
guessType: function(table, column) {
sortfn = sorttable.sort_alpha;
for (var i=0; i<table.tBodies[0].rows.length; i++) {
text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
if (text != '') {
if (text.match(/^-?[ยฃ$ยค]?[\d,.]+%?$/)) {
return sorttable.sort_numeric;
}
possdate = text.match(sorttable.DATE_RE)
if (possdate) {
first = parseInt(possdate[1]);
second = parseInt(possdate[2]);
if (first > 12) {
return sorttable.sort_ddmm;
} else if (second > 12) {
return sorttable.sort_mmdd;
} else {
sortfn = sorttable.sort_ddmm;
}
}
}
}
return sortfn;
},
getInnerText: function(node) {
if (!node) return "";
hasInputs = (typeof node.getElementsByTagName == 'function') &&
node.getElementsByTagName('input').length;
if (node.getAttribute("sorttable_customkey") != null) {
return node.getAttribute("sorttable_customkey");
}
else if (typeof node.textContent != 'undefined' && !hasInputs) {
return node.textContent.replace(/^\s+|\s+$/g, '');
}
else if (typeof node.innerText != 'undefined' && !hasInputs) {
return node.innerText.replace(/^\s+|\s+$/g, '');
}
else if (typeof node.text != 'undefined' && !hasInputs) {
return node.text.replace(/^\s+|\s+$/g, '');
}
else {
switch (node.nodeType) {
case 3:
if (node.nodeName.toLowerCase() == 'input') {
return node.value.replace(/^\s+|\s+$/g, '');
}
case 4:
return node.nodeValue.replace(/^\s+|\s+$/g, '');
break;
case 1:
case 11:
var innerText = '';
for (var i = 0; i < node.childNodes.length; i++) {
innerText += sorttable.getInnerText(node.childNodes[i]);
}
return innerText.replace(/^\s+|\s+$/g, '');
break;
default:
return '';
}
}
},
reverse: function(tbody) {
for (var i=0; i<tbody.rows.length; i++) {
newrows[newrows.length] = tbody.rows[i];
}
for (var i=newrows.length-1; i>=0; i--) {
tbody.appendChild(newrows[i]);
}
delete newrows;
},
sort_numeric: function(a,b) {
aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
if (isNaN(aa)) aa = 0;
bb = parseFloat(b[0].replace(/[^0-9.-]/g,''));
if (isNaN(bb)) bb = 0;
return aa-bb;
},
sort_alpha: function(a,b) {
if (a[0]==b[0]) return 0;
if (a[0]<b[0]) return -1;
return 1;
},
sort_ddmm: function(a,b) {
mtch = a[0].match(sorttable.DATE_RE);
y = mtch[3]; m = mtch[2]; d = mtch[1];
if (m.length == 1) m = '0'+m;
if (d.length == 1) d = '0'+d;
dt1 = y+m+d;
mtch = b[0].match(sorttable.DATE_RE);
y = mtch[3]; m = mtch[2]; d = mtch[1];
if (m.length == 1) m = '0'+m;
if (d.length == 1) d = '0'+d;
dt2 = y+m+d;
if (dt1==dt2) return 0;
if (dt1<dt2) return -1;
return 1;
},
sort_mmdd: function(a,b) {
mtch = a[0].match(sorttable.DATE_RE);
y = mtch[3]; d = mtch[2]; m = mtch[1];
if (m.length == 1) m = '0'+m;
if (d.length == 1) d = '0'+d;
dt1 = y+m+d;
mtch = b[0].match(sorttable.DATE_RE);
y = mtch[3]; d = mtch[2]; m = mtch[1];
if (m.length == 1) m = '0'+m;
if (d.length == 1) d = '0'+d;
dt2 = y+m+d;
if (dt1==dt2) return 0;
if (dt1<dt2) return -1;
return 1;
},
shaker_sort: function(list, comp_func) {
var b = 0;
var t = list.length - 1;
var swap = true;
while(swap) {
swap = false;
for(var i = b; i < t; ++i) {
if ( comp_func(list[i], list[i+1]) > 0 ) {
var q = list[i]; list[i] = list[i+1]; list[i+1] = q;
swap = true;
}
} // for
t--;
if (!swap) break;
for(var i = t; i > b; --i) {
if ( comp_func(list[i], list[i-1]) < 0 ) {
var q = list[i]; list[i] = list[i-1]; list[i-1] = q;
swap = true;
}
} // for
b++;
} // while(swap)
}
}
/* for Mozilla/Opera9 */
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", sorttable.init, false);
}
/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
var _timer = setInterval(function() {
if (/loaded|complete/.test(document.readyState)) {
sorttable.init(); // call the onload handler
}
}, 10);
}
/* for other browsers */
window.onload = sorttable.init;
// written by Dean Edwards, 2005
// with input from Tino Zijdel, Matthias Miller, Diego Perini
// http://dean.edwards.name/weblog/2005/10/add-event/
function dean_addEvent(element, type, handler) {
if (element.addEventListener) {
element.addEventListener(type, handler, false);
} else {
// assign each event handler a unique ID
if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++;
// create a hash table of event types for the element
if (!element.events) element.events = {};
// create a hash table of event handlers for each element/event pair
var handlers = element.events[type];
if (!handlers) {
handlers = element.events[type] = {};
// store the existing event handler (if there is one)
if (element["on" + type]) {
handlers[0] = element["on" + type];
}
}
// store the event handler in the hash table
handlers[handler.$$guid] = handler;
// assign a global event handler to do all the work
element["on" + type] = handleEvent;
}
};
// a counter used to create unique IDs
dean_addEvent.guid = 1;
function removeEvent(element, type, handler) {
if (element.removeEventListener) {
element.removeEventListener(type, handler, false);
} else {
// delete the event handler from the hash table
if (element.events && element.events[type]) {
delete element.events[type][handler.$$guid];
}
}
};
function handleEvent(event) {
var returnValue = true;
// grab the event object (IE uses a global event object)
event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
// get a reference to the hash table of event handlers
var handlers = this.events[event.type];
// execute each event handler
for (var i in handlers) {
this.$$handleEvent = handlers[i];
if (this.$$handleEvent(event) === false) {
returnValue = false;
}
}
return returnValue;
};
function fixEvent(event) {
// add W3C standard event methods
event.preventDefault = fixEvent.preventDefault;
event.stopPropagation = fixEvent.stopPropagation;
return event;
};
fixEvent.preventDefault = function() {
this.returnValue = false;
};
fixEvent.stopPropagation = function() {
this.cancelBubble = true;
}
// Dean's forEach: http://dean.edwards.name/base/forEach.js
/*
forEach, version 1.0
Copyright 2006, Dean Edwards
License: http://www.opensource.org/licenses/mit-license.php
*/
// array-like enumeration
if (!Array.forEach) { // mozilla already supports this
Array.forEach = function(array, block, context) {
for (var i = 0; i < array.length; i++) {
block.call(context, array[i], i, array);
}
};
}
// generic enumeration
Function.prototype.forEach = function(object, block, context) {
for (var key in object) {
if (typeof this.prototype[key] == "undefined") {
block.call(context, object[key], key, object);
}
}
};
// character enumeration
String.forEach = function(string, block, context) {
Array.forEach(string.split(""), function(chr, index) {
block.call(context, chr, index, string);
});
};
// globally resolve forEach enumeration
var forEach = function(object, block, context) {
if (object) {
var resolve = Object; // default
if (object instanceof Function) {
// functions have a "length" property
resolve = Function;
} else if (object.forEach instanceof Function) {
// the object implements a custom forEach method so use that
object.forEach(block, context);
return;
} else if (typeof object == "string") {
// the object is a string
resolve = String;
} else if (typeof object.length == "number") {
// the object is array-like
resolve = Array;
}
resolve.forEach(object, block, context);
}
};
</script>
<form id="form1" action="#" method="POST" >
{% csrf_token %}
<table class="sortable" border="2" >
<thead>
<tr>
<th style='text-align:center'>SL.No</th>
<th style='text-align:center' >Staff-ID</th>
<th style='text-align:center' >Name</th>
<th style='text-align:center' >Date of Birth</th>
<th style='text-align:center' >Gender</th>
<th style='text-align:center' >Designation</th>
<th style='text-align:center' >Subject</th>
<th style='text-align:center'>Date of Appoinment </th>
<th style='text-align:center'>Education Entry</th>
<th style='text-align:center'>Update</th>
<th style='text-align:center'>Delete</th>
</tr>
</thead>
{% for i in teachers_name_list_new %}
<tr>
<td>{{forloop.counter}}</td>
<td> {{ i.pri_tea_id }}</td>
<td > <a href="/teachers/teacher_full_detail_private/{{i.pri_tea_id}}"style="text-decoration: none" ><p class ="text-capitalize">{{ i.name | upper}}</p></td>
<td> {{ i.dob | upper }}</td>
<td> {{ i.gender | upper }}</td>
<td> {{ i.designation.designation | upper}}</td>
<td>{{ i.subject | upper}}</td>
<td> {{i.doa | upper}}</td>
<td><a href="/teachers/edu_qualifaction_create/{{i.pri_tea_id}}"><button type="button" class="btn btn-success">Education Qualification</button></a></td>
<td><a href="/teachers/private_teacher_update/{{i.pri_tea_id}}"><button type="button" class="btn btn-primary">Update</button></a></td>
<td><a href="/teachers/private_teacher_delete/{{i.pri_tea_id}}"><button type="button" class="btn btn-danger">Delete</button></a></td>
{% endfor %}
</tr>
</table>
</form>
<br>
<br>
<br>
<br>
<!--
<p align="center" > <a class="btn btn-small btn-warning" href='/teachers/teacher_detailListView'>HOME</a></p> -->
{% endblock %}
|
tnemis/staging-server
|
teachers/templates/teachers/private/teacher_list.html
|
HTML
|
mit
| 15,557 |
/* -----------------------------------------------
/* How to use? : Check the GitHub README
/* ----------------------------------------------- */
/* To load a config file (particles.json) you need to host this demo (MAMP/WAMP/local)... */
/*
particlesJS.load('particles-js', 'particles.json', function() {
console.log('particles.js loaded - callback');
});
*/
/* Otherwise just put the config content (json): */
width = $(document).width();
if (width>768){
num_nb = Math.round(Math.sqrt(width * 3));
}else{
num_nb = Math.round(Math.sqrt(width * 3));
}
particlesJS('particles-js',
{
"particles": {
"number": {
"value": num_nb,
"density": {
"enable": false,
"value_area": num_nb*num_nb
}
},
"color": {
"value": "#e62b1e"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 10
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 4,
"random": false,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance": 150,
"color": "#e62b1e",
"opacity": 0.4,
"width": 2
},
"move": {
"enable": true,
"speed": 6,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "grab"
},
"onclick": {
"enable": false,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 280,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}
);
|
Prashant351/TedXIIT-ISM-Dhanbad
|
website/public/js/app.js
|
JavaScript
|
mit
| 2,932 |
'use strict';
// Post
exports = module.exports = function(app, mongoose) {
var postSchema = new mongoose.Schema({
organizer: { type: String, default: ''},
title: { type: String, default: ''},
url: { type: String, default: ''},
typeTags: [{ type: String, default: ''}],
tags: [{ type: String, default: ''}],
isActive: { type: Boolean, default: true },
startDate: { type: Date },
endDate: { type: Date },
// update date
date: { type: Date, default: Date.now },
userId: { type: mongoose.Schema.Types.ObjectId, ref: 'Member' },
});
postSchema.plugin(require('./plugins/pagedFind'));
postSchema.index({ organizer: 1 });
postSchema.index({ tags: 1 });
postSchema.index({ tags: 1 });
postSchema.set('autoIndex', true);
app.db.model('Post', postSchema);
}
|
partjs/partjs
|
schema/Post.js
|
JavaScript
|
mit
| 877 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_66-internal) on Tue Dec 08 09:28:01 GMT 2015 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.apache.jena.sparql.expr.E_DateTimeMonth (Apache Jena ARQ)</title>
<meta name="date" content="2015-12-08">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.jena.sparql.expr.E_DateTimeMonth (Apache Jena ARQ)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/jena/sparql/expr/E_DateTimeMonth.html" title="class in org.apache.jena.sparql.expr">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/jena/sparql/expr/class-use/E_DateTimeMonth.html" target="_top">Frames</a></li>
<li><a href="E_DateTimeMonth.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.jena.sparql.expr.E_DateTimeMonth" class="title">Uses of Class<br>org.apache.jena.sparql.expr.E_DateTimeMonth</h2>
</div>
<div class="classUseContainer">No usage of org.apache.jena.sparql.expr.E_DateTimeMonth</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/jena/sparql/expr/E_DateTimeMonth.html" title="class in org.apache.jena.sparql.expr">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/jena/sparql/expr/class-use/E_DateTimeMonth.html" target="_top">Frames</a></li>
<li><a href="E_DateTimeMonth.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Licenced under the Apache License, Version 2.0</small></p>
</body>
</html>
|
manonsys/MVC
|
libs/Jena/javadoc-arq/org/apache/jena/sparql/expr/class-use/E_DateTimeMonth.html
|
HTML
|
mit
| 4,681 |
---
layout: page
title: "404: Page Not Found"
---
<div class="w-100 tc f3-ns f4 mv5 black-70">
You've boldly gone where no one has gone before.
</div>
|
jdillard/personal-site
|
source/404.html
|
HTML
|
mit
| 156 |
//
// Copyright (c) 2008-2015 the Urho3D project.
//
// 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.
//
#pragma once
#include "../../Graphics/GraphicsDefs.h"
#include "../../Graphics/Viewport.h"
namespace Atomic
{
class Camera;
class Scene;
class Texture;
/// %Color or depth-stencil surface that can be rendered into.
class ATOMIC_API RenderSurface : public RefCounted
{
friend class Texture2D;
friend class TextureCube;
REFCOUNTED(RenderSurface)
public:
/// Construct with parent texture.
RenderSurface(Texture* parentTexture);
/// Destruct.
~RenderSurface();
/// Set number of viewports.
void SetNumViewports(unsigned num);
/// Set viewport.
void SetViewport(unsigned index, Viewport* viewport);
/// Set viewport update mode. Default is to update when visible.
void SetUpdateMode(RenderSurfaceUpdateMode mode);
/// Set linked color rendertarget.
void SetLinkedRenderTarget(RenderSurface* renderTarget);
/// Set linked depth-stencil surface.
void SetLinkedDepthStencil(RenderSurface* depthStencil);
/// Queue manual update of the viewport(s).
void QueueUpdate();
/// Create a renderbuffer. Return true if successful.
bool CreateRenderBuffer(unsigned width, unsigned height, unsigned format);
/// Handle device loss.
void OnDeviceLost();
/// Release renderbuffer if any.
void Release();
/// Return parent texture.
Texture* GetParentTexture() const { return parentTexture_; }
/// Return renderbuffer if created.
unsigned GetRenderBuffer() const { return renderBuffer_; }
/// Return width.
int GetWidth() const;
/// Return height.
int GetHeight() const;
/// Return usage.
TextureUsage GetUsage() const;
/// Return number of viewports.
unsigned GetNumViewports() const { return viewports_.Size(); }
/// Return viewport by index.
Viewport* GetViewport(unsigned index) const;
/// Return viewport update mode.
RenderSurfaceUpdateMode GetUpdateMode() const { return updateMode_; }
/// Return linked color buffer.
RenderSurface* GetLinkedRenderTarget() const { return linkedRenderTarget_; }
/// Return linked depth buffer.
RenderSurface* GetLinkedDepthStencil() const { return linkedDepthStencil_; }
/// Set surface's OpenGL target.
void SetTarget(unsigned target);
/// Return surface's OpenGL target.
unsigned GetTarget() const { return target_; }
/// Clear update flag. Called by Renderer.
void WasUpdated();
private:
/// Parent texture.
Texture* parentTexture_;
/// OpenGL target.
unsigned target_;
/// OpenGL renderbuffer.
unsigned renderBuffer_;
/// Viewports.
Vector<SharedPtr<Viewport> > viewports_;
/// Linked color buffer.
WeakPtr<RenderSurface> linkedRenderTarget_;
/// Linked depth buffer.
WeakPtr<RenderSurface> linkedDepthStencil_;
/// Update mode for viewports.
RenderSurfaceUpdateMode updateMode_;
/// Update queued flag.
bool updateQueued_;
};
}
|
rsredsq/AtomicGameEngine
|
Source/Atomic/Graphics/OpenGL/OGLRenderSurface.h
|
C
|
mit
| 4,192 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/chemistry/shared_medpack_enhance_strength_b.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result
|
obi-two/Rebelion
|
data/scripts/templates/object/draft_schematic/chemistry/shared_medpack_enhance_strength_b.py
|
Python
|
mit
| 465 |
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Phaser - Making your first game, part 9</title>
<script type="text/javascript" src="js/phaser.min.js"></script>
<style type="text/css">
body {
margin: 0;
}
</style>
</head>
<body>
<script type="text/javascript">
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });
function preload() {
game.load.image('sky', 'assets/sky.png');
game.load.image('ground', 'assets/platform.png');
game.load.image('star', 'assets/star.png');
game.load.spritesheet('dude', 'assets/dude.png', 32, 48);
}
var player;
var platforms;
var cursors;
var stars;
var score = 0;
var scoreText;
function create() {
// A simple background for our game
game.add.sprite(0, 0, 'sky');
// The platforms group contains the ground and the 2 ledges we can jump on
platforms = game.add.group();
// Here we create the ground.
var ground = platforms.create(0, game.world.height - 64, 'ground');
// Scale it to fit the width of the game (the original sprite is 400x32 in size)
ground.scale.setTo(2, 2);
// This stops it from falling away when you jump on it
ground.body.immovable = true;
// Now let's create two ledges
var ledge = platforms.create(400, 400, 'ground');
ledge.body.immovable = true;
ledge = platforms.create(-150, 250, 'ground');
ledge.body.immovable = true;
// The player and its settings
player = game.add.sprite(32, game.world.height - 150, 'dude');
// Player physics properties. Give the little guy a slight bounce.
player.body.bounce.y = 0.2;
player.body.gravity.y = 6;
player.body.collideWorldBounds = true;
// Our two animations, walking left and right.
player.animations.add('left', [0, 1, 2, 3], 10, true);
player.animations.add('right', [5, 6, 7, 8], 10, true);
// Finally some stars to collect
stars = game.add.group();
// Here we'll create 12 of them evenly spaced apart
for (var i = 0; i < 12; i++)
{
// Create a star inside of the 'stars' group
var star = stars.create(i * 70, 0, 'star');
// Let gravity do its thing
star.body.gravity.y = 6;
// This just gives each star a slightly random bounce value
star.body.bounce.y = 0.7 + Math.random() * 0.2;
}
// The score
scoreText = game.add.text(16, 16, 'score: 0', { fontSize: '32px', fill: '#000' });
// Our controls.
cursors = game.input.keyboard.createCursorKeys();
}
function update() {
// Collide the player and the stars with the platforms
game.physics.collide(player, platforms);
game.physics.collide(stars, platforms);
// Checks to see if the player overlaps with any of the stars, if he does call the collectStar function
game.physics.overlap(player, stars, collectStar, null, this);
// Reset the players velocity (movement)
player.body.velocity.x = 0;
if (cursors.left.isDown)
{
// Move to the left
player.body.velocity.x = -150;
player.animations.play('left');
}
else if (cursors.right.isDown)
{
// Move to the right
player.body.velocity.x = 150;
player.animations.play('right');
}
else
{
// Stand still
player.animations.stop();
player.frame = 4;
}
// Allow the player to jump if they are touching the ground.
if (cursors.up.isDown && player.body.touching.down)
{
player.body.velocity.y = -350;
}
}
function collectStar (player, star) {
// Removes the star from the screen
star.kill();
// Add and update the score
score += 10;
scoreText.content = 'Score: ' + score;
}
</script>
</body>
</html>
|
2016rshah/phaser
|
tutorials/02 Making your first game/part9.html
|
HTML
|
mit
| 3,864 |
var should = require('should');
describe('lib/cli-util', function(){
describe('#resolveOrg', function() {
it('should resolve default org from local first', function(done) {
done();
});
});
});
|
kevinohara80/dmc
|
test/cli-util.js
|
JavaScript
|
mit
| 216 |
/************************************************************************/
/* About different platforms. */
/************************************************************************/
#ifndef LIB_LOGS_PLATFORM_H
#define LIB_LOGS_PLATFORM_H
#define LIB_LOGS_BEGIN namespace LibLogs {
#define LIB_LOGS_END }
#ifdef WIN32
#include <windows.h>
#include <tchar.h>
#include <io.h>
#ifdef LIB_LOGS_EXPORTS
#define LIB_LOGS_API __declspec(dllexport)
#else
#define LIB_LOGS_API __declspec(dllimport)
#endif
#define libLog_localtime(ptm, lt) localtime_s((ptm), &(lt))
#define LIB_LOGS_SEPARATORY '\\'
#else
// other os eg,unix or linux
#include <unistd.h>
#include <sys/stat.h>
#define LIB_LOGS_API
#define libLog_localtime(ptm, lt) localtime_r(&(lt), (ptm))
#define LIB_LOGS_SEPARATORY '/'
#endif
#define LIB_LOGS_INTERFACE struct
#endif
|
ShuangxueBai/libLogs
|
src/libPlatform.h
|
C
|
mit
| 890 |
#include "../../../include/Switch/System/SByte.hpp"
#include "../../../include/Switch/System/Convert.hpp"
#include "../../../include/Switch/System/DivideByZeroException.hpp"
#include "../../../include/Switch/System/NumericalFormat.hpp"
#include "../../../include/Switch/System/NumericalParsing.hpp"
using namespace System;
constexpr sbyte SByte::MaxValue;
constexpr sbyte SByte::MinValue;
sbyte SByte::Parse(const string& str) {
return Parse(str, 10);
}
sbyte SByte::Parse(const string& str, const int32 base) {
int64 value = NumericalParsing::ParseSigned(str, base, 8);
return Convert::ToSByte(value);
}
bool SByte::TryParse(const string& str, sbyte& value) {
return TryParse(str, 10, value);
}
bool SByte::TryParse(const string& str, SByte& value) {
return TryParse(str, 10, value.value);
}
bool SByte::TryParse(const string& str, int32 base, sbyte& value) {
try {
value = Parse(str, base);
} catch (const Exception&) {
return false;
}
return true;
}
bool SByte::TryParse(const string& str, int32 base, SByte& value) {
return TryParse(str, base, value.value);
}
int32 SByte::GetHashCode() const {
return this->value;
}
string SByte::ToString() const {
return ToString("g3", ref<IFormatProvider>::Null());
}
string SByte::ToString(const string& format) const {
return ToString(format, ref<IFormatProvider>::Null());
}
string SByte::ToString(const string& format, const IFormatProvider&) const {
int64 arg = Convert::ToInt64(this->value);
int32 precision;
char32 type = NumericalFormat::GetFormatType(format, precision);
switch (type) {
case 0: return NumericalFormat::Format_Custom(arg, format);
case 'b': return NumericalFormat::Format_B(arg, precision, 8);
case 'd': return NumericalFormat::Format_D(arg, precision);
case 'e': return NumericalFormat::Format_E(Convert::ToInt64(this->value), precision == 0 ? 3 : precision, false);
case 'E': return NumericalFormat::Format_E(Convert::ToInt64(this->value), precision == 0 ? 3 : precision, true);
case 'f':
if (format.Length() == 1) precision = 2;
return NumericalFormat::Format_F(arg, precision);
case 'g':
case 'G': {
if (precision == 0) precision = 3;
return NumericalFormat::Format_G(arg, precision, type == 'G');
}
case 'n':
if (format.Length() == 1) precision = 2;
return NumericalFormat::Format_N(arg, precision);
case 'p':
if (format.Length() == 1) precision = 2;
return NumericalFormat::Format_P(arg, precision);
case 'x': return NumericalFormat::Format_X(arg, precision, false, 2);
case 'X': return NumericalFormat::Format_X(arg, precision, true, 2);
}
return format;
}
int32 SByte::CompareTo(const SByte& value) const {
return (this->value - value.value);
}
int32 SByte::CompareTo(const IComparable& obj) const {
if (!is<SByte>(obj))
return 1;
return CompareTo(static_cast<const SByte&>(obj));
}
TypeCode SByte::GetTypeCode() const {
return TypeCode::SByte;
}
bool SByte::ToBoolean(const IFormatProvider&) const {
return this->value != 0;
}
byte SByte::ToByte(const IFormatProvider&) const {
if (this->value < Byte::MinValue)
throw OverflowException(caller_);
return (sbyte)this->value;
}
char32 SByte::ToChar(const IFormatProvider&) const {
return (char)this->value;
}
DateTime SByte::ToDateTime(const IFormatProvider&) const {
return DateTime((int64)this->value);
}
double SByte::ToDouble(const IFormatProvider&) const {
return (double)this->value;
}
int16 SByte::ToInt16(const IFormatProvider&) const {
return (int16)this->value;
}
int32 SByte::ToInt32(const IFormatProvider&) const {
return (int32)this->value;
}
int64 SByte::ToInt64(const IFormatProvider&) const {
return (int64)this->value;
}
uint16 SByte::ToUInt16(const IFormatProvider&) const {
if (this->value < UInt16::MinValue)
throw OverflowException(caller_);
return (uint16)this->value;
}
uint32 SByte::ToUInt32(const IFormatProvider&) const {
if (this->value < 0)
throw OverflowException(caller_);
return (uint32)this->value;
}
uint64 SByte::ToUInt64(const IFormatProvider&) const {
if (this->value < 0)
throw OverflowException(caller_);
return (uint64)this->value;
}
sbyte SByte::ToSByte(const IFormatProvider&) const {
return this->value;
}
float SByte::ToSingle(const IFormatProvider&) const {
return (float)this->value;
}
string SByte::ToString(const IFormatProvider&) const {
return ToString();
}
SByte::operator sbyte() const {
return this->value;
}
SByte& SByte::operator =(const SByte& value) {
this->value = value.value;
return *this;
}
SByte& SByte::operator +=(const SByte& value) {
this->value += value.value;
return *this;
}
SByte& SByte::operator -=(const SByte& value) {
this->value -= value.value;
return *this;
}
SByte& SByte::operator *=(const SByte& value) {
this->value *= value.value;
return *this;
}
SByte& SByte::operator /=(const SByte& value) {
if (value == 0)
throw DivideByZeroException(caller_);
this->value /= value.value;
return *this;
}
SByte& SByte::operator %=(const SByte& value) {
if (value == 0)
throw DivideByZeroException(caller_);
this->value %= value;
return *this;
}
SByte& SByte::operator &=(const SByte& value) {
this->value &= value.value;
return *this;
}
SByte& SByte::operator |=(const SByte& value) {
this->value |= value.value;
return *this;
}
SByte& SByte::operator ^=(const SByte& value) {
this->value ^= value.value;
return *this;
}
SByte& SByte::operator <<=(const SByte& value) {
this->value <<= value.value;
return *this;
}
SByte& SByte::operator >>=(const SByte& value) {
this->value >>= value.value;
return *this;
}
SByte& SByte::operator ++() {
++this->value;
return *this;
}
const SByte SByte::operator ++(int) {
return this->value++;
}
SByte& SByte::operator --() {
--this->value;
return *this;
}
const SByte SByte::operator --(int) {
return this->value--;
}
|
gammasoft71/Switch
|
src/Switch.Core/src/Switch/System/SByte.cpp
|
C++
|
mit
| 5,939 |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)([/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
cx: "12",
cy: "12",
r: "1",
opacity: ".3"
}, "0"), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M9 12c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3zm4 0c0 .55-.45 1-1 1s-1-.45-1-1 .45-1 1-1 1 .45 1 1z"
}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M8 8H5.09C6.47 5.61 9.05 4 12 4c3.72 0 6.85 2.56 7.74 6h2.06c-.93-4.56-4.96-8-9.8-8-3.27 0-6.18 1.58-8 4.01V4H2v6h6V8zm8 6v2h2.91c-1.38 2.39-3.96 4-6.91 4-3.72 0-6.85-2.56-7.74-6H2.2c.93 4.56 4.96 8 9.8 8 3.27 0 6.18-1.58 8-4.01V20h2v-6h-6z"
}, "2")], 'FlipCameraAndroidTwoTone');
exports.default = _default;
|
oliviertassinari/material-ui
|
packages/mui-icons-material/lib/FlipCameraAndroidTwoTone.js
|
JavaScript
|
mit
| 1,001 |
<?php
namespace SocialEngine\Console\Helper\Seed;
use SocialEngine\Console\Command;
use SocialEngine\Console\Helper\BaseCommand;
use SocialEngine\Console\Helper\Db;
use Zend_Db_Table;
/**
* Class Config Helper
*
* @package SocialEngine\Console\Helper
*/
class User extends BaseCommand
{
private $db;
public function __construct(Command $command)
{
parent::__construct($command);
$this->db = new Db($command);
}
public function make($values)
{
$adapter = $this->db->factory;
$settingsTable = new Zend_Db_Table(array(
'db' => $adapter,
'name' => 'engine4_core_settings',
));
$usersTable = new Zend_Db_Table(array(
'db' => $adapter,
'name' => 'engine4_users',
));
$levelTable = new Zend_Db_Table(array(
'db' => $adapter,
'name' => 'engine4_authorization_levels',
));
$superAdminLevel = $levelTable->fetchRow($levelTable->select()->where('flag = ?', 'superadmin'));
if (is_object($superAdminLevel)) {
$superAdminLevel = $superAdminLevel->level_id;
} else {
$superAdminLevel = 1;
}
$staticSalt = $settingsTable->find('core.secret')->current();
if (is_object($staticSalt)) {
$staticSalt = $staticSalt->value;
} elseif (!is_string($staticSalt)) {
$staticSalt = '';
}
$values['salt'] = (string) rand(1000000, 9999999);
$values['password'] = md5($staticSalt . $values['password'] . $values['salt']);
$values['level_id'] = $superAdminLevel;
$values['enabled'] = 1;
$values['verified'] = 1;
$values['creation_date'] = date('Y-m-d H:i:s');
$values['creation_ip'] = ip2long($_SERVER['REMOTE_ADDR']);
$values['displayname'] = $values['username'];
try {
$row = $usersTable->createRow();
$row->setFromArray($values);
$row->save();
} catch (\Exception $e) {
exit($e->getMessage());
}
}
}
|
redmatterio/socialengine-console
|
src/Helper/Seed/User.php
|
PHP
|
mit
| 2,109 |
package libcentrifugo
import (
"encoding/json"
"errors"
"strings"
"testing"
"github.com/centrifugal/centrifugo/Godeps/_workspace/src/github.com/stretchr/testify/assert"
)
func TestResponse(t *testing.T) {
resp := newResponse("test")
marshalledResponse, err := json.Marshal(resp)
assert.Equal(t, nil, err)
assert.Equal(t, false, resp.Err(nil))
assert.Equal(t, true, strings.Contains(string(marshalledResponse), "\"error\":null"))
assert.Equal(t, true, strings.Contains(string(marshalledResponse), "\"body\":null"))
assert.Equal(t, true, strings.Contains(string(marshalledResponse), "\"method\":\"test\""))
assert.Equal(t, false, strings.Contains(string(marshalledResponse), "\"id\""))
resp = newResponse("test")
resp.Err(errors.New("test error"))
resp.Body = "test body"
resp.UID = "test uid"
marshalledResponse, err = json.Marshal(resp)
t.Log(string(marshalledResponse))
assert.Equal(t, true, resp.Err(nil))
// We test two times to ensure that it hasn't been reset
assert.Equal(t, true, resp.Err(nil))
assert.Equal(t, nil, err)
assert.Equal(t, true, strings.Contains(string(marshalledResponse), "\"error\":\"test error\""))
assert.Equal(t, true, strings.Contains(string(marshalledResponse), "\"body\":\"test body\""))
assert.Equal(t, true, strings.Contains(string(marshalledResponse), "\"method\":\"test\""))
assert.Equal(t, true, strings.Contains(string(marshalledResponse), "\"uid\":\"test uid\""))
}
func TestMultiResponse(t *testing.T) {
var mr multiResponse
resp1 := newResponse("test1")
resp2 := newResponse("test2")
mr = append(mr, resp1)
mr = append(mr, resp2)
marshalledResponse, err := json.Marshal(mr)
t.Log(string(marshalledResponse))
assert.Equal(t, nil, err)
assert.Equal(t, true, strings.Contains(string(marshalledResponse), "\"error\":null"))
assert.Equal(t, true, strings.Contains(string(marshalledResponse), "\"method\":\"test1\""))
assert.Equal(t, true, strings.Contains(string(marshalledResponse), "\"method\":\"test2\""))
}
|
postfix/centrifugo
|
libcentrifugo/response_test.go
|
GO
|
mit
| 1,989 |
<html>
<head>
</head>
<body>
<button id="auth-button">Log in</button>
<div id="follow-buttons"></div>
<!-- scripts -->
<script src="../../lib/cajon/cajon.js"></script>
<script src="../../config/requirejs.conf.js"></script>
<script>
require.config({
baseUrl: '../../'
});
require(['demos/follow-button/follow-button-demo']);
</script>
</body>
</html>
|
gobengo/livefyre-collection-feed
|
demos/follow-button/index.html
|
HTML
|
mit
| 410 |
module Users
class UpdateUser < Mutations::Command
include PicturesMixin
required do
string :id
model :current_user, class: 'User'
hash :attributes do
optional do
string :display_name
string :mailing_list
string :help_list
string :is_private
array :favorited_guide_ids
end
end
end
optional do
hash :user_setting do
optional do
string :location
string :years_experience
string :units
string :favorite_crop
end
end
array :pictures, class: Hash, arrayize: true
end
def validate
validate_user
validate_favorite_crop
validate_favorite_guides
validate_images pictures, current_user.user_setting
end
def execute
@user = User.find(id)
set_user_setting
set_images pictures, current_user.user_setting
set_favorited_guides
@user.update_attributes(attributes)
@user.save
@user
end
protected
def set_user_setting
if user_setting
set_favorite_crop
@user.user_setting.update_attributes(user_setting)
@user.user_setting.save
end
end
def set_favorite_crop
if @favorite_crop
@user.user_setting.favorite_crops = [@favorite_crop]
end
end
def validate_favorite_crop
if user_setting && user_setting[:favorite_crop]
# remove favorite crop from hash, causin' problems
@favorite_crop = [Crop.find(user_setting.delete('favorite_crop'))]
end
rescue Mongoid::Errors::DocumentNotFound
msg = "Could not find a crop with id #{user_setting[:favorite_crop]}"
add_error user_setting[:favorite_crop], :crop_not_found, msg
end
def validate_favorite_guides
current_guide_id = ''
unless attributes[:favorited_guide_ids].nil?
@favorited_guides = []
attributes[:favorited_guide_ids].uniq.each do |guide_id|
current_guide_id = guide_id
guide = Guide.find(guide_id)
unless @favorited_guides.include? guide
@favorited_guides.push(guide)
end
end
attributes.delete 'favorited_guide_ids'
end
rescue Mongoid::Errors::DocumentNotFound => e
# How disappointing that Mongoid::Errors:DocumentNotFound doesn't
# return a reference to the ID looked for.
msg = "There is no guide with id #{current_guide_id}"
add_error 'favorited_guide_ids', :guide_not_found, msg
end
def set_favorited_guides
if @favorited_guides
@user.favorited_guides = @favorited_guides
end
end
def validate_user
# TODO update this to use the Policy
if current_user.id.to_s != id.to_s
msg = 'You can only update your own profile'
raise OpenfarmErrors::NotAuthorized, msg
end
end
end
end
|
openfarmcc/OpenFarm
|
app/mutations/users/update_user.rb
|
Ruby
|
mit
| 2,919 |
=begin
====== RELEASE 1: PSEUDOCODE ======
INPUT: a list of names (an array)
OUTPUT: a list of names and their assigned group nubmers (a hash)
STEPS:
CREATE a process that accepts a list of names
CREATE a new list of names that includes assigned group numbers
**HOW DO I CREATE AND ASSIGN THE GROUP NUMBERS?
**HOW DO I DETERMINE THE NUMBER OF GROUPS?
**Number (INTEGER) of people in the list divided by 3 with no remainder (can't have part of a person) (we want at least three people in any group) THIS tells me how many groups to create
=> If we have ten people, we should have three groups. i.e. 10/3 = 3
**I want to assign each person a group number. Create a hash where key = name and value = group number.
RETURN OUTPUT
CREATE INPUT
INVOKE the process and pass it INPUT
=end
#====== RELEASE 2: INITIAL SOLUTION ======
list_of_people = [
"James",
"Adwoa",
"David",
"Jalal",
"Dan",
"Kevin",
"Hassan"]
def create_groups(people)
number_people = people.length
if number_people < 3
group_quantity = 1
else
group_quantity = number_people / 3
end
names_groups = people.map.with_index { |name| [name, 0] }.to_h
group_number = 1
names_groups.each do |name, group|
if group_number <= group_quantity
names_groups[name] = group_number
group_number += 1
else
names_groups[name] = 1
group_number = 2
end
end
p names_groups
end
#====== RELEASE 5: DRIVER TEST CODE ======
p create_groups(list_of_people) == {
"James"=>1,
"Adwoa"=>2,
"David"=>1,
"Jalal"=>2,
"Dan"=>1,
"Kevin"=>2,
"Hassan"=>1}
# ====== RELEASE 4: INITIAL SOLUTION REFACTORED ======
# (Rearrange the output hash so that keys are the group numbers and the values are strings of people's names. Also, clean up output.)
def create_groups(people)
number_people = people.length
if number_people < 3
group_quantity = 1
else
group_quantity = number_people / 3
end
group_number = 1
groups_names = Hash.new("")
people.each do |name|
if group_number <= group_quantity
groups_names[group_number] += (name + ", ")
group_number += 1
else
groups_names[1] += (name + ", ")
group_number = 2
end
end
groups_names.each do |group, name|
print "\n", "Group ", group, "\n"
print name, "\n"
end
end
=begin
====== RELEASE 3: ADD COMPLEXITY ======
====== RELEASE 6: REFLECTION ======
What was the most interesting and most difficult part of this challenge?
The most difficult part was deciding when to stop!
Do you feel you are improving in your ability to write pseudocode and break the problem down?
Yes. I am still struggling to figure out my style and stick to best practices.But, I think it's coming along.
Was your approach for automating this task a good solution? What could have made it even better?
I think it is a good approach. I think there are some built-in methods that would help me refactor my code. I will continue to explore those.
What data structure did you decide to store the accountability groups in and why?
I chose a hash because I had two categories of related data: unique groups and names.
What did you learn in the process of refactoring your initial solution? Did you learn any new Ruby methods?
This may seem insignificant but I learned how to add a new line character using "\n". Formatting the output so it's legible was tricky but this character helped me accomplish that task. I think there are definitely some methods that would reduce the amount of code i have written. I am still exploring those methods.
=end
|
sheamunion/phase-0
|
week-5/acct_groups.rb
|
Ruby
|
mit
| 3,605 |
namespace ParentLoadSoftDelete.Business.ERLevel
{
public partial class E07_Country_Child
{
#region OnDeserialized actions
/*/// <summary>
/// This method is called on a newly deserialized object
/// after deserialization is complete.
/// </summary>
/// <param name="context">Serialization context object.</param>
protected override void OnDeserialized(System.Runtime.Serialization.StreamingContext context)
{
base.OnDeserialized(context);
// add your custom OnDeserialized actions here.
}*/
#endregion
#region Implementation of DataPortal Hooks
//partial void OnCreate(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnDeletePre(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnDeletePost(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnFetchPre(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnFetchPost(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnFetchRead(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnUpdatePre(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnUpdatePost(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnInsertPre(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnInsertPost(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
#endregion
}
}
|
CslaGenFork/CslaGenFork
|
trunk/Samples/DeepLoad/DAL-DTO/ParentLoadSoftDelete.Business/ERLevel/E07_Country_Child.cs
|
C#
|
mit
| 2,135 |
package neuralnetworksimulator;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JPanel;
/**
* Graph plotting panel, originally made by Rodrigo, and modified by Najib Ghadri
* @author Najib Ghadri - No need for a list in constructor, and method to add new values
* @author Rodrigo - original author (see link)
* @see <a href="https://gist.github.com/roooodcastro/6325153">Very licensed code by MR.RODRIGO. ahem.</a>
*/
public class GraphPanel extends JPanel {
private int width = 800;
private int heigth = 400;
private int padding = 25;
private int labelPadding = 25;
private Color lineColor = new Color(44, 102, 230, 180);
private Color pointColor = new Color(100, 100, 100, 180);
private Color gridColor = new Color(200, 200, 200, 200);
private static final Stroke GRAPH_STROKE = new BasicStroke(2f);
private int pointWidth = 4;
private int numberYDivisions = 10;
private List<Double> scores;
/**
* Construct with value list
* @param scores
*/
public GraphPanel(List<Double> scores) {
this.scores = scores;
}
/**
* Print the graph
* @param g
*/
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
double xScale = ((double) getWidth() - (2 * padding) - labelPadding) / (scores.size() - 1);
double yScale = ((double) getHeight() - 2 * padding - labelPadding) / (getMaxScore() - getMinScore());
List<Point> graphPoints = new ArrayList<>();
for (int i = 0; i < scores.size(); i++) {
int x1 = (int) (i * xScale + padding + labelPadding);
int y1 = (int) ((getMaxScore() - scores.get(i)) * yScale + padding);
graphPoints.add(new Point(x1, y1));
}
// draw white background
g2.setColor(Color.WHITE);
g2.fillRect(padding + labelPadding, padding, getWidth() - (2 * padding) - labelPadding, getHeight() - 2 * padding - labelPadding);
g2.setColor(Color.BLACK);
// create hatch marks and grid lines for y axis.
for (int i = 0; i < numberYDivisions + 1; i++) {
int x0 = padding + labelPadding;
int x1 = pointWidth + padding + labelPadding;
int y0 = getHeight() - ((i * (getHeight() - padding * 2 - labelPadding)) / numberYDivisions + padding + labelPadding);
int y1 = y0;
if (scores.size() > 0) {
g2.setColor(gridColor);
g2.drawLine(padding + labelPadding + 1 + pointWidth, y0, getWidth() - padding, y1);
g2.setColor(Color.BLACK);
String yLabel = ((int) ((getMinScore() + (getMaxScore() - getMinScore()) * ((i * 1.0) / numberYDivisions)) * 100)) + "%";
FontMetrics metrics = g2.getFontMetrics();
int labelWidth = metrics.stringWidth(yLabel);
g2.drawString(yLabel, x0 - labelWidth - 5, y0 + (metrics.getHeight() / 2) - 3);
}
g2.drawLine(x0, y0, x1, y1);
}
// and for x axis
for (int i = 0; i < scores.size(); i++) {
if (scores.size() > 1) {
int x0 = i * (getWidth() - padding * 2 - labelPadding) / (scores.size() - 1) + padding + labelPadding;
int x1 = x0;
int y0 = getHeight() - padding - labelPadding;
int y1 = y0 - pointWidth;
if ((i % ((int) ((scores.size() / 20.0)) + 1)) == 0) {
g2.setColor(gridColor);
g2.drawLine(x0, getHeight() - padding - labelPadding - 1 - pointWidth, x1, padding);
g2.setColor(Color.BLACK);
String xLabel = i + "";
FontMetrics metrics = g2.getFontMetrics();
int labelWidth = metrics.stringWidth(xLabel);
g2.drawString(xLabel, x0 - labelWidth / 2, y0 + metrics.getHeight() + 3);
}
g2.drawLine(x0, y0, x1, y1);
}
}
// create x and y axes
g2.drawLine(padding + labelPadding, getHeight() - padding - labelPadding, padding + labelPadding, padding);
g2.drawLine(padding + labelPadding, getHeight() - padding - labelPadding, getWidth() - padding, getHeight() - padding - labelPadding);
Stroke oldStroke = g2.getStroke();
g2.setColor(lineColor);
g2.setStroke(GRAPH_STROKE);
for (int i = 0; i < graphPoints.size() - 1; i++) {
int x1 = graphPoints.get(i).x;
int y1 = graphPoints.get(i).y;
int x2 = graphPoints.get(i + 1).x;
int y2 = graphPoints.get(i + 1).y;
g2.drawLine(x1, y1, x2, y2);
}
g2.setStroke(oldStroke);
g2.setColor(pointColor);
for (int i = 0; i < graphPoints.size(); i++) {
int x = graphPoints.get(i).x - pointWidth / 2;
int y = graphPoints.get(i).y - pointWidth / 2;
int ovalW = pointWidth;
int ovalH = pointWidth;
g2.fillOval(x, y, ovalW, ovalH);
}
}
public double getMinScore() {
double minScore = Double.MAX_VALUE;
for (Double score : scores) {
minScore = Math.min(minScore, score);
}
return minScore;
}
public double getMaxScore() {
double maxScore = Double.MIN_VALUE;
for (Double score : scores) {
maxScore = Math.max(maxScore, score);
}
return maxScore;
}
/**
* Set the value list
* @param scores
*/
public void setScores(List<Double> scores) {
this.scores = scores;
invalidate();
this.repaint();
}
public List<Double> getScores() {
return scores;
}
/**
* Add new value on the x axis and plot
* @param value
*/
public void addScore(double value){
scores.add(value);
invalidate();
this.repaint();
}
}
|
najibghadri/NeuralNetworkSimulator
|
src/neuralnetworksimulator/GraphPanel.java
|
Java
|
mit
| 6,332 |
package com.coinbase.exchange.websocketfeed;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class ErrorOrderBookMessageTest {
ObjectMapper objectMapper = new ObjectMapper();
@Test
void shouldDeserialiseAllFieldsForErrorOrderBookMessage() throws JsonProcessingException {
String json = "{ \"type\": \"error\", \"message\": \"error message\" }";
ErrorOrderBookMessage errorMessage = objectMapper.readValue(json, ErrorOrderBookMessage.class);
assertEquals("error", errorMessage.getType());
assertEquals("error message", errorMessage.getMessage());
}
}
|
irufus/coinbase-exchange-java
|
websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/ErrorOrderBookMessageTest.java
|
Java
|
mit
| 767 |
describe LinuxAdmin::Rhn do
context "#registered?" do
it "with registered system_id" do
allow_any_instance_of(described_class).to receive_messages(:systemid_file => data_file_path("rhn/systemid"))
expect(described_class.new).to be_registered
end
it "with unregistered system_id" do
allow_any_instance_of(described_class).to receive_messages(:systemid_file => data_file_path("rhn/systemid.missing_system_id"))
expect(described_class.new).to_not be_registered
end
it "with missing systemid file" do
allow_any_instance_of(described_class).to receive_messages(:systemid_file => data_file_path("rhn/systemid.missing_file"))
expect(described_class.new).to_not be_registered
end
end
context "#register" do
it "no username or activation key" do
expect { described_class.new.register({}) }.to raise_error(ArgumentError)
end
context "with username and password" do
let(:base_options) { {:username => "[email protected]",
:password => "SomePass",
:org => "2",
:proxy_address => "1.2.3.4",
:proxy_username => "ProxyUser",
:proxy_password => "ProxyPass",
:server_cert => "/path/to/cert",
}
}
let(:run_params) { {:params=>{"--username="=>"[email protected]", "--password="=>"SomePass", "--proxy="=>"1.2.3.4", "--proxyUser="=>"ProxyUser", "--proxyPassword="=>"ProxyPass"}} }
it "with server_url" do
run_params.store_path(:params, "--systemorgid=", "2")
run_params.store_path(:params, "--serverUrl=", "https://server.url")
run_params.store_path(:params, "--sslCACert=", "/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT")
base_options.store_path(:server_url, "https://server.url")
expect(LinuxAdmin::Common).to receive(:run!).once.with("rhnreg_ks", run_params)
expect(LinuxAdmin::Rpm).to receive(:upgrade).with("http://server.url/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm")
expect(LinuxAdmin::Rpm).to receive(:list_installed).and_return({"rhn-org-trusted-ssl-cert" => "1.0"})
described_class.new.register(base_options)
end
it "without server_url" do
expect(LinuxAdmin::Common).to receive(:run!).once.with("rhnreg_ks", run_params)
expect_any_instance_of(described_class).not_to receive(:install_server_certificate)
expect(LinuxAdmin::Rpm).to receive(:list_installed).and_return({"rhn-org-trusted-ssl-cert" => nil})
described_class.new.register(base_options)
end
end
it "with activation key" do
expect(LinuxAdmin::Common).to receive(:run!).once.with("rhnreg_ks",
:params => {"--activationkey=" => "123abc",
"--proxy=" => "1.2.3.4",
"--proxyUser=" => "ProxyUser",
"--proxyPassword=" => "ProxyPass"})
expect(LinuxAdmin::Rpm).to receive(:list_installed).and_return({"rhn-org-trusted-ssl-cert" => nil})
described_class.new.register(
:activationkey => "123abc",
:proxy_address => "1.2.3.4",
:proxy_username => "ProxyUser",
:proxy_password => "ProxyPass",
)
end
end
it "#enable_channel" do
expect(LinuxAdmin::Common).to receive(:run!).once.with("rhn-channel -a",
:params => {"--user=" => "SomeUser",
"--password=" => "SomePass",
"--channel=" => 123})
described_class.new.enable_channel(123, :username => "SomeUser", :password => "SomePass")
end
it "#enabled_channels" do
expect(LinuxAdmin::Common).to receive(:run!).once.with("rhn-channel -l")
.and_return(double(:output => sample_output("rhn/output_rhn-channel_list")))
expect(described_class.new.enabled_channels).to eq(["rhel-x86_64-server-6", "rhel-x86_64-server-6-cf-me-2"])
end
it "#disable_channel" do
expect(LinuxAdmin::Common).to receive(:run!).once.with("rhn-channel -r", :params => {"--user=" => "SomeUser",
"--password=" => "SomePass",
"--channel=" => 123})
described_class.new.disable_channel(123, :username => "SomeUser", :password => "SomePass")
end
it "#available_channels" do
credentials = {
:username => "some_user",
:password => "password"
}
expected = [
"rhel-x86_64-server-6-cf-me-2",
"rhel-x86_64-server-6-cf-me-2-beta",
"rhel-x86_64-server-6-cf-me-3",
"rhel-x86_64-server-6-cf-me-3-beta"
]
cmd = "rhn-channel -L"
params = {
:params => {
"--user=" => "some_user",
"--password=" => "password"
}
}
expect(LinuxAdmin::Common).to receive(:run!).once.with(cmd, params)
.and_return(double(:output => sample_output("rhn/output_rhn-channel_list_available")))
expect(described_class.new.available_channels(credentials)).to eq(expected)
end
it "#all_repos" do
credentials = {
:username => "some_user",
:password => "password"
}
expected = [
{:repo_id => "rhel-x86_64-server-6-cf-me-2", :enabled => true},
{:repo_id => "rhel-x86_64-server-6-cf-me-2-beta", :enabled => false},
{:repo_id => "rhel-x86_64-server-6-cf-me-3", :enabled => false},
{:repo_id => "rhel-x86_64-server-6-cf-me-3-beta", :enabled => false},
{:repo_id => "rhel-x86_64-server-6", :enabled => true}
]
expect(LinuxAdmin::Common).to receive(:run!).once
.and_return(double(:output => sample_output("rhn/output_rhn-channel_list_available")))
expect(LinuxAdmin::Common).to receive(:run!).once.with("rhn-channel -l")
.and_return(double(:output => sample_output("rhn/output_rhn-channel_list")))
expect(described_class.new.all_repos(credentials)).to eq(expected)
end
end
|
kbrock/linux_admin
|
spec/rhn_spec.rb
|
Ruby
|
mit
| 6,492 |
// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// common test code for type-traits tests
// WARNING: contains code as well as declarations!
#ifndef BOOST_TYPE_TRAITS_TEST_HPP
#define BOOST_TYPE_TRAITS_TEST_HPP
#include <iostream>
#include <typeinfo>
#include <boost/config.hpp>
#include <boost/utility.hpp>
#include <boost/type_traits/alignment_traits.hpp>
//
// define tests here
unsigned failures = 0;
unsigned test_count = 0;
//
// This must get defined within the test file.
// All compilers have bugs, set this to the number of
// regressions *expected* from a given compiler,
// if there are no workarounds for the bugs, *and*
// the regressions have been investigated.
//
extern unsigned int expected_failures;
//
// proc check_result()
// Checks that there were no regressions:
//
int check_result(int argc, char** argv)
{
std::cout << test_count << " tests completed, "
<< failures << " failures found, "
<< expected_failures << " failures expected from this compiler." << std::endl;
if((argc == 2)
&& (argv[1][0] == '-')
&& (argv[1][1] == 'a')
&& (argv[1][2] == 0))
{
std::cout << "Press any key to continue...";
std::cin.get();
}
return (failures == expected_failures)
? 0
: (failures != 0) ? static_cast<int>(failures) : -1;
}
//
// this one is to verify that a constant is indeed a
// constant-integral-expression:
//
// HP aCC cannot deal with missing names for template value parameters
template <bool b>
struct checker
{
static void check(bool, bool, const char*, bool){ ++test_count; }
};
template <>
struct checker<false>
{
static void check(bool o, bool n, const char* name, bool soft)
{
++test_count;
++failures;
// if this is a soft test, then failure is expected,
// or may depend upon factors outside our control
// (like compiler options)...
if(soft)++expected_failures;
std::cout << "checking value of " << name << "...failed" << std::endl;
std::cout << "\tfound: " << n << " expected " << o << std::endl;
}
};
template <class T>
struct typify{};
template <class T, class U>
struct type_checker
{
static void check(const char* TT, const char*, const char* expression)
{
++test_count;
if(typeid(typify<T>) != typeid(typify<U>))
{
++failures;
std::cout << "checking type of " << expression << "...failed" << std::endl;
std::cout << " evaluating: type_checker<" << TT << "," << expression << ">" << std::endl;
std::cout << " expected: type_checker<" << TT << "," << TT << ">" << std::endl;
std::cout << " but got: " << typeid(type_checker<T,U>).name() << std::endl;
}
}
};
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T>
struct type_checker<T,T>
{
static void check(const char*, const char*, const char*)
{
++test_count;
}
};
#endif
#define value_test(v, x) checker<(v == x)>::check(v, x, #x, false);
#define soft_value_test(v, x) checker<(v == x)>::check(v, x, #x, true);
#define value_fail(v, x) \
++test_count; \
++failures; \
++expected_failures;\
std::cout << "checking value of " << #x << "...failed" << std::endl; \
std::cout << " " #x " does not compile on this compiler" << std::endl;
#define type_test(v, x) type_checker<v,x>::check(#v, #x, #x);
#define type_test3(v, x, z) type_checker<v,x,z>::check(#v, #x "," #z, #x "," #z);
#ifndef SHORT_TRANSFORM_TEST
#define transform_check(name, from_suffix, to_suffix)\
type_test(bool to_suffix, name<bool from_suffix>::type);\
type_test(char to_suffix, name<char from_suffix>::type);\
type_test(wchar_t to_suffix, name<wchar_t from_suffix>::type);\
type_test(signed char to_suffix, name<signed char from_suffix>::type);\
type_test(unsigned char to_suffix, name<unsigned char from_suffix>::type);\
type_test(short to_suffix, name<short from_suffix>::type);\
type_test(unsigned short to_suffix, name<unsigned short from_suffix>::type);\
type_test(int to_suffix, name<int from_suffix>::type);\
type_test(unsigned int to_suffix, name<unsigned int from_suffix>::type);\
type_test(long to_suffix, name<long from_suffix>::type);\
type_test(unsigned long to_suffix, name<unsigned long from_suffix>::type);\
type_test(float to_suffix, name<float from_suffix>::type);\
type_test(long double to_suffix, name<long double from_suffix>::type);\
type_test(double to_suffix, name<double from_suffix>::type);\
type_test(UDT to_suffix, name<UDT from_suffix>::type);\
type_test(enum1 to_suffix, name<enum1 from_suffix>::type);
#else
#define transform_check(name, from_suffix, to_suffix)\
type_test(int to_suffix, name<int from_suffix>::type);\
type_test(UDT to_suffix, name<UDT from_suffix>::type);\
type_test(enum1 to_suffix, name<enum1 from_suffix>::type);
#endif
#define boost_dummy_macro_param
template <class T>
struct test_align
{
struct padded
{
char c;
T t;
};
static void do_it()
{
padded p;
unsigned a = reinterpret_cast<char*>(&(p.t)) - reinterpret_cast<char*>(&p);
++test_count;
// only fail if we do not have a multiple of the actual value:
if((a > ::boost::alignment_of<T>::value) || (a % ::boost::alignment_of<T>::value))
{
++failures;
std::cout << "checking value of " << typeid(boost::alignment_of<T>).name() << "...failed" << std::endl;
std::cout << "\tfound: " << boost::alignment_of<T>::value << " expected " << a << std::endl;
}
// suppress warnings about unused variables:
(void)p;
(void)a;
}
};
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T>
struct test_align<T&>
{
static void do_it()
{
//
// we can't do the usual test because we can't take the address
// of a reference, so check that the result is the same as for a
// pointer type instead:
unsigned a = boost::alignment_of<T*>::value;
++test_count;
if(a != boost::alignment_of<T&>::value)
{
++failures;
std::cout << "checking value of " << typeid(boost::alignment_of<T&>).name() << "...failed" << std::endl;
std::cout << "\tfound: " << boost::alignment_of<T&>::value << " expected " << a << std::endl;
}
}
};
#endif
#define align_test(T) test_align<T>::do_it()
template<class T>
struct test_type_with_align
{
typedef typename boost::type_with_alignment<
(boost::alignment_of<T>::value)>::type
align_t;
static void do_it()
{
int align = boost::alignment_of<T>::value;
int new_align = boost::alignment_of<align_t>::value;
++test_count;
if (new_align % align != 0) {
++failures;
std::cerr << "checking for an object with same alignment as "
<< typeid(T).name() << "...failed" << std::endl;
std::cerr << "\tfound: " << typeid(align_t).name() << std::endl;
}
}
};
#define type_with_align_test(T) test_type_with_align<T>::do_it()
//
// the following code allows us to test that a particular
// template functions correctly when instanciated inside another template
// (some bugs only show up in that situation). For each template
// we declare one NESTED_DECL(classname) that sets up the template class
// and multiple NESTED_TEST(classname, template-arg) declarations, to carry
// the actual tests:
template <bool b>
struct nested_test
{
typedef nested_test type;
bool run_time_value;
const char* what;
nested_test(bool b2, const char* w) : run_time_value(b2), what(w) { check(); }
void check()
{
++test_count;
if(b != run_time_value)
{
++failures;
std::cerr << "Mismatch between runtime and compile time values in " << what << std::endl;
}
}
};
#ifndef __SUNPRO_CC
#define NESTED_DECL(what)\
template <class T> \
struct BOOST_TT_JOIN(nested_tester_,what){\
nested_test< (::boost::type_traits::ice_ne<0, ::boost::what<T>::value>::value)> tester;\
BOOST_TT_JOIN(nested_tester_,what)(const char* s) : tester(::boost::what<T>::value, s){}\
};
#define NESTED_TEST(what, with)\
{BOOST_TT_JOIN(nested_tester_,what)<with> check(#what "<" #with ">"); (void)check;}
#else
#define NESTED_DECL(what)
#define NESTED_TEST(what, with)
#endif
#define BOOST_TT_JOIN( X, Y ) BOOST_DO_TT_JOIN( X, Y )
#define BOOST_DO_TT_JOIN( X, Y ) X##Y
//
// define some types to test with:
//
enum enum_UDT{ one, two, three };
struct UDT
{
UDT(){};
~UDT(){};
UDT(const UDT&);
UDT& operator=(const UDT&);
int i;
void f1();
int f2();
int f3(int);
int f4(int, float);
};
typedef void(*f1)();
typedef int(*f2)(int);
typedef int(*f3)(int, bool);
typedef void (UDT::*mf1)();
typedef int (UDT::*mf2)();
typedef int (UDT::*mf3)(int);
typedef int (UDT::*mf4)(int, float);
typedef int (UDT::*mp);
typedef int (UDT::*cmf)(int) const;
// cv-qualifiers applied to reference types should have no effect
// declare these here for later use with is_reference and remove_reference:
# ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4181)
# elif defined(__ICL)
# pragma warning(push)
# pragma warning(disable: 21)
# endif
//
// This is intentional:
// r_type and cr_type should be the same type
// but some compilers wrongly apply cv-qualifiers
// to reference types (this may generate a warning
// on some compilers):
//
typedef int& r_type;
typedef const r_type cr_type;
# ifdef BOOST_MSVC
# pragma warning(pop)
# elif defined(__ICL)
# pragma warning(pop)
# pragma warning(disable: 985) // identifier truncated in debug information
# endif
struct POD_UDT { int x; };
struct empty_UDT
{
~empty_UDT(){};
empty_UDT& operator=(const empty_UDT&){ return *this; }
bool operator==(const empty_UDT&)const
{ return true; }
};
struct empty_POD_UDT
{
empty_POD_UDT& operator=(const empty_POD_UDT&){ return *this; }
bool operator==(const empty_POD_UDT&)const
{ return true; }
};
union union_UDT
{
int x;
double y;
~union_UDT();
};
union POD_union_UDT
{
int x;
double y;
};
union empty_union_UDT
{
~empty_union_UDT();
};
union empty_POD_union_UDT{};
class Base { };
class Derived : public Base { };
class NonDerived { };
enum enum1
{
one_,two_
};
enum enum2
{
three_,four_
};
struct VB
{
virtual ~VB(){};
};
struct VD : VB
{
~VD(){};
};
//
// struct non_pointer:
// used to verify that is_pointer does not return
// true for class types that implement operator void*()
//
struct non_pointer
{
operator void*(){return this;}
};
struct non_int_pointer
{
int i;
operator int*(){return &i;}
};
struct int_constructible
{
int_constructible(int);
};
struct int_convertible
{
operator int();
};
//
// struct non_empty:
// used to verify that is_empty does not emit
// spurious warnings or errors.
//
struct non_empty : private boost::noncopyable
{
int i;
};
//
// abstract base classes:
struct test_abc1
{
virtual void foo() = 0;
virtual void foo2() = 0;
};
struct test_abc2
{
virtual void foo() = 0;
virtual void foo2() = 0;
};
struct incomplete_type;
#endif // BOOST_TYPE_TRAITS_TEST_HPP
|
Ezeer/VegaStrike_win32FR
|
vegastrike/boost/1_28/boost/type_traits/type_traits_test.hpp
|
C++
|
mit
| 11,432 |
/*
*
* Login constants
*
*/
export const LOGIN = 'server/EMPLOYEE_LOGIN';
export const SUCCESS = 'app/Login/EMPLOYEE_LOGIN_SUCCESS';
export const ERROR = 'app/Login/EMPLOYEE_LOGIN_ERROR';
|
seanng/web-server
|
app/containers/Login/constants.js
|
JavaScript
|
mit
| 193 |
/**
* Copyright (C) 2010-14 diirt developers. See COPYRIGHT.TXT
* All rights reserved. Use is subject to license terms. See LICENSE.TXT
*/
package org.diirt.datasource.expression;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.diirt.datasource.PVDirector;
import org.diirt.datasource.QueueCollector;
import org.diirt.datasource.ReadRecipeBuilder;
/**
* A read expression for a key/value map.
* <p>
* This expression returns a map where the key is the name of the child
* expression and the value is the value returned by the child expression.
* The map is dynamic: the child expressions can be added and removed
* while the reader is active.
* <p>
* There is currently no way to retrieve the individual errors for each
* element of the map. If the value is a VType, the connection can be
* retrieved by looking at the alarm.
*
* @param <T> the type for the values in the map
* @author carcassi
*/
public class ReadMap<T> extends DesiredRateExpressionImpl<Map<String, T>> {
private final Object lock = new Object();
private final Map<String, DesiredRateExpression<T>> expressions = new HashMap<>();
private PVDirector<?> director;
/**
* Creates a new group.
*/
public ReadMap() {
super(new DesiredRateExpressionListImpl<Object>(), new MapOfReadFunction<T>(new QueueCollector<MapUpdate<T>>(1000)), "map");
}
MapOfReadFunction<T> getMapOfFunction() {
return (MapOfReadFunction<T>) getFunction();
}
/**
* Removes all the expressions currently in the map.
*
* @return this expression
*/
public ReadMap<T> clear() {
synchronized(lock) {
getMapOfFunction().getMapUpdateCollector().writeValue(MapUpdate.<T>clear());
if (director != null) {
for (DesiredRateExpression<T> desiredRateExpression : expressions.values()) {
director.disconnectReadExpression(desiredRateExpression);
}
}
expressions.clear();
return this;
}
}
/**
* Returns the number of expressions in the group.
*
* @return number of expressions in the group
*/
public int size() {
synchronized(lock) {
return expressions.size();
}
}
/**
* Adds the expression to the map.
*
* @param expression the expression to be added
* @return this expression
*/
public ReadMap<T> add(DesiredRateExpression<T> expression) {
synchronized(lock) {
if (expression.getName() == null) {
throw new NullPointerException("Expression has a null name");
}
if (expressions.containsKey(expression.getName())) {
throw new IllegalArgumentException("MapExpression already contain an expression named '" + expression.getName() + "'");
}
getMapOfFunction().getMapUpdateCollector().writeValue(MapUpdate.addReadFunction(expression.getName(), expression.getFunction()));
expressions.put(expression.getName(), expression);
if (director != null) {
director.connectReadExpression(expression);
}
return this;
}
}
/**
* Adds the expressions to the map.
*
* @param expressions the new list of expressions
* @return this expression
*/
public ReadMap<T> add(DesiredRateExpressionList<T> expressions) {
synchronized(lock) {
for (DesiredRateExpression<T> desiredRateExpression : expressions.getDesiredRateExpressions()) {
add(desiredRateExpression);
}
return this;
}
}
/**
* Removes the expression with the given name.
*
* @param name the name of the expression to remove
* @return this expression
*/
public ReadMap<T> remove(String name) {
synchronized(lock) {
if (!expressions.containsKey(name)) {
throw new IllegalArgumentException("MapExpression does not contain an expression named '" + name + "'");
}
getMapOfFunction().getMapUpdateCollector().writeValue(MapUpdate.<T>removeFunction(name));
DesiredRateExpression<T> expression = expressions.remove(name);
if (director != null) {
director.disconnectReadExpression(expression);
}
return this;
}
}
/**
* Removes the expressions from the map.
*
* @param names the names of the expressions to remove
* @return this expression
*/
public ReadMap<T> remove(Collection<String> names) {
synchronized(lock) {
for (String name : names) {
remove(name);
}
return this;
}
}
@Override
@SuppressWarnings("unchecked")
public void fillReadRecipe(PVDirector director, ReadRecipeBuilder builder) {
synchronized(lock) {
this.director = director;
for (Map.Entry<String, DesiredRateExpression<T>> entry : expressions.entrySet()) {
DesiredRateExpression<T> readExpression = entry.getValue();
director.connectReadExpression(readExpression);
}
}
}
}
|
richardfearn/diirt
|
pvmanager/pvmanager-core/src/main/java/org/diirt/datasource/expression/ReadMap.java
|
Java
|
mit
| 5,366 |
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweล Jฤdrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Core\Promotion\Checker\Rule;
use Sylius\Component\Addressing\Model\CountryInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Promotion\Checker\Rule\RuleCheckerInterface;
use Sylius\Component\Promotion\Exception\UnsupportedTypeException;
use Sylius\Component\Promotion\Model\PromotionSubjectInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @author Saลกa Stamenkoviฤ <[email protected]>
*/
final class ShippingCountryRuleChecker implements RuleCheckerInterface
{
public const TYPE = 'shipping_country';
/**
* @var RepositoryInterface
*/
private $countryRepository;
/**
* @param RepositoryInterface $countryRepository
*/
public function __construct(RepositoryInterface $countryRepository)
{
$this->countryRepository = $countryRepository;
}
/**
* {@inheritdoc}
*/
public function isEligible(PromotionSubjectInterface $subject, array $configuration)
{
if (!$subject instanceof OrderInterface) {
throw new UnsupportedTypeException($subject, OrderInterface::class);
}
if (null === $address = $subject->getShippingAddress()) {
return false;
}
$country = $this->countryRepository->findOneBy(['code' => $address->getCountryCode()]);
if (!$country instanceof CountryInterface) {
return false;
}
return $country->getCode() === $configuration['country'];
}
}
|
psren/Sylius
|
src/Sylius/Component/Core/Promotion/Checker/Rule/ShippingCountryRuleChecker.php
|
PHP
|
mit
| 1,773 |
# Copyright (c) Mochi Media, Inc.
# Copyright (c) Ralph Meijer.
# See LICENSE for details.
"""
Asynchronous Scribe client support.
This provides a Twisted based Scribe client with an asynchronous interface for
sending logs and a consumer for L{udplog.twisted.DispatcherFromUDPLogProtocol}.
"""
from __future__ import division, absolute_import
import copy
import logging
import simplejson
from twisted.internet import defer
from twisted.internet import protocol
from twisted.python import log
from scribe import scribe
from thrift.Thrift import TApplicationException, TMessageType
from thrift.protocol import TBinaryProtocol
from thrift.transport import TTwisted
class AsyncScribeClient(scribe.Client):
"""
Asynchronous Scribe client.
This derives from L{scribe.Client} to work with the Twisted Thrift
transport and provide an asynchronous interface for L{Log}.
@ivar _reqs: List of pending requests. When a result comes in, the
associated deferred will be fired. If the connection is closed,
the deferreds of the pending requests will be fired with an exception.
"""
def __init__(self, transport, factory):
"""
Set up a scribe client.
@param transport: The transport of the connection to the Scribe
server.
@param factory: The protocol factory of the Thrift transport
protocol.
"""
scribe.Client.__init__(self, factory.getProtocol(transport))
self._reqs = {}
def Log(self, messages):
"""
Log messages.
@param messages: The messages to be sent.
@type messages: C{list} of L{scribe.LogEntry}.
@return: L{Deferred<twisted.internet.defer.Deferred>}.
"""
d = defer.Deferred()
self._reqs[self._seqid] = d
self.send_Log(messages)
return d
def send_Log(self, messages):
"""
Called to send log messages.
"""
scribe.Client.send_Log(self, messages)
self._seqid += 1
def recv_Log(self, iprot, mtype, rseqid):
"""
Called when the result of the log request was received.
"""
if mtype == TMessageType.EXCEPTION:
result = TApplicationException()
else:
result = scribe.Log_result()
result.read(iprot)
iprot.readMessageEnd()
try:
d = self._reqs.pop(rseqid)
except KeyError:
log.err(result, "Unexpected log result")
if isinstance(result, Exception):
d.errback(result)
elif result.success is not None:
d.callback(result.success)
else:
d.errback(TApplicationException(
TApplicationException.MISSING_RESULT,
'Log failed: unknown result'))
class ScribeProtocol(TTwisted.ThriftClientProtocol):
"""
Scribe protocol.
This connects an asynchronous Scribe client to a server and sends
out log events from C{dispatcher}.
"""
def __init__(self, dispatcher, minLogLevel=logging.INFO):
self.dispatcher = dispatcher
self.minLogLevel = minLogLevel
factory = TBinaryProtocol.TBinaryProtocolFactory(strictRead=False,
strictWrite=False)
TTwisted.ThriftClientProtocol.__init__(self, AsyncScribeClient,
factory)
def connectionMade(self):
"""
Add this protocol as a consumer of log events.
"""
TTwisted.ThriftClientProtocol.connectionMade(self)
self.dispatcher.register(self.sendEvent)
def connectionLost(self, reason=protocol.connectionDone):
"""
Remove this protocol as a consumer of log events.
"""
self.dispatcher.unregister(self.sendEvent)
TTwisted.ThriftClientProtocol.connectionLost(self, reason)
def sendEvent(self, event):
"""
Write an event to Scribe.
"""
event = copy.copy(event)
# Drop events with a log level lower than the configured minimum.
logLevel = logging.getLevelName(event.get('logLevel', 'INFO'))
if logLevel < self.minLogLevel:
return
category = event['category']
del event['category']
try:
message = simplejson.dumps(event)
except ValueError, e:
log.err(e, "Could not encode event to JSON")
return
entry = scribe.LogEntry(category=category, message=message)
d = self.client.Log(messages=[entry])
d.addErrback(log.err)
|
ralphm/udplog
|
udplog/scribe.py
|
Python
|
mit
| 4,622 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#style_dlg.title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/editable_selects.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="js/props.js"></script>
<link href="css/props.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body id="styleprops" style="display: none" role="application" aria-labelledby="app_title">
<span id="app_title" style="display:none">{#style_dlg.title}</span>
<form onsubmit="updateAction();return false;" action="#" />
<div class="tabs">
<ul>
<li id="text_tab" class="current" aria-controls="text_panel"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onmousedown="return false;">{#style_dlg.text_tab}</a></span></li>
<li id="background_tab" aria-controls="background_panel"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onmousedown="return false;">{#style_dlg.background_tab}</a></span></li>
<li id="block_tab" aria-controls="block_panel"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onmousedown="return false;">{#style_dlg.block_tab}</a></span></li>
<li id="box_tab" aria-controls="box_panel"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onmousedown="return false;">{#style_dlg.box_tab}</a></span></li>
<li id="border_tab" aria-controls="border_panel"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onmousedown="return false;">{#style_dlg.border_tab}</a></span></li>
<li id="list_tab" aria-controls="list_panel"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onmousedown="return false;">{#style_dlg.list_tab}</a></span></li>
<li id="positioning_tab" aria-controls="positioning_panel"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onmousedown="return false;">{#style_dlg.positioning_tab}</a></span></li>
</ul>
</div>
<div class="panel_wrapper">
<div id="text_panel" class="panel current">
<fieldset>
<legend>{#style_dlg.text}</legend>
<table role="presentation" border="0" width="100%">
<tr>
<td><label for="text_font">{#style_dlg.text_font}</label></td>
<td colspan="3">
<select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select>
</td>
</tr>
<tr>
<td><label for="text_size">{#style_dlg.text_size}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
<td> </td>
<td>
<label id="text_size_measurement_label" for="text_size_measurement" style="display: none; visibility: hidden;">Text Size Measurement Unit</label>
<select id="text_size_measurement" name="text_size_measurement" aria-labelledby="text_size_measurement_label"></select>
</td>
</tr>
</table>
</td>
<td><label for="text_weight">{#style_dlg.text_weight}</label></td>
<td>
<select id="text_weight" name="text_weight"></select>
</td>
</tr>
<tr>
<td><label for="text_style">{#style_dlg.text_style}</label></td>
<td>
<select id="text_style" name="text_style" class="mceEditableSelect"></select>
</td>
<td><label for="text_variant">{#style_dlg.text_variant}</label></td>
<td>
<select id="text_variant" name="text_variant"></select>
</td>
</tr>
<tr>
<td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
</td>
<td> </td>
<td>
<label id="text_lineheight_measurement_label" for="text_lineheight_measurement" style="display: none; visibility: hidden;">Line Height Measurement Unit</label>
<select id="text_lineheight_measurement" name="text_lineheight_measurement" aria-labelledby="text_lineheight_measurement_label"></select>
</td>
</tr>
</table>
</td>
<td><label for="text_case">{#style_dlg.text_case}</label></td>
<td>
<select id="text_case" name="text_case"></select>
</td>
</tr>
<tr>
<td><label for="text_color">{#style_dlg.text_color}</label></td>
<td colspan="2">
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input id="text_color" name="text_color" type="text" value="" size="9" onchange="updateColor('text_color_pick','text_color');" /></td>
<td id="text_color_pickcontainer"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
<td colspan="2">
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
<td><label for="text_underline">{#style_dlg.text_underline}</label></td>
</tr>
<tr>
<td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
<td><label for="text_overline">{#style_dlg.text_overline}</label></td>
</tr>
<tr>
<td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
<td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
</tr>
<tr>
<td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
<td><label for="text_blink">{#style_dlg.text_blink}</label></td>
</tr>
<tr>
<td><input id="text_none" name="text_none" class="checkbox" type="checkbox" onclick="updateTextDecorations();" /></td>
<td><label for="text_none">{#style_dlg.text_none}</label></td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div>
<div id="background_panel" class="panel">
<fieldset>
<legend>{#style_dlg.background}</legend>
<table role="presentation" border="0">
<tr>
<td><label for="background_color">{#style_dlg.background_color}</label></td>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input id="background_color" name="background_color" type="text" value="" size="9" onchange="updateColor('background_color_pick','background_color');" /></td>
<td id="background_color_pickcontainer"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="background_image">{#style_dlg.background_image}</label></td>
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="background_image" name="background_image" type="text" /></td>
<td id="background_image_browser"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
<td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
</tr>
<tr>
<td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
<td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
</tr>
<tr>
<td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
<td> </td>
<td>
<label id="background_hpos_measurement_label" for="background_hpos_measurement" style="display: none; visibility: hidden;">Horizontal position measurement unit</label>
<select id="background_hpos_measurement" name="background_hpos_measurement" aria-labelledby="background_hpos_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
<td> </td>
<td>
<label id="background_vpos_measurement_label" for="background_vpos_measurement" style="display: none; visibility: hidden;">Vertical position measurement unit</label>
<select id="background_vpos_measurement" name="background_vpos_measurement" aria-labelledby="background_vpos_measurement_label">></select></td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div>
<div id="block_panel" class="panel">
<fieldset>
<legend>{#style_dlg.block}</legend>
<table role="presentation" border="0">
<tr>
<td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
<td> </td>
<td>
<label id="block_wordspacing_measurement_label" for="block_wordspacing_measurement" style="display: none; visibility: hidden;">Word spacing measurement unit</label>
<select id="block_wordspacing_measurement" name="block_wordspacing_measurement" aria-labelledby="block_wordspacing_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
<td> </td>
<td>
<label id="block_letterspacing_measurement_label" for="block_letterspacing_measurement" style="display: none; visibility: hidden;">Letter spacing measurement unit</label>
<select id="block_letterspacing_measurement" name="block_letterspacing_measurement" aria-labelledby="block_letterspacing_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
<td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
</tr>
<tr>
<td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
<td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
</tr>
<tr>
<td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
<td> </td>
<td>
<label id="block_text_indent_measurement_label" for="block_text_indent_measurement" style="display: none; visibility: hidden;">Text Indent Measurement Unit</label>
<select id="block_text_indent_measurement" name="block_text_indent_measurement" aria-labelledby="block_text_indent_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
<td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
</tr>
<tr>
<td><label for="block_display">{#style_dlg.block_display}</label></td>
<td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
</tr>
</table>
</fieldset>
</div>
<div id="box_panel" class="panel">
<fieldset>
<legend>{#style_dlg.box}</legend>
<table role="presentation" border="0">
<tr>
<td><label for="box_width">{#style_dlg.box_width}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onchange="synch('box_width','positioning_width');" /></td>
<td> </td>
<td>
<label id="box_width_measurement_label" for="box_width_measurement" style="display: none; visibility: hidden;">Box Width Measurement Unit</label>
<select id="box_width_measurement" name="box_width_measurement" aria-labelledby="box_width_measurement_label"></select>
</td>
</tr>
</table>
</td>
<td> <label for="box_float">{#style_dlg.box_float}</label></td>
<td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
</tr>
<tr>
<td><label for="box_height">{#style_dlg.box_height}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onchange="synch('box_height','positioning_height');" /></td>
<td> </td>
<td>
<label id="box_height_measurement_label" for="box_height_measurement" style="display: none; visibility: hidden;">Box Height Measurement Unit</label>
<select id="box_height_measurement" name="box_height_measurement" aria-labelledby="box_height_measurement_label"></select>
</td>
</tr>
</table>
</td>
<td> <label for="box_clear">{#style_dlg.box_clear}</label></td>
<td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
</tr>
</table>
</fieldset>
<div style="float: left; width: 49%">
<fieldset>
<legend>{#style_dlg.padding}</legend>
<table role="presentation" border="0">
<tr>
<td> </td>
<td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onclick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
</tr>
<tr>
<td><label for="box_padding_top">{#style_dlg.top}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
<td> </td>
<td>
<label id="box_padding_top_measurement_label" for="box_padding_top_measurement" style="display: none; visibility: hidden;">Padding Top Measurement Unit</label>
<select id="box_padding_top_measurement" name="box_padding_top_measurement" aria-labelledby="box_padding_top_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="box_padding_right">{#style_dlg.right}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
<td> </td>
<td>
<label id="box_padding_right_measurement_label" for="box_padding_right_measurement" style="display: none; visibility: hidden;">Padding Right Measurement Unit</label>
<select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled" aria-labelledby="box_padding_right_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
<td> </td>
<td>
<label id="box_padding_bottom_measurement_label" for="box_padding_bottom_measurement" style="display: none; visibility: hidden;">Padding Bottom Measurement Unit</label>
<select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled" aria-labelledby="box_padding_bottom_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="box_padding_left">{#style_dlg.left}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
<td> </td>
<td>
<label id="box_padding_left_measurement_label" for="box_padding_left_measurement" style="display: none; visibility: hidden;">Padding Left Measurement Unit</label>
<select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled" aria-labelledby="box_padding_left_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div>
<div style="float: right; width: 49%">
<fieldset>
<legend>{#style_dlg.margin}</legend>
<table role="presentation" border="0">
<tr>
<td> </td>
<td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onclick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
</tr>
<tr>
<td><label for="box_margin_top">{#style_dlg.top}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
<td> </td>
<td>
<label id="box_margin_top_measurement_label" for="box_margin_top_measurement" style="display: none; visibility: hidden;">Margin Top Measurement Unit</label>
<select id="box_margin_top_measurement" name="box_margin_top_measurement" aria-labelledby="box_margin_top_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="box_margin_right">{#style_dlg.right}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
<td> </td>
<td>
<label id="box_margin_right_measurement_label" for="box_margin_right_measurement" style="display: none; visibility: hidden;">Margin Right Measurement Unit</label>
<select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled" aria-labelledby="box_margin_right_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
<td> </td>
<td>
<label id="box_margin_bottom_measurement_label" for="box_margin_bottom_measurement" style="display: none; visibility: hidden;">Margin Bottom Measurement Unit</label>
<select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled" aria-labelledby="box_margin_bottom_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="box_margin_left">{#style_dlg.left}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
<td> </td>
<td>
<label id="box_margin_left_measurement_label" for="box_margin_left_measurement" style="display: none; visibility: hidden;">Margin Left Measurement Unit</label>
<select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled" aria-labelledby="box_margin_left_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div>
<br style="clear: both" />
</div>
<div id="border_panel" class="panel">
<fieldset>
<legend>{#style_dlg.border}</legend>
<table role="presentation" border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="tdelim"> </td>
<td class="tdelim delim"> </td>
<td class="tdelim">{#style_dlg.style}</td>
<td class="tdelim delim"> </td>
<td class="tdelim">{#style_dlg.width}</td>
<td class="tdelim delim"> </td>
<td class="tdelim">{#style_dlg.color}</td>
</tr>
<tr>
<td> </td>
<td class="delim"> </td>
<td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onclick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
<td class="delim"> </td>
<td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onclick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
<td class="delim"> </td>
<td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onclick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
</tr>
<tr>
<td>{#style_dlg.top}</td>
<td class="delim"> </td>
<td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
<td class="delim"> </td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
<td> </td>
<td>
<label id="border_width_top_measurement_label" for="border_width_top_measurement" style="display: none; visibility: hidden;">Width top Measurement Unit</label>
<select id="border_width_top_measurement" name="border_width_top_measurement" aria-labelledby="border_width_top_measurement_label"></select>
</td>
</tr>
</table>
</td>
<td class="delim"> </td>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onchange="updateColor('border_color_top_pick','border_color_top');" /></td>
<td id="border_color_top_pickcontainer"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{#style_dlg.right}</td>
<td class="delim"> </td>
<td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
<td class="delim"> </td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
<td> </td>
<td>
<label id="border_width_right_measurement_label" for="border_width_right_measurement" style="display: none; visibility: hidden;">Width Right Measurement Unit</label>
<select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled" aria-labelledby="border_width_right_measurement_label"></select>
</td>
</tr>
</table>
</td>
<td class="delim"> </td>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onchange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
<td id="border_color_right_pickcontainer"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{#style_dlg.bottom}</td>
<td class="delim"> </td>
<td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
<td class="delim"> </td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
<td> </td>
<td>
<label id="border_width_bottom_measurement_label" for="border_width_bottom_measurement" style="display: none; visibility: hidden;">Width Bottom Measurement Unit</label>
<select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled" aria-labelledby="border_width_bottom_measurement_label"></select>
</td>
</tr>
</table>
</td>
<td class="delim"> </td>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onchange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
<td id="border_color_bottom_pickcontainer"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{#style_dlg.left}</td>
<td class="delim"> </td>
<td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
<td class="delim"> </td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
<td> </td>
<td>
<label id="border_width_left_measurement_label" for="border_width_left_measurement" style="display: none; visibility: hidden;">Width Left Measurement Unit</label>
<select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled" aria-labelledby="border_width_left_measurement_label"></select>
</td>
</tr>
</table>
</td>
<td class="delim"> </td>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onchange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
<td id="border_color_left_pickcontainer"> </td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div>
<div id="list_panel" class="panel">
<fieldset>
<legend>{#style_dlg.list}</legend>
<table role="presentation" border="0">
<tr>
<td><label for="list_type">{#style_dlg.list_type}</label></td>
<td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
</tr>
<tr>
<td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
<td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
</tr>
<tr>
<td><label for="list_position">{#style_dlg.position}</label></td>
<td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
</tr>
</table>
</fieldset>
</div>
<div id="positioning_panel" class="panel">
<fieldset>
<legend>{#style_dlg.position}</legend>
<table role="presentation" border="0">
<tr>
<td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
<td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
<td> <label for="positioning_visibility">{#style_dlg.visibility}</label></td>
<td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
</tr>
<tr>
<td><label for="positioning_width">{#style_dlg.width}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="positioning_width" name="positioning_width" onchange="synch('positioning_width','box_width');" /></td>
<td> </td>
<td>
<label id="positioning_width_measurement_label" for="positioning_width_measurement" style="display: none; visibility: hidden;">Positioning width Measurement Unit</label>
<select id="positioning_width_measurement" name="positioning_width_measurement" aria-labelledby="positioning_width_measurement_label"></select>
</td>
</tr>
</table>
</td>
<td> <label for="positioning_zindex">{#style_dlg.zindex}</label></td>
<td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
</tr>
<tr>
<td><label for="positioning_height">{#style_dlg.height}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="positioning_height" name="positioning_height" onchange="synch('positioning_height','box_height');" /></td>
<td> </td>
<td>
<label id="positioning_height_measurement_label" for="positioning_height_measurement" style="display: none; visibility: hidden;">Positioning Height Measurement Unit</label>
<select id="positioning_height_measurement" name="positioning_height_measurement" aria-labelledby="positioning_height_measurement_label"></select>
</td>
</tr>
</table>
</td>
<td> <label for="positioning_overflow">{#style_dlg.overflow}</label></td>
<td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
</tr>
</table>
</fieldset>
<div style="float: left; width: 49%">
<fieldset>
<legend>{#style_dlg.placement}</legend>
<table role="presentation" border="0">
<tr>
<td> </td>
<td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onclick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
</tr>
<tr>
<td>{#style_dlg.top}</td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
<td> </td>
<td>
<label id="positioning_placement_top_measurement_label" for="positioning_placement_top_measurement" style="display: none; visibility: hidden;">Placement Top Measurement Unit</label>
<select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement" aria-labelledby="positioning_placement_top_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{#style_dlg.right}</td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
<td> </td>
<td>
<label id="positioning_placement_right_measurement_label" for="positioning_placement_right_measurement" style="display: none; visibility: hidden;">Placement Right Measurement Unit</label>
<select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled" aria-labelledby="positioning_placement_right_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{#style_dlg.bottom}</td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
<td> </td>
<td>
<label id="positioning_placement_bottom_measurement_label" for="positioning_placement_bottom_measurement" style="display: none; visibility: hidden;">Placement Bottom Measurement Unit</label>
<select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled" aria-labelledby="positioning_placement_bottom_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{#style_dlg.left}</td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
<td> </td>
<td>
<label id="positioning_placement_left_measurement_label" for="positioning_placement_left_measurement" style="display: none; visibility: hidden;">Placement Left Measurement Unit</label>
<select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled" aria-labelledby="positioning_placement_left_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div>
<div style="float: right; width: 49%">
<fieldset>
<legend>{#style_dlg.clip}</legend>
<table role="presentation" border="0">
<tr>
<td> </td>
<td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onclick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
</tr>
<tr>
<td>{#style_dlg.top}</td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
<td> </td>
<td>
<label id="positioning_clip_top_measurement_label" for="positioning_clip_top_measurement" style="display: none; visibility: hidden;">Clip Top Measurement Unit</label>
<select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement" aria-labelledby="positioning_clip_top_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{#style_dlg.right}</td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
<td> </td>
<td>
<label id="positioning_clip_right_measurement_label" for="positioning_clip_right_measurement" style="display: none; visibility: hidden;">Clip Right Measurement Unit</label>
<select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled" aria-labelledby="positioning_clip_right_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{#style_dlg.bottom}</td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
<td> </td>
<td>
<label id="positioning_clip_bottom_measurement_label" for="positioning_clip_bottom_measurement" style="display: none; visibility: hidden;">Clip Bottom Measurement Unit</label>
<select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled" aria-labelledby="positioning_clip_bottom_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{#style_dlg.left}</td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
<td> </td>
<td>
<label id="positioning_clip_left_measurement_label" for="positioning_clip_left_measurement" style="display: none; visibility: hidden;">Clip Left Measurement Unit</label>
<select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled" aria-labelledby="positioning_clip_left_measurement_label"></select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div>
<br style="clear: both" />
</div>
</div>
<div class="panel_toggle_insert_span">
<input type="checkbox" class="checkbox" id="toggle_insert_span" name="toggle_insert_span" onclick="toggleApplyAction();" />
<label for="toggle_insert_span">{#style_dlg.toggle_insert_span}</label>
</div>
<div class="mceActionPanel">
<input type="submit" id="insert" name="insert" value="{#update}" />
<input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onclick="applyAction();" />
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
</div>
</form>
<div style="display: none">
<div id="container"></div>
</div>
</body>
</html>
|
asmayari1/projet1
|
web/plugins/tiny_mce/plugins/style/props.htm.html
|
HTML
|
mit
| 37,721 |
#ifndef AD_DBOLE_H
#define AD_DBOLE_H
//
// (C) Copyright 1994-2007 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
//
// DESCRIPTION: Class header for AcDbOleFrame & AcDbOle2Frame,
// OLE 2 Container (Client) Feature for Windows/NT
//
// AcDbEntity
// AcDbOleFrame
// AcDbOle2Frame
//
// AcDbOleFrame supports 1) non-OLE platform and 2) pre-R13 C4 OLE 1
// storage and retrieval only. It doesn't support OLE object
// display or activation. It stores
// binary data in lists that can be scanned later using the DbId.
// AcDbOle2Frame supports OLE 2 objects. For non-OLE platforms,
// the virtual methods are not overridden, so the storage methods
// in AcDbOleFrame are used instead.
#include "dbmain.h"
#include "dbframe.h"
#include "gepnt3d.h"
#pragma pack (push, 8)
class CRectangle3d
{
public:
AcGePoint3d upLeft;
AcGePoint3d upRight;
AcGePoint3d lowLeft;
AcGePoint3d lowRight;
};
class CRect;
class AcDbOleFrame: public AcDbFrame
{
public:
ACDB_DECLARE_MEMBERS(AcDbOleFrame);
AcDbOleFrame();
virtual ~AcDbOleFrame();
// --- AcDbObject Protocol
virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;
virtual Adesk::Boolean worldDraw(AcGiWorldDraw*);
virtual void viewportDraw(AcGiViewportDraw* mode);
virtual Acad::ErrorStatus getGeomExtents(AcDbExtents& extents) const;
// OLE Specific Methods
virtual void* getOleObject(void) const;
virtual void setOleObject(const void *pItem);
};
class AcDbOle2Frame: public AcDbOleFrame
{
public:
ACDB_DECLARE_MEMBERS(AcDbOle2Frame);
AcDbOle2Frame();
virtual ~AcDbOle2Frame();
// --- AcDbObject Protocol
virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;
// --- AcDbEntity Protocol
virtual Adesk::Boolean worldDraw(AcGiWorldDraw*);
virtual void viewportDraw(AcGiViewportDraw* mode);
virtual Acad::ErrorStatus getGeomExtents(AcDbExtents& extents) const;
virtual Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform);
virtual Acad::ErrorStatus getTransformedCopy(const AcGeMatrix3d& xform,
AcDbEntity*& ent) const;
virtual Acad::ErrorStatus explode(AcDbVoidPtrArray& entitySet) const;
virtual Acad::ErrorStatus getOsnapPoints(AcDb::OsnapMode osnapMode,
Adesk::GsMarker gsSelectionMark,
const AcGePoint3d& pickPoint,
const AcGePoint3d& lastPoint,
const AcGeMatrix3d& viewXform,
AcGePoint3dArray& snapPoints,
AcDbIntArray & geomIds) const;
virtual Acad::ErrorStatus getGripPoints(AcGePoint3dArray& gripPoints,
AcDbIntArray& osnapModes,
AcDbIntArray & geomIds) const;
virtual Acad::ErrorStatus moveGripPointsAt(const AcDbIntArray& indices,
const AcGeVector3d& offset);
virtual Acad::ErrorStatus getStretchPoints(AcGePoint3dArray& stretchPoints) const;
virtual Acad::ErrorStatus moveStretchPointsAt(const AcDbIntArray& indices,
const AcGeVector3d& offset);
virtual Acad::ErrorStatus getSubentPathsAtGsMarker(AcDb::SubentType type,
Adesk::GsMarker gsMark,
const AcGePoint3d& pickPoint,
const AcGeMatrix3d& viewXform,
int& numPaths,
AcDbFullSubentPath*& subentPaths,
int numInserts = 0,
AcDbObjectId* entAndInsertStack = 0
) const;
virtual Acad::ErrorStatus getGsMarkersAtSubentPath(
const AcDbFullSubentPath& subPath,
AcArray<Adesk::GsMarker>& gsMarkers) const;
virtual AcDbEntity* subentPtr(const AcDbFullSubentPath& id) const;
AcCmTransparency transparency() const;
virtual Acad::ErrorStatus setTransparency(const AcCmTransparency& trans,
Adesk::Boolean doSubents = true);
AcDb::Visibility visibility() const;
virtual Acad::ErrorStatus setVisibility(AcDb::Visibility newVal,
Adesk::Boolean doSubents = true);
virtual void list() const;
virtual void saveAs(AcGiWorldDraw* mode, AcDb::SaveType st);
virtual Acad::ErrorStatus intersectWith(
const AcDbEntity* ent,
AcDb::Intersect intType,
AcGePoint3dArray& points,
Adesk::GsMarker thisGsMarker = 0,
Adesk::GsMarker otherGsMarker = 0
) const;
virtual Acad::ErrorStatus intersectWith(
const AcDbEntity* ent,
AcDb::Intersect intType,
const AcGePlane& projPlane,
AcGePoint3dArray& points,
Adesk::GsMarker thisGsMarker = 0,
Adesk::GsMarker otherGsMarker = 0
) const;
// OLE Specific Methods
// Get pointer to MFC COleClientItem class.
//
virtual void* getOleObject(void) const;
virtual void setOleObject(const void *pItem);
// Upper left corner of OLE object, world coordinates
//
virtual void getLocation(AcGePoint3d& point3d) const;
// Change the location by passing new upper left corner
// of OLE object, world coordinates
void setLocation(const AcGePoint3d& point3d);
// Get world coords of the four corners of OLE object.
//
virtual void position(CRectangle3d& rect3d) const;
// Set world coords of the four corners of OLE object.
//
virtual void setPosition(const CRectangle3d& rect3d);
// Get GDI device coords of the four corners of OLE object
// for the current viewport.
//
virtual void position(RECT& rect) const;
// Set coords according to the GDI device coords of the four corners of OLE object
// for the current viewport.
//
virtual void setPosition(const RECT& rect);
// Description, such as "Paintbrush Bitmap".
// See MFC COleClientItem::GetUserType().
//
virtual void getUserType(ACHAR * pszName, int nNameSize) const;
// Linked, embedded, or static. See MFC COleClientItem::GetType().
// 1 OT_LINK The OLE item is a link.
// 2 OT_EMBEDDED The OLE item is embedded.
// 3 OT_STATIC The OLE item is static, that is, it contains only
// presentation data, not native data, and thus cannot be edited.
//
virtual int getType(void) const;
// If this is a linked object, get the file and item name
// to which it is linked.
// Example: C:\My Documents\link.xls!Sheet1!R5C3:R8C3
//
virtual Adesk::Boolean getLinkName(ACHAR * pszName, int nNameSize) const;
// Get path name of linked object, without the item name.
// Example:
// GetLinkName: C:\My Documents\link.xls!Sheet1!R5C3:R8C3
// GetLinkPath: C:\My Documents\link.xls
//
virtual Adesk::Boolean getLinkPath(ACHAR * pszPath, int nPathSize) const;
// Output quality affects the color depth and resolution at which
// the OLE object is plotted.
virtual Adesk::UInt8 outputQuality() const;
virtual void setOutputQuality(Adesk::UInt8);
// If the Plot Quality is chosen as "Automatically Select" in the OPM,
// a plot quality is internally chosen according to the application
Adesk::Boolean autoOutputQuality() const;
void setAutoOutputQuality(Adesk::UInt8);
// OLE Objects can be rotated any angle similar to raster objects. This
// value may be changed by virtue of a change via the OPM, or by the
// ROTATE command
double rotation() const;
Acad::ErrorStatus setRotation(const double rotation);
// wcsWidth and wcsHeight represent the actual width and height of the OLE
// object, expressed in AutoCAD world coords. These values may be affected
// by changes in the actual coordinates of the object during a manipulation
// command such as STRETCH, via grip editing resulting in a resizing
// operation, or by changing the scale of the object via OPM scale
// properties or the the Text size dialog
double wcsWidth() const;
Acad::ErrorStatus setWcsWidth(const double wcsWidth);
double wcsHeight() const;
Acad::ErrorStatus setWcsHeight(const double wcsHeight);
// scaleWidth and scaleHeight represent the current object scale,
// relative to the original scale from the default Text Size to
// AutoCAD units scale. These are expressed as a *percentage* of
// the original scale. These values may be affected by changes
// in the actual coordinates of the object during a manipulation command
// such as STRETCH, via grip editing, resulting in a resizing operation,
// or by changing the width/height of the object via OPM width/height
// properties or the Text Size dialog.
double scaleWidth() const;
Acad::ErrorStatus setScaleWidth(const double scaleWidth);
double scaleHeight() const;
Acad::ErrorStatus setScaleHeight(const double scaleHeight);
// The Lock Aspect Ratio property affects the behavior of the OLE
// object when its size is changed. It can be set to Yes or No;
// the default value is Yes - locked. This means that when a new
// value is entered for the object's Width, Height, Scale width
// or Scale height, both the width and the height change uniformly.
Adesk::Boolean lockAspect() const;
Acad::ErrorStatus setLockAspect(const Adesk::Boolean bLockAspect);
// Get corresponding COM wrapper class ID
virtual Acad::ErrorStatus getClassID(CLSID* pClsid) const;
virtual bool castShadows() const;
virtual void setCastShadows(bool newVal);
virtual bool receiveShadows() const;
virtual void setReceiveShadows(bool newVal);
};
#pragma pack (pop)
#endif // AD_DBOLE_H_
|
kevinzhwl/ObjectARXCore
|
2008/inc-x64/dbole.h
|
C
|
mit
| 12,443 |
Command for a check point in Versionner
|
vineetreddyrajula/pharo
|
src/Versionner-Core-Commands.package/MBCheckpointDevCommand.class/README.md
|
Markdown
|
mit
| 39 |
import axios from 'axios';
export default axios;
|
JiriChara/vuex-crud
|
src/vuex-crud/client.js
|
JavaScript
|
mit
| 50 |
{% assign odd = false %}{% if include.odd %}{% assign odd = include.odd %}{% endif %}
{% assign li_left_cols = 4 %}{% if include.li_left_cols %}{% assign li_left_cols = include.li_left_cols %}{% endif %}
{% assign li_right_cols = 8 %}{% if include.li_right_cols %}{% assign li_right_cols = include.li_right_cols %}{% endif %}
{% assign li_thumbnail_width = 150 %}{% if include.li_thumbnail_width %}{% assign li_thumbnail_width = include.li_thumbnail_width %}{% endif %}
{% assign li_thumbnail_height = 150 %}{% if include.li_thumbnail_height %}{% assign li_thumbnail_height = include.li_thumbnail_height %}{% endif %}
{% include main/listitem_product.html odd=odd li_left_cols=li_left_cols li_right_cols=li_right_cols li_thumbnail_width=li_thumbnail_width li_thumbnail_height=li_thumbnail_height %}
|
pjdufour/geosite-framework
|
_includes/main/listitem_product_150.html
|
HTML
|
mit
| 800 |
{{diagnostic}}
<div class="aw-ui-callout aw-ui-callout-info">
<span>Please see below all the price set for various Asha Payment Activities.</span>
</div>
<form class="form-horizontal" #rulesForm="ngForm" (ngSubmit)="onSubmit(ruleForm.value)" method="POST">
<div>
<h2>Maternal Health</h2>
<h3>ANC Checkups</h3>
<div class="form-group">
<label for="101" class="col-sm-4 control-label">No. of Registration during the first trimester of pregnancy at</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-101-R"><i class="fa fa-inr"></i></span>
<input id="101_R" class="form-control" type="text" aria-describedby="addon-101-R" [(ngModel)]="model.R_101" name="R_101" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-101-U"><i class="fa fa-inr"></i></span>
<input id="101_U" class="form-control" type="text" aria-describedby="addon-101-U" [(ngModel)]="model.U_101" name="U_101" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<textarea id="101_H" class="form-control" row="1" [(ngModel)]="model.H_101" name="H_101" #name="ngModel"></textarea>
</div>
</div>
<div class="form-group">
<label for="102" class="col-sm-4 control-label">No. of 1st check up</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-102-R"><i class="fa fa-inr"></i></span>
<input id="102_R" class="form-control" type="" aria-describedby="addon-102-R" [(ngModel)]="model.R_102" name="R_102" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-102-U"><i class="fa fa-inr"></i></span>
<input id="102_U" class="form-control" type="" aria-describedby="addon-102-U" [(ngModel)]="model.U_102" name="U_102" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<textarea id="102_H" class="form-control" row="1" [(ngModel)]="model.H_102" name="H_102" #name="ngModel"></textarea>
</div>
</div>
<div class="form-group">
<label for="103" class="col-sm-4 control-label">No. of 2 nd check up </label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-103-R"><i class="fa fa-inr"></i></span>
<input id="103_R" class="form-control" type="" aria-describedby="addon-103-R" [(ngModel)]="model.R_103" name="R_103" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-103-U"><i class="fa fa-inr"></i></span>
<input id="103_U" class="form-control" type="" aria-describedby="addon-103-U" [(ngModel)]="model.U_103" name="U_103" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<textarea id="103_H" class="form-control" row="1" [(ngModel)]="model.H_103" name="H_102" #name="ngModel"></textarea>
</div>
</div>
<div class="form-group">
<label for="104" class="col-sm-4 control-label">No. of 3 rd check up</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-104-R"><i class="fa fa-inr"></i></span>
<input id="104_R" class="form-control" type="" aria-describedby="addon-104-R" [(ngModel)]="model.R_104" name="R_104" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-104-U"><i class="fa fa-inr"></i></span>
<input id="104_U" class="form-control" type="" aria-describedby="addon-104-U" [(ngModel)]="model.U_104" name="U_104" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<textarea id="104_H" class="form-control" row="1" [(ngModel)]="model.H_104" name="H_104" #name="ngModel"></textarea>
</div>
</div>
<div class="form-group">
<label for="105" class="col-sm-4 control-label">No. of 4 th check up by M.O</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-105-R"><i class="fa fa-inr"></i></span>
<input id="105_R" class="form-control" type="" aria-describedby="addon-105-R" [(ngModel)]="model.R_105" name="R_105" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-105-U"><i class="fa fa-inr"></i></span>
<input id="105_U" class="form-control" type="" aria-describedby="addon-105-U" [(ngModel)]="model.R_105" name="R_105" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<textarea id="105_H" class="form-control" row="1" [(ngModel)]="model.H_105" name="H_105" #name="ngModel"></textarea>
</div>
</div>
<div class="form-group">
<label for="106" class="col-sm-4 control-label">No. of Deliveres conducted in PHC/Institutons</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-106-R"><i class="fa fa-inr"></i></span>
<input id="106_R" class="form-control" type="" aria-describedby="addon-106-R" [(ngModel)]="model.R_106" name="R_106" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-106-U"><i class="fa fa-inr"></i></span>
<input id="106_U" class="form-control" type="" aria-describedby="addon-106-U" [(ngModel)]="model.U_106" name="U_106" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<textarea id="106_H" class="form-control" row="1" [(ngModel)]="model.H_106" name="H_106" #name="ngModel"></textarea>
</div>
</div>
<div class="form-group">
<label for="107" class="col-sm-4 control-label">No. of Maternal Death reported to Sub Centre</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-107-R"><i class="fa fa-inr"></i></span>
<input id="107_R" class="form-control" type="" aria-describedby="addon-107-R" [(ngModel)]="model.R_107" name="R_107" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-107-U"><i class="fa fa-inr"></i></span>
<input id="107_U" class="form-control" type="" aria-describedby="addon-107-U" [(ngModel)]="model.U_107" name="R_107" #name="ngModel">
</div>
</div>
<div class="col-sm-2">
<textarea id="107_H" class="form-control" row="1" [(ngModel)]="model.H_107" name="H_107" #name="ngModel"></textarea>
</div>
</div>
</div>
<div>
<h2>Child Health</h2>
<div class="form-group">
<label for="108" class="col-sm-4 control-label">Postnatal Visits (HBNC) (6 visits in Institutional Delivery, 7 Visits in Home Delivery)</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-108-R"><i class="fa fa-inr"></i></span>
<input id="108_R" class="form-control" type="" aria-describedby="addon-108-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-108-U"><i class="fa fa-inr"></i></span>
<input id="108_U" class="form-control" type="" aria-describedby="addon-108-U">
</div>
</div>
<div class="col-sm-2">
<textarea id="108_H" class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="109" class="col-sm-4 control-label">Rreferral & Follow up of SAM Cases to NRC</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-109-R"><i class="fa fa-inr"></i></span>
<input id="109_R" class="form-control" type="" aria-describedby="addon-109-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-109-U"><i class="fa fa-inr"></i></span>
<input id="109_U" class="form-control" type="" aria-describedby="addon-109-U">
</div>
</div>
<div class="col-sm-2">
<textarea id="109_H" class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="110" class="col-sm-4 control-label">Follow up of LBW babies (LBW Low Birth Weight Babies)</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-110-R"><i class="fa fa-inr"></i></span>
<input id="110_R" class="form-control" type="" aria-describedby="addon-110-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-110-U"><i class="fa fa-inr"></i></span>
<input id="110_U" class="form-control" type="" aria-describedby="addon-110-U">
</div>
</div>
<div class="col-sm-2">
<textarea id="110_H" class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="111" class="col-sm-4 control-label">Follow up of SNCU discharge babies</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-111-R"><i class="fa fa-inr"></i></span>
<input id="111_R" class="form-control" type="" aria-describedby="addon-111-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-111-U"><i class="fa fa-inr"></i></span>
<input id="111_U" class="form-control" type="" aria-describedby="addon-111-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="112" class="col-sm-4 control-label">Infant death reporting to Sub-centre and PHC</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-112-R"><i class="fa fa-inr"></i></span>
<input id="112_R" class="form-control" type="" aria-describedby="addon-112-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-112-U"><i class="fa fa-inr"></i></span>
<input id="112_U" class="form-control" type="" aria-describedby="addon-112-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="113" class="col-sm-4 control-label">Intesive Diarrhoea Control Programme</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-113-R"><i class="fa fa-inr"></i></span>
<input id="113_R" class="form-control" type="" aria-describedby="addon-113-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-113-U"><i class="fa fa-inr"></i></span>
<input id="113_U" class="form-control" type="" aria-describedby="addon-113-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
</div>
<div>
<h2>Immunization</h2>
<div class="form-group">
<label for="114" class="col-sm-4 control-label">Pulse Polio Booth Mobilization</label>
<div class="col-sm-2">
<div class="input-group disabled">
<span class="input-group-addon" id="addon-114-R"><i class="fa fa-inr"></i></span>
<input id="114_R" class="form-control" type="" aria-describedby="addon-114-R" disabled>
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-114-U"><i class="fa fa-inr"></i></span>
<input id="114_U" class="form-control" type="" aria-describedby="addon-114-U" disabled>
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<h3>Full Immunization</h3>
<div class="form-group">
<label for="115" class="col-sm-4 control-label">Complete Immunization in 1st year of age</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-115-R"><i class="fa fa-inr"></i></span>
<input id="115_R" class="form-control" type="" aria-describedby="addon-115-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-115-U"><i class="fa fa-inr"></i></span>
<input id="115U" class="form-control" type="" aria-describedby="addon-115-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="116" class="col-sm-4 control-label">Full Immunization of 2nd year of age</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-116-R"><i class="fa fa-inr"></i></span>
<input id="116" class="form-control" type="" aria-describedby="addon-116-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-116-U"><i class="fa fa-inr"></i></span>
<input id="116" class="form-control" type="" aria-describedby="addon-116-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
</div>
<div>
<h2>Family Planning</h2>
<div class="form-group">
<label for="117" class="col-sm-4 control-label">No. of Counseling & Motivation of women for Tubectomy</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-117-R"><i class="fa fa-inr"></i></span>
<input id="117" class="form-control" type="" aria-describedby="addon-117-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-117-U"><i class="fa fa-inr"></i></span>
<input id="117" class="form-control" type="" aria-describedby="addon-117-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="118" class="col-sm-4 control-label">No. of Counseling & Motivation for men of Vasectomy</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-118-R"><i class="fa fa-inr"></i></span>
<input id="118" class="form-control" type="" aria-describedby="addon-118-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-118-U"><i class="fa fa-inr"></i></span>
<input id="118" class="form-control" type="" aria-describedby="addon-118-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="119" class="col-sm-4 control-label">Accompanying the beneficiary for PPIUCD</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-119-R"><i class="fa fa-inr"></i></span>
<input id="119" class="form-control" type="" aria-describedby="addon-119-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-119-U"><i class="fa fa-inr"></i></span>
<input id="119" class="form-control" type="" aria-describedby="addon-119-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
</div>
<div>
<h2>RKSK (only for HPDs)</h2>
<div class="form-group">
<label for="120" class="col-sm-4 control-label">Support to Peer Educator</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-120-R"><i class="fa fa-inr"></i></span>
<input id="120" class="form-control" type="" aria-describedby="addon-120-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-120-U"><i class="fa fa-inr"></i></span>
<input id="120" class="form-control" type="" aria-describedby="addon-120-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="121" class="col-sm-4 control-label">Mobilizing Adolescents for AHD</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-121-R"><i class="fa fa-inr"></i></span>
<input id="121" class="form-control" type="" aria-describedby="addon-121-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-121-U"><i class="fa fa-inr"></i></span>
<input id="121" class="form-control" type="" aria-describedby="addon-121-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
</div>
<div>
<h2>RNTCP</h2>
<div class="form-group">
<label for="122" class="col-sm-4 control-label">New TB case Catg.I TB (42 contacts 6-7 months treatment)</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-122-R"><i class="fa fa-inr"></i></span>
<input id="122" class="form-control" type="" aria-describedby="addon-122-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-122-U"><i class="fa fa-inr"></i></span>
<input id="122" class="form-control" type="" aria-describedby="addon-122-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="123" class="col-sm-4 control-label">Previous treated TB case (57 contacts, catg.II TB 8-9 months treatment</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-123-R"><i class="fa fa-inr"></i></span>
<input id="123" class="form-control" type="" aria-describedby="addon-123-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-123-U"><i class="fa fa-inr"></i></span>
<input id="123" class="form-control" type="" aria-describedby="addon-123-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="124" class="col-sm-4 control-label">Providing treatment and support to Drug resistant TB patient (MDR)</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-124-R"><i class="fa fa-inr"></i></span>
<input id="124" class="form-control" type="" aria-describedby="addon-124-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-124-U"><i class="fa fa-inr"></i></span>
<input id="124" class="form-control" type="" aria-describedby="addon-124-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="125" class="col-sm-4 control-label">Identification & Successful completion of DOTS for TB</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-125-R"><i class="fa fa-inr"></i></span>
<input id="125" class="form-control" type="" aria-describedby="addon-125-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-125-U"><i class="fa fa-inr"></i></span>
<input id="125" class="form-control" type="" aria-describedby="addon-125-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
</div>
<div>
<h2>NLEP</h2>
<div class="form-group">
<label for="126" class="col-sm-4 control-label">PB - Referring for Diagnostics + Complete treatment</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-126-R"><i class="fa fa-inr"></i></span>
<input id="126" class="form-control" type="" aria-describedby="addon-126-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-126-U"><i class="fa fa-inr"></i></span>
<input id="126" class="form-control" type="" aria-describedby="addon-126-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="127" class="col-sm-4 control-label">MB - Dsetection + complete treatment</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-127-R"><i class="fa fa-inr"></i></span>
<input id="127" class="form-control" type="" aria-describedby="addon-127-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-127-U"><i class="fa fa-inr"></i></span>
<input id="127" class="form-control" type="" aria-describedby="addon-127-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
</div>
<div>
<h2>NVBDC Programme (Srikakulam, Vizianagaram, East Godavari)</h2>
<div class="form-group">
<label for="128" class="col-sm-4 control-label">Preparation of Blood Slide </label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-128-R"><i class="fa fa-inr"></i></span>
<input id="128" class="form-control" type="" aria-describedby="addon-128-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-128-U"><i class="fa fa-inr"></i></span>
<input id="128" class="form-control" type="" aria-describedby="addon-128-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="129" class="col-sm-4 control-label">Complete treatment for RDT +ve PF case & complete Radical treatment to +ve PF & PC cases</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-129-R"><i class="fa fa-inr"></i></span>
<input id="129" class="form-control" type="" aria-describedby="addon-129-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-129-U"><i class="fa fa-inr"></i></span>
<input id="129" class="form-control" type="" aria-describedby="addon-129-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="130" class="col-sm-4 control-label">Lymphatic Filariasis โ for One time Line listing of Lymphoedema and Hydrocele cases in non-endemic dist</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-130-R"><i class="fa fa-inr"></i></span>
<input id="130" class="form-control" type="" aria-describedby="addon-130-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-130-U"><i class="fa fa-inr"></i></span>
<input id="130" class="form-control" type="" aria-describedby="addon-130-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="131" class="col-sm-4 control-label">Line listing of Lymphatic Filariasis</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-131-R"><i class="fa fa-inr"></i></span>
<input id="131" class="form-control" type="" aria-describedby="addon-131-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-131-U"><i class="fa fa-inr"></i></span>
<input id="131" class="form-control" type="" aria-describedby="addon-131-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="132" class="col-sm-4 control-label">Referral of AES / JE cases to the nearest CHC / DH / Medical College</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-132-R"><i class="fa fa-inr"></i></span>
<input id="132" class="form-control" type="" aria-describedby="addon-132-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-132-U"><i class="fa fa-inr"></i></span>
<input id="132" class="form-control" type="" aria-describedby="addon-132-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
</div>
<div>
<h2>Routine & Recurrent activities</h2>
<div class="form-group">
<label for="133" class="col-sm-4 control-label">Mobilizing & attending VHND in the month</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-133-R"><i class="fa fa-inr"></i></span>
<input id="133" class="form-control" type="" aria-describedby="addon-133-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-133-U"><i class="fa fa-inr"></i></span>
<input id="133" class="form-control" type="" aria-describedby="addon-133-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="134" class="col-sm-4 control-label">Attending VHSNC meeting</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-134-R"><i class="fa fa-inr"></i></span>
<input id="134" class="form-control" type="" aria-describedby="addon-134-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-134-U"><i class="fa fa-inr"></i></span>
<input id="134" class="form-control" type="" aria-describedby="addon-134-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="135" class="col-sm-4 control-label">Atttending ASHA Day Meeting</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-135-R"><i class="fa fa-inr"></i></span>
<input id="135" class="form-control" type="" aria-describedby="addon-135-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-135-U"><i class="fa fa-inr"></i></span>
<input id="135" class="form-control" type="" aria-describedby="addon-135-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="136" class="col-sm-4 control-label">Line listing of households done at beginning of the year and updated after six months</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-136-R"><i class="fa fa-inr"></i></span>
<input id="136" class="form-control" type="" aria-describedby="addon-136-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-136-U"><i class="fa fa-inr"></i></span>
<input id="136" class="form-control" type="" aria-describedby="addon-136-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="137" class="col-sm-4 control-label">Maintaining village health register and supporting universal registration of births and deaths</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-137-R"><i class="fa fa-inr"></i></span>
<input id="137" class="form-control" type="" aria-describedby="addon-137-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-137-U"><i class="fa fa-inr"></i></span>
<input id="137" class="form-control" type="" aria-describedby="addon-137-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="138" class="col-sm-4 control-label">Preparation of due list of children to be immunized updated on monthly basis</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-138-R"><i class="fa fa-inr"></i></span>
<input id="138" class="form-control" type="" aria-describedby="addon-138-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-138-U"><i class="fa fa-inr"></i></span>
<input id="138" class="form-control" type="" aria-describedby="addon-138-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="139" class="col-sm-4 control-label">Preparation of list of ANC beneficiaries to be updated on monthly basis</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-139-R"><i class="fa fa-inr"></i></span>
<input id="139" class="form-control" type="" aria-describedby="addon-139-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-139-U"><i class="fa fa-inr"></i></span>
<input id="139" class="form-control" type="" aria-describedby="addon-139-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
<div class="form-group">
<label for="140" class="col-sm-4 control-label">Preparation of list of eligible couples updated on monthly basis</label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-140-R"><i class="fa fa-inr"></i></span>
<input id="140" class="form-control" type="" aria-describedby="addon-140-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-140-U"><i class="fa fa-inr"></i></span>
<input id="140" class="form-control" type="" aria-describedby="addon-140-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
</div>
<div>
<h2>104 (by state budget)</h2>
<div class="form-group">
<label for="141" class="col-sm-4 control-label">No.of ASHA attended 104 Fixed day health services in villages </label>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-141-R"><i class="fa fa-inr"></i></span>
<input id="141" class="form-control" type="" aria-describedby="addon-141-R">
</div>
</div>
<div class="col-sm-2">
<div class="input-group">
<span class="input-group-addon" id="addon-141-U"><i class="fa fa-inr"></i></span>
<input id="141" class="form-control" type="" aria-describedby="addon-141-U">
</div>
</div>
<div class="col-sm-2">
<textarea class="form-control" row="1"></textarea>
</div>
</div>
</div>
<div>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
|
mnjkumar426/AshaFrontEnd
|
.history/src/app/admin-configuration/manage-activity-payment/manage-activity-payment.component_20170211122545.html
|
HTML
|
mit
| 40,771 |
import fs from "fs";
import test from "tape";
import path from "path";
import load from "load-json-file";
import write from "write-json-file";
import truncate from "@turf/truncate";
import { brightness } from "chromatism";
import { round, featureCollection, point } from "@turf/helpers";
import { featureEach, propEach } from "@turf/meta";
import interpolate from "./index";
const directories = {
in: path.join(__dirname, "test", "in") + path.sep,
out: path.join(__dirname, "test", "out") + path.sep,
};
var fixtures = fs.readdirSync(directories.in).map((filename) => {
return {
filename,
name: path.parse(filename).name,
geojson: load.sync(directories.in + filename),
};
});
// fixtures = fixtures.filter(fixture => fixture.name === 'points-random')
test("turf-interpolate", (t) => {
for (const { filename, name, geojson } of fixtures) {
const options = geojson.properties;
const cellSize = options.cellSize;
const property = options.property || "elevation";
// Truncate coordinates & elevation (property) to 6 precision
let result = truncate(interpolate(geojson, cellSize, options));
propEach(result, (properties) => {
properties[property] = round(properties[property]);
});
result = colorize(result, property, name);
if (process.env.REGEN) write.sync(directories.out + filename, result);
t.deepEquals(result, load.sync(directories.out + filename), name);
}
t.end();
});
test("turf-interpolate -- throws errors", (t) => {
const cellSize = 1;
const weight = 0.5;
const units = "miles";
const gridType = "point";
const points = featureCollection([
point([1, 2], { elevation: 200 }),
point([2, 1], { elevation: 300 }),
point([1.5, 1.5], { elevation: 400 }),
]);
t.assert(
interpolate(points, cellSize, {
gridType: gridType,
units: units,
weight: weight,
}).features.length
);
t.throws(
() => interpolate(points, undefined),
/cellSize is required/,
"cellSize is required"
);
t.throws(
() => interpolate(undefined, cellSize),
/points is required/,
"points is required"
);
t.throws(
() => interpolate(points, cellSize, { gridType: "foo" }),
/invalid gridType/,
"invalid gridType"
);
t.throws(
() => interpolate(points, cellSize, { units: "foo" }),
"invalid units"
);
t.throws(
() => interpolate(points, cellSize, { weight: "foo" }),
/weight must be a number/,
"weight must be a number"
);
t.throws(
() => interpolate(points, cellSize, { property: "foo" }),
/zValue is missing/,
"zValue is missing"
);
t.end();
});
test("turf-interpolate -- zValue from 3rd coordinate", (t) => {
const cellSize = 1;
const points = featureCollection([
point([1, 2, 200]),
point([2, 1, 300]),
point([1.5, 1.5, 400]),
]);
t.assert(
interpolate(points, cellSize).features.length,
"zValue from 3rd coordinate"
);
t.end();
});
// style result
function colorize(grid, property, name) {
property = property || "elevation";
let max = -Infinity;
let min = Infinity;
propEach(grid, (properties) => {
const value = properties[property];
if (value > max) max = value;
if (value < min) min = value;
});
const delta = max - min;
if (delta === 0) throw new Error(name + " delta is invalid");
featureEach(grid, (feature) => {
const value = feature.properties[property];
const percent = round(((value - min - delta / 2) / delta) * 100);
// darker corresponds to higher values
const color = brightness(-percent, "#0086FF").hex;
if (feature.geometry.type === "Point")
feature.properties["marker-color"] = color;
else {
feature.properties["stroke"] = color;
feature.properties["fill"] = color;
feature.properties["fill-opacity"] = 0.85;
}
});
return grid;
}
|
dpmcmlxxvi/turf
|
packages/turf-interpolate/test.js
|
JavaScript
|
mit
| 3,862 |
import * as React from "react";
import { IDetailsWidgetProps } from "../interfaces";
import { BaseWidgetComponent } from "./widgetbase";
import { IPullrequest, IPullRequestState } from "../model";
import VCContracts = require("TFS/VersionControl/Contracts");
// 'DevDetailsComponent' to render pullRequests associated with a workitem
export class DevDetailsComponent extends BaseWidgetComponent<void> {
public render(): JSX.Element {
if (!this.props.backlogDetailsModel || !this.props.backlogDetailsModel.pullRequests) {
return null;
}
let pullRequests = this.props.backlogDetailsModel.pullRequests;
return <div className="widget">
<div className="title">Development</div>
<div className="content">
{pullRequests.map((pullrequest, index) => {
return <div key={pullrequest.id} className="pull-request-item">
<div className="pull-request-icon">
<span className="icon bowtie-icon bowtie-tfvc-pull-request"></span>
</div>
<div className="pull-request-data">
<div className="pull-request-primary-data">
<span className="pull-request-assigned-to-icon"><img src={ pullrequest.user.imageUrl } /></span>
<span className="pull-request-primary-data">
<a href={ pullrequest.uri } target="_blank">
{ pullrequest.name }
</a>
</span>
</div>
<div className="pull-request-secondary-data">
<span>Created on { pullrequest.lastUpdated.toLocaleDateString() }</span>, <PullRequestState status={ pullrequest.status } />
</div>
</div>
</div>;
}) }
</div>
</div>;
}
}
// 'PullRequestState' renders pullRequest state
class PullRequestState extends React.Component<{ status: IPullRequestState }, void> {
public render(): JSX.Element {
return <span><span className={ this.props.status.iconClass }></span> { this.props.status.state }</span>;
}
}
|
Microsoft/vso-extension-samples
|
backlogs-panel/src/components/devdetails.tsx
|
TypeScript
|
mit
| 2,423 |
---
category: release-notes
version: 1.0.2
title: Fix Typos, Inconsistencies in Docs
breaking-changes:
potential-breaking-changes:
deprecated:
added:
- bower.json for your convenience.
release-notes:
- Solid logo is visible in docs.
- No more responsive prefixes on type size classes.
- Responsive prefixes re-added on floats.
- Various typos and inconsistencies resolved in docs.
---
|
buzzfeed/solid
|
release-notes/2015-08-11-1.0.2.html
|
HTML
|
mit
| 400 |
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
///////////////////////////////////////////////////////////////////////////////
package gnu.trove;
//////////////////////////////////////////////////
// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
//////////////////////////////////////////////////
/**
* Iterator for maps of type long and long.
*
* <p>The iterator semantics for Trove's primitive maps is slightly different
* from those defined in <tt>java.util.Iterator</tt>, but still well within
* the scope of the pattern, as defined by Gamma, et al.</p>
*
* <p>This iterator does <b>not</b> implicitly advance to the next entry when
* the value at the current position is retrieved. Rather, you must explicitly
* ask the iterator to <tt>advance()</tt> and then retrieve either the <tt>key()</tt>,
* the <tt>value()</tt> or both. This is done so that you have the option, but not
* the obligation, to retrieve keys and/or values as your application requires, and
* without introducing wrapper objects that would carry both. As the iteration is
* stateful, access to the key/value parts of the current map entry happens in
* constant time.</p>
*
* <p>In practice, the iterator is akin to a "search finger" that you move from
* position to position. Read or write operations affect the current entry only and
* do not assume responsibility for moving the finger.</p>
*
* <p>Here are some sample scenarios for this class of iterator:</p>
*
* <pre>
* // accessing keys/values through an iterator:
* for (TLongLongIterator it = map.iterator();
* it.hasNext();) {
* it.advance();
* if (satisfiesCondition(it.key()) {
* doSomethingWithValue(it.value());
* }
* }
* </pre>
*
* <pre>
* // modifying values in-place through iteration:
* for (TLongLongIterator it = map.iterator();
* it.hasNext();) {
* it.advance();
* if (satisfiesCondition(it.key()) {
* it.setValue(newValueForKey(it.key()));
* }
* }
* </pre>
*
* <pre>
* // deleting entries during iteration:
* for (TLongLongIterator it = map.iterator();
* it.hasNext();) {
* it.advance();
* if (satisfiesCondition(it.key()) {
* it.remove();
* }
* }
* </pre>
*
* <pre>
* // faster iteration by avoiding hasNext():
* TLongLongIterator iterator = map.iterator();
* for (int i = map.size(); i-- > 0;) {
* iterator.advance();
* doSomethingWithKeyAndValue(iterator.key(), iterator.value());
* }
* </pre>
*
* @author Eric D. Friedman
* @version $Id: P2PIterator.template,v 1.1 2006/11/10 23:28:00 robeden Exp $
*/
public class TLongLongIterator extends TPrimitiveIterator {
/** the collection being iterated over */
private final TLongLongHashMap _map;
/**
* Creates an iterator over the specified map
*/
public TLongLongIterator(TLongLongHashMap map) {
super(map);
this._map = map;
}
/**
* Moves the iterator forward to the next entry in the underlying map.
*
* @throws java.util.NoSuchElementException if the iterator is already exhausted
*/
public void advance() {
moveToNextIndex();
}
/**
* Provides access to the key of the mapping at the iterator's position.
* Note that you must <tt>advance()</tt> the iterator at least once
* before invoking this method.
*
* @return the key of the entry at the iterator's current position.
*/
public long key() {
return _map._set[_index];
}
/**
* Provides access to the value of the mapping at the iterator's position.
* Note that you must <tt>advance()</tt> the iterator at least once
* before invoking this method.
*
* @return the value of the entry at the iterator's current position.
*/
public long value() {
return _map._values[_index];
}
/**
* Replace the value of the mapping at the iterator's position with the
* specified value. Note that you must <tt>advance()</tt> the iterator at
* least once before invoking this method.
*
* @param val the value to set in the current entry
* @return the old value of the entry.
*/
public long setValue(long val) {
long old = value();
_map._values[_index] = val;
return old;
}
}// TLongLongIterator
|
jgaltidor/VarJ
|
analyzed_libs/trove-2.1.0/src/gnu/trove/TLongLongIterator.java
|
Java
|
mit
| 5,085 |
require 'spec_helper'
module UserDisplayTest
class User < ActiveRecord::Base
self.table_name = :users
include Shared::User::Display
end
end
describe Shared::User::Display do
fixtures :users
let(:user) { fixture(:users, :paul, UserDisplayTest) }
it "should calculate display names" do
user.class.name.should == "UserDisplayTest::User"
user.display_name.should == "Paul P."
user.full_name.should == "Paul Poster"
user.first_name = nil
user.last_name = nil
user.display_name.should == "paul"
end
end
|
taskrabbit/rails_engines_example
|
spec/shared/models/user_display_spec.rb
|
Ruby
|
mit
| 545 |
//
// OMWForeCastDaily.h
// APIManager
//
// Created by Darshan Patel on 7/14/15.
// Copyright (c) 2015 Darshan Patel. All rights reserved.
//
// The MIT License (MIT)
//
// Copyright (c) 2015 Darshan Patel
//
// 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.
#import <Foundation/Foundation.h>
#import "FCDCity.h"
#import "FCDList.h"
#import "OWMHeader.h"
@interface OWMForeCastDaily : NSObject
@property (nonatomic,strong) FCDCity *city;
@property (nonatomic,assign) NSInteger cod;
@property (nonatomic,assign) double message;
@property (nonatomic,assign) NSInteger cnt;
@property (nonatomic,strong) NSArray *list;
- (instancetype)initWithAttributes:(NSDictionary *)attributes;
+ (void)doFetchForeCastFiveByCityName:(NSString *)cityName withCnt:(NSInteger)cnt
withBlock:(void (^)(OWMForeCastDaily *forcastDaily, NSError *error))block;
+ (void)doFetchForeCastFiveByCityName:(NSString *)cityName
withCountry:(NSString *)countryCode
withCnt:(NSInteger)cnt
withBlock:(void (^)(OWMForeCastDaily *forcastDaily, NSError *error))block;
+ (void)doFetchForeCastFiveByCityID:(NSString *)cityID
withCnt:(NSInteger)cnt
withBlock:(void (^)(OWMForeCastDaily *forcastDaily, NSError *error))block;
+ (void)doFetchForeCastFiveByCoordinates:(CLLocationCoordinate2D )coordinate
withCnt:(NSInteger)cnt
withBlock:(void (^)(OWMForeCastDaily *forcastDaily, NSError *error))block;
+ (void)doFetchForeCastFiveByParams:(NSDictionary *)params
withBlock:(void (^)(OWMForeCastDaily *forcastDaily, NSError *error))block;
@end
|
pchauhan/OWMAPIManager
|
OWMAPIManager/OWMForeCastDaily.h
|
C
|
mit
| 2,800 |
package net.minecraft.client.resources;
import com.google.common.collect.Sets;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.io.filefilter.DirectoryFileFilter;
public class FolderResourcePack extends AbstractResourcePack
{
private static final String __OBFID = "CL_00001076";
public FolderResourcePack(File p_i1291_1_)
{
super(p_i1291_1_);
}
protected InputStream getInputStreamByName(String p_110591_1_) throws IOException
{
return new BufferedInputStream(new FileInputStream(new File(this.resourcePackFile, p_110591_1_)));
}
protected boolean hasResourceName(String p_110593_1_)
{
return (new File(this.resourcePackFile, p_110593_1_)).isFile();
}
public Set getResourceDomains()
{
HashSet var1 = Sets.newHashSet();
File var2 = new File(this.resourcePackFile, "assets/");
if (var2.isDirectory())
{
File[] var3 = var2.listFiles((java.io.FileFilter)DirectoryFileFilter.DIRECTORY);
int var4 = var3.length;
for (int var5 = 0; var5 < var4; ++var5)
{
File var6 = var3[var5];
String var7 = getRelativeName(var2, var6);
if (!var7.equals(var7.toLowerCase()))
{
this.logNameNotLowercase(var7);
}
else
{
var1.add(var7.substring(0, var7.length() - 1));
}
}
}
return var1;
}
}
|
Hexeption/Youtube-Hacked-Client-1.8
|
minecraft/net/minecraft/client/resources/FolderResourcePack.java
|
Java
|
mit
| 1,700 |
//
// SASGreyView.h
// Save a Selfie
//
// Created by Stephen Fox on 05/07/2015.
// Copyright (c) 2015 Stephen Fox. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SASGreyView : UIView
// Animates into receiving view with a fade.
- (void) animateIntoView:(UIView*) view;
// Animates out of the parentView with a fade.
- (void) animateOutOfParentView;
@end
|
StephenFox1995/save-a-selfie
|
src/Save a Selfie 2/GUI/SASGreyView/SASGreyView.h
|
C
|
mit
| 376 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>#{get 'title' /}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/main.css'}" />
<link rel="shortcut icon" type="image/png" href="@{'/public/images/favicon.png'}" />
<script type="text/javascript" src="@{'/public/javascripts/jquery-1.3.2.min.js'}"></script>
<script type="text/javascript" src="@{'/public/javascripts/ejohn-templating.js'}"></script>
</head>
<body>
#{doLayout /}
</body>
</html>
|
ericlink/adms-server
|
playframework-dist/play-1.1/samples-and-tests/chat/app/views/main.html
|
HTML
|
mit
| 780 |
I am a subclass which work when VM does not supports finalization lists.
I am about 3 times slower when it comes to finalizing items
|
vineetreddyrajula/pharo
|
src/Announcements-Core.package/LegacyWeakSubscription.class/README.md
|
Markdown
|
mit
| 132 |
import {Entity} from "../../../../../src/decorator/entity/Entity";
import {Column} from "../../../../../src/decorator/columns/Column";
import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn";
@Entity({
database: "yoman"
})
export class Category {
@PrimaryGeneratedColumn()
id: number;
@Column()
name: string;
}
|
typeorm/typeorm
|
test/functional/multi-schema-and-database/custom-junction-database/entity/Category.ts
|
TypeScript
|
mit
| 377 |
package com.qycloud.oatos.server.test.logic;
import org.junit.Test;
import org.unitils.spring.annotation.SpringBeanByType;
import com.conlect.oatos.dto.client.DepartmentAndUserDTO;
import com.conlect.oatos.http.PojoMapper;
import com.qycloud.oatos.server.domain.logic.UserLogic;
import com.qycloud.oatos.server.test.BaseTest;
public class UserLogicTest extends BaseTest {
@SpringBeanByType
private UserLogic userLogic;
@Test
public void getDepartmentAndUserWithStatusByUserId() {
DepartmentAndUserDTO dto = userLogic.getDepartmentAndUserWithStatusByUserId(user.getUserId());
System.out.println(PojoMapper.toJson(dto));
}
}
|
allanfish/facetime-demo
|
oatos_project/oatos-server/server/src/test/java/com/qycloud/oatos/server/test/logic/UserLogicTest.java
|
Java
|
mit
| 638 |
<!doctype html>
<html>
<title>package.json</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
<body>
<div id="wrapper">
<h1><a href="../files/package.json.html">package.json</a></h1> <p>Specifics of npm's package.json handling</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>This document is all you need to know about what's required in your package.json
file. It must be actual JSON, not just a JavaScript object literal.</p>
<p>A lot of the behavior described in this document is affected by the config
settings described in <code><a href="../misc/npm-config.html">npm-config(7)</a></code>.</p>
<h2 id="DEFAULT-VALUES">DEFAULT VALUES</h2>
<p>npm will default some values based on package contents.</p>
<ul><li><p><code>"scripts": {"start": "node server.js"}</code></p><p>If there is a <code>server.js</code> file in the root of your package, then npm
will default the <code>start</code> command to <code>node server.js</code>.</p></li><li><p><code>"scripts":{"preinstall": "node-waf clean || true; node-waf configure build"}</code></p><p>If there is a <code>wscript</code> file in the root of your package, npm will
default the <code>preinstall</code> command to compile using node-waf.</p></li><li><p><code>"scripts":{"preinstall": "node-gyp rebuild"}</code></p><p>If there is a <code>binding.gyp</code> file in the root of your package, npm will
default the <code>preinstall</code> command to compile using node-gyp.</p></li><li><p><code>"contributors": [...]</code></p><p>If there is an <code>AUTHORS</code> file in the root of your package, npm will
treat each line as a <code>Name <email> (url)</code> format, where email and url
are optional. Lines which start with a <code>#</code> or are blank, will be
ignored.</p></li></ul>
<h2 id="name">name</h2>
<p>The <em>most</em> important things in your package.json are the name and version fields.
Those are actually required, and your package won't install without
them. The name and version together form an identifier that is assumed
to be completely unique. Changes to the package should come along with
changes to the version.</p>
<p>The name is what your thing is called. Some tips:</p>
<ul><li>Don't put "js" or "node" in the name. It's assumed that it's js, since you're
writing a package.json file, and you can specify the engine using the "engines"
field. (See below.)</li><li>The name ends up being part of a URL, an argument on the command line, and a
folder name. Any name with non-url-safe characters will be rejected.
Also, it can't start with a dot or an underscore.</li><li>The name will probably be passed as an argument to require(), so it should
be something short, but also reasonably descriptive.</li><li>You may want to check the npm registry to see if there's something by that name
already, before you get too attached to it. http://registry.npmjs.org/</li></ul>
<h2 id="version">version</h2>
<p>The <em>most</em> important things in your package.json are the name and version fields.
Those are actually required, and your package won't install without
them. The name and version together form an identifier that is assumed
to be completely unique. Changes to the package should come along with
changes to the version.</p>
<p>Version must be parseable by
<a href="https://github.com/isaacs/node-semver">node-semver</a>, which is bundled
with npm as a dependency. (<code>npm install semver</code> to use it yourself.)</p>
<p>More on version numbers and ranges at <a href="../misc/semver.html">semver(7)</a>.</p>
<h2 id="description">description</h2>
<p>Put a description in it. It's a string. This helps people discover your
package, as it's listed in <code>npm search</code>.</p>
<h2 id="keywords">keywords</h2>
<p>Put keywords in it. It's an array of strings. This helps people
discover your package as it's listed in <code>npm search</code>.</p>
<h2 id="homepage">homepage</h2>
<p>The url to the project homepage.</p>
<p><strong>NOTE</strong>: This is <em>not</em> the same as "url". If you put a "url" field,
then the registry will think it's a redirection to your package that has
been published somewhere else, and spit at you.</p>
<p>Literally. Spit. I'm so not kidding.</p>
<h2 id="bugs">bugs</h2>
<p>The url to your project's issue tracker and / or the email address to which
issues should be reported. These are helpful for people who encounter issues
with your package.</p>
<p>It should look like this:</p>
<pre><code>{ "url" : "http://github.com/owner/project/issues"
, "email" : "[email protected]"
}</code></pre>
<p>You can specify either one or both values. If you want to provide only a url,
you can specify the value for "bugs" as a simple string instead of an object.</p>
<p>If a url is provided, it will be used by the <code>npm bugs</code> command.</p>
<h2 id="license">license</h2>
<p>You should specify a license for your package so that people know how they are
permitted to use it, and any restrictions you're placing on it.</p>
<p>The simplest way, assuming you're using a common license such as BSD or MIT, is
to just specify the name of the license you're using, like this:</p>
<pre><code>{ "license" : "BSD" }</code></pre>
<p>If you have more complex licensing terms, or you want to provide more detail
in your package.json file, you can use the more verbose plural form, like this:</p>
<pre><code>"licenses" : [
{ "type" : "MyLicense"
, "url" : "http://github.com/owner/project/path/to/license"
}
]</code></pre>
<p>It's also a good idea to include a license file at the top level in your package.</p>
<h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
<p>The "author" is one person. "contributors" is an array of people. A "person"
is an object with a "name" field and optionally "url" and "email", like this:</p>
<pre><code>{ "name" : "Barney Rubble"
, "email" : "[email protected]"
, "url" : "http://barnyrubble.tumblr.com/"
}</code></pre>
<p>Or you can shorten that all into a single string, and npm will parse it for you:</p>
<pre><code>"Barney Rubble <[email protected]> (http://barnyrubble.tumblr.com/)</code></pre>
<p>Both email and url are optional either way.</p>
<p>npm also sets a top-level "maintainers" field with your npm user info.</p>
<h2 id="files">files</h2>
<p>The "files" field is an array of files to include in your project. If
you name a folder in the array, then it will also include the files
inside that folder. (Unless they would be ignored by another rule.)</p>
<p>You can also provide a ".npmignore" file in the root of your package,
which will keep files from being included, even if they would be picked
up by the files array. The ".npmignore" file works just like a
".gitignore".</p>
<h2 id="main">main</h2>
<p>The main field is a module ID that is the primary entry point to your program.
That is, if your package is named <code>foo</code>, and a user installs it, and then does
<code>require("foo")</code>, then your main module's exports object will be returned.</p>
<p>This should be a module ID relative to the root of your package folder.</p>
<p>For most modules, it makes the most sense to have a main script and often not
much else.</p>
<h2 id="bin">bin</h2>
<p>A lot of packages have one or more executable files that they'd like to
install into the PATH. npm makes this pretty easy (in fact, it uses this
feature to install the "npm" executable.)</p>
<p>To use this, supply a <code>bin</code> field in your package.json which is a map of
command name to local file name. On install, npm will symlink that file into
<code>prefix/bin</code> for global installs, or <code>./node_modules/.bin/</code> for local
installs.</p>
<p>For example, npm has this:</p>
<pre><code>{ "bin" : { "npm" : "./cli.js" } }</code></pre>
<p>So, when you install npm, it'll create a symlink from the <code>cli.js</code> script to
<code>/usr/local/bin/npm</code>.</p>
<p>If you have a single executable, and its name should be the name
of the package, then you can just supply it as a string. For example:</p>
<pre><code>{ "name": "my-program"
, "version": "1.2.5"
, "bin": "./path/to/program" }</code></pre>
<p>would be the same as this:</p>
<pre><code>{ "name": "my-program"
, "version": "1.2.5"
, "bin" : { "my-program" : "./path/to/program" } }</code></pre>
<h2 id="man">man</h2>
<p>Specify either a single file or an array of filenames to put in place for the
<code>man</code> program to find.</p>
<p>If only a single file is provided, then it's installed such that it is the
result from <code>man <pkgname></code>, regardless of its actual filename. For example:</p>
<pre><code>{ "name" : "foo"
, "version" : "1.2.3"
, "description" : "A packaged foo fooer for fooing foos"
, "main" : "foo.js"
, "man" : "./man/doc.1"
}</code></pre>
<p>would link the <code>./man/doc.1</code> file in such that it is the target for <code>man foo</code></p>
<p>If the filename doesn't start with the package name, then it's prefixed.
So, this:</p>
<pre><code>{ "name" : "foo"
, "version" : "1.2.3"
, "description" : "A packaged foo fooer for fooing foos"
, "main" : "foo.js"
, "man" : [ "./man/foo.1", "./man/bar.1" ]
}</code></pre>
<p>will create files to do <code>man foo</code> and <code>man foo-bar</code>.</p>
<p>Man files must end with a number, and optionally a <code>.gz</code> suffix if they are
compressed. The number dictates which man section the file is installed into.</p>
<pre><code>{ "name" : "foo"
, "version" : "1.2.3"
, "description" : "A packaged foo fooer for fooing foos"
, "main" : "foo.js"
, "man" : [ "./man/foo.1", "./man/foo.2" ]
}</code></pre>
<p>will create entries for <code>man foo</code> and <code>man 2 foo</code></p>
<h2 id="directories">directories</h2>
<p>The CommonJS <a href="http://wiki.commonjs.org/wiki/Packages/1.0">Packages</a> spec details a
few ways that you can indicate the structure of your package using a <code>directories</code>
hash. If you look at <a href="http://registry.npmjs.org/npm/latest">npm's package.json</a>,
you'll see that it has directories for doc, lib, and man.</p>
<p>In the future, this information may be used in other creative ways.</p>
<h3 id="directories-lib">directories.lib</h3>
<p>Tell people where the bulk of your library is. Nothing special is done
with the lib folder in any way, but it's useful meta info.</p>
<h3 id="directories-bin">directories.bin</h3>
<p>If you specify a "bin" directory, then all the files in that folder will
be used as the "bin" hash.</p>
<p>If you have a "bin" hash already, then this has no effect.</p>
<h3 id="directories-man">directories.man</h3>
<p>A folder that is full of man pages. Sugar to generate a "man" array by
walking the folder.</p>
<h3 id="directories-doc">directories.doc</h3>
<p>Put markdown files in here. Eventually, these will be displayed nicely,
maybe, someday.</p>
<h3 id="directories-example">directories.example</h3>
<p>Put example scripts in here. Someday, it might be exposed in some clever way.</p>
<h2 id="repository">repository</h2>
<p>Specify the place where your code lives. This is helpful for people who
want to contribute. If the git repo is on github, then the <code>npm docs</code>
command will be able to find you.</p>
<p>Do it like this:</p>
<pre><code>"repository" :
{ "type" : "git"
, "url" : "http://github.com/isaacs/npm.git"
}
"repository" :
{ "type" : "svn"
, "url" : "http://v8.googlecode.com/svn/trunk/"
}</code></pre>
<p>The URL should be a publicly available (perhaps read-only) url that can be handed
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It's for computers.</p>
<h2 id="scripts">scripts</h2>
<p>The "scripts" member is an object hash of script commands that are run
at various times in the lifecycle of your package. The key is the lifecycle
event, and the value is the command to run at that point.</p>
<p>See <code><a href="../misc/npm-scripts.html">npm-scripts(7)</a></code> to find out more about writing package scripts.</p>
<h2 id="config">config</h2>
<p>A "config" hash can be used to set configuration
parameters used in package scripts that persist across upgrades. For
instance, if a package had the following:</p>
<pre><code>{ "name" : "foo"
, "config" : { "port" : "8080" } }</code></pre>
<p>and then had a "start" command that then referenced the
<code>npm_package_config_port</code> environment variable, then the user could
override that by doing <code>npm config set foo:port 8001</code>.</p>
<p>See <code><a href="../misc/npm-config.html">npm-config(7)</a></code> and <code><a href="../misc/npm-scripts.html">npm-scripts(7)</a></code> for more on package
configs.</p>
<h2 id="dependencies">dependencies</h2>
<p>Dependencies are specified with a simple hash of package name to
version range. The version range is a string which has one or more
space-separated descriptors. Dependencies can also be identified with
a tarball or git URL.</p>
<p><strong>Please do not put test harnesses or transpilers in your
<code>dependencies</code> hash.</strong> See <code>devDependencies</code>, below.</p>
<p>See <a href="../misc/semver.html">semver(7)</a> for more details about specifying version ranges.</p>
<ul><li><code>version</code> Must match <code>version</code> exactly</li><li><code>>version</code> Must be greater than <code>version</code></li><li><code>>=version</code> etc</li><li><code><version</code></li><li><code><=version</code></li><li><code>~version</code> "Approximately equivalent to version" See <a href="../misc/semver.html">semver(7)</a></li><li><code>1.2.x</code> 1.2.0, 1.2.1, etc., but not 1.3.0</li><li><code>http://...</code> See 'URLs as Dependencies' below</li><li><code>*</code> Matches any version</li><li><code>""</code> (just an empty string) Same as <code>*</code></li><li><code>version1 - version2</code> Same as <code>>=version1 <=version2</code>.</li><li><code>range1 || range2</code> Passes if either range1 or range2 are satisfied.</li><li><code>git...</code> See 'Git URLs as Dependencies' below</li><li><code>user/repo</code> See 'GitHub URLs' below</li></ul>
<p>For example, these are all valid:</p>
<pre><code>{ "dependencies" :
{ "foo" : "1.0.0 - 2.9999.9999"
, "bar" : ">=1.0.2 <2.1.2"
, "baz" : ">1.0.2 <=2.3.4"
, "boo" : "2.0.1"
, "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0"
, "asd" : "http://asdf.com/asdf.tar.gz"
, "til" : "~1.2"
, "elf" : "~1.2.3"
, "two" : "2.x"
, "thr" : "3.3.x"
}
}</code></pre>
<h3 id="URLs-as-Dependencies">URLs as Dependencies</h3>
<p>You may specify a tarball URL in place of a version range.</p>
<p>This tarball will be downloaded and installed locally to your package at
install time.</p>
<h3 id="Git-URLs-as-Dependencies">Git URLs as Dependencies</h3>
<p>Git urls can be of the form:</p>
<pre><code>git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+ssh://user@hostname/project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish</code></pre>
<p>The <code>commit-ish</code> can be any tag, sha, or branch which can be supplied as
an argument to <code>git checkout</code>. The default is <code>master</code>.</p>
<h2 id="GitHub-URLs">GitHub URLs</h2>
<p>As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-project". For example:</p>
<p><code>json
{
"name": "foo",
"version": "0.0.0",
"dependencies": {
"express": "visionmedia/express"
}
}
</code></p>
<h2 id="devDependencies">devDependencies</h2>
<p>If someone is planning on downloading and using your module in their
program, then they probably don't want or need to download and build
the external test or documentation framework that you use.</p>
<p>In this case, it's best to list these additional items in a
<code>devDependencies</code> hash.</p>
<p>These things will be installed when doing <code>npm link</code> or <code>npm install</code>
from the root of a package, and can be managed like any other npm
configuration param. See <code><a href="../misc/npm-config.html">npm-config(7)</a></code> for more on the topic.</p>
<p>For build steps that are not platform-specific, such as compiling
CoffeeScript or other languages to JavaScript, use the <code>prepublish</code>
script to do this, and make the required package a devDependency.</p>
<p>For example:</p>
<p><code>json
{ "name": "ethopia-waza",
"description": "a delightfully fruity coffee varietal",
"version": "1.2.3",
"devDependencies": {
"coffee-script": "~1.6.3"
},
"scripts": {
"prepublish": "coffee -o lib/ -c src/waza.coffee"
},
"main": "lib/waza.js"
}
</code></p>
<p>The <code>prepublish</code> script will be run before publishing, so that users
can consume the functionality without requiring them to compile it
themselves. In dev mode (ie, locally running <code>npm install</code>), it'll
run this script as well, so that you can test it easily.</p>
<h2 id="bundledDependencies">bundledDependencies</h2>
<p>Array of package names that will be bundled when publishing the package.</p>
<p>If this is spelled <code>"bundleDependencies"</code>, then that is also honorable.</p>
<h2 id="optionalDependencies">optionalDependencies</h2>
<p>If a dependency can be used, but you would like npm to proceed if it
cannot be found or fails to install, then you may put it in the
<code>optionalDependencies</code> hash. This is a map of package name to version
or url, just like the <code>dependencies</code> hash. The difference is that
failure is tolerated.</p>
<p>It is still your program's responsibility to handle the lack of the
dependency. For example, something like this:</p>
<pre><code>try {
var foo = require('foo')
var fooVersion = require('foo/package.json').version
} catch (er) {
foo = null
}
if ( notGoodFooVersion(fooVersion) ) {
foo = null
}
// .. then later in your program ..
if (foo) {
foo.doFooThings()
}</code></pre>
<p>Entries in <code>optionalDependencies</code> will override entries of the same name in
<code>dependencies</code>, so it's usually best to only put in one place.</p>
<h2 id="engines">engines</h2>
<p>You can specify the version of node that your stuff works on:</p>
<pre><code>{ "engines" : { "node" : ">=0.10.3 <0.12" } }</code></pre>
<p>And, like with dependencies, if you don't specify the version (or if you
specify "*" as the version), then any version of node will do.</p>
<p>If you specify an "engines" field, then npm will require that "node" be
somewhere on that list. If "engines" is omitted, then npm will just assume
that it works on node.</p>
<p>You can also use the "engines" field to specify which versions of npm
are capable of properly installing your program. For example:</p>
<pre><code>{ "engines" : { "npm" : "~1.0.20" } }</code></pre>
<p>Note that, unless the user has set the <code>engine-strict</code> config flag, this
field is advisory only.</p>
<h2 id="engineStrict">engineStrict</h2>
<p>If you are sure that your module will <em>definitely not</em> run properly on
versions of Node/npm other than those specified in the <code>engines</code> hash,
then you can set <code>"engineStrict": true</code> in your package.json file.
This will override the user's <code>engine-strict</code> config setting.</p>
<p>Please do not do this unless you are really very very sure. If your
engines hash is something overly restrictive, you can quite easily and
inadvertently lock yourself into obscurity and prevent your users from
updating to new versions of Node. Consider this choice carefully. If
people abuse it, it will be removed in a future version of npm.</p>
<h2 id="os">os</h2>
<p>You can specify which operating systems your
module will run on:</p>
<pre><code>"os" : [ "darwin", "linux" ]</code></pre>
<p>You can also blacklist instead of whitelist operating systems,
just prepend the blacklisted os with a '!':</p>
<pre><code>"os" : [ "!win32" ]</code></pre>
<p>The host operating system is determined by <code>process.platform</code></p>
<p>It is allowed to both blacklist, and whitelist, although there isn't any
good reason to do this.</p>
<h2 id="cpu">cpu</h2>
<p>If your code only runs on certain cpu architectures,
you can specify which ones.</p>
<pre><code>"cpu" : [ "x64", "ia32" ]</code></pre>
<p>Like the <code>os</code> option, you can also blacklist architectures:</p>
<pre><code>"cpu" : [ "!arm", "!mips" ]</code></pre>
<p>The host architecture is determined by <code>process.arch</code></p>
<h2 id="preferGlobal">preferGlobal</h2>
<p>If your package is primarily a command-line application that should be
installed globally, then set this value to <code>true</code> to provide a warning
if it is installed locally.</p>
<p>It doesn't actually prevent users from installing it locally, but it
does help prevent some confusion if it doesn't work as expected.</p>
<h2 id="private">private</h2>
<p>If you set <code>"private": true</code> in your package.json, then npm will refuse
to publish it.</p>
<p>This is a way to prevent accidental publication of private repositories.
If you would like to ensure that a given package is only ever published
to a specific registry (for example, an internal registry),
then use the <code>publishConfig</code> hash described below
to override the <code>registry</code> config param at publish-time.</p>
<h2 id="publishConfig">publishConfig</h2>
<p>This is a set of config values that will be used at publish-time. It's
especially handy if you want to set the tag or registry, so that you can
ensure that a given package is not tagged with "latest" or published to
the global public registry by default.</p>
<p>Any config values can be overridden, but of course only "tag" and
"registry" probably matter for the purposes of publishing.</p>
<p>See <code><a href="../misc/npm-config.html">npm-config(7)</a></code> to see the list of config options that can be
overridden.</p>
<h2 id="SEE-ALSO">SEE ALSO</h2>
<ul><li><a href="../misc/semver.html">semver(7)</a></li><li><a href="../cli/npm-init.html">npm-init(1)</a></li><li><a href="../cli/npm-version.html">npm-version(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../cli/npm-help.html">npm-help(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li></ul>
</div>
<p id="footer">package.json — [email protected]</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
.filter(function (el) {
return el.parentNode === wrapper
&& el.tagName.match(/H[1-6]/)
&& el.id
})
var l = 2
, toc = document.createElement("ul")
toc.innerHTML = els.map(function (el) {
var i = el.tagName.charAt(1)
, out = ""
while (i > l) {
out += "<ul>"
l ++
}
while (i < l) {
out += "</ul>"
l --
}
out += "<li><a href='#" + el.id + "'>" +
( el.innerText || el.text || el.innerHTML)
+ "</a>"
return out
}).join("\n")
toc.id = "toc"
document.body.appendChild(toc)
})()
</script>
|
birkestroem/NougatUI
|
tools/bin/node_modules/npm/html/doc/files/package.json.html
|
HTML
|
mit
| 25,667 |
# Migrating from v0.17.x to v2
## New Features
* This documentation!
* Subscriptions - [details](https://graphql-dotnet.github.io/docs/getting-started/subscriptions)
* DataLoader - helps solve N+1 requests - [details](https://graphql-dotnet.github.io/docs/guides/dataloader)
* New `SchemaBuilder` that supports GraphQL schema language. [details](https://graphql-dotnet.github.io/docs/getting-started/introduction#schema-first-approach)
* Unique Directive Per Location Validation Rule - [details](https://github.com/graphql-dotnet/graphql-dotnet/issues/231)
* Apollo Tracing - [details](https://graphql-dotnet.github.io/docs/getting-started/metrics)
* Parser support for the `null` keyword
* Addition of `IDependencyResolver` for dependency injection - [details](https://graphql-dotnet.github.io/docs/getting-started/dependency-injection)
* Add `ThrowOnUnhandledException` to `ExecutionOptions`. [details](https://github.com/graphql-dotnet/graphql-dotnet/pull/776)
* Add the ability to return a `GraphQLTypeReference` from `ResolveType` [details](https://github.com/graphql-dotnet/graphql-dotnet/pull/775)
* General updates to conform to the June 2018 Specification - [details](https://github.com/facebook/graphql/releases/tag/June2018)
## Breaking Changes
### Dependency Injection
The func that was previously used for dependency injection has been replaced by the `IDependencyResolver` interface. Use `FuncDependencyResolver` to help integrate with containers. See the [Dependency Injection documentation](https://graphql-dotnet.github.io/docs/getting-started/dependency-injection) for more details.
```csharp
[Obsolete]
public Schema(Func<Type, IGraphType> resolveType)
: this(new FuncDependencyResolver(resolveType))
{
}
public Schema(IDependencyResolver dependencyResolver)
{
...
}
```
### DocumentWriter
The `JsonSerializerSettings` now use all default values. This was altered to support the changes to dates.
### Dates
The `DateGraphType` has been split into multiple types. [See the GitHub issue](https://github.com/graphql-dotnet/graphql-dotnet/issues/662) for more details.
- `DateGraphType` - A date with no time.
- Scalar Name: `Date`
- Format: `2018-05-17` (ISO8601 compliant).
- Maps to .NET type - `System.DateTime`
- Added to `GraphTypeRegistry` as the default representation of `System.DateTime`.
- `DateTimeGraphType` - A date and time.
- Scalar Name: `DateTime`
- Format: `2018-05-17T12:11:06.3684072Z` (ISO8601 compliant).
- Maps to .NET type - `System.DateTime`
- `DateTimeOffsetGraphType` - A date and time with an offset.
- Scalar Name: `DateTimeOffset`
- Format: : `2018-05-17T13:11:06.368408+01:00` (ISO8601 compliant).
- Maps to .NET type `System.DateTimeOffset`
- Added to `GraphTypeRegistry` as the default representation of `System.DateTimeOffset`.
- `TimeSpanSecondsGraphType` - A period of time as seconds.
- Scalar Name: `Seconds`
- Format: `10`
- Maps to .NET type - `System.TimeSpan`
- Added to `GraphTypeRegistry` as the default representation of `System.TimeSpan`.
- `TimeSpanMillisecondsGraphType` - A period of time as milliseconds.
- Scalar Name: `Milliseconds`
- Format: `100`
- Maps to .NET type - `System.TimeSpan`
### Names
Fields, enumerations, and arguments all now have their names validated according to the GraphQL spec, which is `/[_A-Za-z][_0-9A-Za-z]*/`.
`QueryArgument` names are now run through the `IFieldNameConverter` set on the `Schema`.
### SchemaPrinter
`SchemaPrinter` now only ignores core GraphQL scalars by default. Those are `String`, `Boolean`, `Int`, `Float`, and `ID`. [See the GitHub issue](https://github.com/graphql-dotnet/graphql-dotnet/issues/378) for more details.
|
graphql-dotnet/graphql-dotnet
|
docs2/site/docs/migrations/migration2.md
|
Markdown
|
mit
| 3,705 |
class User < ActiveRecord::Base
comma do
first_name
last_name
full_name "Name"
end
comma :shortened do
first_name
last_name
end
def full_name
"#{first_name} #{last_name}".strip
end
end
|
crafterm/comma
|
spec/rails_app/app/models/user.rb
|
Ruby
|
mit
| 223 |
require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
RSpec.describe VictorOps::Client do
describe "version" do
it 'should be a string type' do
expect(VictorOps::Client::VERSION).to be_a(String)
end
end
end
|
clok/victor-ops-client
|
spec/version_spec.rb
|
Ruby
|
mit
| 246 |
<?php
namespace knx\ParametrizarBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ContratoType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('numero', 'text', array('required' => true, 'attr' => array('placeholder' => 'Ingrese el nombre del contacto', 'autofocus'=>'autofocus')))
->add('fechaInicio', 'date', array('required' => true))
->add('fechaFin', 'date', array('required' => true))
->add('contacto', 'date', array('required' => true, 'attr' => array('placeholder' => 'Ingrese el nombre del contacto')))
->add('contacto', 'text', array('required' => true, 'attr' => array('placeholder' => 'Ingrese el nombre del contacto')))
->add('cargo', 'text', array('required' => false, 'attr' => array('placeholder' => 'Ingrese el cargo del contacto')))
->add('telefono', 'integer', array('required' => false, 'label' => 'Telรฉfono', 'attr' => array('placeholder' => 'Nรบmero telefonico')))
->add('celular', 'text', array('required' => false, 'attr' => array('placeholder' => 'Nรบmero movil')))
->add('email', 'text', array('attr' => array('placeholder' => 'Correo electrรณnico')))
->add('estado', 'choice', array('required' => true, 'choices' => array('A' => 'Activo', 'I' => 'Inactivo')))
->add('porcentaje', 'percent', array('required' => true, 'precision' => 0, 'attr' => array('placeholder' => 'Porcentaje pactado')))
->add('tipo', 'choice', array('required' => true, 'choices' => array('P' => 'Actividades', 'M' => 'Medicamentos', 'PP' => 'PYP')))
->add('observacion', 'text', array('required' => false, 'attr' => array('placeholder' => 'Ingrese observaciรณn del contacto')))
;
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'knx\ParametrizarBundle\Entity\Contrato'
));
}
public function getName()
{
return 'gstContrato';
}
}
|
hbocanegra/knx
|
src/knx/ParametrizarBundle/Form/ContratoType.php
|
PHP
|
mit
| 2,208 |
<div class="jumbotron">
<img src="/{{ .Page.Params.Image }}" class="img-responsive pull-right img-rounded">
{{ .Inner }}
<br>
</div>
|
haydex/nexuslab
|
local/layouts/shortcodes/profile.html
|
HTML
|
mit
| 135 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_72) on Wed Nov 05 20:55:19 EST 2014 -->
<title>Cassandra.AsyncClient.system_add_column_family_call (apache-cassandra API)</title>
<meta name="date" content="2014-11-05">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Cassandra.AsyncClient.system_add_column_family_call (apache-cassandra API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Cassandra.AsyncClient.system_add_column_family_call.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncClient.set_keyspace_call.html" title="class in org.apache.cassandra.thrift"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncClient.system_add_keyspace_call.html" title="class in org.apache.cassandra.thrift"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.AsyncClient.system_add_column_family_call.html" target="_top">Frames</a></li>
<li><a href="Cassandra.AsyncClient.system_add_column_family_call.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested_classes_inherited_from_class_org.apache.thrift.async.TAsyncMethodCall">Nested</a> | </li>
<li><a href="#fields_inherited_from_class_org.apache.thrift.async.TAsyncMethodCall">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.cassandra.thrift</div>
<h2 title="Class Cassandra.AsyncClient.system_add_column_family_call" class="title">Class Cassandra.AsyncClient.system_add_column_family_call</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.thrift.async.TAsyncMethodCall</li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.thrift.Cassandra.AsyncClient.system_add_column_family_call</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncClient.html" title="class in org.apache.cassandra.thrift">Cassandra.AsyncClient</a></dd>
</dl>
<hr>
<br>
<pre>public static class <span class="strong">Cassandra.AsyncClient.system_add_column_family_call</span>
extends org.apache.thrift.async.TAsyncMethodCall</pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="nested_classes_inherited_from_class_org.apache.thrift.async.TAsyncMethodCall">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from class org.apache.thrift.async.TAsyncMethodCall</h3>
<code>org.apache.thrift.async.TAsyncMethodCall.State</code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.thrift.async.TAsyncMethodCall">
<!-- -->
</a>
<h3>Fields inherited from class org.apache.thrift.async.TAsyncMethodCall</h3>
<code>client, transport</code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncClient.system_add_column_family_call.html#Cassandra.AsyncClient.system_add_column_family_call(org.apache.cassandra.thrift.CfDef,%20org.apache.thrift.async.AsyncMethodCallback,%20org.apache.thrift.async.TAsyncClient,%20org.apache.thrift.protocol.TProtocolFactory,%20org.apache.thrift.transport.TNonblockingTransport)">Cassandra.AsyncClient.system_add_column_family_call</a></strong>(<a href="../../../../org/apache/cassandra/thrift/CfDef.html" title="class in org.apache.cassandra.thrift">CfDef</a> cf_def,
org.apache.thrift.async.AsyncMethodCallback resultHandler,
org.apache.thrift.async.TAsyncClient client,
org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.transport.TNonblockingTransport transport)</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncClient.system_add_column_family_call.html#getResult()">getResult</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncClient.system_add_column_family_call.html#write_args(org.apache.thrift.protocol.TProtocol)">write_args</a></strong>(org.apache.thrift.protocol.TProtocol prot)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.thrift.async.TAsyncMethodCall">
<!-- -->
</a>
<h3>Methods inherited from class org.apache.thrift.async.TAsyncMethodCall</h3>
<code>getClient, getFrameBuffer, getSequenceId, getStartTime, getState, getTimeoutTimestamp, hasTimeout, isFinished, onError, prepareMethodCall, transition</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Cassandra.AsyncClient.system_add_column_family_call(org.apache.cassandra.thrift.CfDef, org.apache.thrift.async.AsyncMethodCallback, org.apache.thrift.async.TAsyncClient, org.apache.thrift.protocol.TProtocolFactory, org.apache.thrift.transport.TNonblockingTransport)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Cassandra.AsyncClient.system_add_column_family_call</h4>
<pre>public Cassandra.AsyncClient.system_add_column_family_call(<a href="../../../../org/apache/cassandra/thrift/CfDef.html" title="class in org.apache.cassandra.thrift">CfDef</a> cf_def,
org.apache.thrift.async.AsyncMethodCallback resultHandler,
org.apache.thrift.async.TAsyncClient client,
org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.transport.TNonblockingTransport transport)
throws org.apache.thrift.TException</pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code>org.apache.thrift.TException</code></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="write_args(org.apache.thrift.protocol.TProtocol)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write_args</h4>
<pre>public void write_args(org.apache.thrift.protocol.TProtocol prot)
throws org.apache.thrift.TException</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>write_args</code> in class <code>org.apache.thrift.async.TAsyncMethodCall</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>org.apache.thrift.TException</code></dd></dl>
</li>
</ul>
<a name="getResult()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getResult</h4>
<pre>public java.lang.String getResult()
throws <a href="../../../../org/apache/cassandra/thrift/InvalidRequestException.html" title="class in org.apache.cassandra.thrift">InvalidRequestException</a>,
<a href="../../../../org/apache/cassandra/thrift/SchemaDisagreementException.html" title="class in org.apache.cassandra.thrift">SchemaDisagreementException</a>,
org.apache.thrift.TException</pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/thrift/InvalidRequestException.html" title="class in org.apache.cassandra.thrift">InvalidRequestException</a></code></dd>
<dd><code><a href="../../../../org/apache/cassandra/thrift/SchemaDisagreementException.html" title="class in org.apache.cassandra.thrift">SchemaDisagreementException</a></code></dd>
<dd><code>org.apache.thrift.TException</code></dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Cassandra.AsyncClient.system_add_column_family_call.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncClient.set_keyspace_call.html" title="class in org.apache.cassandra.thrift"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.AsyncClient.system_add_keyspace_call.html" title="class in org.apache.cassandra.thrift"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.AsyncClient.system_add_column_family_call.html" target="_top">Frames</a></li>
<li><a href="Cassandra.AsyncClient.system_add_column_family_call.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested_classes_inherited_from_class_org.apache.thrift.async.TAsyncMethodCall">Nested</a> | </li>
<li><a href="#fields_inherited_from_class_org.apache.thrift.async.TAsyncMethodCall">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2014 The Apache Software Foundation</small></p>
</body>
</html>
|
vangav/vos_backend
|
apache-cassandra-2.1.2/javadoc/org/apache/cassandra/thrift/Cassandra.AsyncClient.system_add_column_family_call.html
|
HTML
|
mit
| 14,868 |
import _plotly_utils.basevalidators
class StepdefaultsValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="stepdefaults", parent_name="indicator.gauge", **kwargs
):
super(StepdefaultsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_str=kwargs.pop("data_class_str", "Step"),
data_docs=kwargs.pop(
"data_docs",
"""
""",
),
**kwargs
)
|
plotly/python-api
|
packages/python/plotly/plotly/validators/indicator/gauge/_stepdefaults.py
|
Python
|
mit
| 548 |
package com.dhemery.annotation.testing;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
public class SourceFile {
private final Path path;
private final List<String> content;
public SourceFile(Path relativePath, List<String> content) {
path = relativePath;
this.content = Collections.unmodifiableList(content);
}
public SourceFile(String relativePath, List<String> content) {
this(Paths.get(relativePath), content);
}
public Path path() {
return path;
}
public List<String> content() {
return content;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
return Objects.equals(this.path, ((SourceFile) o).path());
}
@Override
public int hashCode() {
return Objects.hash(path);
}
}
|
dhemery/generator
|
src/test/java/com/dhemery/annotation/testing/SourceFile.java
|
Java
|
mit
| 932 |
//
// DBProfileViewControllerUpdateContext.h
// DBProfileViewController
//
// Created by Devon Boyer on 2016-03-20.
// Copyright (c) 2015 Devon Boyer. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DBProfileViewControllerUpdateContext : NSObject
@property (nonatomic, assign) CGFloat beforeUpdatesDetailsViewHeight;
@property (nonatomic, assign) CGFloat afterUpdatesDetailsViewHeight;
@end
|
DevonBoyer/DBProfileViewController
|
Pods/DBProfileViewController/Source/Private/DBProfileViewControllerUpdateContext.h
|
C
|
mit
| 420 |
# -*- coding: utf-8 -*-
from mock import Mock, patch
from flask.ext.login import login_user
from feedback_test.unit.test_base import BaseTestCase
from feedback_test.unit.util import insert_a_user
from feedback.user.models import User
class TestLoginAuth(BaseTestCase):
render_template = True
def setUp(self):
super(TestLoginAuth, self).setUp()
self.email = '[email protected]'
insert_a_user(email=self.email)
def test_login_route(self):
'''
Test the login route works propertly
'''
request = self.client.get('/login')
self.assert200(request)
self.assert_template_used('user/login.html')
@patch('urllib2.urlopen')
def test_auth_persona_failure(self, urlopen):
'''
Test that we reject when persona throws bad statuses to us
'''
mock_open = Mock()
mock_open.read.side_effect = ['{"status": "error"}']
urlopen.return_value = mock_open
post = self.client.post('/auth', data=dict(
assertion='test'
))
self.assert403(post)
@patch('urllib2.urlopen')
def test_auth_no_user(self, urlopen):
'''
Test that we reject bad email addresses
'''
mock_open = Mock()
mock_open.read.side_effect = ['{"status": "okay", "email": "not_a_valid_email"}']
urlopen.return_value = mock_open
post = self.client.post('/auth', data=dict(
assertion='test'
))
self.assert403(post)
@patch('urllib2.urlopen')
def test_logout(self, urlopen):
'''
Test that we can logout properly
'''
login_user(User.query.all()[0])
logout = self.client.get('/logout', follow_redirects=True)
self.assertTrue('You are logged out' in logout.data)
self.assert_template_used('user/logout.html')
login_user(User.query.all()[0])
logout = self.client.post('/logout?persona=True', follow_redirects=True)
self.assertTrue(logout.data, 'OK')
|
codeforamerica/mdc-feedback
|
feedback_test/unit/public/test_public.py
|
Python
|
mit
| 2,042 |
#ifndef _VRML_LOADER_CPP
#define _VRML_LOADER_CPP
#include "Globals.h"
#include "VRMLLoader.h"
#include <memory.h>
#include <stdio.h>
#include <fstream>
void
computeNormals( Mesh &m ) {
m.normals = new vector3[m.numVerts];
// TODO: calculate the normals per vertex
int *count=new int[m.numVerts];//counting uses extra memory by is very fast
int i=0;
for(i=0;i<m.numVerts;i++)
count[i]=0;
vector3 normal;
for(i=0;i<m.numFaces;i++)//calculate running average by iterating faces
{
normal=CrossProduct( m.vertices[(int)m.faces[i].y] - m.vertices[(int) m.faces[i].x],
m.vertices[(int)m.faces[i].z] - m.vertices[(int) m.faces[i].x]).normalize();
m.normals[((int)m.faces[i].x)]=(((m.normals[((int)m.faces[i].x)] * (float)(count[((int)m.faces[i].x)])) + normal)/(count[((int)m.faces[i].x)]+1)).normalize();
m.normals[((int)m.faces[i].y)]=(((m.normals[((int)m.faces[i].y)] * (float)(count[((int)m.faces[i].y)])) + normal)/(count[((int)m.faces[i].y)]+1)).normalize();
m.normals[((int)m.faces[i].z)]=(((m.normals[((int)m.faces[i].z)] * (float)(count[((int)m.faces[i].z)])) + normal)/(count[((int)m.faces[i].z)]+1)).normalize();
count[((int)m.faces[i].x)]++;
count[((int)m.faces[i].y)]++;
count[((int)m.faces[i].z)]++;
}
}
void
createArrays( VRIndexedFaceSet *ifset, Mesh &m ) {
m.ifset = ifset;
m.numVerts = ifset->coord->point.numValues;
m.vertices = new vector3[m.numVerts];
for (int i = 0; i < m.numVerts; i++) {
m.vertices[i].set(ifset->coord->point.values[i]);
}
m.numFaces = (int) (ifset->coordIndex.numValues * 0.25); // There is one face for every four of these values
m.faces = new vector3[m.numFaces];
for (int j = 0; j < ifset->coordIndex.numValues; j += 4) {
m.faces[j / 4].set( ifset->coordIndex.values[j], ifset->coordIndex.values[j + 1], ifset->coordIndex.values[j + 2] );
}
}
/**
* To use the return value of loadVRML to render the geometry, you might do something like the following:
void renderGeometry() {
glDisable( GL_LIGHTING );
glColor3f( 0.2, 0.5, 0.5 );
glBegin( GL_TRIANGLES );
for ( int i = 0; i < meshes.size(); i++ ) {
for ( int j = 0; j < meshes[i].numFaces; j++ ) {
glVertex3fv( meshes[i].vertices[(int) meshes[i].faces[j].x].get() );
glVertex3fv( meshes[i].vertices[(int) meshes[i].faces[j].y].get() );
glVertex3fv( meshes[i].vertices[(int) meshes[i].faces[j].z].get() );
}
}
glEnd();
}
*/
std::vector < Mesh >
loadVRML( char *filename ) {
std::vector < Mesh > meshes;
VRNode *root = Vrml2VR( filename );
if (!root) {
cout << "loadVRML: could not load file " << filename << endl;
return meshes;
}
VRMFNode nodes;
root->getNodesOfType( VR_INDEXED_FACE_SET, nodes );
VRNode **sets = nodes.values;
VRIndexedFaceSet **faceSets = (VRIndexedFaceSet**) sets;
for (int i = 0; i < nodes.numValues; i++) {
if (faceSets[i]->triangulate() != VR_OK) {
cerr << "Unable to triangulate indexed face set " << i << " in " << filename << endl;
}
Mesh mesh;
createArrays( faceSets[i], mesh );
computeNormals( mesh );
meshes.push_back( mesh );
}
return meshes;
}
#endif //_VRML_LOADER_CPP
|
ducis/pile-of-cpp
|
GameProgramCourseProj/FinalProject/VRMLLoader.cpp
|
C++
|
mit
| 3,213 |
๏ปฟusing Microsoft.Extensions.DependencyInjection;
namespace GM.Utilities.TranslateText
{
public class Program
{
private static string[] allDocuments = { "overview1", "overview2", "workflow", "project-status", "setup", "sys-design", "dev-notes", "database" };
private static string[] allLanguages = { "de", "es", "fr", "it", "fi", "ar", "sw", "zh", "pt", "bn", "hi" };
// Edit these arrays as you prefer
private static string[] someDocuments = { "sys-design" };
private static string[] someLanguages = { "hu" };
private static bool update = true; // if true, only re-translate files that were edited (NOT WORKING)
public static void Main(string[] args)
{
// create service collection
var services = new ServiceCollection();
ConfigureServices(services);
// create service provider
var serviceProvider = services.BuildServiceProvider();
GMFileAccess.SetGoogleCredentialsEnvironmentVariable();
TranslateDocs translate = serviceProvider.GetService<TranslateDocs>();
// ################ Translate documentation files ########################
// UNCOMMENT one of the following lines as you prefer
//TranslateDocumentsLanguages(allDocuments, allLanguages, update);
//translate.TranslateDocuments(allDocuments, someLanguages, update);
//translate.TranslateDocuments(someDocuments, allLanguages, update);
//translate.TranslateDocuments(someDocuments, someLanguages, update);
// ################ Add new language to lookup arrays for GUI ########################
// UNCOMMENT this to add a new language to the arrays.
//translate.AddNewLanguageToArrays("hu", "Hungarian")
}
private static void ConfigureServices(IServiceCollection services)
{
services.AddTransient<TranslateInCloud>();
services.AddTransient<TranslateDocs>();
}
}
}
|
johnpankowicz/govmeeting
|
Utilities/TranslateText/Program.cs
|
C#
|
mit
| 2,061 |
namespace Codisa.InterwayDocs.Business
{
public partial class IncomingRegister
{
#region OnDeserialized actions
/*/// <summary>
/// This method is called on a newly deserialized object
/// after deserialization is complete.
/// </summary>
/// <param name="context">Serialization context object.</param>
protected override void OnDeserialized(System.Runtime.Serialization.StreamingContext context)
{
base.OnDeserialized(context);
// add your custom OnDeserialized actions here.
}*/
#endregion
#region Custom Business Rules and Property Authorization
//partial void AddBusinessRulesExtend()
//{
// throw new NotImplementedException();
//}
#endregion
#region Implementation of DataPortal Hooks
//partial void OnCreate(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnFetchPre(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnFetchPost(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnFetchRead(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnUpdatePre(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnUpdatePost(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnInsertPre(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
//partial void OnInsertPost(DataPortalHookArgs args)
//{
// throw new NotImplementedException();
//}
#endregion
}
}
|
CslaGenFork/CslaGenFork
|
trunk/CoverageTest/InterwayDocs/DAL-DTO/Codisa.InterwayDocs.Business/IncomingRegister.cs
|
C#
|
mit
| 1,985 |
export { FormlyFieldInput } from './input';
export { FormlyFieldCheckbox } from './checkbox';
export { FormlyFieldRadio } from './radio';
export { FormlyFieldSelect } from './select';
export { FormlyFieldTextArea } from './textarea';
|
formly-js/ng-formly
|
src/primeng/src/lib/types/types.ts
|
TypeScript
|
mit
| 234 |
๏ปฟusing System;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using Microsoft.Owin.Security;
using Caching.Models;
namespace Caching
{
public class EmailService : IIdentityMessageService
{
public Task SendAsync(IdentityMessage message)
{
// Plug in your email service here to send an email.
return Task.FromResult(0);
}
}
public class SmsService : IIdentityMessageService
{
public Task SendAsync(IdentityMessage message)
{
// Plug in your SMS service here to send a text message.
return Task.FromResult(0);
}
}
// Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application.
public class ApplicationUserManager : UserManager<ApplicationUser>
{
public ApplicationUserManager(IUserStore<ApplicationUser> store)
: base(store)
{
}
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
{
var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<ApplicationDbContext>()));
// Configure validation logic for usernames
manager.UserValidator = new UserValidator<ApplicationUser>(manager)
{
AllowOnlyAlphanumericUserNames = false,
RequireUniqueEmail = true
};
// Configure validation logic for passwords
manager.PasswordValidator = new PasswordValidator
{
RequiredLength = 6,
RequireNonLetterOrDigit = true,
RequireDigit = true,
RequireLowercase = true,
RequireUppercase = true,
};
// Register two factor authentication providers. This application uses Phone and Emails as a step of receiving a code for verifying the user
// You can write your own provider and plug it in here.
manager.RegisterTwoFactorProvider("Phone Code", new PhoneNumberTokenProvider<ApplicationUser>
{
MessageFormat = "Your security code is {0}"
});
manager.RegisterTwoFactorProvider("Email Code", new EmailTokenProvider<ApplicationUser>
{
Subject = "Security Code",
BodyFormat = "Your security code is {0}"
});
// Configure user lockout defaults
manager.UserLockoutEnabledByDefault = true;
manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5);
manager.MaxFailedAccessAttemptsBeforeLockout = 5;
manager.EmailService = new EmailService();
manager.SmsService = new SmsService();
var dataProtectionProvider = options.DataProtectionProvider;
if (dataProtectionProvider != null)
{
manager.UserTokenProvider = new DataProtectorTokenProvider<ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity"));
}
return manager;
}
}
public class ApplicationSignInManager : SignInManager<ApplicationUser, string>
{
public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticationManager) :
base(userManager, authenticationManager) { }
public override Task<ClaimsIdentity> CreateUserIdentityAsync(ApplicationUser user)
{
return user.GenerateUserIdentityAsync((ApplicationUserManager)UserManager);
}
public static ApplicationSignInManager Create(IdentityFactoryOptions<ApplicationSignInManager> options, IOwinContext context)
{
return new ApplicationSignInManager(context.GetUserManager<ApplicationUserManager>(), context.Authentication);
}
}
}
|
Spurch/TelerikAcademy
|
ASP NET MVC Homeworks/CachingHomework/Caching/App_Start/IdentityConfig.cs
|
C#
|
mit
| 4,104 |
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "toggleRef", "closing", "popupDirection", "onClose", "className", "style"];
import { createScopedElement } from "../../lib/jsxRuntime";
import * as React from "react";
import { getClassName } from "../../helpers/getClassName";
import { classNames } from "../../lib/classNames";
import { useDOM } from "../../lib/dom";
import { usePlatform } from "../../hooks/usePlatform";
import { useEffectDev } from "../../hooks/useEffectDev";
import { useAdaptivity } from "../../hooks/useAdaptivity";
import { isRefObject } from "../../lib/isRefObject";
import { warnOnce } from "../../lib/warnOnce";
import { useEventListener } from "../../hooks/useEventListener";
import { FocusTrap } from "../FocusTrap/FocusTrap";
import { Popper } from "../Popper/Popper";
import "./ActionSheet.css";
var warn = warnOnce("ActionSheet");
function getEl(ref) {
return ref && "current" in ref ? ref.current : ref;
}
export var ActionSheetDropdownDesktop = function ActionSheetDropdownDesktop(_ref) {
var children = _ref.children,
toggleRef = _ref.toggleRef,
closing = _ref.closing,
popupDirection = _ref.popupDirection,
onClose = _ref.onClose,
className = _ref.className,
style = _ref.style,
restProps = _objectWithoutProperties(_ref, _excluded);
var _useDOM = useDOM(),
document = _useDOM.document;
var platform = usePlatform();
var _useAdaptivity = useAdaptivity(),
sizeY = _useAdaptivity.sizeY;
var elementRef = React.useRef(null);
useEffectDev(function () {
var toggleEl = getEl(toggleRef);
if (!toggleEl) {
warn("toggleRef not passed");
}
}, [toggleRef]);
var isPopupDirectionTop = React.useMemo(function () {
return popupDirection === "top" || typeof popupDirection === "function" && popupDirection(elementRef) === "top";
}, [popupDirection, elementRef]);
var bodyClickListener = useEventListener("click", function (e) {
var dropdownElement = elementRef === null || elementRef === void 0 ? void 0 : elementRef.current;
if (dropdownElement && !dropdownElement.contains(e.target)) {
onClose === null || onClose === void 0 ? void 0 : onClose();
}
});
React.useEffect(function () {
setTimeout(function () {
bodyClickListener.add(document.body);
});
}, [bodyClickListener, document]);
var onClick = React.useCallback(function (e) {
return e.stopPropagation();
}, []);
var targetRef = React.useMemo(function () {
if (isRefObject(toggleRef)) {
return toggleRef;
}
var refObject = {
current: toggleRef
};
return refObject;
}, [toggleRef]);
return createScopedElement(Popper, {
targetRef: targetRef,
offsetDistance: 0,
placement: isPopupDirectionTop ? "top-end" : "bottom-end",
vkuiClass: classNames(getClassName("ActionSheet", platform), "ActionSheet--desktop", "ActionSheet--sizeY-".concat(sizeY)),
className: className,
style: style,
getRef: elementRef,
forcePortal: false
}, createScopedElement(FocusTrap, _extends({
onClose: onClose
}, restProps, {
onClick: onClick
}), children));
};
//# sourceMappingURL=ActionSheetDropdownDesktop.js.map
|
cdnjs/cdnjs
|
ajax/libs/vkui/4.27.2/cssm/components/ActionSheet/ActionSheetDropdownDesktop.js
|
JavaScript
|
mit
| 3,322 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 CodeRevisited.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package com.hackerearth.codex;
import java.io.*;
import java.util.StringTokenizer;
import static java.lang.Integer.parseInt;
import static java.lang.System.in;
import static java.lang.System.out;
/**
* User : Suresh
* Date : 08/09/15
* Version : v1
*/
/**
* https://www.hackerearth.com/problem/algorithm/paint-the-cars
* <p>
* * Optimal Sub-structure
* =====================
* minCost(i, R, G, B) = min{
* cost(R) + minCost(i-1, G, B),
* cost(G) + minCost(i-1, R, B),
* cost(B) + minCost(i-1, R, G)
* }
* <p>
* <p>
* table[i][R] = min{
* cost(G) + table[index - 1][G],
* cost(B) + table[index - 1][B]
* }
* <p>
* table[i][G] = min{
* cost(R) + table[index - 1][R],
* cost(B) + table[index - 1][B]
* }
* <p>
* table[i][B] = min{
* cost(R) + table[index - 1][R],
* cost(B) + table[index - 1][B]
* }
*/
public class PaintTheCarsDP {
private static BufferedReader reader;
private static StringTokenizer tokenizer;
private static String next() throws IOException {
while (!tokenizer.hasMoreTokens()) {
tokenizer = new StringTokenizer(
reader.readLine());
}
return tokenizer.nextToken();
}
private static int nextInt() throws IOException {
return parseInt(next());
}
public static void main(String[] args) throws IOException {
reader = new BufferedReader(new InputStreamReader(in));
tokenizer = new StringTokenizer("");
PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out)));
int T = nextInt();
for (int t = 0; t < T; t++) {
int N = nextInt();
int[][] cost = new int[N][3];
for (int i = 0; i < N; i++) {
for (int j = 0; j < 3; j++) {
cost[i][j] = nextInt();
}
}
pw.println(findMinCost(cost, N));
}
reader.close();
pw.close();
}
private static int findMinCost(int[][] cost, int N) {
int[][] table = new int[N][3];
int i = cost[0][0];
int j = cost[0][1];
int k = cost[0][2];
table[0][0] = j > k ? k : j;
table[0][1] = i > k ? k : i;
table[0][2] = i > j ? j : i;
for (int index = 1; index < N; index++) {
i = cost[index][0] + table[index - 1][0];
j = cost[index][1] + table[index - 1][1];
k = cost[index][2] + table[index - 1][2];
table[index][0] = j > k ? k : j;
table[index][1] = i > k ? k : i;
table[index][2] = i > j ? j : i;
}
i = table[N - 1][0];
j = table[N - 1][1];
k = table[N - 1][2];
return compare(i, j, k);
}
private static int compare(int i, int j, int k) {
if (i < j) {
if (i < k) {
return i;
} else {
return k;
}
} else if (j < k) {
return j;
} else {
return k;
}
}
}
|
sureshsajja/CodeRevisited
|
src/main/java/com/hackerearth/codex/PaintTheCarsDP.java
|
Java
|
mit
| 4,200 |
๏ปฟusing System;
using System.Diagnostics;
using System.Reflection;
using BenchmarkDotNet.Running;
using EnumsNET.Tests.Benchmarks;
namespace EnumsNET.PerfTestConsole
{
static class Program
{
static void Main()
{
var version = FileVersionInfo.GetVersionInfo(typeof(Enums).GetTypeInfo().Assembly.Location).FileVersion;
Console.WriteLine("Enums.NET Version: " + version);
new BenchmarkSwitcher(new[] { typeof(HasFlagBenchmarks), typeof(GetHashCodeBenchmarks), typeof(IsDefinedBenchmarks), typeof(ToStringBenchmarks), typeof(ParseNamesBenchmarks), typeof(ParseValuesBenchmarks), typeof(ParseFlagsBenchmarks), typeof(DictionaryBenchmarks), typeof(InRangeBenchmarks) }).Run(new[] { "*" });
}
}
}
|
TylerBrinkley/Enums.NET
|
Src/Enums.NET.PerfTestConsole/Program.cs
|
C#
|
mit
| 764 |
#include <hx/CFFI.h>
#include <stdio.h>
#include <string.h>
#include <hxcpp.h>
#include <hx/OS.h>
#ifdef NEKO_WINDOWS
# include <windows.h>
#endif
/**
<doc>
<h1>File</h1>
<p>
The file api can be used for different kind of file I/O.
</p>
</doc>
**/
int __file_prims() { return 0; }
#if defined(ANDROID) || defined(IPHONE) || defined(APPLETV)
typedef char FilenameChar;
#define val_filename val_string
#define alloc_filename alloc_string
#define MAKE_STDIO(k) \
static value file_##k() { \
fio *f; \
f = new fio(#k,k); \
value result = alloc_abstract(k_file,f); \
val_gc(result,free_stdfile); \
return result; \
} \
DEFINE_PRIM(file_##k,0);
#else
typedef wchar_t FilenameChar;
#define val_filename val_wstring
#define alloc_filename alloc_wstring
#define MAKE_STDIO(k) \
static value file_##k() { \
fio *f; \
f = new fio(L###k,k); \
value result = alloc_abstract(k_file,f); \
val_gc(result,free_stdfile); \
return result; \
} \
DEFINE_PRIM(file_##k,0);
#endif
struct fio
{
fio(const FilenameChar *inName, FILE *inFile=0) : io(inFile)
{
int len = 0;
for(const FilenameChar *p = inName; *p; p++)
len++;
name = new FilenameChar[len+1];
memcpy(name, inName, len*sizeof(FilenameChar));
name[len] = '\0';
}
~fio()
{
delete [] name;
}
void close()
{
if (io)
{
fclose(io);
io = 0;
}
}
FilenameChar *name;
FILE *io;
};
#define val_file(o) ((fio *)val_data(o))
static void free_file( value v )
{
fio *file = val_file(v);
file->close();
delete file;
free_abstract(v);
}
static void free_stdfile( value v )
{
// Delete, but do not close...
fio *file = val_file(v);
delete file;
free_abstract(v);
}
DECLARE_KIND(k_file);
static void file_error( const char *msg, fio *f, bool delete_f = false ) {
gc_exit_blocking();
value a = alloc_array(2);
val_array_set_i(a,0,alloc_string(msg));
val_array_set_i(a,1,alloc_filename(f->name));
if (delete_f)
delete f;
val_throw(a);
}
/**
file_open : f:string -> r:string -> 'file
<doc>
Call the C function [fopen] with the file path and access rights.
Return the opened file or throw an exception if the file couldn't be open.
</doc>
**/
static value file_open( value name, value r ) {
val_check(name,string);
val_check(r,string);
fio *f = new fio(val_filename(name));
#ifdef NEKO_WINDOWS
const wchar_t *fname = val_wstring(name);
const wchar_t *mode = val_wstring(r);
gc_enter_blocking();
f->io = _wfopen(fname,mode);
#else
const char *fname = val_string(name);
const char *mode = val_string(r);
gc_enter_blocking();
f->io = fopen(fname,mode);
#endif
if( f->io == NULL )
{
file_error("file_open",f,true);
}
gc_exit_blocking();
value result = alloc_abstract(k_file,f);
val_gc(result,free_file);
return result;
}
/**
file_close : 'file -> void
<doc>Close an file. Any other operations on this file will fail</doc>
**/
static value file_close( value o ) {
fio *f;
val_check_kind(o,k_file);
f = val_file(o);
f->close();
return alloc_bool(true);
}
/**
file_name : 'file -> string
<doc>Return the name of the file which was opened</doc>
**/
static value file_name( value o ) {
val_check_kind(o,k_file);
return alloc_filename(val_file(o)->name);
}
/**
file_write : 'file -> s:string -> p:int -> l:int -> int
<doc>
Write up to [l] chars of string [s] starting at position [p].
Returns the number of chars written which is >= 0.
</doc>
**/
static value file_write( value o, value s, value pp, value n ) {
int p, len;
int buflen;
fio *f;
val_check_kind(o,k_file);
val_check(s,buffer);
buffer buf = val_to_buffer(s);
buflen = buffer_size(buf);
val_check(pp,int);
val_check(n,int);
f = val_file(o);
p = val_int(pp);
len = val_int(n);
if( p < 0 || len < 0 || p > buflen || p + len > buflen )
return alloc_null();
gc_enter_blocking();
while( len > 0 ) {
int d;
POSIX_LABEL(file_write_again);
d = (int)fwrite(buffer_data(buf)+p,1,len,f->io);
if( d <= 0 ) {
HANDLE_FINTR(f->io,file_write_again);
file_error("file_write",f);
}
p += d;
len -= d;
}
gc_exit_blocking();
return n;
}
/**
file_read : 'file -> s:string -> p:int -> l:int -> int
<doc>
Read up to [l] chars into the string [s] starting at position [p].
Returns the number of chars readed which is > 0 (or 0 if l == 0).
</doc>
**/
static value file_read( value o, value s, value pp, value n ) {
fio *f;
int p;
int len;
int buf_len;
val_check_kind(o,k_file);
val_check(s,buffer);
buffer buf = val_to_buffer(s);
buf_len = buffer_size(buf);
val_check(pp,int);
val_check(n,int);
f = val_file(o);
p = val_int(pp);
len = val_int(n);
if( p < 0 || len < 0 || p > buf_len || p + len > buf_len )
return alloc_null();
gc_enter_blocking();
while( len > 0 ) {
int d;
POSIX_LABEL(file_read_again);
d = (int)fread(buffer_data(buf)+p,1,len,f->io);
if( d <= 0 ) {
int size = val_int(n) - len;
HANDLE_FINTR(f->io,file_read_again);
if( size == 0 )
file_error("file_read",f);
gc_exit_blocking();
return alloc_int(size);
}
p += d;
len -= d;
}
gc_exit_blocking();
return n;
}
/**
file_write_char : 'file -> c:int -> void
<doc>Write the char [c]. Error if [c] outside of the range 0..255</doc>
**/
static value file_write_char( value o, value c ) {
unsigned char cc;
fio *f;
val_check(c,int);
val_check_kind(o,k_file);
if( val_int(c) < 0 || val_int(c) > 255 )
return alloc_null();
cc = (char)val_int(c);
f = val_file(o);
gc_enter_blocking();
POSIX_LABEL(write_char_again);
if( fwrite(&cc,1,1,f->io) != 1 ) {
HANDLE_FINTR(f->io,write_char_again);
file_error("file_write_char",f);
}
gc_exit_blocking();
return alloc_bool(true);
}
/**
file_read_char : 'file -> int
<doc>Read a char from the file. Exception on error</doc>
**/
static value file_read_char( value o ) {
unsigned char cc;
fio *f;
val_check_kind(o,k_file);
f = val_file(o);
gc_enter_blocking();
POSIX_LABEL(read_char_again);
if( fread(&cc,1,1,f->io) != 1 ) {
HANDLE_FINTR(f->io,read_char_again);
file_error("file_read_char",f);
}
gc_exit_blocking();
return alloc_int(cc);
}
/**
file_seek : 'file -> pos:int -> mode:int -> void
<doc>Use [fseek] to move the file pointer.</doc>
**/
static value file_seek( value o, value pos, value kind ) {
fio *f;
val_check_kind(o,k_file);
val_check(pos,int);
val_check(kind,int);
f = val_file(o);
gc_enter_blocking();
if( fseek(f->io,val_int(pos),val_int(kind)) != 0 )
file_error("file_seek",f);
gc_exit_blocking();
return alloc_bool(true);
}
/**
file_tell : 'file -> int
<doc>Return the current position in the file</doc>
**/
static value file_tell( value o ) {
int p;
fio *f;
val_check_kind(o,k_file);
f = val_file(o);
gc_enter_blocking();
p = ftell(f->io);
if( p == -1 )
file_error("file_tell",f);
gc_exit_blocking();
return alloc_int(p);
}
/**
file_eof : 'file -> bool
<doc>Tell if we have reached the end of the file</doc>
**/
static value file_eof( value o ) {
val_check_kind(o,k_file);
return alloc_bool( feof(val_file(o)->io) );
}
/**
file_flush : 'file -> void
<doc>Flush the file buffer</doc>
**/
static value file_flush( value o ) {
fio *f;
val_check_kind(o,k_file);
f = val_file(o);
gc_enter_blocking();
if( fflush( f->io ) != 0 )
file_error("file_flush",f);
gc_exit_blocking();
return alloc_bool(true);
}
#include <Kore/pch.h>
#include <Kore/IO/FileReader.h>
/**
file_contents : f:string -> string
<doc>Read the content of the file [f] and return it.</doc>
**/
static value file_contents( value name ) {
using namespace Kore;
buffer s=0;
int len;
val_check(name,string);
fio f(val_filename(name));
const char *fname = val_string(name);
gc_enter_blocking();
{
FileReader file;
if (file.open(fname)) {
len = static_cast<int>(file.size());
#ifdef KORE_WIIU
void* data = file.readAll();
Array_obj<unsigned char>* b = new Array_obj<unsigned char>(len, len);
memcpy(b->GetBase(), data, len);
s = (buffer)b;
#else
s = alloc_buffer_len(len);
file.read(buffer_data(s), static_cast<uint>(len));
#endif
}
else {
file_error("file_contents", &f);
}
}
gc_exit_blocking();
return buffer_val(s);
}
/**
file_stdin : void -> 'file
<doc>The standard input</doc>
**/
MAKE_STDIO(stdin);
/**
file_stdout : void -> 'file
<doc>The standard output</doc>
**/
MAKE_STDIO(stdout);
/**
file_stderr : void -> 'file
<doc>The standard error output</doc>
**/
MAKE_STDIO(stderr);
DEFINE_PRIM(file_open,2);
DEFINE_PRIM(file_close,1);
DEFINE_PRIM(file_name,1);
DEFINE_PRIM(file_write,4);
DEFINE_PRIM(file_read,4);
DEFINE_PRIM(file_write_char,2);
DEFINE_PRIM(file_read_char,1);
DEFINE_PRIM(file_seek,3);
DEFINE_PRIM(file_tell,1);
DEFINE_PRIM(file_eof,1);
DEFINE_PRIM(file_flush,1);
DEFINE_PRIM(file_contents,1);
/* ************************************************************************ */
|
KTXSoftware/KodeStudio-win32
|
resources/app/kodeExtensions/kha/Kha/Backends/Kore/khacpp/project/libs/std/File.cpp
|
C++
|
mit
| 9,343 |
/*
* Feature Toggling
*
* Activete/Hide features that are in process of development or under testing
* Once a feature is accepted to be includded must be removed from the
* feature toggle scheme
*/
const FEATURE_TOGGLE = {
FPS_CONTROL: true // FPS controll for AnimationPlayer class
};
export default FEATURE_TOGGLE;
|
GorillaBus/PhySim
|
src/feature-toggle.js
|
JavaScript
|
mit
| 350 |
"use strict";
const { assert } = require("chai");
const { describe, specify } = require("mocha-sugar-free");
const jsdom = require("../../lib/old-api.js");
describe("history", () => {
specify(
"a default window should have a history object with correct default values",
() => {
const window = jsdom.jsdom().defaultView;
assert.ok(window.history);
assert.strictEqual(window.history.state, null);
assert.strictEqual(window.history.length, 1);
}
);
specify(
"the history object should update correctly when calling pushState/replaceState",
() => {
const window = jsdom.jsdom("", { url: "http://www.example.org/" }).defaultView;
window.addEventListener("popstate", () => {
assert.fail("popstate should not fire as a result of a pushState() or replaceState() call");
});
// Absolute path
window.history.pushState({ foo: "one" }, "unused title", "/bar/baz#fuzz");
assert.strictEqual(window.history.length, 2);
assert.strictEqual(window.history.state.foo, "one");
assert.strictEqual(window.location.pathname, "/bar/baz");
assert.strictEqual(window.location.hash, "#fuzz");
window.history.pushState({ foo: "two" }, "unused title 2", "/bar/foo#boo");
assert.strictEqual(window.history.length, 3);
assert.strictEqual(window.history.state.foo, "two");
assert.strictEqual(window.location.pathname, "/bar/foo");
assert.strictEqual(window.location.hash, "#boo");
// Relative path
window.history.pushState({ foo: "three" }, "unused title 3", "fizz");
assert.strictEqual(window.history.length, 4);
assert.strictEqual(window.history.state.foo, "three");
assert.strictEqual(window.location.pathname, "/bar/fizz");
assert.strictEqual(window.location.hash, "");
window.history.replaceState({ foo: "four" }, "unused title 4", "/buzz");
assert.strictEqual(window.history.length, 4);
assert.strictEqual(window.history.state.foo, "four");
assert.strictEqual(window.location.pathname, "/buzz");
}
);
specify(
"the history object should update correctly when calling forward/back/go",
t => {
const window = jsdom.jsdom("", { url: "http://www.example.org/" }).defaultView;
const initialPath = window.location.pathname;
[
[{ foo: "bar" }, "title 1", "/bar"],
[{ foo: "baz" }, "title 2", "/baz"],
[{ foo: "buzz" }, "title 3", "/buzz"]
].forEach(args => {
window.history.pushState(...args);
});
// Sanity check
assert.strictEqual(window.history.length, 4);
assert.strictEqual(window.history.state.foo, "buzz");
assert.strictEqual(window.location.pathname, "/buzz");
// Test forward boundary
window.history.forward();
assert.strictEqual(window.history.length, 4);
assert.strictEqual(window.history.state.foo, "buzz");
assert.strictEqual(window.location.pathname, "/buzz");
window.history.back();
assert.strictEqual(window.history.length, 4);
// Should not change immediately.
assert.strictEqual(window.history.state.foo, "buzz");
assert.strictEqual(window.location.pathname, "/buzz");
setTimeout(() => {
// Should not even change after one task!
assert.strictEqual(window.history.state.foo, "buzz");
assert.strictEqual(window.location.pathname, "/buzz");
setTimeout(() => {
// It takes two tasks to change!
assert.strictEqual(window.history.state.foo, "baz");
assert.strictEqual(window.location.pathname, "/baz");
// From hereon out we just assume this is correct and wait for it.
window.history.back();
waitForHistoryChange(() => {
assert.strictEqual(window.history.length, 4);
assert.strictEqual(window.history.state.foo, "bar");
assert.strictEqual(window.location.pathname, "/bar");
window.history.back();
waitForHistoryChange(() => {
assert.strictEqual(window.history.length, 4);
assert.strictEqual(window.history.state, null);
assert.strictEqual(window.location.pathname, initialPath);
// Test backward boundary
window.history.back();
waitForHistoryChange(() => {
assert.strictEqual(window.history.length, 4);
assert.strictEqual(window.history.state, null);
assert.strictEqual(window.location.pathname, initialPath);
window.history.go(2);
waitForHistoryChange(() => {
assert.strictEqual(window.history.length, 4);
assert.strictEqual(window.history.state.foo, "baz");
assert.strictEqual(window.location.pathname, "/baz");
t.done();
});
});
});
});
}, 0);
}, 0);
}, {
async: true
}
);
specify(
"the history object should update correctly when calling pushState with index behind length",
t => {
const window = jsdom.jsdom("", { url: "http://www.example.org/" }).defaultView;
[
[{ foo: "bar" }, "title 1", "/bar"],
[{ foo: "baz" }, "title 2", "/baz"],
[{ foo: "buzz" }, "title 3", "/buzz"]
].forEach(args => {
window.history.pushState(...args);
});
// Sanity check
assert.strictEqual(window.history.length, 4);
assert.strictEqual(window.history.state.foo, "buzz");
assert.strictEqual(window.location.pathname, "/buzz");
window.history.go(-2);
waitForHistoryChange(() => {
assert.strictEqual(window.history.length, 4);
assert.strictEqual(window.history.state.foo, "bar");
assert.strictEqual(window.location.pathname, "/bar");
// Call pushState when index is behind length
window.history.pushState({ foo: "bar-b" }, "title 2b", "/bar/b");
assert.strictEqual(window.history.length, 3);
assert.strictEqual(window.history.state.foo, "bar-b");
assert.strictEqual(window.location.pathname, "/bar/b");
t.done();
});
}, {
async: true
}
);
specify(
"the history object should fire popstate on the window while navigating the history",
t => {
const window = jsdom.jsdom("", { url: "http://www.example.org/" }).defaultView;
const state = { foo: "bar" };
window.addEventListener("popstate", event => {
assert.strictEqual(event.bubbles, true);
assert.strictEqual(event.cancelable, false);
assert.strictEqual(event.state, state);
t.done();
});
window.history.pushState(state, "title", "bar");
window.history.pushState(null, "", "baz");
window.history.back();
}, {
async: true
}
);
function waitForHistoryChange(fn) {
// See notes above.
setTimeout(() => setTimeout(fn, 0), 0);
}
});
|
Zirro/jsdom
|
test/to-port-to-wpts/history.js
|
JavaScript
|
mit
| 7,027 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// TGUI - Texus's Graphical User Interface
// Copyright (C) 2012-2017 Bruno Van de Velde ([email protected])
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented;
// you must not claim that you wrote the original software.
// If you use this software in a product, an acknowledgment
// in the product documentation would be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such,
// and must not be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef TGUI_LAYOUT_HPP
#define TGUI_LAYOUT_HPP
#include <SFML/System/Vector2.hpp>
#include <TGUI/Config.hpp>
#include <functional>
#include <memory>
#include <vector>
#include <set>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace tgui
{
class Gui;
class Widget;
class Layout;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Shared information between layouts
/// @internal
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class TGUI_API LayoutImpl : public std::enable_shared_from_this<LayoutImpl>
{
public:
/// Does the layout contain a value or an operation between other layouts?
enum class Operation
{
Value,
String,
Plus,
Minus,
Multiplies,
Divides,
Modulus,
And,
Or,
LessThan,
LessOrEqual,
GreaterThan,
GreaterOrEqual,
Equal,
NotEqual,
Minimum,
Maximum,
Conditional
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public:
/// @brief Destructor
~LayoutImpl();
/// @brief Recalculate the value
void recalculate();
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private:
// Calculate the value of a layout defined by a string
float parseLayoutString(std::string expression);
// Parse references to widgets from the layout strings
float parseWidgetName(const std::string& expression, Widget* widget, const std::string& alreadyParsedPart = "");
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public:
float value = 0; ///< Cached value of the layout
std::set<Layout*> attachedLayouts; ///< Layout objects that use this shared object
std::set<LayoutImpl*> parents; ///< Other layouts that make use of this layout in their expression
Operation operation = Operation::Value; ///< Does the layout contain a value or an operation between other layouts?
std::vector<std::shared_ptr<LayoutImpl>> operands; ///< Operands used in the operation that this object performs
// These members are only used when operation == Operation::String
std::string stringExpression; ///< String expression in this layout
Widget* parentWidget = nullptr; ///< Widget connected to this layout
private:
std::set<std::string> boundCallbacks;
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Class to store the left, top, width or height of a widget
///
/// You don't have to create an instance of this class, numbers are implicitly cast to this class.
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class TGUI_API Layout
{
public:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Default constructor
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Layout();
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Constructor to implicitly construct from numeric constant
///
/// @param constant Value of the layout
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
Layout(T constant)
{
m_impl->value = static_cast<float>(constant);
m_impl->attachedLayouts.insert(this);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Construct the layout based on a string which will be parsed to determine the value of the layout
///
/// @param expression String to parse
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Layout(const char* expression);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Construct the layout based on a string which will be parsed to determine the value of the layout
///
/// @param expression String to parse
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Layout(const std::string& expression);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Copy constructor
///
/// @param copy Instance to copy
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Layout(const Layout& copy);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Destructor
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
~Layout();
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Overload of assignment operator
///
/// @param right Instance to assign
///
/// @return Reference to itself
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Layout& operator=(const Layout& right);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Return the cached value of the layout
///
/// @return Value of the layout
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
float getValue() const;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
/// @brief Connect a callback function to call when the layout is updated
///
/// @param callbackFunction Function to call when layout value changes
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void connectUpdateCallback(const std::function<void()>& callbackFunction);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
/// @brief Tells the layout that its value has been changed and that the callback function must be called
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void update() const;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @internal
/// @brief Access the layout implementation that is shared between layout objects
///
/// @return Shared layout data
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
std::shared_ptr<LayoutImpl> getImpl() const;
/// @brief Unary plus operator for the Layout class
Layout operator+();
/// @brief Unary minus operator for the Layout class
Layout operator-();
/// @brief += operator for the Layout class
Layout operator+=(Layout right);
/// @brief -= operator for the Layout class
Layout operator-=(Layout right);
/// @brief *= operator for the Layout class
Layout operator*=(Layout right);
/// @brief /= operator for the Layout class
Layout operator/=(Layout right);
/// @brief %= operator for the Layout class (floating point modulo)
Layout operator%=(Layout right);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private:
std::shared_ptr<LayoutImpl> m_impl = std::make_shared<LayoutImpl>();
std::function<void()> m_callbackFunction;
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Class to store the position or size of a widget
///
/// You don't have to create an instance of this class, sf::Vector2f is implicitly converted to this class.
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class TGUI_API Layout2d
{
public:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Default constructor to implicitly construct from an sf::Vector2f.
///
/// @param constant Value of the layout
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Layout2d(sf::Vector2f constant = {0, 0});
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Constructor to create the Layout2d from two Layout classes
///
/// @param layoutX x component
/// @param layoutY y component
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Layout2d(Layout layoutX, Layout layoutY);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Construct the layout based on a string which will be parsed to determine the value of the layout
///
/// @param expression String to parse
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Layout2d(const char* expression);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Constructs the layout based on a string which will be parsed to determine the value of the layout
///
/// @param expression String to parse
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Layout2d(const std::string& expression);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Return the cached value of the layout
///
/// @return Value of the layout
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
sf::Vector2f getValue() const;
/// @brief Unary plus operator for the Layout class
Layout2d operator+();
/// @brief Unary minus operator for the Layout class
Layout2d operator-();
/// @brief += operator for the Layout2d class
Layout2d operator+=(Layout2d right);
/// @brief -= operator for the Layout2d class
Layout2d operator-=(Layout2d right);
/// @brief *= operator for the Layout2d class
Layout2d operator*=(Layout right);
/// @brief /= operator for the Layout2d class
Layout2d operator/=(Layout right);
/// @brief %= operator for the Layout2d class (floating point modulo)
Layout2d operator%=(Layout right);
public:
Layout x; ///< Layout to store the x component
Layout y; ///< Layout to store the y component
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief \< operator for the Layout class
TGUI_API Layout operator<(Layout left, Layout right);
/// @brief <= operator for the Layout class
TGUI_API Layout operator<=(Layout left, Layout right);
/// @brief \> operator for the Layout class
TGUI_API Layout operator>(Layout left, Layout right);
/// @brief >= operator for the Layout class
TGUI_API Layout operator>=(Layout left, Layout right);
/// @brief == operator for the Layout class
TGUI_API Layout operator==(Layout left, Layout right);
/// @brief != operator for the Layout class
TGUI_API Layout operator!=(Layout left, Layout right);
/// @brief + operator for the Layout class
TGUI_API Layout operator+(Layout left, Layout right);
/// @brief - operator for the Layout class
TGUI_API Layout operator-(Layout left, Layout right);
/// @brief * operator for the Layout class
TGUI_API Layout operator*(Layout left, Layout right);
/// @brief / operator for the Layout class
TGUI_API Layout operator/(Layout left, Layout right);
/// @brief % operator for the Layout class
TGUI_API Layout operator%(Layout left, Layout right);
/// @brief && operator for the Layout class
TGUI_API Layout operator&&(Layout left, Layout right);
/// @brief || operator for the Layout class
TGUI_API Layout operator||(Layout left, Layout right);
/// @brief == operator for the Layout2d class
TGUI_API Layout operator==(Layout2d left, Layout2d right);
/// @brief != operator for the Layout2d class
TGUI_API Layout operator!=(Layout2d left, Layout2d right);
/// @brief + operator for the Layout2d class
TGUI_API Layout2d operator+(Layout2d left, Layout2d right);
/// @brief - operator for the Layout2d class
TGUI_API Layout2d operator-(Layout2d left, Layout2d right);
/// @brief * operator for the Layout2d class
TGUI_API Layout2d operator*(Layout2d left, Layout right);
/// @brief / operator for the Layout2d class
TGUI_API Layout2d operator/(Layout2d left, Layout right);
/// @brief % operator for the Layout2d class
TGUI_API Layout2d operator%(Layout2d left, Layout right);
/// @brief * operator for the Layout2d class
TGUI_API Layout2d operator*(Layout left, Layout2d right);
/// @brief Bind to the x position of the widget
TGUI_API Layout bindLeft(std::shared_ptr<Widget> widget);
/// @brief Bind to the y position of the widget
TGUI_API Layout bindTop(std::shared_ptr<Widget> widget);
/// @brief Bind to the width of the widget
TGUI_API Layout bindWidth(std::shared_ptr<Widget> widget);
/// @brief Bind to the height of the widget
TGUI_API Layout bindHeight(std::shared_ptr<Widget> widget);
/// @brief Bind to the right position of the widget
TGUI_API Layout bindRight(std::shared_ptr<Widget> widget);
/// @brief Bind to the bottom of the widget
TGUI_API Layout bindBottom(std::shared_ptr<Widget> widget);
/// @brief Bind to the position of the widget
TGUI_API Layout2d bindPosition(std::shared_ptr<Widget> widget);
/// @brief Bind to the size of the widget
TGUI_API Layout2d bindSize(std::shared_ptr<Widget> widget);
/// @brief Bind to the x position of the gui view
TGUI_API Layout bindLeft(Gui& gui);
/// @brief Bind to the y position of the gui view
TGUI_API Layout bindTop(Gui& gui);
/// @brief Bind to the width of the gui view
TGUI_API Layout bindWidth(Gui& gui);
/// @brief Bind to the height of the gui view
TGUI_API Layout bindHeight(Gui& gui);
/// @brief Bind to the right position of the gui view
TGUI_API Layout bindRight(Gui& gui);
/// @brief Bind to the bottom position of the gui view
TGUI_API Layout bindBottom(Gui& gui);
/// @brief Bind to the position of the gui view
TGUI_API Layout2d bindPosition(Gui& gui);
/// @brief Bind to the size of the gui view
TGUI_API Layout2d bindSize(Gui& gui);
/// @brief Bind to the minimum of two values
TGUI_API Layout bindMin(Layout value1, Layout value2);
/// @brief Bind to the maximum of two values
TGUI_API Layout bindMax(Layout value1, Layout value2);
/// @brief Bind to a value that remains between the minimum and maximum
TGUI_API Layout bindRange(Layout minimum, Layout maximum, Layout value);
/// @brief Bind conditionally to one of the two layouts
TGUI_API Layout bindIf(Layout condition, Layout trueExpr, Layout falseExpr);
/// @brief Bind conditionally to one of the two layouts
TGUI_API Layout2d bindIf(Layout condition, Layout2d trueExpr, Layout2d falseExpr);
/// @brief Bind a string for a layout (you can also just create the layout directly with the string)
TGUI_API Layout bindStr(const std::string& expression);
/// @brief Bind a string for a layout (you can also just create the layout directly with the string)
TGUI_API Layout bindStr(const char* expression);
/// @brief Bind a string for a layout (you can also just create the layout directly with the string)
TGUI_API Layout2d bindStr2d(const std::string& expression);
/// @brief Bind a string for a layout (you can also just create the layout directly with the string)
TGUI_API Layout2d bindStr2d(const char* expression);
// Put TGUI_IMPORT_LAYOUT_BIND_FUNCTIONS somewhere in your code to no longer have to put "tgui::" in front of the bind functions
// without having to import everything from tgui in your namespace or writing all these using statements yourself.
#define TGUI_IMPORT_LAYOUT_BIND_FUNCTIONS \
using tgui::bindLeft; \
using tgui::bindTop; \
using tgui::bindWidth; \
using tgui::bindHeight; \
using tgui::bindRight; \
using tgui::bindBottom; \
using tgui::bindPosition; \
using tgui::bindSize; \
using tgui::bindMin; \
using tgui::bindMax; \
using tgui::bindRange; \
using tgui::bindIf; \
using tgui::bindStr; \
using tgui::bindStr2d;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#endif // TGUI_LAYOUT_HPP
|
Disrado/QueenGame
|
extlibs/include/TGUI/Layout.hpp
|
C++
|
mit
| 20,945 |
module.exports={A:{A:{"2":"M D H F A B mB"},B:{"2":"C E q L O I J K"},C:{"2":"0 1 2 3 4 5 6 8 9 jB AB G M D H F A B C E q L O I J P Q R S T U V W X Y Z a b c d f g h i j k l m n o p N r s t u v w x y z LB BB CB DB EB FB HB IB JB eB cB"},D:{"2":"0 1 2 3 4 5 6 8 9 G M D H F A B C E q L O I V W X Y Z a b c d f g h i j k l m n o p N r s t u v w x y z LB BB CB DB EB FB HB IB JB bB VB PB oB K QB RB SB TB","258":"J P Q R S T U"},E:{"1":"7 E dB KB","2":"5 G M D H F A B C UB NB WB YB ZB aB e","16":"XB"},F:{"2":"0 1 2 3 4 7 8 F B C L O I J P Q R S T U V W X Y Z a b c d f g h i j k l m n o p N r s t u v w x y z fB gB hB iB e MB kB"},G:{"1":"E yB KB","2":"H NB lB GB nB OB pB qB rB sB tB uB vB wB xB"},H:{"2":"zB"},I:{"2":"AB G 0B 1B 2B 3B GB 4B","514":"K 5B"},J:{"2":"D A"},K:{"2":"7 A B C N e MB"},L:{"1":"K"},M:{"514":"6"},N:{"2":"A B"},O:{"2":"6B"},P:{"2":"G","514":"7B 8B 9B AC BC"},Q:{"2":"CC"},R:{"16":"DC"},S:{"2":"EC"}},B:7,C:"Web Share API"};
|
emccosky/emccosky.github.io
|
node_modules/caniuse-lite/data/features/web-share.js
|
JavaScript
|
mit
| 949 |
/* Configuration of lookup functions. SPARC version.
Copyright (C) 2000-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
/* Number of extra dynamic section entries for this architecture. By
default there are none. */
#define DT_THISPROCNUM DT_SPARC_NUM
|
andrewrk/zig
|
lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h
|
C
|
mit
| 981 |
<?php
namespace Knp\JsonSchemaBundle\PhpSpec;
use PhpSpec\ServiceContainer;
use PhpSpec\Extension\ExtensionInterface;
class CompatibilityExtension implements ExtensionInterface
{
public function load(ServiceContainer $container)
{
// This exists for PHP 5.3 compatibility
if (!interface_exists('\JsonSerializable')) {
class_alias('Knp\JsonSchemaBundle\Model\JsonSerializable', 'JsonSerializable');
}
}
}
|
seydu/KnpJsonSchemaBundle
|
src/Knp/JsonSchemaBundle/PhpSpec/CompatibilityExtension.php
|
PHP
|
mit
| 454 |
<?php
/**
* This file is automatically @generated by {@link GeneratePhonePrefixData}.
* Please don't modify it directly.
*/
return array (
4021 => 'Bucharest and Ilfov County',
40230 => 'Suceava',
40231 => 'Botoศani',
40232 => 'Iaศi',
40233 => 'Neamศ',
40234 => 'Bacฤu',
40235 => 'Vaslui',
40236 => 'Galaศi',
40237 => 'Vrancea',
40238 => 'Buzฤu',
40239 => 'Brฤila',
40240 => 'Tulcea',
40241 => 'Constanศa',
40242 => 'Cฤlฤraศi',
40243 => 'Ialomiศa',
40244 => 'Prahova',
40245 => 'Dรขmboviศa',
40246 => 'Giurgiu',
40247 => 'Teleorman',
40248 => 'Argeศ',
40249 => 'Olt',
40250 => 'Vรขlcea',
40251 => 'Dolj',
40252 => 'Mehedinศi',
40253 => 'Gorj',
40254 => 'Hunedoara',
40255 => 'Caraศ-Severin',
40256 => 'Timiศ',
40257 => 'Arad',
40258 => 'Alba',
40259 => 'Bihor',
40260 => 'Sฤlaj',
40261 => 'Satu Mare',
40262 => 'Maramureศ',
40263 => 'Bistriศa-Nฤsฤud',
40264 => 'Cluj',
40265 => 'Mureศ',
40266 => 'Harghita',
40267 => 'Covasna',
40268 => 'Braศov',
40269 => 'Sibiu',
4031 => 'Bucharest and Ilfov County',
40330 => 'Suceava',
40331 => 'Botoศani',
40332 => 'Iaศi',
40333 => 'Neamศ',
40334 => 'Bacฤu',
40335 => 'Vaslui',
40336 => 'Galaศi',
40337 => 'Vrancea',
40338 => 'Buzฤu',
40339 => 'Brฤila',
40340 => 'Tulcea',
40341 => 'Constanศa',
40342 => 'Cฤlฤraศi',
40343 => 'Ialomiศa',
40344 => 'Prahova',
40345 => 'Dรขmboviศa',
40346 => 'Giurgiu',
40347 => 'Teleorman',
40348 => 'Argeศ',
40349 => 'Olt',
40350 => 'Vรขlcea',
40351 => 'Dolj',
40352 => 'Mehedinศi',
40353 => 'Gorj',
40354 => 'Hunedoara',
40355 => 'Caraศ-Severin',
40356 => 'Timiศ',
40357 => 'Arad',
40358 => 'Alba',
40359 => 'Bihor',
40360 => 'Sฤlaj',
40361 => 'Satu Mare',
40362 => 'Maramureศ',
40363 => 'Bistriศa-Nฤsฤud',
40364 => 'Cluj',
40365 => 'Mureศ',
40366 => 'Harghita',
40367 => 'Covasna',
40368 => 'Braศov',
40369 => 'Sibiu',
);
/* EOF */
|
phpManufaktur/kfContact
|
Library/libphonenumber/src/libphonenumber/geocoding/data/en/40.php
|
PHP
|
mit
| 2,019 |
<?php /* CassandraDynamicCalcScorePreprocessHeaderCommonDynamic.php */ ?>
<?php ?>
<?php /* CassandraDynamicCalcScorePreprocessHeaderSearchRelated.php */ ?>
<?php ?>
<?php /* CassandraDynamicCalcScorePreprocessProgCheckCommonDynamic.php */ ?>
<?php ?>
<?php /* CassandraDynamicCalcScorePreprocessProgCheckSearchRelated.php */ ?>
<?php ?>
<?php /* CassandraDynamicCalcScorePreprocessProgCheckTwoCommonDynamic.php */ ?>
<?php ?>
<?php /* CassandraDynamicCalcScorePreprocessProgCheckTwoSearchRelated.php */ ?>
<?php ?>
<?php /* CassandraDynamicCalcScorePreprocessProgSetCommonDynamic.php */ ?>
<?php ?>
<?php /* CassandraDynamicCalcScorePreprocessProgSetSearchRelated.php */ ?>
<?php ?>
<?php /* CassandraDynamicCalcScorePreprocessProgPostCommonDynamic.php */ ?>
<?php ?>
<?php /* CassandraDynamicCalcScorePreprocessProgPostSearchRelated.php */ ?>
<?php ?>
<?php
function CalcScoreSearchRelatedPreprocess(&$params, &$result) {
global $NoSQL;
$DEBUG_FILENAME = "#" . __FILE__ . "@" . __FUNCTION__;
/* CassandraDynamicCalcScorePreprocessProgCheckCommonDynamic.php */
/* CassandraDynamicCalcScorePreprocessProgCheckSearchRelated.php */
/* CassandraDynamicCalcScorePreprocessProgCheckTwoCommonDynamic.php */
/* CassandraDynamicCalcScorePreprocessProgCheckTwoSearchRelated.php */
/* CassandraDynamicCalcScorePreprocessProgSetCommonDynamic.php */
/* CassandraDynamicCalcScorePreprocessProgSetSearchRelated.php */
/* CassandraDynamicCalcScorePreprocessProgPostCommonDynamic.php */
/* CassandraDynamicCalcScorePreprocessProgPostSearchRelated.php */
}
?>
|
chhsiao1981/tw_ly_cassandra_db
|
src/api-core/SearchRelated/SearchRelated/CalcScoreSearchRelated/CalcScoreSearchRelatedPreprocess.php
|
PHP
|
mit
| 1,580 |
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSArray.h"
@interface NSArray (PBXPListASCIIDescription)
- (void)_appendPListDescriptionToUTF8Data:(id)arg1 withIndentLevel:(unsigned long long)arg2;
@end
|
liyong03/YLCleaner
|
YLCleaner/Xcode-RuntimeHeaders/DevToolsCore/NSArray-PBXPListASCIIDescription.h
|
C
|
mit
| 308 |
/**
* Copyright (c) 2012 Ivo Wetzel.
*
* 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.
*/
/*global Class, Maple */
var Test = Class(function() {
Maple.Client(this, 30, 60);
}, Maple.Client, {
started: function() {
this.log('Client started');
},
update: function(t, tick) {
//this.log('Running');
},
render: function(t, dt, u) {
},
stopped: function() {
this.log('Stopped');
},
connected: function() {
this.log('Connection established');
},
message: function(type, tick, data) {
//this.log('Message received:', type, data);
},
syncedMessage: function(type, tick, data) {
this.log('Synced message received:', type, data);
},
closed: function(byRemote, errorCode) {
this.log('Connection closed:', byRemote, errorCode);
}
});
var client = new Test();
client.connect('localhost', 4000);
|
mayfer/antigame
|
demo/client.js
|
JavaScript
|
mit
| 1,967 |
๏ปฟ// ----------------------------------------------------------------------------------
// <copyright file="IEntityMemberInfoServicesProvider`2.cs" company="NMemory Team">
// Copyright (C) 2012-2014 NMemory Team
//
// 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.
// </copyright>
// ----------------------------------------------------------------------------------
namespace NMemory.Common
{
interface IEntityMemberInfoServicesProvider<TEntity, TMember>
{
IEntityMemberInfoServices<TEntity, TMember> EntityMemberInfoServices { get; }
}
}
|
wertzui/nmemory
|
Main/Source/NMemory/Common/IEntityMemberInfoServicesProvider`2.cs
|
C#
|
mit
| 1,679 |
var my_skins = ["skin-blue", "skin-black", "skin-red", "skin-yellow", "skin-purple", "skin-green"];
$(function () {
/* For demo purposes */
var demo = $("<div />").css({
position: "fixed",
top: "70px",
right: "0",
background: "#fff",
"border-radius": "5px 0px 0px 5px",
padding: "10px 15px",
"font-size": "16px",
"z-index": "99999",
cursor: "pointer",
color: "#3c8dbc",
"box-shadow": "0 1px 3px rgba(0,0,0,0.1)"
}).html("<i class='fa fa-gear'></i>").addClass("no-print");
var demo_settings = $("<div />").css({
"padding": "10px",
position: "fixed",
top: "70px",
right: "-250px",
background: "#fff",
border: "0px solid #ddd",
"width": "250px",
"z-index": "99999",
"box-shadow": "0 1px 3px rgba(0,0,0,0.1)"
}).addClass("no-print");
demo_settings.append(
"<h4 class='text-light-blue' style='margin: 0 0 5px 0; border-bottom: 1px solid #ddd; padding-bottom: 15px;'>Layout Options</h4>"
//Fixed layout
+ "<div class='form-group'>"
+ "<div class='checkbox'>"
+ "<label>"
+ "<input type='checkbox' onchange='change_layout(\"fixed\");'/> "
+ "Fixed layout"
+ "</label>"
+ "</div>"
+ "</div>"
//Boxed layout
+ "<div class='form-group'>"
+ "<div class='checkbox'>"
+ "<label>"
+ "<input type='checkbox' onchange='change_layout(\"layout-boxed\");'/> "
+ "Boxed Layout"
+ "</label>"
+ "</div>"
+ "</div>"
//Sidebar Collapse
+ "<div class='form-group'>"
+ "<div class='checkbox'>"
+ "<label>"
+ "<input type='checkbox' onchange='change_layout(\"sidebar-collapse\");'/> "
+ "Collapsed Sidebar"
+ "</label>"
+ "</div>"
+ "</div>"
);
var skins_list = $("<ul />", {"class": 'list-unstyled'});
var skin_blue =
$("<li />", {style: "float:left; width: 50%; padding: 5px;"})
.append("<a href='javascript:void(0);' onclick='change_skin(\"skin-blue\")' style='display: block; box-shadow: -1px 1px 2px rgba(0,0,0,0.0);' class='clearfix full-opacity-hover'>"
+ "<div><span style='display:block; width: 20%; float: left; height: 10px; background: #367fa9;'></span><span class='bg-light-blue' style='display:block; width: 80%; float: left; height: 10px;'></span></div>"
+ "<div><span style='display:block; width: 20%; float: left; height: 40px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 40px; background: #f4f5f7;'></span></div>"
+ "<p class='text-center'>Skin Blue</p>"
+ "</a>");
skins_list.append(skin_blue);
var skin_black =
$("<li />", {style: "float:left; width: 50%; padding: 5px;"})
.append("<a href='javascript:void(0);' onclick='change_skin(\"skin-black\")' style='display: block; box-shadow: -1px 1px 2px rgba(0,0,0,0.0);' class='clearfix full-opacity-hover'>"
+ "<div style='box-shadow: 0 0 2px rgba(0,0,0,0.1)' class='clearfix'><span style='display:block; width: 20%; float: left; height: 10px; background: #fefefe;'></span><span style='display:block; width: 80%; float: left; height: 10px; background: #fefefe;'></span></div>"
+ "<div><span style='display:block; width: 20%; float: left; height: 40px; background: #222;'></span><span style='display:block; width: 80%; float: left; height: 40px; background: #f4f5f7;'></span></div>"
+ "<p class='text-center'>Skin Black</p>"
+ "</a>");
skins_list.append(skin_black);
var skin_purple =
$("<li />", {style: "float:left; width: 50%; padding: 5px;"})
.append("<a href='javascript:void(0);' onclick='change_skin(\"skin-purple\")' style='display: block; box-shadow: -1px 1px 2px rgba(0,0,0,0.0);' class='clearfix full-opacity-hover'>"
+ "<div><span style='display:block; width: 20%; float: left; height: 10px;' class='bg-purple-active'></span><span class='bg-purple' style='display:block; width: 80%; float: left; height: 10px;'></span></div>"
+ "<div><span style='display:block; width: 20%; float: left; height: 40px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 40px; background: #f4f5f7;'></span></div>"
+ "<p class='text-center'>Skin Purple</p>"
+ "</a>");
skins_list.append(skin_purple);
var skin_green =
$("<li />", {style: "float:left; width: 50%; padding: 5px;"})
.append("<a href='javascript:void(0);' onclick='change_skin(\"skin-green\")' style='display: block; box-shadow: -1px 1px 2px rgba(0,0,0,0.0);' class='clearfix full-opacity-hover'>"
+ "<div><span style='display:block; width: 20%; float: left; height: 10px;' class='bg-green-active'></span><span class='bg-green' style='display:block; width: 80%; float: left; height: 10px;'></span></div>"
+ "<div><span style='display:block; width: 20%; float: left; height: 40px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 40px; background: #f4f5f7;'></span></div>"
+ "<p class='text-center'>Skin Green</p>"
+ "</a>");
skins_list.append(skin_green);
var skin_red =
$("<li />", {style: "float:left; width: 50%; padding: 5px;"})
.append("<a href='javascript:void(0);' onclick='change_skin(\"skin-red\")' style='display: block; box-shadow: -1px 1px 2px rgba(0,0,0,0.0);' class='clearfix full-opacity-hover'>"
+ "<div><span style='display:block; width: 20%; float: left; height: 10px;' class='bg-red-active'></span><span class='bg-red' style='display:block; width: 80%; float: left; height: 10px;'></span></div>"
+ "<div><span style='display:block; width: 20%; float: left; height: 40px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 40px; background: #f4f5f7;'></span></div>"
+ "<p class='text-center'>Skin Red</p>"
+ "</a>");
skins_list.append(skin_red);
var skin_yellow =
$("<li />", {style: "float:left; width: 50%; padding: 5px;"})
.append("<a href='javascript:void(0);' onclick='change_skin(\"skin-yellow\")' style='display: block; box-shadow: -1px 1px 2px rgba(0,0,0,0.0);' class='clearfix full-opacity-hover'>"
+ "<div><span style='display:block; width: 20%; float: left; height: 10px;' class='bg-yellow-active'></span><span class='bg-yellow' style='display:block; width: 80%; float: left; height: 10px;'></span></div>"
+ "<div><span style='display:block; width: 20%; float: left; height: 40px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 40px; background: #f4f5f7;'></span></div>"
+ "<p class='text-center'>Skin Yellow</p>"
+ "</a>");
skins_list.append(skin_yellow);
demo_settings.append("<h4 class='text-light-blue' style='margin: 0 0 5px 0; border-bottom: 1px solid #ddd; padding-bottom: 15px;'>Skins</h4>");
demo_settings.append(skins_list);
demo.click(function () {
if (!$(this).hasClass("open")) {
$(this).animate({"right": "250px"});
demo_settings.animate({"right": "0"});
$(this).addClass("open");
} else {
$(this).animate({"right": "0"});
demo_settings.animate({"right": "-250px"});
$(this).removeClass("open");
}
});
$("body").append(demo);
$("body").append(demo_settings);
setup();
});
function change_layout(cls) {
$("body").toggleClass(cls);
$.AdminLTE.layout.fixSidebar();
}
function change_skin(cls) {
$.each(my_skins, function (i) {
$("body").removeClass(my_skins[i]);
});
$("body").addClass(cls);
store('skin', cls);
return false;
}
function store(name, val) {
if (typeof (Storage) !== "undefined") {
localStorage.setItem(name, val);
} else {
alert('Please use a modern browser to properly view this template!');
}
}
function get(name) {
if (typeof (Storage) !== "undefined") {
return localStorage.getItem(name);
} else {
alert('Please use a modern browser to properly view this template!');
}
}
function setup() {
var tmp = get('skin');
if (tmp && $.inArray(tmp, my_skins))
change_skin(tmp);
}
|
diedertimmers/oxTrust
|
static/src/main/resources/META-INF/resources/theme/dist/js/demo.js
|
JavaScript
|
mit
| 8,685 |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Catel.Test.EntityFramework5.DbContextTest
{
using System;
using System.Collections.Generic;
public partial class DbContextOrder
{
public int ProductId { get; set; }
public int CustomerId { get; set; }
public System.DateTime OrderCreated { get; set; }
public int Amount { get; set; }
public virtual DbContextCustomer DbContextCustomer { get; set; }
public virtual DbContextProduct DbContextProduct { get; set; }
}
}
|
blebougge/Catel
|
src/Catel.Test/Catel.Test.EntityFramework5.DbContextTest.NET45/DbContextOrder.cs
|
C#
|
mit
| 924 |
from __future__ import absolute_import
try:
from django.db.backends.base.base import BaseDatabaseWrapper
except ImportError:
# Backwards compatibility for Django <1.8
from django.db.backends import BaseDatabaseWrapper
try:
from django.db.backends.utils import CursorWrapper
except ImportError:
# Backwards compatibility for Django <1.9
from django.db.backends.util import CursorWrapper
from .base import BaseModule, RequestTrace
from .monkey_patching import monkeypatch_method
class SqlModule(BaseModule):
key = 'sql'
def __init__(self):
super(SqlModule, self).__init__()
self.queries = []
def get_metrics(self):
return RequestTrace.instance().stacktracer.get_node_metrics('SQL')
def get_details(self):
sql_nodes = RequestTrace.instance().stacktracer.get_nodes('SQL')
return [{'sql': node.label, 'time': int(node.duration*1000)} for node in sql_nodes]
class _DetailedTracingCursorWrapper(CursorWrapper):
def execute(self, sql, params=()):
request_trace = RequestTrace.instance()
if request_trace:
stack_entry = request_trace.stacktracer.push_stack('SQL', sql)
try:
return self.cursor.execute(sql, params)
finally:
if request_trace:
request_trace.stacktracer.pop_stack()
sql = self.db.ops.last_executed_query(self.cursor, sql, params)
stack_entry.label = sql
def executemany(self, sql, param_list):
request_trace = RequestTrace.instance()
if request_trace:
request_trace.stacktracer.push_stack('SQL', sql)
try:
return self.cursor.executemany(sql, param_list)
finally:
if request_trace:
request_trace.stacktracer.pop_stack()
# The linter thinks the methods we monkeypatch are not used
# pylint: disable=W0612
def init():
@monkeypatch_method(BaseDatabaseWrapper)
def cursor(original, self, *args, **kwargs):
result = original(*args, **kwargs)
return _DetailedTracingCursorWrapper(result, self)
return SqlModule
|
mixcloud/django-speedbar
|
speedbar/modules/sql.py
|
Python
|
mit
| 2,138 |
import {testAndSnapshot} from 'lib/utils/component'
import Selector from '../selector'
testAndSnapshot(Selector)
|
conveyal/analysis-ui
|
lib/modules/r5-version/components/__tests__/selector.js
|
JavaScript
|
mit
| 115 |
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
// Lint Task
gulp.task('lint', function() {
return gulp.src('src/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
/*
// Compile Our Sass
gulp.task('sass', function() {
return gulp.src('scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('css'));
});
*/
// Concatenate & Minify JS
gulp.task('scripts', function() {
return gulp.src('src/**/*.js')
.pipe(concat('pixelmixer.js'))
.pipe(gulp.dest('build'))
.pipe(rename('pixelmixer.min.js'))
.pipe(uglify())
.pipe(gulp.dest('build'));
});
// Watch Files For Changes
gulp.task('watch', function() {
//gulp.watch('js/**/*.js', ['lint', 'scripts']);
//gulp.watch('import/**/*.js', ['lint', 'scripts']);
//gulp.watch('scss/*.scss', ['sass']);
});
// Default Task
gulp.task('default', ['lint',/*'sass',*/ 'scripts'/*, 'watch'*/]);
|
audiopixel/pixelmixer
|
gulpfile.js
|
JavaScript
|
mit
| 1,128 |
// MvxReachability.cs
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
// Project Lead - Stuart Lodge, @slodge, [email protected]
using System;
using System.Net;
using SystemConfiguration;
using CoreFoundation;
using MvvmCross.Plugins.Network.Reachability;
namespace MvvmCross.Plugins.Network.iOS
{
public class MvxReachability
: IMvxReachability
{
private const string DefaultHostName = "www.google.com";
// Is the host reachable with the current network configuration
public bool IsHostReachable(string host)
{
return StaticIsHostReachable(host);
}
public static bool StaticIsHostReachable(string host)
{
if (string.IsNullOrEmpty(host))
return false;
using (var r = new NetworkReachability(host))
{
NetworkReachabilityFlags flags;
if (r.TryGetFlags(out flags))
{
return IsReachableWithoutRequiringConnection(flags);
}
}
return false;
}
public static bool IsReachableWithoutRequiringConnection(NetworkReachabilityFlags flags)
{
// Is it reachable with the current network configuration?
bool isReachable = (flags & NetworkReachabilityFlags.Reachable) != 0;
// Do we need a connection to reach it?
bool noConnectionRequired = (flags & NetworkReachabilityFlags.ConnectionRequired) == 0;
// Since the network stack will automatically try to get the WAN up,
// probe that
if ((flags & NetworkReachabilityFlags.IsWWAN) != 0)
noConnectionRequired = true;
return isReachable && noConnectionRequired;
}
//
// Raised every time there is an interesting reachable event,
// we do not even pass the info as to what changed, and
// we lump all three status we probe into one
//
public static event EventHandler ReachabilityChanged;
private static void OnChange(NetworkReachabilityFlags flags)
{
var h = ReachabilityChanged;
h?.Invoke(null, EventArgs.Empty);
}
//
// Returns true if it is possible to reach the AdHoc WiFi network
// and optionally provides extra network reachability flags as the
// out parameter
//
private static NetworkReachability adHocWiFiNetworkReachability;
public static bool IsAdHocWiFiNetworkAvailable(out NetworkReachabilityFlags flags)
{
if (adHocWiFiNetworkReachability == null)
{
adHocWiFiNetworkReachability = new NetworkReachability(new IPAddress(new byte[] { 169, 254, 0, 0 }));
#warning Need to look at SetNotification instead - ios6 change
adHocWiFiNetworkReachability.SetNotification(OnChange);
adHocWiFiNetworkReachability.Schedule(CFRunLoop.Current, CFRunLoop.ModeDefault);
}
if (!adHocWiFiNetworkReachability.TryGetFlags(out flags))
return false;
return IsReachableWithoutRequiringConnection(flags);
}
private static NetworkReachability defaultRouteReachability;
private static bool IsNetworkAvaialable(out NetworkReachabilityFlags flags)
{
if (defaultRouteReachability == null)
{
defaultRouteReachability = new NetworkReachability(new IPAddress(0));
#warning Need to look at SetNotification instead - ios6 change
defaultRouteReachability.SetNotification(OnChange);
defaultRouteReachability.Schedule(CFRunLoop.Current, CFRunLoop.ModeDefault);
}
if (defaultRouteReachability.TryGetFlags(out flags))
return false;
return IsReachableWithoutRequiringConnection(flags);
}
private static NetworkReachability remoteHostReachability;
public static MvxReachabilityStatus RemoteHostStatus()
{
NetworkReachabilityFlags flags;
bool reachable;
if (remoteHostReachability == null)
{
remoteHostReachability = new NetworkReachability(DefaultHostName);
// Need to probe before we queue, or we wont get any meaningful values
// this only happens when you create NetworkReachability from a hostname
reachable = remoteHostReachability.TryGetFlags(out flags);
#warning Need to look at SetNotification instead - ios6 change
remoteHostReachability.SetNotification(OnChange);
remoteHostReachability.Schedule(CFRunLoop.Current, CFRunLoop.ModeDefault);
}
else
reachable = remoteHostReachability.TryGetFlags(out flags);
if (!reachable)
return MvxReachabilityStatus.Not;
if (!IsReachableWithoutRequiringConnection(flags))
return MvxReachabilityStatus.Not;
if ((flags & NetworkReachabilityFlags.IsWWAN) != 0)
return MvxReachabilityStatus.ViaCarrierDataNetwork;
return MvxReachabilityStatus.ViaWiFiNetwork;
}
public static MvxReachabilityStatus InternetConnectionStatus()
{
NetworkReachabilityFlags flags;
bool defaultNetworkAvailable = IsNetworkAvaialable(out flags);
if (defaultNetworkAvailable)
{
if ((flags & NetworkReachabilityFlags.IsDirect) != 0)
return MvxReachabilityStatus.Not;
}
else if ((flags & NetworkReachabilityFlags.IsWWAN) != 0)
return MvxReachabilityStatus.ViaCarrierDataNetwork;
return MvxReachabilityStatus.ViaWiFiNetwork;
}
public static MvxReachabilityStatus LocalWifiConnectionStatus()
{
NetworkReachabilityFlags flags;
if (IsAdHocWiFiNetworkAvailable(out flags))
{
if ((flags & NetworkReachabilityFlags.IsDirect) != 0)
return MvxReachabilityStatus.ViaWiFiNetwork;
}
return MvxReachabilityStatus.Not;
}
}
}
|
Didux/MvvmCross-Plugins
|
Network/MvvmCross.Plugins.Network.iOS/MvxReachability.cs
|
C#
|
mit
| 6,426 |
import React, { PureComponent } from 'react';
import WatchlistContainer from '../watchlist/WatchlistContainer';
import TradingTimesContainer from '../trading-times/TradingTimesContainer';
import AssetIndexContainer from '../asset-index/AssetIndexContainer';
import PortfolioContainer from '../portfolio/PortfolioContainer';
import StatementContainer from '../statement/StatementContainer';
import ExamineAssetContainer from '../examine-asset/ExamineAssetContainer';
import SettingsContainer from '../settings/SettingsContainer';
import UserAccountsContainer from '../user-accounts/UserAccountsContainer';
const components = [
PortfolioContainer,
StatementContainer,
WatchlistContainer,
TradingTimesContainer,
AssetIndexContainer,
ExamineAssetContainer,
SettingsContainer,
UserAccountsContainer
];
export default class WorkspaceSidePanel extends PureComponent {
props: {
sideActiveTab: number,
sidePanelSize: number,
sidePanelVisible: boolean,
};
render() {
const { sideActiveTab, sidePanelSize, sidePanelVisible } = this.props;
const ActiveComponent = components[sideActiveTab] || components[0];
if (!sidePanelVisible) return null;
return (
<div
className="workspace-panel"
style={{ width: sidePanelSize }}
>
<ActiveComponent key={sideActiveTab} />
</div>
);
}
}
|
nazaninreihani/binary-next-gen
|
src/workspace/WorkspaceSidePanel.js
|
JavaScript
|
mit
| 1,320 |
/**
* @name เคซเฅเคฐเฅเคเฅเคตเฅเคเคธเฅ เคธเฅเคชเฅเคเฅเคเฅเคฐเคฎ Spec
* @description <p>เคฒเคพเคเคต เคเคกเคฟเคฏเฅ เคเคจเคชเฅเค เคเฅ เคซเคผเฅเคฐเฅเคเฅเคตเฅเคเคธเฅ เคธเฅเคชเฅเคเฅเคเฅเคฐเคฎ เคเฅ เคเคฒเฅเคชเคจเคพ เคเคฐเฅเคเฅค</p>
* <p><em><span class="small"> เคเคธ เคเคฆเคพเคนเคฐเคฃ เคเฅ เคธเฅเคฅเคพเคจเฅเคฏ เคฐเฅเคช เคธเฅ เคเคฒเคพเคจเฅ เคเฅ เคฒเคฟเค, เคเคชเคเฅ เคเคธเคเฅ เคเคตเคถเฅเคฏเคเคคเคพ เคนเฅเคเฅ
* <a href="http://p5js.org/reference/#/libraries/p5.sound">p5.sound เคฒเคพเคเคฌเฅเคฐเฅเคฐเฅ</a>
* เคเคฐ เคเค เคเคพเคฒเฅ <a href="https://github.com/processing/p5.js/wiki/Local-server">เคธเฅเคฅเคพเคจเฅเคฏ เคธเคฐเฅเคตเคฐ</a>เฅค</span></em></p>
*/
let mic, fft;
function setup() {
createCanvas(710, 400);
noFill();
mic = new p5.AudioIn();
mic.start();
fft = new p5.FFT();
fft.setInput(mic);
}
function draw() {
background(200);
let spectrum = fft.analyze();
beginShape();
for (i = 0; i < spectrum.length; i++) {
vertex(i, map(spectrum[i], 0, 255, height, 0));
}
endShape();
}
|
processing/p5.js-website
|
src/data/examples/hi/33_Sound/12_FFT_Spectrum.js
|
JavaScript
|
mit
| 1,096 |
---
published: true
layout: default
title: Common Core Metadata Schema v1.0
permalink: /schema/
filename: schema.md
id: schema
---
******************
{: .bg-warning .text-danger}
***IMPORTANT NOTE***
This version of the schema has been deprecated in favor of the [Project Open Data Metadata Schema v1.1](/v1.1/schema). Federal CFO-Act agencies are expected to complete the transition to the v1.1 schema by **February 1st, 2015**.
******************
This section contains guidance to support the use of the common core metadata to list agency datasets and application programming interfaces (APIs) as hosted at agency.gov/data.
Updates to the metadata schema can be found in the [changelog](/metadata-changelog). This is metadata version: 1.0 FINAL as of 9/20/13.
Standard Metadata Vocabulary
----------------------------
Metadata is structured information that describes, explains, locates, or otherwise makes it easier to retrieve, use, or manage an information resource (NISO 2004, ISBN: 1-880124-62-9). The challenge is to define and name standard metadata fields so that a data consumer has sufficient information to process and understand the described data. The more information that can be conveyed in a standardized regular format, the more valuable data becomes.
Metadata can range from basic to advanced, from allowing one to discover the mere fact that a certain data asset exists and is about a general subject all the way to providing detailed information documenting the structure, processing history, quality, relationships, and other properties of a dataset. Making metadata machine readable greatly increases its utility, but requires more detailed standardization, defining not only field names, but also how information is encoded in the metadata fields.
Establishing a common vocabulary is the key to communication. The **common core metadata** specified in this memorandum is based on [DCAT](http://www.w3.org/TR/vocab-dcat/), a hierarchical vocabulary specific to datasets. This specification defines three levels of metadata elements: Required, Required-if (conditionally required), and Expanded fields. These elements were selected to represent information that is most often looked for on the web. To assist users of other metadata standards, [mappings](/metadata-resources/#common_core_required_fields_equivalents) to equivalent elements in other standards are provided.
What to Document -- Datasets and Web APIs
-------------------------------------
A dataset is an identifiable collection of structured data objects unified by some criteria (authorship, subject, scope, spatial, or temporal extent...). A catalog is a collection of descriptions of datasets; each description is a metadata record. The intention of a data catalog is to facilitate data access by users who are first interested in a particular kind of data, and upon finding a fit-for-purpose dataset, will next want to know how to get the data.
A Web API (**A**pplication **P**rogramming **I**nterface) allows computer programs to dynamically query a dataset using the World Wide Web. For example, a dataset [of farmers markets](https://explore.data.gov/Agriculture/Farmers-Markets-Geographic-Data/wfna-38ey) may be made available for download as a single file (e.g. a CSV), or may be made available to developers through a Web API, such that a computer program could use a ZIP Code to retrieve a list of farmers markets in the ZIP Code area.
The catalog file for each agency should list all of the agency's datasets that can be made public, regardless of whether they are distributed by a file download or through a Web API. The **Endpoint** data element is used to indicate which datasets offer Web APIs (see below for more information on Common Core and Extended metadata elements).
Metadata File Format -- JSON
---------------------------------------
The [Implementation Guidance](/implementation-guide/) available as a part of Project Open Data describes Agency requirements for the development of metadata as per the Open Data Policy. A quick primer on the file format involved:
[JSON](http://www.json.org) is a lightweight data-exchange format that is very easy to read, parse, and generate. Based on a subset of the JavaScript programming language, JSON is a text format that is optimized for data interchange. JSON is built on two structures: (1) a collection of name/value pairs; and (2) an ordered list of values.
Where optional fields are included in a catalog file but are unpopulated, they may be represented by a `null` value. They should not be represented by an empty string (`""`).
The Project Open Data schema is case sensitive. The schema uses a camel case convention where the first letter of some words within a field are capitalized (usually all words but the first one). While it may seem subtle which characters are uppercase and lowercase, it is necessary to follow the exact same casing as defined in the schema documented here. For example:
> Correct: `contactPoint`
> Incorrect: `ContactPoint`
> Incorrect: `contactpoint`
> incorrect: `CONTACTPOINT`
Links to downloadable examples of metadata files developed in this and other formats in [the metadata resources](/metadata-resources/). Tools to help agencies produce and maintain their data inventories are [available on GitHub](http://www.github.com/project-open-data) and hosted at [Labs.Data.gov](http://labs.data.gov).
"Common Core" Required Fields
-----------------------------
The following "common core" fields are required, to be used to describe each entry:
*(Consult the 'Further Metadata Field Guidance' section lower in the page to learn more about the use of each element, including the range of valid entries where appropriate. Consult the [schema maps](/metadata-resources#common-core-required-fields-equivalents) to find the equivalent DCAT, Schema.org, and CKAN fields.)*
{: .table .table-striped}
Field | Label | Definition
-------------- | -------------- | --------------
title | Title | Human-readable name of the asset. Should be in plain English and include sufficient detail to facilitate search and discovery.
description | Description | Human-readable description (e.g., an abstract) with sufficient detail to enable a user to quickly understand whether the asset is of interest.
keyword | Tags | Tags (or keywords) help users discover your dataset; please include terms that would be used by technical and non-technical users.
modified | Last Update | Most recent date on which the dataset was changed, updated or modified.
publisher | Publisher | The publishing entity.
contactPoint | Contact Name | Contact person's name for the asset.
mbox | Contact Email | Contact person's email address.
identifier | Unique Identifier | A unique identifier for the dataset or API as maintained within an Agency catalog or database.
accessLevel | Public Access Level | The degree to which this dataset **could** be made publicly-available, *regardless of whether it has been made available*. Choices: public (Data asset is or could be made publicly available to all without restrictions), restricted public (Data asset is available under certain use restrictions), or non-public (Data asset is not available to members of the public)
"Common Core" Required-if-Applicable Fields
-------------------------------------------
The following fields must be used to describe each dataset if they are applicable. U.S. Federal agencies must fill out BureauCode and ProgramCode.
{: .table .table-striped}
Field | Label | Definition
-------------- | -------------- | --------------
bureauCode | Bureau Code | Federal agencies, combined agency and bureau code from [OMB Circular A-11, Appendix C](http://www.whitehouse.gov/sites/default/files/omb/assets/a11_current_year/app_c.pdf) in the format of `015:11`.
programCode | Program Code | Federal agencies, list the primary program related to this data asset, from the [Federal Program Inventory](http://goals.performance.gov/sites/default/files/images/FederalProgramInventory_FY13_MachineReadable_091613.xls). Use the format of `015:001`
accessLevelComment | Access Level Comment | An explanation for the selected โaccessLevelโ including instructions for how to access a restricted file, if applicable, or explanation for why a โnon-publicโ or โrestricted publicโ data asset is not โpublic,โ if applicable. Text, 255 characters.
accessURL | Download URL | URL providing direct access to the downloadable distribution of a dataset.
webService | Endpoint | Endpoint of web service to access dataset.
format | Format | The file format or API type of the distribution.
license | License | The license with which the dataset or API is published. See [Open Licenses](/open-licenses/) for more information.
spatial | Spatial | The range of spatial applicability of a dataset. Could include a spatial region like a bounding box or a named place.
temporal | Temporal | The range of temporal applicability of a dataset (i.e., a start and end date of applicability for the data).
Beyond Common Core -- Extending the Schema
------------------------------------------
Extensional" and/or domain-specific metadata FIELDS can easily be added using other vocabularies even if the field is not a term (entity/property) that will get indexed by the major search engines - it could still be indexed by other custom search engines and by Data.gov. Agencies are encouraged to extend their metadata descriptions using elements from the "Expanded Fields" list shown below, or from any well-known vocabulary (including Dublin Core, FGDC, ISO 19115, NIEM, and a growing number of vocabularies published at [Vocab.Data.gov](http://vocab.data.gov)) as long as they are properly assigned.
Expanded Fields
---------------
Agencies are encouraged to use the following expanded fields when appropriate. Agencies may freely augment these fields with their own.
{: .table .table-striped}
Field | Label | Definition
-------------- | -------------- | --------------
theme | Category | Main thematic category of the dataset.
dataDictionary | Data Dictionary | URL to the data dictionary for the dataset or API. Note that documentation other than a data dictionary can be referenced using Related Documents as shown in the expanded fields.
dataQuality | Data Quality | Whether the dataset meets the agency's Information Quality Guidelines (true/false).
distribution | Distribution | Holds multiple download URLs for datasets composed of multiple files and/or file types
accrualPeriodicity | Frequency | Frequency with which dataset is published.
landingPage | Homepage URL | Alternative landing page used to redirect user to a contextual, Agency-hosted "homepage" for the dataset or API when selecting this resource from the Data.gov user interface.
language | Language | The language of the dataset.
PrimaryITInvestmentUII | Primary IT Investment UII | For linking a dataset with an IT Unique Investment Identifier (UII)
references | Related Documents | Related documents such as technical information about a dataset, developer documentation, etc.
issued | Release Date | Date of formal issuance.
systemOfRecords | System of Records | If the systems is designated as a system of records under the Privacy Act of 1974, provide the URL to the System of Records Notice related to this dataset.
Further Metadata Field Guidance (alphabetical by field)
-------------------------------
{: .table .table-striped}
**Field <a class="permalink" href="#accessLevel">#</a>** | **<a name="accessLevel">accessLevel</a>**
----- | -----
**Cardinality** | (1,1)
**Required** | Yes, always
**Accepted Values** | Must be one of the following: "public", "restricted public", "non-public"
**Usage Notes** | This field refers to degree to which this dataset *could be made available* to the public, regardless of whether it is currently available to the public. For example, if a member of the public can walk into your agency and obtain a dataset, that entry is **public** even if there are no files online. A *restricted public* dataset is one only available under certain conditions or to certain audiences (such as researchers who sign a waiver). A *non-public* dataset is one that could never be made available to the public for privacy, security, or other reasons as determined by your agency.
**Example** | `{"accessLevel":"public"}`
{: .table .table-striped}
**Field <a class="permalink" href="#accessLevelComment">#</a>** | **<a name="accessLevelComment">accessLevelComment</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | Yes, if accessLevel is "restricted public" or "non-public"
**Accepted Values** | String
**Usage Notes** | An explanation for the selected โaccessLevelโ including instructions for how to access a restricted file, if applicable, or explanation for why a โnon-publicโ or โrestricted publicโ data asset is not โpublic,โ if applicable.
**Example** | `{"accessLevelComment":"This dataset contains Personally Identifiable Information and could not be released for public access. A statistical analysis of the data contained herein, stripped of all personal identifiers, is available at http://another.website.gov/dataset."}`
{: .table .table-striped}
**Field <a class="permalink" href="#accessURL">#</a>** | **<a name="accessURL">accessURL</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | Yes, if the file is available for public download.
**Accepted Values** | String (URL)
**Usage Notes** | This must be the **direct** download URL. Use **homepage** for landing or disambiguation pages, or **references** for documentation pages. For multiple downloads, use **distribution** to include as many **accessURL** entries as you need.
**Example** | `{"accessURL":"http://www.agency.gov/vegetables/listofvegetables.csv"}`
{: .table .table-striped}
**Field <a class="permalink" href="#accrualPeriodicity">#</a>** | **<a name="accrualPeriodicity">accrualPeriodicity</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | No
**Accepted Values** | See usage notes
**Usage Notes** | Must be a value from [DCCDAccrualPeriodicity](http://www.ukoln.ac.uk/metadata/dcmi/collection-DCCDAccrualPeriodicity/): "Annual","Bimonthly","Semiweekly","Daily","Biweekly","Semiannual","Biennial","Triennial","Three times a week","Three times a month","Continuously updated","Monthly","Quarterly","Semimonthly","Three times a year","Weekly","Completely irregular"
**Example** | `{"accrualPeriodicity":"Annual"}`
{: .table .table-striped}
**Field <a class="permalink" href="#bureauCode">#</a>** | **<a name="bureauCode">bureauCode</a>**
----- | -----
**Cardinality** | (0,n)
**Required** | Yes, for United States Federal Government agencies
**Accepted Values** | Array of Strings
**Usage Notes** | Represent each bureau responsible for the dataset according to the codes found in [OMB Circular A-11, Appendix C](http://www.whitehouse.gov/sites/default/files/omb/assets/a11_current_year/app_c.pdf). Start with the agency code, then a colon, then the bureau code.
**Example** | The Office of the Solicitor (86) at the Department of the Interior (010) would be: `{"bureauCode":["010:86"]}`. If a second bureau was also responsible, the format like this: `{"bureauCode":["010:86","010:04"]}`.
{: .table .table-striped}
**Field <a class="permalink" href="#contactPoint">#</a>** | **<a name="contactPoint">contactPoint</a>**
----- | -----
**Cardinality** | (1,1)
**Required** | Yes, always
**Accepted Values** | String
**Usage Notes** | -
**Example** | `{"contactPoint":"John Brown"}`
{: .table .table-striped}
**Field <a class="permalink" href="#dataDictionary">#</a>** | **<a name="dataDictionary">dataDictionary</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | No (Documentation that is not specifically a data dictionary belongs in "references")
**Accepted Values** | String (URL)
**Usage Notes** | -
**Example** | `{"dataDictionary":"http://www.agency.gov/vegetables/dictionary.html"}`
{: .table .table-striped}
**Field <a class="permalink" href="#dataQuality">#</a>** | **<a name="dataQuality">dataQuality</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | No
**Accepted Values** | Must be a boolean value of `true` or `false` (not contained within quote marks)
**Usage Notes** | Indicates whether a dataset conforms to the agency's information quality guidelines.
**Example** | `{"dataQuality":true}`
{: .table .table-striped}
**Field <a class="permalink" href="#description">#</a>** | **<a name="description">description</a>**
----- | -----
**Cardinality** | (1,1)
**Required** | Yes, always
**Accepted Values** | String
**Usage Notes** | This should be human-readable and understandable to an average person.
**Example** | `{"description":"This dataset contains a list of vegetables, including nutrition information and seasonality. Includes details on tomatoes, which are really fruit but considered a vegetable in this dataset."}`
{: .table .table-striped}
**Field <a class="permalink" href="#distribution">#</a>** | **<a name="distribution">distribution</a>**
----- | -----
**Cardinality** | (0,n)
**Required** | No
**Accepted Values** | See Usage Notes
**Usage Notes** | Distribution is a concatenation, as appropriate, of the following elements: **accessURL** and **format**. If an entry has only one dataset, enter details for that one; if it has multiple datasets (such as a bulk download and an API), separate entries as seen below:
"distribution": [
{
"accessURL":"https://explore.data.gov/views/ykv5-fn9t/rows.csv?accessType=DOWNLOAD",
"format":"text/csv"
},
{
"accessURL":"https://explore.data.gov/views/ykv5-fn9t/rows.json?accessType=DOWNLOAD",
"format":"application/json"
},
{
"accessURL":"https://explore.data.gov/views/ykv5-fn9t/rows.xml?accessType=DOWNLOAD",
"format":"text/xml"
}
]
{: .table .table-striped}
**Field <a class="permalink" href="#format">#</a>** | **<a name="format">format</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | Yes, if the file is available for public download.
**Accepted Values** | String
**Usage Notes** | This must describe the exact files available at **accessURL** using [MIME Types](http://en.wikipedia.org/wiki/Internet_media_type). _[Also note [Office Open XML MIME types](http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/05/08/office-2007-open-xml-mime-types.aspx)]_
**Example** | `{"format":"application/json"}`
{: .table .table-striped}
**Field <a class="permalink" href="#identifier">#</a>** | **<a name="identifier">identifier</a>**
----- | -----
**Cardinality** | (1,1)
**Required** | Yes, always
**Accepted Values** | String
**Usage Notes** | This field allows third parties to maintain a consistent record for datasets even if title or URLs are updated. Agencies may integrate an existing system for maintaining unique identifiers or enter arbitrary characters for this field. However, each identifier **must** be unique across the agency's catalog and remain fixed. Characters should be alphanumeric.
**Example** | `{"identifier":"1344"}`
{: .table .table-striped}
**Field <a class="permalink" href="#issued">#</a>** | **<a name="issued">issued</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | No
**Accepted Values** | ISO 8601 Date
**Usage Notes** | Dates should be [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) of least resolution. In other words, as much of YYYY-MM-DDThh:mm:ss.sTZD as is relevant to this dataset.
**Example** | `{"issued":"2001-01-15"}`
{: .table .table-striped}
**Field <a class="permalink" href="#keyword">#</a>** | **<a name="keyword">keyword</a>**
----- | -----
**Cardinality** | (1,n)
**Required** | Yes, always
**Accepted Values** | Array of strings
**Usage Notes** | Surround each keyword with quotes. Separate keywords with commas. Avoid duplicate keywords in the same record.
**Example** | `{"keyword":["vegetables","veggies","greens","leafy","spinach","kale","nutrition"]}`
{: .table .table-striped}
**Field <a class="permalink" href="#landingPage">#</a>** | **<a name="landingPage">landingPage</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | No
**Accepted Values** | String (URL)
**Usage Notes** | This field is not intended for an agency's homepage (e.g. www.agency.gov), but rather if a dataset has a human-friendly hub or landing page that users should be directed to for all resources tied to the dataset. This allows agencies to better specify what a visitor receives after selecting one of the agency's datasets on Data.gov or in third-party mashups.
**Example** | `{"landingPage":"http://www.agency.gov/vegetables"}`
{: .table .table-striped}
**Field <a class="permalink" href="#language">#</a>** | **<a name="language">language</a>**
----- | -----
**Cardinality** | (0,n)
**Required** | No
**Accepted Values** | Array of strings
**Usage Notes** | This should adhere to the [RFC 5646](http://tools.ietf.org/html/rfc5646) standard. This [language subtag lookup](http://rishida.net/utils/subtags/) provides a good tool for checking and verifying language codes. A language tag is comprised of either one or two parts, the language subtag (such as en for English, sp for Spanish, wo for Wolof) and the regional subtag (such as US for United States, GB for Great Britain, MX for Mexico), separated by a hyphen. Regional subtags should only be provided when needed to distinguish a language tag from another one (such as American vs. British English).
**Example** | `{"language":["en-US"]}` or if multiple languages, `{"language":["es-MX","wo","nv","en-US"]}`
{: .table .table-striped}
**Field <a class="permalink" href="#license">#</a>** | **<a name="license">license</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | No
**Accepted Values** | -
**Usage Notes** | See list of licenses.
**Example** | `{"license":""}`
{: .table .table-striped}
**Field <a class="permalink" href="#mbox">#</a>** | **<a name="mbox">mbox</a>**
----- | -----
**Cardinality** | (1,1)
**Required** | Yes, always
**Accepted Values** | Email address
**Usage Notes** | -
**Example** | `{"mbox":"[email protected]"}`
{: .table .table-striped}
**Field <a class="permalink" href="#modified">#</a>** | **<a name="modified">modified</a>**
----- | -----
**Cardinality** | (1,1)
**Required** | Yes, always
**Accepted Values** | ISO 8601 Date
**Usage Notes** | Dates should be [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) of least resolution. In other words, as much of YYYY-MM-DDThh:mm:ss.sTZD as is relevant to this dataset. If this file is brand-new, enter the **issued** date here as well.
If there is a need to reflect that the dataset is continually updated, ISO 8601 formatting can account for this [with repeating intervals](http://en.wikipedia.org/wiki/ISO_8601#Time_intervals). For instance, `R/P1D` for daily, `R/P2W` for every two weeks, and `R/PT5M` for every five minutes.
**Example** | `{"modified":"2012-01-15"}` or `{"modified":"R/P1D"}`
{: .table .table-striped}
**Field <a class="permalink" href="#PrimaryITInvestmentUII">#</a>** | **<a name="PrimaryITInvestmentUII">PrimaryITInvestmentUII</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | No
**Accepted Values** | String
**Usage Notes** | Use to link a given dataset with its related IT Unique Investment Identifier, which can often be found in Exhibit 53 documents.
**Example** | `{"PrimaryITInvestmentUII":"023-000000001"}`
{: .table .table-striped}
**Field <a class="permalink" href="#programCode">#</a>** | **<a name="programCode">programCode</a>**
----- | -----
**Cardinality** | (0,n)
**Required** | Yes, for United States Federal Government Agencies
**Accepted Values** | Array of strings
**Usage Notes** | Provide an array of programs related to this data asset, from the [Federal Program Inventory](http://goals.performance.gov/sites/default/files/images/FederalProgramInventory_FY13_MachineReadable_091613.xls).
**Example** | `{"programCode":["015:001"]}` or if multiple programs, `{"programCode":["015:001","015:002"]}`
{: .table .table-striped}
**Field <a class="permalink" href="#publisher">#</a>** | **<a name="publisher">publisher</a>**
----- | -----
**Cardinality** | (1,1)
**Required** | Yes, always
**Accepted Values** | String
**Usage Notes** | The plaintext name of the entity publishing this dataset.
**Example** | `{"publisher":"U.S. Department of Education"}`
{: .table .table-striped}
**Field <a class="permalink" href="#references">#</a>** | **<a name="references">references</a>**
----- | -----
**Cardinality** | (0,n)
**Required** | No
**Accepted Values** | Array of strings (URLs)
**Usage Notes** | Enclose each URL within strings. Separate multiple URLs with a comma.
**Example** | `{"references":["http://www.agency.gov/legumes/legumes_data_documentation.html"]}` or if multiple URLs, `{"references":["http://www.agency.gov/legumes/legumes_data_documentation.html","http://www.agency.gov/fruits/fruit_data_documentation.html"]}`
{: .table .table-striped}
**Field <a class="permalink" href="#spatial">#</a>** | **<a name="spatial">spatial</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | Yes, if the dataset is spatial
**Accepted Values** | See Usage Notes
**Usage Notes** | This field should contain one of the following types of content: (1) a bounding coordinate box for the dataset represented in latitude / longitude pairs where the coordinates are specified in decimal degrees and in the order of: minimum longitude, minimum latitude, maximum longitude, maximum latitude; (2) a latitude / longitude pair (in decimal degrees) representing a point where the dataset is relevant; (3) a geographic feature expressed in [Geography Markup Language using the Simple Features Profile](http://www.ogcnetwork.net/gml-sf); or (4) a geographic feature from the [GeoNames database](http://www.geonames.org).
**Example** | `{"spatial":"Lincoln, Nebraska"}`
{: .table .table-striped}
**Field <a class="permalink" href="#temporal">#</a>** | **<a name="temporal">temporal</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | Yes, if applicable
**Accepted Values** | ISO 8601 Date
**Usage Notes** | This field should contain an interval of time defined by start and end dates. Dates should be formatted as pairs of {start datetime/end datetime} in the [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format. ISO 8601 specifies that datetimes can be formatted in a number of ways, including a simple four-digit year (eg. 2013) to a much more specific YYYY-MM-DDTHH:MM:SSZ, where the T specifies a seperator between the date and time and time is expressed in 24 hour notation in the UTC (Zulu) time zone. (e.g., 2011-02-14T12:00:00Z/2013-07-04T19:34:00Z). Use a solidus ("/") to separate start and end times.
If there is a need to reflect that the dataset is continually updated, ISO 8601 formatting can account for this [with repeating intervals](http://en.wikipedia.org/wiki/ISO_8601#Time_intervals). For instance, updated monthly starting in January 2010 and continuing through the present would be represented as: `R/2010-01/P1M`.
Updated every 5 minutes beginning on February 15, 2010 would be represented as: `R/2010-02-15/PT5M`.
**Example** | `{"temporal":"2000-01-15T00:45:00Z/2010-01-15T00:06:00Z"}` or `{"temporal":"R/2000-01-15T00:45:00Z/P1W"}`
{: .table .table-striped}
**Field <a class="permalink" href="#theme">#</a>** | **<a name="theme">theme</a>**
----- | -----
**Cardinality** | (0,n)
**Required** | No
**Accepted Values** | Array of strings
**Usage Notes** | Separate multiple categories with a comma. Could include [ISO Topic Categories](http://www.isotopicmaps.org/).
**Examples** | `{"theme":["vegetables"]}` or if multiple categories, `{"theme":["vegetables","produce"]}`
{: .table .table-striped}
**Field <a class="permalink" href="#title">#</a>** | **<a name="title">title</a>**
----- | -----
**Cardinality** | (1,1)
**Required** | Yes, always
**Accepted Values** | String
**Usage Notes** | Acronyms should be avoided.
**Example** | `{"title":"Types of Vegetables"}`
{: .table .table-striped}
**Field <a class="permalink" href="#webService">#</a>** | **<a name="webService">webService</a>**
----- | -----
**Cardinality** | (0,1)
**Required** | Yes, if the dataset has an API
**Accepted Values** | String (URL)
**Usage Notes** | This field will serve to delineate the web services offered by an agency and will be used to aggregate cross-government API catalogs.
**Example** | `{"webService":"http://www.agency.gov/vegetables/vegetables.json"}`
Rationale for Metadata Nomenclature
----------------------
We sought to be platform-independent and to align as much as possible with existing open standards.
To that end, our JSON key names are directly drawn from [DCAT](http://www.w3.org/TR/vocab-dcat/), with a few exceptions.
We added the new **accessLevel** field to help easily sort datasets into our three existing categories: public, restricted public, and non-public. This field means an agency can run a basic filter against its enterprise data catalog to generate a public-facing list of datasets that are, or *could one day be*, made publicly available (or, in the case of restricted data, available under certain conditions). This field also makes it easy for anyone to generate a list of datasets that *could* be made available but have not yet been released by filtering **accessLevel** to *public* and **accessURL** to *blank*.
We added the new **accessLevelComment** field for data stewards to explain how to access restricted public datasets, and for agencies to have a place to record (even if only internally) the reason for not releasing a non-public dataset.
We added the new **systemOfRecords** field for data stewards to optionally link to a relevant System of Records Notice URL. A System of Records is a group of any records under the control of any agency from which information is retrieved by the name of the individual or by some identifying number, symbol, or other identifier assigned to the individual.
We added the new **bureauCode** field to ensure every dataset is connected in a standard way with an agency bureau.
We added the new **programCode** field to ensure that when applicable, every dataset is connected in a standard way with an agency program office.
We added the new **dataQuality** to indicate whether or not the data meets an agencyโs Information Quality Guidelines.
Additional Information
----------------------
* [Schema.org](http://schema.org)
* [DCAT](http://www.w3.org/TR/vocab-dcat/)
* [Vocab.Data.gov](http://vocab.data.gov)
* [Template and Sample Files (CSV and JSON format)](/metadata-resources/)
|
portofsandiego/project-open-data.github.io
|
schema.md
|
Markdown
|
cc0-1.0
| 31,270 |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="0;url=/2011/01/24/felsenstein-web-seminar.html" />
</head>
</html>
|
sunbjt/cboettig.github.com
|
wordpress/archives/832/index.html
|
HTML
|
cc0-1.0
| 215 |
# coding: utf-8
# # ANALISIS DE PROGRESIVIDAD DE LA REFORMA DEL IRPF PARA EL CASO DE ARAGรN:
#
# ## 1. Introducciรณn de datos: Introducimos los datos para hacer cรกlculos, se presentan capturas de los datos usados.
#
#
# In[83]:
#!/usr/bin/env python
# ---------------------------------------------------------------------------------
# CARGAR LIBRERIAS
# ---------------------------------------------------------------------------------
import numpy as np
import scipy as sc
import matplotlib.pyplot as plt
import seaborn as sns
# ESTO INCRUSTA LOS GRAFICOS EN LA MISMA PAGINA
get_ipython().magic(u'matplotlib inline')
sns.set_context(rc={"figure.figsize": (18, 13)})
print u"Introducimos datos para simular una serie de rentas para aplicar los tipos del IRPF y estudiar su comportamiento"
print u"La simulaciรณn por defecto crea una serie desde 5000 hasta 400000 con incrementos de 1000"
# r = raw_input(u"Para cambiar los parรกmetros de la simulaciรณn escriba 1, sino 0: ")
# ## INTRODUCCIรN DE LOS DATOS DE IRPF PARA EL CASO DE ARAGON:
#
# 
#
# 
#
# 
# In[84]:
####################################################################################
#### DATOS ACTUALES DE IRPF #######
####################################################################################
base_actual = [0, 17707.20, 33007.20, 53407.20, 120000.00, 175000.00, 300000.00]
cuota_actual = [0, 4382.53, 8972.53, 17132.53, 48431.15, 75381.15, 139131.15]
t_actual = [0.2475, 0.3000, 0.4000, 0.470, 0.490, 0.510, 0.520]
####################################################################################
######### DATOS REFORMA DE 2015: ########
####################################################################################
t_estatal = [.10, .125, .155, .195, .235]
t_aragon = [.10, .125, .1550, .19, .215]
t_2015 = [t_estatal[i] + t_aragon[i] for i in range(5)]
base_2015 = [0, 12450.00, 20200.00, 34000.00, 60000.00]
cuota_2015 = [0, 2490, 4427.5, 8705.5, 18715.5]
# In[85]:
####################################################################################
############## SIMULACIรN E INCOGNITAS: ####################
####################################################################################
# SIMULAMOS UNA SERIE DE RENTAS:
# calculamos una serie de bases liquidas para simular el comportamiento. Agregar # al principio de la linea para activar la siguiente.
try:
if int(r) == 1:
base_sim = range(int(raw_input(">Renta de inicio: ")), int(raw_input(">Renta final: ")), int(raw_input(">Incremento: "))) # eliminar el primer # para controlar la simulacion
else:
base_sim = range(5000, 400000, 1000)
except (RuntimeError, TypeError, NameError):
base_sim = range(5000, 400000, 1000)
# DECLARAMOS LAS INCOGNITAS:
t_me_actual = []
t_mg_actual = []
ci_actual = []
ci_2015 = []
t_me_2015 = []
t_mg_2015 = []
# In[86]:
####################################################################################
##### CALCULO DE CUOTA, TIPOS MARGINALES Y MEDIO DEL ACTUAL IRPF: ######
####################################################################################
'''
Para hallar las incognitas creo dos variables comp_actual e ind_actual,
el primero lo que hace es comparar la lista de las bases de cada tramo con la base
simulada y crea una lista que devuelve TRUE o FALSE para cada tramo, para saber
que indice es y poder aplicar los tipos y cuotas del tramo correspondiente aplicamos
ind_actual que busca el primer TRUE de y devuelve el indice al que corresponde el tramo.
'''
comp_actual = [[base_sim[i] <= base_actual[ii] for ii in range(len(base_actual))] for i in range(len(base_sim))]
ind_actual = []
for i in range(len(base_sim)):
if True in comp_actual[i]:
ind_actual.append(comp_actual[i].index(True) - 1)
else:
ind_actual.append(len(base_actual) - 1)
for i in range(len(base_sim)):
ci_actual.append(cuota_actual[ind_actual[i]] + (base_sim[i] - base_actual[ind_actual[i]]) * t_actual[ind_actual[i]])
t_mg_actual.append(t_actual[ind_actual[i]])
t_me_actual.append(ci_actual[i] / base_sim[i])
####################################################################################
# CALCULOS CUOTAS, TIPO MARGINAL Y TIPO MEDIO TRAS LA REFORMA 2015 #
####################################################################################
comp_2015 = [[base_sim[i] <= base_2015[ii] for ii in range(len(base_2015))] for i in range(len(base_sim))]
ind_2015 = []
for i in range(len(base_sim)):
if True in comp_2015[i]:
ind_2015.append(comp_2015[i].index(True) - 1)
else:
ind_2015.append(len(base_2015) - 1)
for i in range(len(base_sim)):
ci_2015.append(cuota_2015[ind_2015[i]] + (base_sim[i] - base_2015[ind_2015[i]]) * t_2015[ind_2015[i]])
t_mg_2015.append(t_2015[ind_2015[i]])
t_me_2015.append(ci_2015[i] / base_sim[i])
# In[86]:
# In[87]:
####################################################################################
###### PRESENTACION DE DATOS VISUALES #########
####################################################################################
# ---------------------------------------------------------------------------------
# VISUALIZAR CALCULOS IRPF ACTUAL:
# ---------------------------------------------------------------------------------
def ver_calculos_ac():
tac = "CALCULOS IRPF ACTUAL PARA ARAGON"
print tac
print "=" * len(tac)
print "BASE\tCUOTA\tt\'\tt*"
print "-" * len(tac)
for i in range(len(base_sim)):
print "%s\t%s\t%s\t%s" % (base_sim[i], ci_actual[i], t_mg_actual[i], t_me_actual[i])
print ""
ver_calculos_ac()
# In[192]:
# ---------------------------------------------------------------------------------
# VISUALIZAR DATOS REFORMA 2015
# ---------------------------------------------------------------------------------
def ver_datos_ac():
print " DATOS IRPF ACTUAL PARA ARAGON"
print "=" * 40
print "base\t\tcuota\t\tt_total"
print "-" * 40
for i in range(len(base_actual)):
print "%s\t\t%s\t\t%s" % (base_actual[i], cuota_actual[i], t_actual[i])
print ""
ver_datos_ac()
plt.figure(figsize=(10,6), dpi=800)
plt.plot(base_sim, t_mg_actual)
plt.fill_between(base_sim, t_mg_actual, 0, alpha=0.3)
plt.yticks(t_actual)
plt.xticks(base_actual)
plt.margins(0.03)
plt.xlim(0,350000)
plt.show()
# ## DATOS DE LA REFORMA DEL IRPF 2015
# In[194]:
# ---------------------------------------------------------------------------------
# VISUALIZAR DATOS REFORMA 2015
# ---------------------------------------------------------------------------------
def ver_datos_2015():
print "DATOS IRPF 2015 PARA ARAGON"
print "=" * len("DATOS IRPF EN 2015 PARA ARAGON")
print "BASE\tCUOTA\tGRAVAMEN"
print "-" * len("DATOS IRPF EN 2015 PARA ARAGON")
for i in range(len(base_2015)):
print "%s\t%s\t%s" % (base_2015[i], cuota_2015[i], t_2015[i])
print ""
ver_datos_2015()
plt.figure(figsize=(10,6), dpi=800)
plt.plot(base_sim, t_mg_2015)
plt.fill_between(base_sim, t_mg_2015, 0, alpha=0.3)
plt.yticks(t_2015)
plt.xticks(base_2015)
plt.xlim(0,65000)
plt.margins(0.03)
plt.show()
# ## RESULTADOS SIMULADOS:
# In[195]:
# ---------------------------------------------------------------------------------
# VISUALIZAR LOS RESULTADOS IRPF 2015:
# ---------------------------------------------------------------------------------
def ver_calculos_2015():
print "\t\tRESULTADO CALCULOS IRPF 2015"
print "=" * 55
print "Base\t\tCuota\t\ttme\t\tt\'"
print "-" * 55
for i in range(len(base_sim)):
print "%s\t\t%s\t\t%s\t\t%s"% (base_sim[i], round(ci_2015[i], 3),
round(t_me_2015[i], 3), round(t_mg_2015[i],3))
ver_calculos_2015()
# ## ANรLISIS GRรFICO DE LA REFORMA:
#
# > LAS SOMBRAS SON EL AREA ENTRE LAS CURVAS RESPECTO DE TIPO MEDIO Y MARGINAL PARA EL CASO QUE NO SE GRAFICA.
#
#
# In[196]:
# ---------------------------------------------------------------------------------
# GRAFICO DE IRFP 2014:
# ---------------------------------------------------------------------------------
plt.figure(dpi=900)
plt.subplot(3,2,1)
plt.plot(ci_actual, t_mg_actual, label = "cuota_tmg_2014")
plt.plot(ci_actual, t_me_actual, label = "cuota_tme_2014")
plt.fill_between(ci_2015, t_mg_2015, t_me_2015, color = 'black', interpolate = True, alpha=0.1)
plt.margins(0.1)
plt.legend(loc = 0)
plt.subplot(3,2,3)
plt.plot(base_sim, t_mg_actual, label = "base_tmg_2014")
plt.plot(base_sim, t_me_actual, label = "base_tme_2014")
plt.fill_between(base_sim, t_mg_2015, t_me_2015, color = 'black', interpolate = True, alpha=0.1)
plt.margins(0.1)
plt.legend(loc = 0)
plt.subplot(3,2,5)
plt.plot(t_me_actual, base_sim, label = "base_tme_2014")
plt.plot(t_me_actual, ci_actual, label = "cuota_tme_2014")
plt.fill_between(t_me_2015, base_sim, ci_2015, color = 'black', interpolate = True, alpha=0.1)
plt.margins(0.1)
plt.xticks([round(t_actual[i], 2) for i in range(len(t_actual))])
# Pinta poligonos color verde entre las lineas cuando y1 < y2
# ---------------------------------------------------------------------------------
# GRAFICO DE LOS RESULTADOS DE LA REFORMA 2015:
# ---------------------------------------------------------------------------------
plt.subplot(3,2,2)
plt.plot(ci_2015, t_mg_2015, label = "cuota_tmg_2015")
plt.plot(ci_2015, t_me_2015, label = "cuota_tme_2015")
plt.fill_between(ci_actual, t_mg_actual, t_me_actual, color = 'black', interpolate = True, alpha=0.1)
plt.margins(0.031)
plt.legend(loc = 0)
plt.subplot(3,2,4)
plt.plot(base_sim, t_mg_2015, label = "base_tmg_2015")
plt.plot(base_sim, t_me_2015, label = "base_tme_2015")
plt.fill_between(base_sim, t_mg_actual, t_me_actual, color = 'black', interpolate = True, alpha=0.1)
plt.margins(0.031)
plt.legend(loc = 0)
plt.subplot(3,2,6)
plt.plot(t_me_2015, base_sim, label = "base_tme_2015")
plt.plot(t_me_2015, ci_2015, label = "cuota_tme_2015")
plt.fill_between(t_me_actual, base_sim, ci_actual, color = 'black', interpolate = True, alpha=0.1)
plt.margins(0.031)
plt.xticks([round(t_2015[i], 2) for i in range(len(t_2015))])
#for i in range(len(base_2015)):
# plt.axvline(base_2015[i], color = 'w')
# plt.axvline(t_2015[i], color = "black", label = "t_2015 = %r" % round(t_2015[i], 3), alpha=0.4)
# Pinta poligonos color verde entre las lineas cuando y1 < y2
plt.show()
# In[90]:
# In[91]:
####################################################################################
# ANALISIS DE LA PROGRESIVIDAD 2015:
####################################################################################
lp_actual = []
arp_actual = []
LP_2015 = [] # indice LP_2015
ARP_2015 = [] # indice ARP_2015
for i in range(len(base_sim)):
LP_2015.append(t_mg_2015[i] / t_me_2015[i])
ARP_2015.append((t_mg_2015[i] - t_me_2015[i]) / base_sim[i])
lp_actual.append(t_mg_actual[i] / t_me_actual[i])
arp_actual.append((t_mg_actual[i] - t_me_actual[i]) / base_sim[i])
# In[92]:
# ---------------------------------------------------------------------------------
# VISUALIZAR LOS RESULTADOS PROGRESIVIDAD 2015:
# ---------------------------------------------------------------------------------
def ver_calculos_prog():
print "\tANALISIS DE PROGRESIVIDAD"
print "=" * 60
print "Base\tt\'\tt*\tLP_14\tLP_15\tARP_14*\tARP_15*"
print "-" * 60
for i in range(len(base_sim)):
print "%s\t%s\t%s\t%s\t%s\t%s\t%s" % (base_sim[i], round(t_mg_2015[i], 4),
round(t_me_2015[i], 3), round(lp_actual[i], 3), round(LP_2015[i], 3), 1000000 * arp_actual[i], 1000000 * ARP_2015[i])
ver_calculos_prog()
# # REPRESENTACION DE LOS INDICES ARP Y LP ANTES Y DESPUES DE LA REFORMA:
# In[110]:
plt.subplot(2,1,1)
plt.plot(base_sim, arp_actual, label = "ARP 2014")
plt.plot(base_sim, ARP_2015, label = "ARP 2015")
plt.fill_between(base_sim, arp_actual, ARP_2015, color = 'black', interpolate = True, alpha = 0.3)
plt.legend()
plt.margins(0.03)
plt.subplot(2,1,2)
plt.plot(base_sim, lp_actual, label = "LP 2014")
plt.plot(base_sim, LP_2015, label = "LP 2015")
plt.fill_between(base_sim, lp_actual, LP_2015, color = 'black', interpolate = True, alpha=0.3)
plt.legend()
plt.margins(0.03)
# # CALCULO DE GANACIA RELATIVA DE PROGRESIVIDAD:
#
# > POR ENCIMA DE 0 ESTAMOS ANTES GANANCIAS DE PROGRESIVIDAD (MAS INTENSO) RESPECTO DEL MODELO DE 2014
# > POR DEBAJO DE 0 PERDIDAS DE PROGRESIVIDAD RESPECTO DEL AรO 2014
# In[127]:
# CALCULO DE GANANCIA O PERDIDA DE PROGRESIVIDAD CON LOS INDICES LP Y ARP NORMALIZADOS
inc_arp = []
inc_lp = []
for i in range(len(base_sim)):
try:
inc_arp.append((ARP_2015[i] / arp_actual[i]) - 1 )
inc_lp.append((LP_2015[i] / lp_actual[i]) - 1 )
except ZeroDivisionError:
inc_arp.append(0)
inc_lp.append(0)
plt.figure("saldo", figsize = (13,8), dpi = 800)
plt.figure("saldo")
plt.plot(base_sim, inc_lp, label = "Saldo de Progresividad LP")
plt.plot(base_sim, inc_arp, label = "Saldo de Progresividad ARP")
plt.fill_between(base_sim, inc_lp, 0, color = "b", alpha = 0.1,)
plt.fill_between(base_sim, inc_arp, 0, color = "g", alpha = 0.1,)
plt.legend()
# # GRAFICOS DE LOS INDICES ARP Y LP INDIVIDUALIZADOS:
# In[94]:
# ---------------------------------------------------------------------------------
# GRAFICO DEL INDICE LP 2014 2015
# ---------------------------------------------------------------------------------
plt.suptitle(u'ANรLISIS DE PROGRESIVIDAD')
plt.subplot(2,2,3) # Divide en dos el lienzo por la vertical primer 2 y segundo 2 por la horizontal
plt.plot(base_sim, lp_actual, label = u"รndice LP_2014")
plt.scatter(base_sim, lp_actual) # aรฑade los puntos en cada base
plt.margins(0.1)
plt.legend()
plt.subplot(2,2,4)
plt.plot(base_sim, LP_2015, label = "LP_2015")
plt.scatter(base_sim, LP_2015)
plt.margins(0.1) # AGREGA UN MARGEN PARA VISUALIZAR EL GRรFICO COMPLETO EN LOS LIMITES
plt.legend()
# ---------------------------------------------------------------------------------
# GRAFICO INDICE ARP 2014 2015
# ---------------------------------------------------------------------------------
plt.subplot(2,2,1)
plt.plot(base_sim, arp_actual, label = u"รndice ARP_2014")
plt.scatter(base_sim, arp_actual, label = "ARP 2014")
plt.margins(0.1) # AGREGA UN MARGEN PARA VISUALIZAR EL GRรFICO COMPLETO EN LOS LIMITES
plt.legend()
plt.subplot(2,2,2)
plt.plot(base_sim, ARP_2015, label = u"รndice ARP_2015")
plt.scatter(base_sim, ARP_2015, label = "ARP 2015")
plt.legend()
plt.show()
|
mmngreco/data_work
|
an_prog_fiscal.py
|
Python
|
cc0-1.0
| 15,286 |
๏ปฟ/**
* AXSelectConverter
* @class AXSelectConverter
* @extends AXJ
* @version v2.0.0
* @author [email protected]
* @logs
"2012-12-19 ์คํ 12:00:43",
"2013-04-24 ์คํ 5:45:44 - value change bug fix",
"2013-06-04 ์ค์ 11:00:42 - bind ๋ฉ์๋ ์
๊ทธ๋ ์ด๋",
"2013-07-26 ์คํ 1:14:16 - bind, unbind, bindSetConfig ํฝ์ค",
"2013-08-21 ์คํ 4:45:02 - ์ฐ์ appendAnchor ๋ฒ๊ทธํฝ์ค",
"2013-08-23 ์คํ 8:14:22 - expandBox ํฌ์ง์
๊ฐ๋ณ ์ฒ๋ฆฌ",
"2013-09-06 ์ค์ 10:08:28 - bindSelect % ๋ฒ๊ทธํฝ์ค",
"2013-09-27 ์คํ 1:29:14 - onLoad ์ถ๊ฐ : tom",bin
"2013-10-24 ์คํ 5:54:05 - resizeAnchor ๊ธฐ๋ฅ ์ถ๊ฐ : tom",
"2013-11-06 ์คํ 12:47:53 - tabindex ์์ฑ ๊ฐ์ ธ์ค๊ธฐ ๊ธฐ๋ฅ ์ถ๊ฐ : tom",
"2013-11-27 ์คํ 8:03:57 - tom : positionFixed ๊ธฐ๋ฅ ์ถ๊ฐ",
"2013-12-09 ์คํ 7:03:57 - tom : bindSelectUpdate ๊ธฐ๋ฅ์ถ๊ฐ",
"2014-01-10 ์คํ 5:08:59 - tom : event modify & bugFix",
"2014-03-11 ์ค์ 11:08:54 - tom : add bindSelectGetValue ",
"2014-03-18 ์คํ 10:09:21 - tom : select ํฌ์ปค์ค ํ ํค์
๋ ฅ ํ๋ฉด optionValue๋ฅผ ๋น๊ตํ์ฌ ์ ํ์ฒ๋ฆฌ ๊ธฐ๋ฅ ๊ตฌํ - 2์ฐจ๋ฒ์ ์ ํ๊ธ ํฌ์ปค์ค ๋ฐ optionText ๋น๊ต ์ฒ๋ฆฌ ๊ตฌ๋ฌธ ์ถ๊ฐ",
"2014-03-27 ์คํ 3:38:25 - tom : onchange ํจ์๊ฐ setValue ์์ฑ์ ๋ถ์ฌํด์ผ๋ง ์๋ํ๋ ๊ฒ์ ๋ฌด์กฐ๊ฑด ์๋ ํ๋๋ก ๋ณ๊ฒฝ",
"2014-03-31 ์คํ 4:41:18 - tom : ์
๋ ํธ ํฌ์ปค์ค ๋ ์ํ์์ ํค ์
๋ ฅํ๋ฉด ์
๋ ฅ๋ ๊ฐ์ผ๋ก select ์ฒ๋ฆฌ ํ๊ธฐ (ํ์ฌ ์๋ฌธ๋ง)",
"2014-04-10 ์คํ 6:09:44 - tom : appendAnchor, alignAnchor ๋ฐฉ์ ๋ณ๊ฒฝ ๋ฐ ํฌ๊ธฐ ๋ฒ๊ทธ ํฝ์ค & select element hide ์์ ํฌ๋ช
์ผ๋ก ๋ณ๊ฒฝ",
"2014-04-18 - tom : mobile ๋ธ๋ผ์ฐ์ ๋ฒ๊ทธ ํฝ์ค"
"2014-05-21 tom : resize event ์์"
"2014-06-02 tom : change ajax data protocol check result or error key in data"
"2014-07-02 tom : bindSelect for Array support setValue attribute"
"2014-07-09 tom : bindSelect for AJAX then serialObject not working"
"2014-07-14 tom : direct align when window resize and add method 'bindSelectAddOptions', 'bindSelectRemoveOptions'"
"2014-07-25 tom : support chaining 'method bind..'"
"2014-08-06 tom : active onLoad event when script mode "
"2014-08-08 tom : select option value ์ต์ ํ, option change ํ๋ฉด ์๋ณธ onchange ์ด๋ฒคํธ trigger"
"2014-08-08 tom : bindSelectSetValue bug fix"
"2014-08-19 tom : mobile์์ onnchange ๋ฒ๊ทธ ํฝ์ค"
"2014-08-28 tom : bindSelectDisabled(true|false) ์ง์"
"2014-10-21 tom : change ์ด๋ฒคํธ load ํ์์์ ์คํ ์ ๋๋๋ก ๋ณ๊ฒฝ"
"2015-01-14 tom : onchange ์ด๋ฒคํธ์์ ์ ๋ฌ๋๋ ๋ด์ฉ ํ์ฅ {"optionIndex":[Number], "optionValue":"", "optionText":"", "value":"", "text":""}
"2015-01-19 tom : onload ์ด๋ฒคํธ ์ธ์ ์์ selectedIndex,selectedObject,options,response "
"2015-01-19 tom : options๊ฐ ์์๋ ๋ฐ์ธ๋ ์ค๋ฅ ์์ / ๋๋น์ฌ๊ณ์ฐ ์ค๋ฅ ์์ "
"2015-01-19 tom : isspace ์ผ๋ ๊ธฐ๋ณธ๊ฐ ์ ํ ์ค๋ฅ ์์ "
"2015-01-21 tom : bindSelectUpdateOptions ๋ฉ์๋ ์ถ๊ฐ"
"2015-01-22 tom : https://github.com/axisj-com/axisj/issues/394 ์ด์ ํด๊ฒฐ isspaceValue ์์ฑ ์ถ๊ฐ"
"2015-02-02 tom : options๊ฐ ์์ ๋ onchange ์์ฑ ์ค๋ฅ ํฝ์ค, AJAX๋ฐฉ์์์ select ๋๋น ์ฒ๋ฆฌ ์ค๋ฅ"
"2015-03-16 tom : bindSelect reserveKeys ์ค์ ์ถ๊ฐ"
"2015-03-22 tom : ajax ํต์ ์ต์
์ค์ ๊ฐ๋ฅ ํ๋๋ก ์์ https://github.com/axisj-com/axisj/issues/469"
"2015-03-24 tom : select optionsData ํค ์ถ๊ฐ"
"2015-03-27 tom : modile ์์ bindSelectUpdateOptions ํธ์ถ ํ ๋ฒ๊ทธ ํฝ์ค"
"2015-03-28 tom : bindSelectUpdate ์คํ๋ ๋ onchange ํธ์ถ ๋๋๋ก ์์ "
"2015-04-17 HJ.Park : [ IE8 ] select ํ๊ทธ๊ฐ ํด๋ฆญ๋์ select์ option์ด ๋ณด์ด๋ ๋ฒ๊ทธ ์์ , AXSelect ํ
์คํธ์ ํ์ดํ ์ฌ์ด ๋น ๊ณต๊ฐ์ ํด๋ฆญํด๋ ํด๋ฆญ์ด๋ฒคํธ๊ฐ ์ผ์ด๋์ง ์๋ ๋ฒ๊ทธ ์์ "
"2015-04-20 tom : bindSelectOptionsClick id ๊ธธ์ด์ ๋ฐ๋ฅธ ๋ฒ๊ทธ ํฝ์ค "
"2015-05-04 tom : bindSelect options ๋งค์นํ ๋ ์ฌ์ฉ์ ํค ์ ์ ๊ธฐ๋ฅ์ถ๊ฐ"
"2015-05-17 tom : unbindSelect ์ visibility ๋ฒ๊ทธ ํฝ์ค"
"2015-06-02 tom : onexpand ์ค์ ์ถ๊ฐ"
"2015-06-26 HJ.Park : focus๋๋ ๊ฒฝ์ฐ ์คํ์ผ ์ถ๊ฐ https://github.com/axisj/axisj/issues/613"
"2016-08-12 tom : focus, blur, click ์ด๋ฒคํธ ์ก์
๋ณ๊ฒฝ
*
*/
var AXSelectConverter = Class.create(AXJ, {
initialize: function (AXJ_super) {
AXJ_super();
this.objects = [];
this.config.anchorClassName = "AXanchor";
this.config.anchorSelectClassName = "AXanchorSelect";
},
init: function () {
var browser = AXUtil.browser;
this.isMobile = browser.mobile;
//axdom(window).resize(this.windowResize.bind(this));
axdom(window).resize(this.alignAllAnchor.bind(this));
this.config.reserveKeys = {
options: (AXConfig.AXSelect && AXConfig.AXSelect.keyOptions) || "options",
optionValue: (AXConfig.AXSelect && AXConfig.AXSelect.keyOptionValue) || "optionValue",
optionText: (AXConfig.AXSelect && AXConfig.AXSelect.keyOptionText) || "optionText",
optionData: (AXConfig.AXSelect && AXConfig.AXSelect.keyOptionData) || "optionData"
};
},
windowResize: function () {
// ์ฌ์ฉ์ํจ
var windowResizeApply = this.windowResizeApply.bind(this);
if (this.windowResizeObserver) clearTimeout(this.windowResizeObserver);
this.windowResizeObserver = setTimeout(function () {
windowResizeApply();
}, 10);
},
windowResizeApply: function () {
// ์ฌ์ฉ์ํจ
if (this.windowResizeObserver) clearTimeout(this.windowResizeObserver);
this.alignAllAnchor();
},
alignAllAnchor: function () {
for (var i = 0; i < this.objects.length; i++) {
this.alignAnchor(this.objects[i].id, i);
}
},
bindSetConfig: function (objID, configs) {
var findIndex = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
findIndex = index;
break;
}
}
if (findIndex == null) {
//trace("๋ฐ์ธ๋ ๋ ์ค๋ธ์ ํธ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.");
} else {
var _self = this.objects[findIndex];
axdom.each(configs, function (k, v) {
_self.config[k] = v;
});
}
},
unbind: function (obj) {
//var collect = [];
var removeAnchorId;
var removeIdx;
//trace(this.objects);
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id != obj.id) {
// collect.push(this);
} else {
if (O.isDel != true) {
removeAnchorId = O.anchorID;
removeIdx = index;
}
}
}
//this.objects = collect;
if (removeAnchorId) {
var objDom = axdom("#" + obj.id), objAnchorDom = axdom("#" + removeAnchorId);
this.objects[removeIdx].isDel = true;
objDom.removeAttr("data-axbind");
objDom.css({visibility: "visible"});
if (this.isMobile) {
objAnchorDom.before(axdom("#" + obj.id));
objAnchorDom.remove();
} else {
objAnchorDom.remove();
objDom.show();
}
}
},
bind: function (obj) {
var cfg = this.config;
if (!AXgetId(obj.id)) {
obj.id = "AXSelect-" + axf.getUniqueId();
}
var objID = obj.id, objSeq = null, objConfig = {}, reserveKeys = jQuery.extend({}, cfg.reserveKeys);
objConfig = jQuery.extend(objConfig, obj, true);
if (typeof objConfig.reserveKeys == "undefined") objConfig.reserveKeys = {};
objConfig.reserveKeys = jQuery.extend(reserveKeys, objConfig.reserveKeys, true);
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
objSeq = index;
break;
}
}
if (typeof objConfig.href == "undefined") objConfig.href = cfg.href;
if (objSeq == null) {
objSeq = this.objects.length;
this.objects.push({id: objID, anchorID: cfg.targetID + "_AX_" + objID, config: objConfig});
} else {
this.objects[objSeq].isDel = undefined;
this.objects[objSeq].config = objConfig;
}
this.appendAnchor(objID, objSeq);
this.bindSelect(objID, objSeq);
this.windowResize();
},
appendAnchor: function (objID, objSeq) {
var cfg = this.config, _this = this;
var obj = this.objects[objSeq];
if (AXgetId(cfg.targetID + "_AX_" + objID)) {
axdom("#" + cfg.targetID + "_AX_" + objID).remove();
}
var anchorNode = axdom("<div id=\"" + cfg.targetID + "_AX_" + objID + "\" class=\"" + cfg.anchorClassName + "\" style=\"display:none;\"></div>");
var iobj = axdom("#" + objID);
iobj.attr("data-axbind", "select");
if (this.isMobile) iobj.before(anchorNode);
else iobj.after(anchorNode);
var iobjPosition = iobj.position();
var l = iobjPosition.left, t = iobjPosition.top, w = 0, h = 0;
w = iobj.outerWidth();
h = iobj.outerHeight();
var css = {left: l, top: t, width: w, height: h}, objDom = axdom("#" + cfg.targetID + "_AX_" + objID);
objDom.css(css);
objDom.data("height", h);
obj.iobj = iobj;
obj.objDom = objDom;
// TODO : obj์ iobj, objDom ์ฐ๊ฒฐ
},
alignAnchor: function (objID, objSeq) {
var cfg = this.config, _this = this;
var obj = this.objects[objSeq];
var iobj = obj.iobj;
var iobjPosition = iobj.position();
var l = iobjPosition.left, t = iobjPosition.top, w = 0, h = 0;
var borderW = iobj.css("border-left-width").number();
var borderT = iobj.css("border-top-width").number();
var borderB = iobj.css("border-bottom-width").number();
var marginW = iobj.css("margin-left").number();
var marginH = iobj.css("margin-top").number();
l = l + marginW;
//t = t;
w = iobj.outerWidth();
h = iobj.outerHeight();
var css = {left: l, top: t, width: w, height: h};
obj.objDom.css(css);
obj.objDom.data("height", h);
obj.objDom.find("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectBox").css({width: w, height: h});
obj.objDom.find("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").css({height: (h - (borderT + borderB)) + "px"});
obj.objDom.find("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectText").css({"line-height": (h - (borderT + borderB)) + "px"});
obj.objDom.find("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectBoxArrow").css({height: h});
},
bindSelect: function (objID, objSeq) {
var cfg = this.config, _this = this;
var obj = this.objects[objSeq], options, sendObj;
var iobj = obj.iobj;
var objDom = obj.objDom;
if (!obj.config.onChange) obj.config.onChange = obj.config.onchange;
if (!obj.config.onLoad) obj.config.onLoad = obj.config.onload;
var w = objDom.width();
var h = objDom.data("height");
var borderT = iobj.css("border-top-width").number();
var borderB = iobj.css("border-bottom-width").number();
//trace(obj.config);
var fontSize = iobj.css("font-size").number();
var tabIndex = iobj.attr("tabindex");
var po = [];
po.push("<div id=\"" + cfg.targetID + "_AX_" + objID + "_AX_SelectBox\" class=\"" + cfg.anchorSelectClassName + "\" style=\"width:" + w + "px;height:" + h + "px;\">");
po.push("<a " + obj.config.href + " class=\"selectedTextBox\" id=\"" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox\" style=\"height:" + (h - (borderT + borderB)) + "px;\"");
po.push(" data-ax-anchor=\"axselect\" ");
if (iobj.attr("data-return-tab-next-focus-id")) po.push(" data-return-tab-next-focus-id = \"" + iobj.attr("data-return-tab-next-focus-id") + "\"");
if (iobj.attr("data-return-tab-prev-focus-id")) po.push(" data-return-tab-prev-focus-id = \"" + iobj.attr("data-return-tab-prev-focus-id") + "\"");
if (tabIndex != undefined) po.push(" tabindex=\"" + tabIndex + "\"");
po.push(">");
po.push(" <div class=\"selectedText\" id=\"" + cfg.targetID + "_AX_" + objID + "_AX_SelectText\" style=\"line-height:" + (h - (borderT + borderB)) + "px;padding:0px 4px;font-size:" + fontSize + "px;\"></div>");
po.push(" <div class=\"selectBoxArrow\" id=\"" + cfg.targetID + "_AX_" + objID + "_AX_SelectBoxArrow\" style=\"height:" + h + "px;\"></div>");
po.push("</a>");
po.push("</div>");
//append to anchor
objDom.empty();
objDom.append(po.join(''));
objDom.show();
var objDom_selectTextBox = objDom.find("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox");
obj.selectedIndex = AXgetId(objID).options.selectedIndex;
var options = [];
for (var oi = 0; oi < AXgetId(objID).options.length; oi++) {
options.push({optionValue: AXgetId(objID).options[oi].value, optionText: AXgetId(objID).options[oi].text.enc()});
}
obj.options = AXUtil.copyObject(options);
if (this.isMobile) {
// mobile ๋ธ๋ผ์ฐ์ ์ธ ๊ฒฝ์ฐ
iobj.css({opacity: 0});
var bindSelectChange = this.bindSelectChange.bind(this);
obj.objOnChange = function () {
bindSelectChange(objID, objSeq);
if (obj.config.onChange) {
obj.selectedIndex = AXgetId(objID).options.selectedIndex;
AXgetId(objID).options[obj.selectedIndex].selected = true;
obj.config.selectedObject = obj.options[obj.selectedIndex];
options = AXgetId(objID).options[obj.selectedIndex];
sendObj = {
optionIndex: obj.selectedIndex, optionValue: options.value, optionText: options.text,
value: options.value, text: options.text
};
obj.config.onChange.call(sendObj, sendObj);
}
};
objDom_selectTextBox.unbind("click.AXSelect").bind("click.AXSelect", function (event) {
axdom("#" + objID).click();
});
iobj.addClass("rootSelectBox");
iobj.bind("change.AXSelect", obj.objOnChange);
} else {
//AXUtil.alert(obj.options);
// PC ๋ธ๋ผ์ฐ์ ์ธ ๊ฒฝ์ฐ
iobj
.css({visibility: "hidden"});
var bindSelectExpand = this.bindSelectExpand.bind(this);
var bindSelectClose = this.bindSelectClose.bind(this);
var bindSelectFocus = this.bindSelectFocus.bind(this);
var bindSelectBlur = this.bindSelectBlur.bind(this);
objDom_selectTextBox.bind("click.AXSelect", function (event) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").focus();
bindSelectExpand(objID, objSeq, true, event);
});
objDom_selectTextBox.bind("keydown.AXSelect", function (event) {
if (event.keyCode == AXUtil.Event.KEY_SPACE) {
bindSelectExpand(objID, objSeq, true, event);
_this.stopEvent(event);
}
if (event.keyCode == AXUtil.Event.KEY_TAB || event.keyCode == AXUtil.Event.KEY_RETURN) return;
//trace(String.fromCharCode(event.keyCode));
if (_this.selectTextBox_onkeydown_obj) {
clearTimeout(_this.selectTextBox_onkeydown_obj);
_this.selectTextBox_onkeydown_data += String.fromCharCode(event.keyCode);
} else {
_this.selectTextBox_onkeydown_data = String.fromCharCode(event.keyCode);
}
_this.selectTextBox_onkeydown_obj = setTimeout(function () {
_this.selectTextBox_onkeydown(objID, objSeq, event);
}, 300);
});
objDom_selectTextBox.bind("focus.AXSelect", function (event) {
bindSelectFocus(objID);
});
objDom_selectTextBox.bind("blur.AXSelect", function (event) {
bindSelectBlur(objID);
});
}
if (obj.config.ajaxUrl) {
var bindSelectChangeBind = this.bindSelectChange.bind(this);
var bindSelectChange = function () {
bindSelectChangeBind(objID, objSeq, "load");
};
var url = obj.config.ajaxUrl;
var pars = obj.config.ajaxPars;
var _method = "post";
var _headers = {};
var _contentType = AXConfig.AXReq.contentType;
var _responseType = AXConfig.AXReq.responseType;
var _dataType = AXConfig.AXReq.dataType;
var _async = AXConfig.AXReq.async;
// ajax ์ต์
ํ์ฅ
if (obj.config.method) _method = obj.config.method;
if (obj.config.headers) _headers = obj.config.headers;
if (obj.config.contentType) _contentType = obj.config.contentType;
if (obj.config.responseType) _responseType = obj.config.responseType;
if (obj.config.dataType) _dataType = obj.config.dataType;
if (obj.config.ajaxAsync) _async = obj.config.ajaxAsync;
obj.selectedIndex = null;
iobj.html("<option></option>");
obj.inProgress = true; //์งํ์ค ์ํ ๋ณ๊ฒฝ
new AXReq(url, {
type: _method,
headers: _headers,
contentType: _contentType,
responseType: _responseType,
dataType: _dataType,
async: _async,
debug: ((typeof obj.config.debug !== "undefined") ? obj.config.debug : false),
pars: pars,
onsucc: function (res) {
if ((res.result && res.result == AXConfig.AXReq.okCode) || (res.result == undefined && !res.error)) {
var po = [], adj = 0;
//obj.config.options = res.options;
obj.config.options = res[obj.config.reserveKeys.options];
if (obj.config.isspace) {
po.push("<option value='" + (obj.config.isspaceValue || "") + "'");
if (obj.selectedIndex == 0) po.push(" selected=\"selected\"");
po.push(">" + (obj.config.isspaceTitle || " ") + "</option>");
adj = -1;
}
for (var opts, oidx = 0; (oidx < res[obj.config.reserveKeys.options].length && (opts = res[obj.config.reserveKeys.options][oidx])); oidx++) {
//trace(opts);
po.push("<option value=\"" + opts[obj.config.reserveKeys.optionValue] + "\" data-option=\"" + opts[obj.config.reserveKeys.optionData] + "\" ");
if (obj.config.setValue == opts[obj.config.reserveKeys.optionValue] || opts.selected || (obj.selectedIndex || 0).number() + adj == oidx) po.push(" selected=\"selected\"");
po.push(">" + opts[obj.config.reserveKeys.optionText].dec() + "</option>");
}
axdom("#" + objID).html(po.join(''));
var options = [];
for (var oi = 0; oi < AXgetId(objID).options.length; oi++) {
options.push({
optionValue: AXgetId(objID).options[oi].value,
optionText: AXgetId(objID).options[oi].text.enc(),
optionData: AXgetId(objID).options[oi].getAttribute("data-option")
});
}
obj.options = AXUtil.copyObject(options);
obj.selectedIndex = AXgetId(objID).options.selectedIndex;
if (obj.config.onChange && obj.config.alwaysOnChange) {
obj.config.focusedIndex = obj.selectedIndex;
obj.config.selectedObject = obj.options[obj.selectedIndex];
sendObj = {
optionIndex: obj.selectedIndex,
optionValue: obj.options[obj.selectedIndex].optionValue,
optionText: obj.options[obj.selectedIndex].optionText,
optionData: obj.options[obj.selectedIndex].optionData,
value: obj.options[obj.selectedIndex].optionValue,
text: obj.options[obj.selectedIndex].optionText,
data: obj.options[obj.selectedIndex].optionData
};
obj.config.onChange.call(sendObj, sendObj, "isPostBack");
}
bindSelectChange();
if (obj.config.onLoad) {
sendObj = {
selectedIndex: obj.selectedIndex,
selectedObject: obj.options[obj.selectedIndex],
options: obj.options,
response: res
};
obj.config.onLoad.call(sendObj, sendObj);
}
_this.alignAnchor(objID, objSeq);
} else {
//trace(res);
}
obj.inProgress = false;
}
});
}
else if (obj.config.options) {
iobj.html("<option></option>");
var po = [], adj = 0;
if (obj.config.isspace) {
po.push("<option value='" + (obj.config.isspaceValue || "") + "'");
if (obj.selectedIndex == 0) po.push(" selected=\"selected\"");
po.push(">" + (obj.config.isspaceTitle || " ") + "</option>");
adj = -1;
}
for (var opts, oidx = 0; (oidx < obj.config.options.length && (opts = obj.config.options[oidx])); oidx++) {
//[obj.config.reserveKeys.optionValue]
//[obj.config.reserveKeys.optionText]
var optionText = (opts[obj.config.reserveKeys.optionText] || "").dec();
po.push("<option value=\"" + opts[obj.config.reserveKeys.optionValue] + "\"");
if (obj.config.setValue == opts[obj.config.reserveKeys.optionValue] || opts.selected || obj.selectedIndex.number() + adj == oidx) po.push(" selected=\"selected\"");
po.push(">" + optionText + "</option>");
}
iobj.html(po.join(''));
var options = [];
for (var oi = 0; oi < AXgetId(objID).options.length; oi++) {
options.push({optionValue: AXgetId(objID).options[oi].value, optionText: AXgetId(objID).options[oi].text.enc()});
}
obj.options = AXUtil.copyObject(options);
obj.selectedIndex = AXgetId(objID).options.selectedIndex;
this.bindSelectChange(objID, objSeq, "load");
if (obj.config.onChange && obj.config.alwaysOnChange) {
obj.config.focusedIndex = obj.selectedIndex;
obj.config.selectedObject = obj.options[obj.selectedIndex];
options = AXgetId(objID).options[obj.selectedIndex];
if (!options) {
options = {value: "", text: ""};
}
sendObj = {
optionIndex: obj.selectedIndex, optionValue: options.value, optionText: options.text,
value: options.value, text: options.text
};
obj.config.onChange.call(sendObj, sendObj, "isPostBack");
}
if (obj.config.onLoad) {
var selectedOption = this.getSelectedOption(objID, objSeq);
obj.config.onLoad.call({selectedIndex: obj.selectedIndex, selectedObject: {optionValue: selectedOption.value, optionText: selectedOption.text}});
}
this.alignAnchor(objID, objSeq);
}
else {
this.bindSelectChange(objID, objSeq, "load");
if (obj.config.onChange && obj.config.alwaysOnChange) {
var selectedOption = this.getSelectedOption(objID, objSeq);
if (selectedOption) {
sendObj = {
optionIndex: selectedOption.index,
optionValue: selectedOption.value,
optionText: selectedOption.text,
value: selectedOption.value,
text: selectedOption.text
};
obj.config.onChange.call(sendObj, sendObj, "isPostBack");
}
}
if (obj.config.onLoad) {
var selectedOption = this.getSelectedOption(objID, objSeq);
obj.config.onLoad.call({selectedIndex: obj.selectedIndex, selectedObject: {optionValue: selectedOption.value, optionText: selectedOption.text}});
}
this.alignAnchor(objID, objSeq);
}
},
selectTextBox_onkeydown: function (objID, objSeq, event) {
var cfg = this.config, _this = this;
var obj = this.objects[objSeq];
var bindSelectClose = this.bindSelectClose.bind(this);
var chkVal = (_this.selectTextBox_onkeydown_data || ""), chkIndex = null;
for (var O, index = 0; (index < obj.options.length && (O = obj.options[index])); index++) {
if (O.optionValue.left(chkVal.length).lcase() == chkVal.lcase() || O.optionText.left(chkVal.length).lcase() == chkVal.lcase()) {
chkIndex = index;
break;
}
}
;
if (chkIndex != null) {
obj.selectedIndex = chkIndex;
obj.config.focusedIndex = chkIndex;
obj.config.selectedObject = obj.options[chkIndex];
obj.config.isChangedSelect = true;
bindSelectClose(objID, objSeq, event); // ๊ฐ ์ ๋ฌ ํ ๋ซ๊ธฐ
}
_this.selectTextBox_onkeydown_data = "";
},
getSelectedOption: function (objID, objSeq) {
var cfg = this.config;
var obj = this.objects[objSeq];
if (AXgetId(objID) && AXgetId(objID).options.selectedIndex > -1) {
try {
if (obj.selectedIndex != AXgetId(objID).options.selectedIndex) obj.selectedIndex = AXgetId(objID).options.selectedIndex;
} catch (e) {
}
var options = AXgetId(objID).options[AXgetId(objID).options.selectedIndex];
return {
value: options.value, text: options.text, data: options.getAttribute("data-option"), index: AXgetId(objID).options.selectedIndex
}
} else {
obj.selectedIndex = 0;
var options = AXgetId(objID).options[0];
options = (options) ? {value: options.value, text: options.text, data: options.getAttribute("data-option")} : {value: "", text: "", data: ""};
return {
value: options.value, text: options.text, data: options.data, index: 0
}
}
},
bindSelectChange: function (objID, objSeq, isLoad) {
var cfg = this.config;
var obj = this.objects[objSeq];
var selectedOption = this.getSelectedOption(objID, objSeq);
if (selectedOption) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectText").html(selectedOption.text);
}
if (obj && !this.isMobile) {
if (!obj.iobj) obj.iobj = axdom("#" + objID);
if (isLoad != "load") obj.iobj.trigger("change"); // change ์ด๋ฒคํธ ๋ฐ์
}
},
bindSelectExpand: function (objID, objSeq, isToggle, event) {
var _this = this;
var cfg = this.config;
var obj = this.objects[objSeq];
var jqueryTargetObjID = axdom("#" + cfg.targetID + "_AX_" + objID);
//Selector Option box Expand
if (jqueryTargetObjID.data("disabled")) return;
if (isToggle) { // ํ์ฑํ ์ฌ๋ถ๊ฐ ํ ๊ธ ์ด๋ฉด
if (AXgetId(cfg.targetID + "_AX_" + objID + "_AX_expandBox")) {
if (obj.config.isChangedSelect) {
this.bindSelectClose(objID, objSeq, event); // ๋ซ๊ธฐ
} else {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_expandBox").remove(); // ๊ฐ์ฒด ์ญ์ ์ฒ๋ฆฌ
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectBoxArrow").removeClass("on");
//๋นํ์ฑ ์ฒ๋ฆฌํ ๋ฉ์๋ ์ข
๋ฃ
axdom(document).unbind("click.AXSelect");
axdom(document).unbind("keydown.AXSelect");
}
return;
}
}
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_expandBox").remove(); // ํ์ฑํ ์ ์ ๊ฐ์ฒด ์ญ์ ์ฒ๋ฆฌ
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectBoxArrow").removeClass("on");
//Expand Box ์์ฑ ๊ตฌ๋ฌธ ์์ฑ
var anchorWidth = axdom("#" + cfg.targetID + "_AX_" + objID).width() - 2; // anchor width
var anchorHeight = axdom("#" + cfg.targetID + "_AX_" + objID).data("height") - 1;
var styles = [];
//styles.push("top:"+anchorHeight+"px");
styles.push("width:" + anchorWidth + "px");
var po = [];
po.push("<div id=\"" + cfg.targetID + "_AX_" + objID + "_AX_expandBox\" class=\"AXselectExpandBox\" style=\"" + styles.join(";") + "\">");
po.push("<div id=\"" + cfg.targetID + "_AX_" + objID + "_AX_expandScroll\" class=\"AXselectExpandScroll\">");
po.push(" <div class=\"AXLoadingSmall\"></div>");
po.push("</div>");
po.push("</div>");
axdom(document.body).append(po.join(''));
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectBoxArrow").addClass("on");
var expandBox = axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_expandBox");
if (obj.config.positionFixed) {
expandBox.css({"position": "fixed"});
}
var expBoxHeight = expandBox.outerHeight();
var offset = (obj.config.positionFixed) ? jqueryTargetObjID.position() : jqueryTargetObjID.offset();
if (obj.config.position) {
offset = jqueryTargetObjID.offset();
if (obj.config.position.top != undefined) {
offset.top = obj.config.position.top;
}
}
var css = {};
css.top = offset.top + anchorHeight;
//css.top = offset.top;
css.left = offset.left;
var bodyHeight;
(AXUtil.docTD == "Q") ? bodyHeight = document.body.scrollHeight : bodyHeight = document.documentElement.scrollHeight;
//trace({bodyHeight:bodyHeight, top:css.top});
if (!obj.config.positionFixed) {
if (bodyHeight < css.top.number() + expBoxHeight) {
css = {
top: offset.top - expBoxHeight,
left: offset.left
}
}
}
expandBox.css(css);
// onexpand ํจ์๊ฐ ์กด์ฌ ํ๋ค๋ฉด
if (obj.config.onexpand) {
obj.config.onexpand.call({
obj: obj,
objID: objID,
objSeq: objSeq
}, function (args) {
if (typeof args != "undefined") {
obj.options = obj.config.options = axf.copyObject(args.options);
var po = [], adj = 0;
if (obj.config.isspace) {
po.push("<option value='" + (obj.config.isspaceValue || "") + "'");
if (obj.selectedIndex == 0) po.push(" selected=\"selected\"");
po.push(">" + (obj.config.isspaceTitle || " ") + "</option>");
adj = -1;
}
for (var opts, oidx = 0; oidx < obj.options.length; oidx++) {
var opts = obj.options[oidx];
po.push("<option value=\"" + opts[obj.config.reserveKeys.optionValue] + "\" data-option=\"" + opts[obj.config.reserveKeys.optionData] + "\" ");
if (obj.config.setValue == opts[obj.config.reserveKeys.optionValue] || opts.selected || (obj.selectedIndex || 0).number() + adj == oidx) po.push(" selected=\"selected\"");
po.push(">" + opts[obj.config.reserveKeys.optionText].dec() + "</option>");
}
axdom("#" + objID).html(po.join(''));
_this.bindSelectSetOptions(objID, objSeq);
_this.alignAnchor(objID, objSeq);
}
});
} else {
this.bindSelectSetOptions(objID, objSeq);
}
},
bindSelectClose: function (objID, objSeq, event) {
var obj = this.objects[objSeq], options, sendObj;
//trace("bindSelectorClose");
var cfg = this.config;
if (AXgetId(cfg.targetID + "_AX_" + objID + "_AX_expandBox")) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_expandBox").remove(); // ๊ฐ์ฒด ์ญ์ ์ฒ๋ฆฌ
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectBoxArrow").removeClass("on");
//๋นํ์ฑ ์ฒ๋ฆฌํ ๋ฉ์๋ ์ข
๋ฃ
axdom(document).unbind("click.AXSelect");
//axdom(document.body).unbind("focus.AXSelect", obj.documentclickEvent);
axdom(document).unbind("keydown.AXSelect");
axdom(document.body).off("focus.AXSelect", "input,select,button,a,textarea");
if (obj.config.isChangedSelect) {
AXgetId(objID).options[obj.selectedIndex].selected = true;
if (obj.config.onChange) {
options = AXgetId(objID).options[obj.selectedIndex];
sendObj = {
optionIndex: obj.selectedIndex, optionValue: options.value, optionText: options.text, optionData: options.getAttribute("data-option"),
value: options.value, text: options.text, data: options.data
};
obj.config.onChange.call(sendObj, sendObj);
}
obj.config.isChangedSelect = false;
this.bindSelectChange(objID, objSeq);
}
if (event) event.stopPropagation(); // disableevent
return;
} else {
if (obj.config.isChangedSelect) {
AXgetId(objID).options[obj.selectedIndex].selected = true;
if (obj.config.onChange) {
options = AXgetId(objID).options[obj.selectedIndex];
sendObj = {
optionIndex: obj.selectedIndex, optionValue: options.value, optionText: options.text, optionData: options.getAttribute("data-option"),
value: options.value, text: options.text, data: options.data
};
obj.config.onChange.call(sendObj, sendObj);
}
obj.config.isChangedSelect = false;
this.bindSelectChange(objID, objSeq);
}
}
},
bindSelectSetOptions: function (objID, objSeq) {
var obj = this.objects[objSeq];
var cfg = this.config;
var jqueryTargetObjID = axdom("#" + cfg.targetID + "_AX_" + objID);
var maxHeight = obj.config.maxHeight || 200;
if (!obj.options) return;
if (obj.options.length == 0) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_expandBox").hide();
}
var po = [];
for (var O, index = 0; (index < obj.options.length && (O = obj.options[index])); index++) {
po.push("<a " + obj.config.href + " id=\"" + cfg.targetID + "_AX_" + objID + "_AX_" + index + "_AX_option\">" + O.optionText.dec() + "</a>");
}
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_expandScroll").html(po.join(''));
var expandScrollHeight = axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_expandScroll").height();
if (expandScrollHeight > maxHeight) expandScrollHeight = maxHeight;
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_expandBox").css({height: expandScrollHeight + "px"});
var bindSelectOptionsClick = this.bindSelectOptionsClick.bind(this);
obj.documentclickEvent = function (event) {
bindSelectOptionsClick(objID, objSeq, event);
};
var bindSelectKeyup = this.bindSelectKeyup.bind(this);
obj.documentKeyup = function (event) {
bindSelectKeyup(objID, objSeq, event);
};
axdom(document).unbind("click.AXSelect").bind("click.AXSelect", obj.documentclickEvent);
/*
axdom(document.body).bind("focus.AXSelect", function(e){
console.log(e);
});
*/
axdom(document).unbind("keydown.AXSelect").bind("keydown.AXSelect", obj.documentKeyup);
axdom(document.body).off("focus.AXSelect").on("focus.AXSelect", "input,select,button,a,textarea", obj.documentclickEvent);
if (obj.myUIScroll) obj.myUIScroll.unbind();
obj.myUIScroll = new AXScroll();
obj.myUIScroll.setConfig({
CT_className: "AXScrollSmall",
targetID: cfg.targetID + "_AX_" + objID + "_AX_expandBox",
scrollID: cfg.targetID + "_AX_" + objID + "_AX_expandScroll",
touchDirection: false
});
if (obj.selectedIndex != undefined) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_" + obj.selectedIndex + "_AX_option").addClass("on");
obj.myUIScroll.focusElement(cfg.targetID + "_AX_" + objID + "_AX_" + obj.selectedIndex + "_AX_option"); //focus
obj.config.focusedIndex = obj.selectedIndex;
}
// ์์น ์ฌ ์ ์ ํ์ํ๋ฉด ์ ์ ํ ๊ฒ ----------------------------------
var bodyHeight;
(AXUtil.docTD == "Q") ? bodyHeight = document.body.clientHeight : bodyHeight = document.documentElement.clientHeight;
var anchorHeight = jqueryTargetObjID.data("height") - 1;
var expandBox = axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_expandBox");
var expBoxHeight = expandBox.outerHeight();
var offset = (obj.config.positionFixed) ? jqueryTargetObjID.position() : jqueryTargetObjID.offset();
if (obj.config.position) {
offset = jqueryTargetObjID.offset();
if (obj.config.position.top != undefined) {
offset.top = obj.config.position.top;
}
}
var css = {};
css.top = offset.top + anchorHeight;
if (!obj.config.positionFixed) {
if (bodyHeight < css.top.number() + expBoxHeight) {
css = {
top: offset.top - expBoxHeight,
left: offset.left
}
expandBox.css(css);
}
}
// ์์น ์ฌ ์ ์ ํ์ํ๋ฉด ์ ์ ํ ๊ฒ ----------------------------------
},
bindSelectOptionsClick: function (objID, objSeq, event) {
var obj = this.objects[objSeq];
var cfg = this.config;
var isSelectorClick = false;
var eid = event.target.id.split(/_AX_/g);
var tgid = event.target.id;
if (event.target.id == "") isSelectorClick = false;
else {
if (event.target.id == objID || (eid[0] == cfg.targetID && tgid.substr(eid[0].length + 4, objID.length) == objID)) {
isSelectorClick = true;
}
}
if (!isSelectorClick) {
this.bindSelectClose(objID, objSeq, event); // ์
๋ญํฐ ์ธ์ ์์ญ์ด ๋ฏ๋ก ๋ซ๊ธฐ
} else {
if (eid.last() == "option") {
var selectedIndex = eid[eid.length - 2];
obj.selectedIndex = selectedIndex;
obj.config.focusedIndex = selectedIndex;
obj.config.selectedObject = obj.options[selectedIndex];
obj.config.isChangedSelect = true;
this.bindSelectClose(objID, objSeq, event); // ๊ฐ ์ ๋ฌ ํ ๋ซ๊ธฐ
}
}
},
bindSelectKeyup: function (objID, objSeq, event) {
var obj = this.objects[objSeq];
var cfg = this.config;
if (event.keyCode == AXUtil.Event.KEY_TAB || event.keyCode == AXUtil.Event.KEY_ESC) {
this.bindSelectClose(objID, objSeq, event); // ๋ซ๊ธฐ
return;
} else if (event.keyCode == AXUtil.Event.KEY_UP) {
if (!obj.options) return;
if (obj.options.length == 0) return;
var focusIndex = obj.options.length - 1;
if (obj.config.focusedIndex == undefined || obj.config.focusedIndex == 0) {
} else {
focusIndex = (obj.config.focusedIndex) - 1;
}
this.bindSelectorSelect(objID, objSeq, focusIndex);
this.stopEvent(event);
} else if (event.keyCode == AXUtil.Event.KEY_DOWN) {
if (!obj.options) return;
if (obj.options.length == 0) return;
var focusIndex = 0;
if (obj.config.focusedIndex == undefined || obj.config.focusedIndex == obj.options.length - 1) {
} else {
focusIndex = (obj.config.focusedIndex).number() + 1;
}
this.bindSelectorSelect(objID, objSeq, focusIndex);
this.stopEvent(event);
} else if (event.keyCode == AXUtil.Event.KEY_RETURN) {
//alert("RETURN");
/*
axdom(document).unbind("click", obj.documentclickEvent);
axdom(document).unbind("keydown", obj.documentKeyup);
*/
/*
var selectedIndex = eid[eid.length - 2];
obj.selectedIndex = selectedIndex;
obj.config.focusedIndex = selectedIndex;
obj.config.selectedObject = obj.options[selectedIndex];
obj.config.isChangedSelect = true;
this.bindSelectClose(objID, objSeq, event); // ๊ฐ ์ ๋ฌ ํ ๋ซ๊ธฐ
*/
}
},
/* ~~~~~~~~~~~~~ */
bindSelectorSelect: function (objID, objSeq, index, changeValue) {
var obj = this.objects[objSeq];
var cfg = this.config;
if (obj.config.focusedIndex != undefined) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_" + obj.config.focusedIndex + "_AX_option").removeClass("on");
}
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_" + index + "_AX_option").addClass("on");
obj.config.focusedIndex = index;
obj.selectedIndex = index;
obj.config.selectedObject = obj.options[index];
obj.config.isChangedSelect = true;
obj.myUIScroll.focusElement(cfg.targetID + "_AX_" + objID + "_AX_" + index + "_AX_option"); //focus
},
bindSelectorSelectClear: function (objID, objSeq) {
var obj = this.objects[objSeq];
var cfg = this.config;
if (obj.selectedIndex != undefined) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_" + obj.selectedIndex + "_AX_option").removeClass("on");
}
obj.selectedIndex = null;
obj.config.focusedIndex = null;
obj.config.selectedObject = null;
obj.config.isChangedSelect = true;
},
/* ~~~~~~~~~~~~~ */
bindSelectChangeValue: function (objID, value, onEnd) {
var findIndex = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
findIndex = index;
break;
}
}
;
if (findIndex == null) {
//trace("๋ฐ์ธ๋ ๋ ์ค๋ธ์ ํธ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.");
return;
} else {
var obj = this.objects[findIndex], options, sendObj;
var cfg = this.config;
if (this.isMobile) {
for (var oi = 0; oi < AXgetId(objID).options.length; oi++) {
if (AXgetId(objID).options[oi].value == value) {
var selectedIndex = oi;
AXgetId(objID).options[oi].selected = true;
obj.config.selectedObject = {optionIndex: oi, optionValue: AXgetId(objID).options[oi].value, optionText: AXgetId(objID).options[oi].text.enc()};
this.bindSelectChange(objID, findIndex);
if (obj.config.onChange) {
options = AXgetId(objID).options[oi];
sendObj = {
optionIndex: oi, optionValue: options.value, optionText: options.text,
value: options.value, text: options.text
};
obj.config.onChange.call(sendObj, sendObj);
}
break;
}
}
} else {
var selectedIndex = null;
for (var O, oidx = 0; (oidx < obj.options.length && (O = obj.options[oidx])); oidx++) {
if ((O.optionValue || O.value || "") == value) {
selectedIndex = oidx;
break;
}
}
;
if (selectedIndex != null) {
obj.selectedIndex = selectedIndex;
obj.config.focusedIndex = selectedIndex;
AXgetId(objID).options[obj.selectedIndex].selected = true;
obj.config.selectedObject = obj.options[selectedIndex];
this.bindSelectChange(objID, findIndex);
if (obj.config.onChange) {
options = AXgetId(objID).options[selectedIndex];
sendObj = {
optionIndex: selectedIndex, optionValue: options.value, optionText: options.text,
value: options.value, text: options.text
};
obj.config.onChange.call(sendObj, sendObj);
}
} else {
//trace("์ผ์นํ๋ ๊ฐ์ ์ฐพ์ ์ ์์ต๋๋ค.");
}
}
}
},
bindSelectDisabled: function (objID, _disabled) {
var findIndex = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
findIndex = index;
break;
}
}
;
if (findIndex == null) {
//trace("๋ฐ์ธ๋ ๋ ์ค๋ธ์ ํธ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.");
return;
} else {
var obj = this.objects[findIndex];
var cfg = this.config;
if (typeof _disabled == "boolean") {
axf.getId(objID).disabled = _disabled;
} else {
axf.getId(objID).disabled = !AXgetId(objID).disabled;
}
if (this.isMobile) {
} else {
var bindTarget = axdom("#" + cfg.targetID + "_AX_" + objID);
bindTarget.data("disabled", axf.getId(objID).disabled);
if (axf.getId(objID).disabled) {
bindTarget.find(".AXanchorSelect").addClass("disable");
} else {
bindTarget.find(".AXanchorSelect").removeClass("disable");
}
}
}
},
bindSelectUpdate: function (objID) {
var findIndex = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
findIndex = index;
break;
}
}
if (findIndex != null) {
var obj = this.objects[findIndex], selectedIndex, options, sendObj;
if (obj.config.onChange) {
selectedIndex = AXgetId(objID).options.selectedIndex;
options = AXgetId(objID).options[selectedIndex];
sendObj = {
optionIndex: selectedIndex,
optionValue: options.value, optionText: options.text,
value: options.value,
text: options.text
};
obj.config.onChange.call(sendObj, sendObj);
}
this.bindSelectChange(objID, findIndex);
}
},
bindSelectFocus: function (objID, elFocus) {
var cfg = this.config;
var findIndex = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
findIndex = index;
break;
}
}
if (findIndex != null) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").addClass("focus");
if(elFocus) axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").focus();
}
},
bindSelectBlur: function (objID) {
var cfg = this.config;
var findIndex = null;
var _this = this;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
findIndex = index;
break;
}
}
if (findIndex != null) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").removeClass("focus");
}
},
bindSelectGetAnchorObject: function (objID) {
var cfg = this.config;
var findIndex = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
findIndex = index;
break;
}
}
;
if (findIndex != null) {
return axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox");
}
},
bindSelectGetValue: function (objID, onEnd) {
var findIndex = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
findIndex = index;
break;
}
}
;
if (findIndex == null) {
return {optionValue: null, optionText: null, error: "๋ฐ์ธ๋ ๋ ์ค๋ธ์ ํธ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค."};
} else {
var obj = this.objects[findIndex];
var cfg = this.config;
if (obj.selectedIndex != undefined) {
var options = AXgetId(objID).options[obj.selectedIndex];
return {optionValue: options.value, optionText: options.text, optionData: options.getAttribute("data-option")};
} else {
return {optionValue: null, optionText: null};
}
}
},
/**
* @method AXSelectConverter.bindSelectAddOptions
* @param {String} objID - element select id
* @param {Array} options - ์ถ๊ฐํ๋ ค๋ ์ต์
๋ฐฐ์ด
* @returns {Array} options
* @description ์ค๋ช
* @example
```
mySelect.bindSelectAddOptions("objID", [{optionValue:"1", optionText:"์ก์์ค์ ์ด"}]);
```
*/
bindSelectAddOptions: function (objID, options) {
var cfg = this.config, _this = this;
var objSeq = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
objSeq = index;
break;
}
}
if (objSeq == null) {
trace("not found element id");
return;
}
var obj = this.objects[objSeq];
var iobj = obj.iobj;
if (!Object.isArray(options)) {
trace("options ์๊ท๋จผํธ๊ฐ ์์ต๋๋ค.");
return;
}
var newOptions = obj.options;
for (var i = 0; i < options.length; i++) {
var hasValue = false;
for (var oi = 0; oi < obj.options.length; oi++) {
if (obj.options[oi].optionValue == options[i].optionValue) {
hasValue = true;
}
}
if (!hasValue) {
newOptions.push({optionText: options[i].optionText.enc(), optionValue: options[i].optionValue});
}
}
obj.options = newOptions;
iobj.css({opacity: 100});
//trace(obj.options);
var po = [];
for (var opts, oidx = 0; (oidx < obj.options.length && (opts = obj.options[oidx])); oidx++) {
var optionText = (opts.optionText || "").dec();
po.push("<option value=\"" + opts.optionValue + "\"");
if (obj.selectedIndex == oidx) po.push(" selected=\"selected\"");
po.push(">" + optionText + "</option>");
}
iobj.empty();
iobj.append(po.join(''));
//this.bindSelectChangeValue(objID, obj.config.setValue);
this.alignAnchor(objID, objSeq);
return obj.options;
},
/**
* @method AXSelectConverter.bindSelectRemoveOptions
* @param objID {String} element select id
* @param options {Array} ์ถ๊ฐํ๋ ค๋ ์ต์
๋ฐฐ์ด
* @returns {Array} options
* @description ์ค๋ช
* @example
```
mySelect.bindSelectRemoveOptions("objID", [{optionValue:"1", optionText:"์ก์์ค์ ์ด"}]);
```
*/
bindSelectRemoveOptions: function (objID, options) {
var cfg = this.config, _this = this;
var objSeq = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
objSeq = index;
break;
}
}
if (objSeq == null) {
trace("not found element id");
return;
}
var obj = this.objects[objSeq];
var iobj = obj.iobj;
if (!Object.isArray(options)) {
trace("options ์๊ท๋จผํธ๊ฐ ์์ต๋๋ค.");
return;
}
var newOptions = [];
for (var oi = 0; oi < obj.options.length; oi++) {
var hasValue = false;
for (var i = 0; i < options.length; i++) {
if (obj.options[oi].optionValue == options[i].optionValue) {
hasValue = true;
}
}
if (!hasValue) {
newOptions.push({optionText: obj.options[oi].optionText, optionValue: obj.options[oi].optionValue});
}
}
obj.options = newOptions;
//trace(obj.options);
iobj.css({opacity: 100});
var po = [];
for (var opts, oidx = 0; (oidx < obj.options.length && (opts = obj.options[oidx])); oidx++) {
var optionText = (opts.optionText || "").dec();
po.push("<option value=\"" + opts.optionValue + "\"");
if (obj.selectedIndex == oidx) po.push(" selected=\"selected\"");
po.push(">" + optionText + "</option>");
}
iobj.empty();
iobj.append(po.join(''));
this.alignAnchor(objID, objSeq);
return obj.options;
},
/**
* @method AXSelectConverter.bindSelectUpdateOptions
* @param {String} objID - element select id
* @param {Array|Object} options - ์ต์
๋ฐฐ์ด
* @param {Number} optionIndex - ๋ณ๊ฒฝํ๋ ค๋ ์ต์
์ธ๋ฑ์ค
* @returns {AXSelectConverter}
* @description ์ค๋ช
* @example
```
jQuery("#AXSelect1").bindSelectUpdateOptions([
{optionValue:1, optionText:"abc-1 : ABCDEFG"},
{optionValue:2, optionText:"abc-2 : 09123123"},
{optionValue:3, optionText:"abc-3 : 1222"},
{optionValue:4, optionText:"abc-4 : AXISJ"},
{optionValue:5, optionText:"abc-5 : ์ก์์ค ์ ์ด"}
]);
jQuery("#AXSelect1").bindSelectUpdateOptions({optionValue:3, optionText:"ํน๋ณํ ๊ฐ์ผ๋ก ๋ณ๊ฒฝ"}, 3);
```
*/
bindSelectUpdateOptions: function (objID, options, optionIndex) {
var cfg = this.config, _this = this;
var objSeq = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
if (O.id == objID && O.isDel != true) {
objSeq = index;
break;
}
}
if (objSeq == null) {
trace("not found element id");
return;
}
var obj = this.objects[objSeq];
var iobj = obj.iobj;
if (typeof optionIndex === "undefined" && !Object.isArray(options)) {
trace("options ์๊ท๋จผํธ๊ฐ ์์ต๋๋ค.");
return;
}
var newOptions = [];
if (typeof optionIndex === "undefined") {
for (var i = 0; i < options.length; i++) {
newOptions.push(jQuery.extend({optionText: options[i].optionText.enc(), optionValue: options[i].optionValue}, options[i]));
}
obj.selectedIndex = 0;
} else {
var _adj = 0;
if (obj.config.isspace) _adj = 1;
for (var i = 0; i < obj.config.options.length; i++) {
if (i + _adj == optionIndex) {
newOptions.push(jQuery.extend({optionText: options.optionText.enc(), optionValue: options.optionValue}, options));
} else {
newOptions.push(obj.config.options[i]);
}
}
}
obj.config.options = newOptions;
iobj.css({opacity: 100});
iobj.html("<option></option>");
var po = [], adj = 0;
if (obj.config.isspace) {
po.push("<option value='" + (obj.config.isspaceValue || "") + "'");
if (obj.selectedIndex == 0) po.push(" selected=\"selected\"");
po.push(">" + (obj.config.isspaceTitle || " ") + "</option>");
adj = -1;
}
for (var opts, oidx = 0; (oidx < obj.config.options.length && (opts = obj.config.options[oidx])); oidx++) {
var optionText = (opts.optionText || "").dec();
po.push("<option value=\"" + opts.optionValue + "\"");
if (obj.config.setValue == opts.optionValue || opts.selected || (obj.selectedIndex || 0).number() + adj == oidx) po.push(" selected=\"selected\"");
po.push(">" + optionText + "</option>");
}
iobj.html(po.join(''));
var options = [];
for (var oi = 0; oi < AXgetId(objID).options.length; oi++) {
options.push({optionValue: AXgetId(objID).options[oi].value, optionText: AXgetId(objID).options[oi].text.enc()});
}
obj.options = AXUtil.copyObject(options);
obj.selectedIndex = AXgetId(objID).options.selectedIndex;
this.bindSelectChange(objID, objSeq, "load");
if (obj.config.onChange && obj.config.alwaysOnChange) {
obj.config.focusedIndex = obj.selectedIndex;
obj.config.selectedObject = obj.options[obj.selectedIndex];
options = AXgetId(objID).options[obj.selectedIndex];
sendObj = {
optionIndex: obj.selectedIndex, optionValue: options.value, optionText: options.text,
value: options.value, text: options.text
};
obj.config.onChange.call(sendObj, sendObj, "isPostBack");
}
this.alignAnchor(objID, objSeq);
iobj.css({opacity: 0});
return this;
}
});
var AXSelect = new AXSelectConverter();
AXSelect.setConfig({targetID: "AXselect"});
/**
* @method jQueryExtends.unbindSelect
* @param {JSObject} configs
* @returns {jQueryObject}
* @description select ์๋ฆฌ๋จผํธ์ select ์ฝํธ๋กค์ ์ธ๋ฐ์ธ๋(์ ๊ฑฐ) ํฉ๋๋ค.
* @example
```js
axdom("Selector").unbindSelect();
```
**/
axdom.fn.unbindSelect = function (config) {
axdom.each(this, function () {
if (config == undefined) config = {};
config.id = this.id;
AXSelect.unbind(config);
});
return this;
};
/**
* @method jQueryExtends.bindSelect
* @param {JSObject} configs
* @returns {jQueryObject}
* @description
* select ์๋ฆฌ๋จผํธ์ select ์ฝํธ๋กค์ ๋ฐ์ธ๋ ํฉ๋๋ค.
* @example
```
axdom("Selector").bindSelect(configs);
```
*/
axdom.fn.bindSelect = function (config) {
axdom.each(this, function () {
if (!this.id) this.id = "AXInput-" + axf.getUniqueId();
if (config == undefined) config = {};
config.id = this.id;
AXSelect.bind(config);
});
return this;
};
/**
* @method jQueryExtends.setConfigSelect
* @param {jsObject} config - select ์ค์
* @returns {jQueryObject}
* @description
* select ์ฝํธ๋กค์ ์ค์ ์ ๋ณ๊ฒฝํฉ๋๋ค.
* @example
```
axdom("Selector").bindSelect(configs);
```
*/
axdom.fn.setConfigSelect = function (config) {
axdom.each(this, function () {
AXSelect.bindSetConfig(this.id, config);
});
return this;
};
/**
* @method jQueryExtends.bindSelectSetValue
* @param {String} value
* @param {fn} [onEnd] - ๋๋๊ณ ์คํ๋ ํจ์ / ์์
* @returns {jQueryObject}
* @description
* ํด๋น ์
๋ ํธ ์ปจํธ๋กค์ ๊ฐ์ ์
๋ ฅํ๊ณ onEnd ํจ์๊ฐ ์๋ ๊ฒฝ์ฐ ์คํํฉ๋๋ค.
* @example
```
axdom("Selector").bindSelectSetValue('test');
```
*/
axdom.fn.bindSelectSetValue = function (value, onEnd) {
axdom.each(this, function () {
AXSelect.bindSelectChangeValue(this.id, value, onEnd);
});
return this;
};
axdom.fn.bindSelectGetValue = function (onEnd) {
return AXSelect.bindSelectGetValue(this[0].id, onEnd);
};
//SetText
//getText
/**
* @method jQueryExtends.setValueSelect
* @param {String} value
* @param {fn} [onEnd] - ๋๋๊ณ ์คํ๋ ํจ์ / ์์
* @returns {jQueryObject}
* @description
* ํด๋น ์
๋ ํธ ์ปจํธ๋กค์ ๊ฐ์ ์
๋ ฅํ๊ณ onEnd ํจ์๊ฐ ์๋ ๊ฒฝ์ฐ ์คํํฉ๋๋ค.
* @example
```
axdom("Selector").setValueSelect('test');
```
*/
axdom.fn.setValueSelect = function (value, onEnd) {
axdom.each(this, function () {
AXSelect.bindSelectChangeValue(this.id, value, onEnd);
});
return this;
};
/**
* @method jQueryExtends.bindSelectDisabled
* @param {Boolean} Disabled
* @returns {jQueryObject}
* @description
* ํด๋น ์
๋ ํธ ์ปจํธ๋กค์ Disabled ์์ฑ์ ์ปจํธ๋กค ํฉ๋๋ค.
* @example
```
axdom("Selector").bindSelectDisabled(true);
```
*/
axdom.fn.bindSelectDisabled = function (Disabled) {
axdom.each(this, function () {
AXSelect.bindSelectDisabled(this.id, Disabled);
});
return this;
};
/**
* @method jQueryExtends.bindSelectUpdate
* @returns {jQueryObject}
* @description
* ํด๋น ์
๋ ํธ ์ปจํธ๋กค์ view ๋ฅผ value ๊ธฐ์ค์ผ๋ก ๋ณ๊ฒฝํฉ๋๋ค.
* @example
```
axdom("Selector").bindSelectUpdate();
```
*/
axdom.fn.bindSelectUpdate = function () {
axdom.each(this, function () {
AXSelect.bindSelectUpdate(this.id);
});
return this;
};
/**
* @method jQueryExtends.bindSelectFocus
* @returns {jQueryObject}
* @description
* ํด๋น ์
๋ ํธ ์ปจํธ๋กค์ focus๋ฅผ ์ค๋๋ค.
* @example
```
axdom("Selector").bindSelectFocus();
```
*/
axdom.fn.bindSelectFocus = function () {
axdom.each(this, function () {
AXSelect.bindSelectFocus(this.id, true);
});
return this;
};
/**
* @method jQueryExtends.bindSelectBlur
* @returns {jQueryObject}
* @description
* ํด๋น ์
๋ ํธ ์ปจํธ๋กค์ blur ์ํ๋ก ๋ณ๊ฒฝํฉ๋๋ค.(๋นํ์ฑ ์ฒ๋ฆฌํ ๋ฉ์๋ ์ข
๋ฃ)
* @example
```
axdom("Selector").bindSelectBlur();
```
*/
axdom.fn.bindSelectBlur = function () {
axdom.each(this, function () {
AXSelect.bindSelectBlur(this.id);
});
return this;
};
/**
* @method jQueryExtends.bindSelectGetAnchorObject
* @returns {jQueryObject}
* @description
* ํด๋น ์
๋ ํธ ์ปจํธ๋กค์ view html element๋ฅผ ๋ฐํํฉ๋๋ค.
* @example
```
axdom("Selector").bindSelectGetAnchorObject();
```
*/
axdom.fn.bindSelectGetAnchorObject = function () {
var returnObj;
axdom.each(this, function () {
returnObj = AXSelect.bindSelectGetAnchorObject(this.id);
});
return returnObj;
};
/**
* @method jQueryExtends.bindSelectAddOptions
* @param {Array} options - ์ถ๊ฐํ๋ ค๋ ์ต์
๋ฐฐ์ด
* @description ๋ฐฐ์ด๋ก ์ง์ ํ ๊ฐ์ฒด๋ฅผ ํด๋น ์
๋ ํธ์ option ์ ์ถ๊ฐํฉ๋๋ค.
* @example
```
$("#mySelect").bindSelectAddOptions([
{optionValue:"1", optionText:"์ก์์ค์ ์ด"}
]);
```
*/
axdom.fn.bindSelectAddOptions = function (options) {
var returnObj;
axdom.each(this, function () {
returnObj = AXSelect.bindSelectAddOptions(this.id, options);
});
return returnObj;
};
/**
* @method jQueryExtends.bindSelectRemoveOptions
* @param {Array} options - ์ญ์ ํ๋ ค๋ ์ต์
๋ฐฐ์ด
* @description ๋ฐฐ์ด๋ก ์ง์ ํ ๊ฐ์ฒด๋ฅผ ํด๋น ์
๋ ํธ์ option ์์ ์ ๊ฑฐํฉ๋๋ค.
* @example
```
```
*/
axdom.fn.bindSelectRemoveOptions = function (options) {
var returnObj;
axdom.each(this, function () {
returnObj = AXSelect.bindSelectRemoveOptions(this.id, options);
});
return returnObj;
};
/**
* @method jQueryExtends.bindSelectUpdateOptions
* @param {Array} options - ์ญ์ ํ๋ ค๋ ์ต์
๋ฐฐ์ด
* @description ๋ฐฐ์ด๋ก ์ง์ ํ ๊ฐ์ฒด๋ฅผ ํด๋น ์
๋ ํธ์ option ์์ ์ ๊ฑฐํฉ๋๋ค.
* @example
```
jQuery("#AXSelect1").bindSelectUpdateOptions([
{optionValue:1, optionText:"abc-1 : ABCDEFG"},
{optionValue:2, optionText:"abc-2 : 09123123"},
{optionValue:3, optionText:"abc-3 : 1222"},
{optionValue:4, optionText:"abc-4 : AXISJ"},
{optionValue:5, optionText:"abc-5 : ์ก์์ค ์ ์ด"}
]);
jQuery("#AXSelect1").bindSelectUpdateOptions({optionValue:3, optionText:"ํน๋ณํ ๊ฐ์ผ๋ก ๋ณ๊ฒฝ"}, 3);
```
*/
axdom.fn.bindSelectUpdateOptions = function (options, oidx) {
var returnObj;
axdom.each(this, function () {
returnObj = AXSelect.bindSelectUpdateOptions(this.id, options, oidx);
});
return returnObj;
};
|
Chungjaehong/autoBidding
|
js/axis/AXSelect.js
|
JavaScript
|
cc0-1.0
| 67,224 |
subroutine resbact
!! ~ ~ ~ PURPOSE ~ ~ ~
!! this subroutine models bacteria in reservoirs
!! ~ ~ ~ INCOMING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! inum1 |none |reservoir number
!! inum2 |none |inflow hydrograph storage location number
!! res_bactlp(:) |# cfu/100ml |less persistent bacteria stored in
!! |reservoir
!! res_bactp(:) |# cfu/100ml |persistent bacteria stored in reservoir
!! reswtr |m^3 H2O |initial reservoir volume
!! thbact |none |temperature adjustment factor for bacteria
!! |die-off/growth
!! tmpav(:) |deg C |average air temperature on current day
!! varoute(2,:) |m^3 H2O |water flowing into reservoir on day
!! varoute(18,:) |# cfu/100ml |persistent bacteria
!! varoute(19,:) |# cfu/100ml |less persistent bacteria
!! wdlpres |1/day |Die-off factor for less persistent bacteria
!! |in reservoirs
!! wdpres |1/day |Die-off factor for persistent bacteria in
!! |reservoirs
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ OUTGOING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! res_bactlp(:)|# cfu/100ml |less persistent bacteria in reservoir/outflow
!! |at end of day
!! res_bactp(:) |# cfu/100ml |persistent bacteria in reservoir/outflow at
!! |end of day
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ LOCAL DEFINITIONS ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! jres |none |reservoir number
!! netwtr |m^3 H2O |net amount of water in reservoir during
!! |time step
!! totbactlp |10^4 cfu |mass less persistent bacteria
!! totbactp |10^4 cfu |mass persistent bacteria
!! wtmp |deg C |temperature of water in reach
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ SUBROUTINES/FUNCTIONS CALLED ~ ~ ~
!! Intrinsic: Exp, Max
!! SWAT: Theta
!! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~
use parm
implicit none
real, external :: Theta
integer :: jres
real :: totbactp, totbactlp, netwtr
real :: wtmp
jres = 0
jres = inum1
!! calculate temperature in stream
!! Stefan and Preudhomme. 1993. Stream temperature estimation
!! from air temperature. Water Res. Bull. p. 27-45
!! SWAT manual equation 2.3.13
wtmp = 0.
wtmp = 5.0 + 0.75 * tmpav(jres)
if (wtmp <= 0.) wtmp = 0.1
!! daily mass balance
!! total bacteria mass in reservoir
totbactp = 0.
totbactlp = 0.
totbactp = varoute(18,inum2) * varoute(2,inum2)
& + res_bactp(jres) * reswtr
totbactlp = varoute(19,inum2) * varoute(2,inum2)
& + res_bactlp(jres) * reswtr
!! compute bacteria die-off
totbactp = totbactp * Exp(-Theta(wdpres,thbact,wtmp))
totbactp = Max(0., totbactp)
totbactlp = totbactlp * Exp(-Theta(wdlpres,thbact,wtmp))
totbactlp = Max(0., totbactlp)
!! new concentration
netwtr = 0.
netwtr = varoute(2,inum2) + reswtr
if (netwtr >= 1.) then
res_bactp(jres) = totbactp / netwtr
res_bactlp(jres) = totbactlp / netwtr
else
res_bactp(jres) = 0.
res_bactlp(jres) = 0.
end if
return
end
|
grmpfhmbl/swatmodel-trusty64
|
src/resbact.f
|
FORTRAN
|
cc0-1.0
| 4,115 |
/**
* AngularJS default filter with the following expression:
* "layer in layers | filter: {name: $select.search, parameters: $select.search}"
* performs a AND between 'name: $select.search' and 'parameters: $select.search'.
* We want to perform a OR.
*/
|
MUSEZOOLVERT/musezoolvert.github.io
|
static/scripts/apps/selectExternalLayer.js
|
JavaScript
|
cc0-1.0
| 261 |
import { combineReducers } from 'redux';
import visibilityFilter from './visibilityFilter.js';
import todos from './todos.js';
/* reducer composition, metaprogramming structure */
const todoApp = combineReducers({
todos,
visibilityFilter
});
export default todoApp;
|
wandarkaf/React-Bible
|
reduxBasicApp/src/js/reducers/composition.js
|
JavaScript
|
cc0-1.0
| 273 |
<!DOCTYPE html>
<html>
<head>
<title>Creating custom item</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlxcombo.css"/>
<script src="../../../codebase/dhtmlxcombo.js"></script>
<style>
/* green */
div.dhxcombolist_material div.dhxcombo_option div.dhxcombo_checkbox.dhxcombo_radio_green_1 {
background-image: url("../common/flags2/flag_green.png");
background-position: center center;
}
/* red */
div.dhxcombolist_material div.dhxcombo_option div.dhxcombo_checkbox.dhxcombo_radio_red_1 {
background-image: url("../common/flags2/flag_red.png");
background-position: center center;
}
/* unchecked - common */
div.dhxcombolist_material div.dhxcombo_option div.dhxcombo_checkbox.dhxcombo_radio_green_0,
div.dhxcombolist_material div.dhxcombo_option div.dhxcombo_checkbox.dhxcombo_radio_red_0 {
background-image: url("../common/flags2/flag_gray.png");
background-position: center center;
}
/* log */
#log_here {
font-size: 8pt;
font-family: Tahoma;
width: 500px;
height: 120px;
border: 1px solid #cecece;
padding: 2px 5px;
overflow: auto;
}
</style>
<script>
var myCombo, myCombo2;
var eventIndex = 1;
function doOnLoad() {
// green
myCombo = new dhtmlXCombo("combo_zone", "combo", 230, "my_radio_green");
myCombo.load("../common/data2_short.json");
myCombo.enableFilteringMode(true);
// onRadioCheck is a custom event used in custom item type, just as an example
myCombo.attachEvent("onRadioCheck", function(value, state){
log("onRadioCheck event for green, value: "+value+", new state: "+state.toString());
return true;
});
// red
myCombo2 = new dhtmlXCombo("combo_zone2", "combo2", 230, "my_radio_red");
myCombo2.load("../common/data2_short.json");
myCombo2.enableFilteringMode(true);
myCombo2.attachEvent("onRadioCheck", function(value, state){
log("onRadioCheck event for red, value: "+value+", new state: "+state.toString());
return true;
});
}
function log(text) {
var t = document.getElementById("log_here");
t.innerHTML += (eventIndex++)+") "+text+"<br>";
t.scrollTop = t.scrollHeight;
}
// green checkbox
dhtmlXCombo.prototype.modes.my_radio_green = {
// define if top image will present (at least you can use it for margin to justify text)
image: true,
// defile css for image, for better inheritance (see my_radio_red)
image_css: "dhxcombo_checkbox dhxcombo_radio_green_#state#",
option_css: "dhxcombo_option_text dhxcombo_option_text_chbx",
// items pull, here we will keep all items to be able to uncheck them
items: {},
// last checked item within group, will used on loading stage,
// only first item will checked if more than one have "checked" set to true
last_checked: {},
// this is basic render function, called by combo instance
render: function(item, data) {
// item - div created by combo, placed in popup list
// data - item data, json from init/server
// all items from simple combo belong to common parent,
// we will set custom attr to it and collect items from common parent to group,
// this will allow to separate items from several combos on page
if (typeof(item.parentNode._optRbGroup) == "undefined") {
// 1st creation, assign uniq id to parent
item.parentNode._optRbGroup = window.dhx4.newId();
this.items[item.parentNode._optRbGroup] = {}; // storage for items from single combo
}
this.items[item.parentNode._optRbGroup][item._optId] = item;
// check only first item from group
var checked = window.dhx4.s2b(data.checked);
if (checked) {
if (typeof(this.last_checked[item.parentNode._optRbGroup]) == "undefined") {
// first matched item, mark group
this.last_checked[item.parentNode._optRbGroup] = true;
} else {
// group already have checked item, clear flag
checked = false;
}
}
// here you can save some item's params
// value - mandatory, no matter how to save it, you just will need to return it several times
item._conf = {
value: data.value,
css: "",
checked: checked
};
// main item class, make sure if you will change it - you need to add corresponding css
item.className = "dhxcombo_option";
// item text/image if any
// dhxcombo_checkbox - default css for checkbox/image, postfix can be easily modified, see css above
// dhxcombo_option_text dhxcombo_option_text_chbx - also default option text css
// if you plan to use different css rules - make sure you not forgot to add them
// text will saved later
item.innerHTML = "<div class='"+String(this.image_css).replace("#state#",(item._conf.checked?"1":"0"))+"'></div>"+
"<div class='"+this.option_css+"'> </div>";
// add custom attr to radio-button image, to separate what element was clicked
// item._optId - inner option uniq id (different than value), assigned by combo
// can help you to identify your option
item.firstChild._optRbId = item._optId;
// apply css (default code, just for def-code compat)
if (data.css != null) {
item.lastChild.style.cssText += data.css;
item._conf.css = data.css;
}
// apply item text if any, also default code, will copied for "option" mode functionality
// you also can use your own
this.setText(item, data.text);
// return object instance
return this;
},
destruct: function(item) {
// nothing special, just clear storage
this.items[item.parentNode._optRbGroup][item._optId] = null;
item._conf = null;
},
setChecked: function(item, state) {
// check/uncheck item code
item._conf.checked = window.dhx4.s2b(state);
item.firstChild.className = String(this.image_css).replace("#state#",(item._conf.checked?"1":"0"));
// is state==true - we need to turn "off" all other items from the same list
if (state == true) {
for (var a in this.items[item.parentNode._optRbGroup]) {
if (a != item._optId) { // skip current item
this.setChecked(this.items[item.parentNode._optRbGroup][a], false);
}
}
}
},
isChecked: function(item) {
// true if checked
return (item._conf.checked==true);
},
getExtraData: function(item) {
// extra data will added to data returned by getOption()
return {type: "my_radio_green", checked: item._conf.checked, extra_param: "value"};
},
optionClick: function(item, ev, combo) {
// called when option clicked, return true allows selection+confirm, return false - not
// for exaple - return false to prevent list hiding if image was clicked
var r = true;
var t = (ev.target||ev.srcElement);
while (r == true && t != null && t != item) {
// check if node have "custom attr" (was set in render())
if (t._optRbId != null) {
// call custom event, if handler will return true - allow state-change
// do not allow uncheck item by click
if (item._conf.checked == false && combo.callEvent("onRadioCheck", [item._conf.value,!item._conf.checked]) === true) {
this.setChecked(item, !this.isChecked(item));
// also here we need to uncheck any checked button
};
r = false; // return value, false if image was clicked
} else {
t = t.parentNode;
}
}
t = combo = item = null;
return r;
},
getTopImage: function(item, enabled) {
// returns html for top image
// if item not specified - default image
// enabled specify if combo enabled
return "";
},
topImageClick: function(item, combo) {
// called when user clicked on top-image,
// return true/false to allow defailt action (open/close list) ot not
// for checkbox - perform default action
return true;
}
};
// copy some basic functionality like setText/getText, setValue, setSelected/isSelected (in-list highlight) from default item "option"
dhtmlXComboExtend("my_radio_green", "option");
// red checkbox, this item actually the same as green but css changed a bit
dhtmlXCombo.prototype.modes.my_radio_red = {
image_css: "dhxcombo_checkbox dhxcombo_radio_red_#state#"
};
dhtmlXComboExtend("my_radio_red", "my_radio_green");
</script>
</head>
<body onload="doOnLoad();">
<h3>Custom item (green radio-flag)</h3>
<div id="combo_zone"></div>
<br>
<h3>Custom item from custom item (red radio-flag)</h3>
<div id="combo_zone2"></div>
<br><br><br><br><br><br><br><br><br><br>
<div id="log_here"></div>
</body>
</html>
|
dongnan-cn/electron-pm
|
release-builds/AKKA Project Management Tool-win32-ia32/resources/app.asar.unpacked/lib/dhtmlxCombo/samples/dhtmlxCombo/08_advanced/03_creating_custom_item.html
|
HTML
|
cc0-1.0
| 8,862 |
---
comments: true
date: 2012-02-10 10:06:11
layout: post
slug: thursday-writing-some-latexdiff-notes
title: 'Thursday: writing; some latexdiff notes'
redirects: [/wordpress/archives/3804, /archives/3804]
categories:
- ecology
tags:
- code-tricks
---
## Forage fish writing
See doc, FF dropbox PopDyn
## Warning signals edits
* Alan edits
* Figure captions, titles.
* Text changes from Noam.
## A better git latexdiff solution
Placing the script below somewhere in the path like `/usr/local/bin` and modify `~/.gitconfig` as indicated in the header comments. Then oen can view pdf-diffs of the latex of the current version against previous versions with commands such as
```bash
git latexdiff HEAD
```
shows the differences between the last commit and the current (uncommitted) changes. References to other versions should work just as in git diff commands, see [git book for more](http://book.git-scm.com/3_comparing_commits_-_git_diff.html).
[gist id=1128616]
## logistics
* Evolution reimbursement.
* CPB travel funds.
|
fboehm/labnotebook
|
_posts/2012-02-10-thursday-writing-some-latexdiff-notes.md
|
Markdown
|
cc0-1.0
| 1,061 |
/******************************************************************************
*
* Copyright 2014 Paphus Solutions Inc.
*
* Licensed under the Eclipse Public License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
package android.widget;
import javax.swing.DefaultListModel;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
import android.view.View;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemSelectedListener;
/**
* ListView proxy for a Swing list.
*/
public class ListView extends View {
public static int TRANSCRIPT_MODE_ALWAYS_SCROLL = -1;
DefaultListModel model = new DefaultListModel();
public ListView() {
}
public void transcriptMode(){
int lastIndex = ((JList)this.component).getModel().getSize() - 1;
if (lastIndex >= 0) {
((JList)this.component).ensureIndexIsVisible(lastIndex);
}
}
public ListView(JComponent component) {
super(component);
}
public int getCheckedItemPosition() {
return ((JList)this.component).getSelectedIndex();
}
public void setSelection(int index) {
((JList)this.component).setSelectedIndex(index);
}
public void setAdapter(ArrayAdapter adapter) {
for (Object element : adapter.array) {
model.addElement(element);
}
((JList)this.component).setModel(model);
}
public void setList(String [] list){
for(Object element : list){
model.addElement(element);
}
((JList)this.component).setModel(model);
}
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
}
public void setOnTouchListener(View.OnTouchListener listner) {
}
public void clear(){
DefaultListModel listModel = (DefaultListModel) ((JList)this.component).getModel();
listModel.removeAllElements();
}
public void addItem(String s){
model.addElement(s);
((JList)this.component).setModel(model);
}
public void setTranscriptMode(int mode) {
((JList)this.component).ensureIndexIsVisible(((JList)this.component).getModel().getSize() - mode);
}
public int getCount() {
return ((JList)this.component).getModel().getSize();
}
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
}
public Object getItemAtPosition(int position) {
return ((JList)this.component).getModel().getElementAt(position);
}
public void setCellRender(ListCellRenderer re){
((JList)this.component).setCellRenderer(re);
}
}
|
BOTlibre/BOTlibre
|
swingdroid/source/android/widget/ListView.java
|
Java
|
epl-1.0
| 3,017 |
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate;
import org.hibernate.util.StringHelper;
/**
* A problem occurred accessing a property of an instance of a
* persistent class by reflection, or via CGLIB. There are a
* number of possible underlying causes, including
* <ul>
* <li>failure of a security check
* <li>an exception occurring inside the getter or setter method
* <li>a nullable database column was mapped to a primitive-type property
* <li>the Hibernate type was not castable to the property type (or vice-versa)
* </ul>
* @author Gavin King
*/
public class PropertyAccessException extends HibernateException {
private final Class persistentClass;
private final String propertyName;
private final boolean wasSetter;
public PropertyAccessException(Throwable root, String s, boolean wasSetter, Class persistentClass, String propertyName) {
super(s, root);
this.persistentClass = persistentClass;
this.wasSetter = wasSetter;
this.propertyName = propertyName;
}
public Class getPersistentClass() {
return persistentClass;
}
public String getPropertyName() {
return propertyName;
}
public String getMessage() {
return super.getMessage() +
( wasSetter ? " setter of " : " getter of ") +
StringHelper.qualify( persistentClass.getName(), propertyName );
}
}
|
ControlSystemStudio/cs-studio
|
thirdparty/plugins/org.csstudio.platform.libs.hibernate/project/core/src/main/java/org/hibernate/PropertyAccessException.java
|
Java
|
epl-1.0
| 2,352 |
/* $Id: triefa.h,v 1.2 2005/04/08 20:45:34 erg Exp $ $Revision: 1.2 $ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/* File - TrieFA.h
The data types for the generated trie-baseed finite automata.
*/
struct TrieState { /* An entry in the FA state table */
short def; /* If this state is an accepting state then */
/* this is the definition, otherwise -1. */
short trans_base; /* The base index into the transition table.*/
long mask; /* The transition mask. */
};
struct TrieTrans { /* An entry in the FA transition table. */
short c; /* The transition character (lowercase). */
short next_state; /* The next state. */
};
typedef struct TrieState TrieState;
typedef struct TrieTrans TrieTrans;
extern TrieState TrieStateTbl[];
extern TrieTrans TrieTransTbl[];
#ifdef __cplusplus
}
#endif
|
ceyhunc/graphviz-win
|
cmd/lefty/dot2l/triefa.h
|
C
|
epl-1.0
| 1,669 |
/*******************************************************************************
* Copyright (c) 2020 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
/**
* @version 1.0
*/
@org.osgi.annotation.versioning.Version("1.0")
@TraceOptions(traceGroup = "METRICS", messageBundle = "io.openliberty.microprofile.metrics.internal.resources.Metrics")
package io.openliberty.microprofile.metrics.internal.publicapi;
import com.ibm.websphere.ras.annotation.TraceOptions;
|
OpenLiberty/open-liberty
|
dev/io.openliberty.microprofile.metrics.internal.public/src/io/openliberty/microprofile/metrics/internal/publicapi/package-info.java
|
Java
|
epl-1.0
| 845 |
/**
* Copyright (c) 2010-2021 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.nzwateralerts.internal.binder;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingStatusDetail;
/**
* The {@link NZWaterAlertsControllerListener} is responsible for handling the events from the WebClient and Handler.
*
* @author Stewart Cossey - Initial contribution
*/
@NonNullByDefault
public interface NZWaterAlertsBinderListener {
void updateWaterLevel(int level);
void updateBindingStatus(ThingStatus thingStatus);
void updateBindingStatus(ThingStatus thingStatus, ThingStatusDetail thingStatusDetail, String description);
}
|
MikeJMajor/openhab2-addons-dlinksmarthome
|
bundles/org.openhab.binding.nzwateralerts/src/main/java/org/openhab/binding/nzwateralerts/internal/binder/NZWaterAlertsBinderListener.java
|
Java
|
epl-1.0
| 1,038 |
package rlpark.plugin.rltoys.experiments.scheduling.network;
import rlpark.plugin.rltoys.experiments.scheduling.interfaces.JobDoneEvent;
import rlpark.plugin.rltoys.experiments.scheduling.schedulers.LocalScheduler;
import zephyr.plugin.core.api.signals.Listener;
import zephyr.plugin.core.api.synchronization.Chrono;
public class NetworkClient {
static private double maximumMinutesTime = -1;
static private String serverHost = "";
static private int serverPort = ServerScheduler.DefaultPort;
static private int nbCore = LocalScheduler.getDefaultNbThreads();
private final LocalScheduler localScheduler;
final protected NetworkJobQueue networkJobQueue;
public NetworkClient(int nbThread, String serverHost, int port, boolean multipleAttempts) {
this(new LocalScheduler(nbThread, createJobQueue(serverHost, port, nbThread, multipleAttempts)));
}
public NetworkClient(final LocalScheduler localScheduler) {
this.localScheduler = localScheduler;
networkJobQueue = (NetworkJobQueue) localScheduler.queue();
}
private static NetworkJobQueue createJobQueue(String serverHost, int port, int nbCore,
boolean multipleConnectionAttempts) {
return new NetworkJobQueue(serverHost, port, nbCore, multipleConnectionAttempts);
}
private void setMaximumTime(final double wallTime) {
networkJobQueue.onJobDone().connect(new Listener<JobDoneEvent>() {
final Chrono chrono = new Chrono();
@Override
public void listen(JobDoneEvent event) {
if (chrono.getCurrentChrono() > wallTime)
networkJobQueue.denyNewJobRequest();
}
});
}
public void run() {
localScheduler.start();
localScheduler.waitAll();
}
public void asyncRun() {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
NetworkClient.this.run();
}
});
thread.setDaemon(true);
thread.start();
}
public void dispose() {
localScheduler.dispose();
networkJobQueue.dispose();
}
private static void readParams(String[] args) {
for (String arg : args)
if (arg.startsWith("-"))
readOption(arg);
else
readServerInfo(arg);
}
private static void readOption(String arg) {
switch (arg.charAt(1)) {
case 't':
maximumMinutesTime = Double.parseDouble(arg.substring(2));
break;
case 'c':
nbCore = Integer.parseInt(arg.substring(2));
break;
default:
System.err.println("Unknown option: " + arg);
}
}
private static void readServerInfo(String arg) {
int portSeparator = arg.lastIndexOf(":");
serverHost = portSeparator >= 0 ? arg.substring(0, portSeparator) : arg;
if (portSeparator >= 0)
serverPort = Integer.parseInt(arg.substring(portSeparator + 1));
}
public static void runClient() {
NetworkClient scheduler = new NetworkClient(nbCore, serverHost, serverPort, true);
if (maximumMinutesTime > 0)
scheduler.setMaximumTime(maximumMinutesTime * 60);
scheduler.run();
scheduler.dispose();
}
private static void printParams() {
System.out.println("maximumMinutesTime: " + String.valueOf(maximumMinutesTime));
System.out.println("nbCore: " + String.valueOf(nbCore));
}
public NetworkJobQueue queue() {
return networkJobQueue;
}
public static void main(String[] args) {
if (args.length < 1) {
System.err.println("Usage: java -jar <jarfile.jar> -t<max time: 30,60,... mins> -c<nb cores> <hostname:port>");
return;
}
readParams(args);
printParams();
try {
runClient();
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
rlpark/rlpark
|
rlpark.plugin.rltoys/jvsrc/rlpark/plugin/rltoys/experiments/scheduling/network/NetworkClient.java
|
Java
|
epl-1.0
| 3,657 |
/**
* Copyright 2016 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.dependencies.util;
import org.jboss.forge.addon.dependencies.Dependency;
import org.jboss.forge.furnace.util.Predicate;
/**
* {@link Predicate} used to filter out SNAPSHOT {@link Dependency} instances.
*/
public class NonSnapshotDependencyFilter implements Predicate<Dependency>
{
@Override
public boolean accept(Dependency dependency)
{
return dependency != null && !dependency.getCoordinate().isSnapshot();
}
}
|
forge/core
|
dependencies/api/src/main/java/org/jboss/forge/addon/dependencies/util/NonSnapshotDependencyFilter.java
|
Java
|
epl-1.0
| 647 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.