code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
/* * Copyright (c) 2009 - 2014 Deutsches Elektronen-Synchroton, * Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 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 Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this program (see the file COPYING.LIB for more * details); if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ package org.dcache.nfs.v4.xdr; import org.dcache.xdr.*; import java.io.IOException; public class component4 extends utf8str_cs { public component4() { } public component4(String value) { super(value); } public component4(XdrDecodingStream xdr) throws OncRpcException, IOException { super(xdr); } } // End of component4.java
devsunny/app-galleries
dcache-nfs/src/main/java/org/dcache/nfs/v4/xdr/component4.java
Java
mit
1,285
exports.pathResolver = function pathResolver(base, path) { base = base.slice(); path = path.slice(); while (base.length && path[0] === '..') { path.shift(); base.pop(); } return base.concat(path); }; exports.pathSpliter = function pathSpliter(path) { var splitPath; if (path instanceof Array) { splitPath = path; } else if (typeof path === 'string') { if (path.match(/[/]|[.][.]/)) { splitPath = path.split('/'); } else { splitPath = path.split('.'); } if (!splitPath[0] && !splitPath[1]) { splitPath = ['.']; } var barsProp = splitPath.pop() .split('@'); if (barsProp[0]) { splitPath.push(barsProp[0]); } if (barsProp[1]) { splitPath.push('@' + barsProp[1]); } } else { throw 'bad arrgument: expected String | Array<String>.'; } return splitPath; }; function findPath(arg) { if (arg) { if (arg.type === 'insert') { return arg.path; } else if ( arg.type === 'operator' || arg.type === 'transform' ) { for (var i = 0; i < arg.arguments.length; i++) { var argI = findPath(arg.arguments[i]); if (argI.type === 'insert') { return argI.argument; } } } } return ''; } exports.findPath = findPath;
Mike96Angelo/Bars
lib/runtime/utils.js
JavaScript
mit
1,501
"use strict"; var logger = require('./misc/debug.js'); var TPDU_Client = require('./tpdu_client.js'); var PDU_TYPE = require('./types.js').PDU_TYPE; var S7_Req_Header = require('./types.js').S7_Req_Header; var S7_ReqFun_PlcStop = require('./types.js').S7_ReqFun_PlcStop; var S7_Client = function(host, rack, slot, callback) { var self = this; host = host || '127.0.0.1'; rack = rack || 0x01; slot = slot || 0x02; self.host = host; self.tsap_client = 0x0100; self.tsap_server = 0x0104; logger.debug('TSAP Client: ' + self.tsap_client); logger.debug('TSAP Server: ' + self.tsap_server); self.tpdu_client = new TPDU_Client({ host: self.host, tsap_client: self.tsap_client, tsap_server: self.tsap_server }); }; S7_Client.prototype.ReadArea = function() { }; S7_Client.prototype.WriteArea = function() { }; S7_Client.prototype.DBRead = function() { }; S7_Client.prototype.DBWrite = function() { }; S7_Client.prototype.MBRead = function() { }; S7_Client.prototype.MBWrite = function() { }; S7_Client.prototype.IBRead = function() { }; S7_Client.prototype.IBWrite = function() { }; S7_Client.prototype.QBRead = function() { }; S7_Client.prototype.QBWrite = function() { }; // Control functions S7_Client.prototype.PlcHotStart = function() { }; S7_Client.prototype.PlcColdStart = function() { }; S7_Client.prototype.PlcStop = function() { var s7_pdu = Buffer(0); var header = new S7_Req_Header(); var para = new S7_ReqFun_PlcStop(); header.PDUType = PDU_TYPE.Request; header.ParLen.value = para.length(); s7_pdu = Buffer.concat([s7_pdu, header.toBytes()]); s7_pdu = Buffer.concat([s7_pdu, para.toBytes()]); logger.debug('S7 PDU - PlcStop: \n' + s7_pdu.toString('hex')); this.tpdu_client.send(s7_pdu); }; S7_Client.prototype.CopyRamToRom = function() { }; S7_Client.prototype.Compress = function() { }; S7_Client.prototype.GetPlcStatus = function() { }; module.exports = S7_Client;
Lvhehehe/node-s7client
lib/s7_client.js
JavaScript
mit
1,957
/*--------------------------------------------------------------------------- /*--------------------------------------------------------------------------- Ammo types --------------------------------------------------------------------------- Ammo boxes that can be purchased in the F4 menu. Add your custom ammo types in this file. Here's the syntax: fprp.createAmmoType("ammoType", { name = "Ammo name", model = "Model", price = 1234, amountGiven = 5678, customCheck = function(ply) return ply:IsAdmin() end }); ammoType: The name of the ammo that Garry's mod recognizes If you open your SWEP's shared.lua, you can find the ammo name next to SWEP.Primary.Ammo = "AMMO NAME HERE" or SWEP.Secondary.Ammo = "AMMO NAME HERE" name: The name you want to give to the ammo. This can be anything. model: The model you want the ammo to have in the F4 menu price: the price of your ammo in dollars amountGiven: How much bullets of this ammo is given every time the player buys it customCheck: (Optional! Advanced!) a Lua function that describes who can buy the ammo. Similar to the custom check function for jobs and shipments Parameters: ply: the player who is trying to buy the ammo Examples are below! ---------------------------------------------------------------------------*/ -- Pistol ammo type. Used by p228, desert eagle and all other pistols fprp.createAmmoType("pistol", { name = "Pistol ammo", model = "models/Items/BoxSRounds.mdl", price = 30, amountGiven = 24 }); -- Buckshot ammo, used by the shotguns fprp.createAmmoType("buckshot", { name = "Shotgun ammo", model = "models/Items/BoxBuckshot.mdl", price = 50, amountGiven = 8 }); -- Rifle ammo, usually used by assault rifles fprp.createAmmoType("smg1", { name = "Rifle ammo", model = "models/Items/BoxMRounds.mdl", price = 80, amountGiven = 30 }); fprp.createCategory{ name = "Other", categorises = "ammo", startExpanded = true, color = Color(0, 107, 0, 255), canSee = fp{fn.Id, true}, sortOrder = 255, }
aStonedPenguin/fprp
gamemode/config/ammotypes.lua
Lua
mit
2,040
using Newtonsoft.Json; using Phaxio.ThinRestClient; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Phaxio.Resources.V2 { public class PhoneNumber { public PhaxioClient PhaxioClient { private get; set; } [JsonProperty(PropertyName = "phone_number")] public string Number { get; set; } [JsonProperty(PropertyName = "city")] public string City { get; set; } [JsonProperty(PropertyName = "state")] public string State { get; set; } [JsonProperty(PropertyName = "country")] public string Country { get; set; } [JsonProperty(PropertyName = "cost")] public int Cost { get; set; } [JsonProperty(PropertyName = "last_billed_at")] public DateTime LastBilledAt { get; set; } [JsonProperty(PropertyName = "provisioned_at")] public DateTime ProvisionedAt { get; set; } [JsonProperty(PropertyName = "callback_url")] public string CallbackUrl { get; set; } /// <summary> /// Releases a number /// </summary> public void Release() { PhaxioClient.request<Object>("phone_numbers/" + Number, Method.DELETE); } } }
phaxio/phaxio-dotnet
Phaxio/Resources/V2/PhoneNumber.cs
C#
mit
1,296
# encoding: utf-8 module IceNine class Freezer # A freezer class for handling Range objects class Range < Object # Deep Freeze a Range # # @example # range = IceNine:Freezer::Range.deep_freeze('a'..'z') # range.begin.frozen? # => true # range.end.frozen? # => true # # @param [Range] range # @param [RecursionGuard] recursion_guard # # @return [Range] # # @api public def self.deep_freeze(range, recursion_guard = RecursionGuard.new) IceNine.deep_freeze(range.begin, recursion_guard) IceNine.deep_freeze(range.end, recursion_guard) super end end # class Range end # class Freezer end # module IceNine
suhongrui/gitlab
vendor/bundle/ruby/2.1.0/gems/ice_nine-0.10.0/lib/ice_nine/freezer/range.rb
Ruby
mit
745
package dao; import java.sql.Connection; import java.sql.SQLException; import java.util.Date; import java.util.UUID; import bean.User; /* * @author Siying * Data Access Object */ public class UserDao { private Date date = new Date(); public void insertUser(User u) throws Exception { Connection connection = null; //TODO: connect to database try{ //Insert user's data to database } catch (Exception e) { throw new Exception(this.getClass() + ".addUser: Database failure."); } finally { if(connection != null) try{ connection.close(); } catch (SQLException e) { System.out.println(this.getClass()); } } } public boolean notExist(String userAccount) throws Exception { Connection connection = null; try{ //TODO: DB query } catch (Exception e) { throw new Exception(this.getClass() + ".notExist: database failure."); } finally { if(connection != null) try { connection.close(); } catch (SQLException e) { System.out.println(this.getClass() + ".notExist: Could not close the database"); } } return System.currentTimeMillis() % 9 !=0; } //By user email. public User selectByUserEmail(String userEmail, String password) throws Exception { Connection connection = null; User u = null; try { //TODO: select user by user email from database String userName = ""; UUID userId = UUID.randomUUID(); u = new User(userEmail, userName, password, userId); return date.getTime() % 9 == 0 ? null:u; } catch (Exception e) { throw new Exception(this.getClass() + ".selectUserByEmail: database failure."); } finally { if(connection != null) try { connection.close(); } catch (SQLException e) { System.out.println(this.getClass() + ".selectUserByEmail: Could not close the database"); } } } //By user Id public User selectByUserId(UUID userId, String password) throws Exception { Connection connection = null; User u = null; try { //TODO: select user by userId String userName = ""; String userEmail = ""; u = new User(userEmail, userName, password, userId); return date.getTime() % 9 == 0? null:u; } catch (Exception e) { throw new Exception(this.getClass() + ".selectUserById: database failure."); } finally { if(connection != null) try { connection.close(); } catch (SQLException e) { System.out.println(this.getClass() + ".selectUserById: Could not close the database"); } } } }
infsci2560sp16/full-stack-web-project-SiyingZhang
src/main/java/dao/UserDao.java
Java
mit
2,479
module EventMachine # Makes Net::IMAP.add_authenticator accessible through EM::IMAP and instances thereof. # Also provides the authenticator method to EM::IMAP::Client to get authenticators # for use in the authentication exchange. # module IMAP def self.add_authenticator(*args) Net::IMAP.add_authenticator(*args) end module Authenticators def add_authenticator(*args) EventMachine::IMAP.add_authenticator(*args) end private def authenticator(type, *args) raise ArgumentError, "Unknown auth type - '#{type}'" unless imap_authenticators[type] imap_authenticators[type].new(*args) end def imap_authenticators Net::IMAP.send :class_variable_get, :@@authenticators end end end end
ConradIrwin/em-imap
lib/em-imap/authenticators.rb
Ruby
mit
790
## Synopises Library for a custom arduino hall effect sensor speaking i2c to the raspberry pi
leachj/arduinoHallSensor
README.md
Markdown
mit
98
{% extends "granos_basicos/base.html" %} {% block contenido %} <style type="text/css"> #grafo1,#grafo2,#grafo3,#grafo4{ border: 1px solid #eee; } .panel-graficos .panel-heading{ margin-bottom:20px; } </style> <div class="container-fluid"> <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3"> {% include "granos_basicos/menu_salidas_indicadores.html" %} </div> <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9"> <div class="panel panel-default panel-graficos"> <div class="panel-heading"> <h3 class="panel-title"> <ol class="breadcrumb"> <li class="active">Productores</li> <li class="active">Composición familiar</li> <li class="active">Número de productores {{productores}}</li> </ol> </h3> </div> <div class="panel-body"> <div class="row"> <div class="col-md-12"> <table id="customers2" class="table table-bordered table-hover" cellspacing="0" width="100%"> <caption>Número promedio de Hijos/Hijas</caption> <thead> <tr> <th></th> <th>Número de hijos</th> <th>Número de hijas</th> <th>Número de hijos + hijas</th> </tr> </thead> <tbody> {%for fila in result %} <tr> {% if forloop.counter == 1 %} <td>Promedio</td> {% elif forloop.counter == 2 %} <td>Mediana</td> {% elif forloop.counter == 3 %} <td>Desviación estandar</td> {% elif forloop.counter == 4 %} <td>Mínimo</td> {% elif forloop.counter == 5 %} <td>Máximo</td> {% endif %} {%for celda in fila %} <td>{{celda|floatformat:"2"}}</td> {%endfor%} </tr> {%endfor%} </tbody> </table> </div> </div> <div class="row"> <div class="col-md-12"> <div id="grafo1" style="min-width: 510px; width: 860px; margin: 0 auto;"></div> </div> </div> <div class="row"> <div class="col-md-12"> <div id="grafo2" style="min-width: 510px; width: 860px; margin: 0 auto;"></div> </div> </div> <div class="row"> <div class="col-md-12"> <div id="grafo3" style="min-width: 510px; width: 860px; margin: 0 auto;"></div> </div> </div> <div class="row"> <div class="col-md-12"> <table id="customers2" class="table table-bordered table-hover" cellspacing="0" width="100%"> <caption>Participación de familiares en producción de Granos Básicos</caption> <thead> <tr> <th></th> <th>% Si</th> <th>Número/Familia</th> </tr> </thead> <tbody> {%for fila in list_participacion %} <tr> {%for celda in fila %} <td>{{celda}}</td> {%endfor%} </tr> {%endfor%} </tbody> </table> </div> </div> </div> </div> </div> </div> {% endblock %} {% block extra_js %} <script type="text/javascript"> $( "#productores" ).addClass( "in" ); $(function () { $('#grafo1').highcharts({ chart: { type: 'column' }, title: { text: 'Nivel educativo de padres de las familias' }, xAxis: { categories: [{% for k in escolaridad.keys %}'{{k}}',{% endfor %}] }, yAxis: { min: 0, title: { text: 'Frecuencia (%)' } }, tooltip: { pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>', shared: true }, plotOptions: { column: { stacking: 'percent', dataLabels: { enabled: true, color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white', style: { textShadow: '0 0 3px black' } } } }, series: [{ name: 'Madre', data: [{% for v in escolaridad.values %}{{v.0}},{% endfor %}] }, { name: 'Padre', data: [{% for v in escolaridad.values %}{{v.1}},{% endfor %}] }] }); $('#grafo2').highcharts({ chart: { type: 'column' }, title: { text: 'Nivel educativo de hijos' }, xAxis: { categories: [{% for k in escolaridad.keys %}'{{k}}',{% endfor %}] }, yAxis: { min: 0, title: { text: 'Frecuencia (%)' } }, tooltip: { pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>', shared: true }, plotOptions: { column: { stacking: 'percent', dataLabels: { enabled: true, color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white', style: { textShadow: '0 0 3px black' } } } }, series: [{ name: '5-12 años', data: [{% for v in escolaridad.values %}{{v.2}},{% endfor %}] }, { name: '13-18 años', data: [{% for v in escolaridad.values %}{{v.3}},{% endfor %}] },{ name: '> 19 años', data: [{% for v in escolaridad.values %}{{v.4}},{% endfor %}] } ] }); $('#grafo3').highcharts({ chart: { type: 'column' }, title: { text: 'Nivel educativo de hijas' }, xAxis: { categories: [{% for k in escolaridad.keys %}'{{k}}',{% endfor %}] }, yAxis: { min: 0, title: { text: 'Frecuencia (%)' } }, tooltip: { pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>', shared: true }, plotOptions: { column: { stacking: 'percent', dataLabels: { enabled: true, color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white', style: { textShadow: '0 0 3px black' } } } }, series: [{ name: '5-12 años', data: [{% for v in escolaridad.values %}{{v.5}},{% endfor %}] }, { name: '13-18 años', data: [{% for v in escolaridad.values %}{{v.6}},{% endfor %}] },{ name: '> 19 años', data: [{% for v in escolaridad.values %}{{v.7}},{% endfor %}] } ] }); }); </script> {% endblock %}
shiminasai/ciat_plataforma
templates/granos_basicos/productores/composicion_familiar.html
HTML
mit
8,618
--- layout: page title: What do you want to become better at? permalink: /learn/ --- - [Front-End Development](/front-end-development)
neilhoff/neilhoff.github.io
_pages/learn.md
Markdown
mit
141
using System; using System.Collections.Generic; namespace MonadSharp { public static class Maybe { public static Maybe<T> Some<T>(T value) { return Maybe<T>.NewSome(value); } public static Maybe<T> None<T>() { return Maybe<T>.None; } public static Func<Maybe<T>, Maybe<TResult>> Lift<T, TResult>(Func<T, TResult> fn) { return x => x.FMap(fn); } public static Maybe<T> TryInvoke<T>(Func<T> fn) { try { return Maybe.Some(fn()); } catch { return Maybe.None<T>(); } } } // Implementation is based off F# ADT IL // TODO: IComparable, IEquatable public abstract class Maybe<T> { private static readonly Maybe<T> UniqueNone = new _None(); public static Maybe<T> None { get { return UniqueNone; } } public bool IsSome { get { return this is Some; } } public bool IsNone { get { return this is _None; } } public sealed override bool Equals(object other) { var o = other as Maybe<T>; return o == null ? false : Equals(o); } public bool Equals(Maybe<T> other) { if (other == null) return false; if (this.IsNone && other.IsNone) return true; if (this.IsSome && other.IsSome) { var thisValue = ((Some)this).Value; var otherValue = ((Some)other).Value; return EqualityComparer<T>.Default.Equals(thisValue, otherValue); } return false; } public sealed override int GetHashCode() { return IsNone ? base.GetHashCode() : EqualityComparer<T>.Default.GetHashCode(((Some)this).Value); } internal static Maybe<TValue> NewSome<TValue>(TValue value) { return new Maybe<TValue>.Some(value); } internal sealed class Some : Maybe<T> { public T Value { get; private set; } internal Some(T value) { if (value == null) throw new MaybeValueCannotBeNullException(); Value = value; } } internal sealed class _None : Maybe<T> { } } }
kallanreed/monadsharp
MonadSharp/Maybe.cs
C#
mit
2,503
using System; using System.Collections.Generic; using System.Text; namespace ExtraStandard { /// <summary> /// DIN 66303 in der Fassung von 1986-11 (Deutsche Referenz-Version des 8-Bit-Code (DRV8)) /// </summary> public class Din66303Drv8Encoding : Encoding { private static readonly char?[] _bytesToChars = { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '§', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ä', 'Ö', 'Ü', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'ä', 'ö', 'ü', 'ß', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '\u00a0', 'Í', '¢', '£', '¤', '¥', '¦', '@', '¨', '©', 'ª', '«', '¬', '\u00ad', '®', '¯', '°', '±', '²', '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', '½', '¾', '¿', 'À', 'Á', 'Â', 'Ã', '[', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Ö', '\\', '×', 'Ø', 'Ù', 'Ú', 'Û', ']', 'Ý', 'Þ', '~', 'à', 'á', 'â', 'ä', '{', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'ö', '|', '÷', 'ø', 'ù', 'ú', 'û', '}', 'ý', 'þ', 'ÿ' }; private static readonly Lazy<IDictionary<char, byte>> _charsToBytes = new Lazy<IDictionary<char, byte>>(() => { var result = new Dictionary<char, byte>(256); for (var i = 0; i != _bytesToChars.Length; ++i) { var ch = _bytesToChars[i]; if (ch.HasValue) { switch (i) { case 161: case 213: case 227: case 245: break; default: result.Add(ch.Value, (byte)i); break; } } } return result; }); /// <inheritdoc /> public override string EncodingName { get; } = "DIN 66303:1986-11 DRV8"; /// <inheritdoc /> public override bool IsSingleByte { get; } = true; /// <inheritdoc /> public override int GetByteCount(char[] chars, int index, int count) { var result = 0; var charsToBytes = _charsToBytes.Value; for (var i = 0; i != count; ++i) { if (charsToBytes.ContainsKey(chars[index + i])) { result += 1; } } return result; } /// <inheritdoc /> public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { var charsToBytes = _charsToBytes.Value; var destIndex = byteIndex; for (var i = 0; i != charCount; ++i) { byte b; var c = chars[charIndex + i]; if (charsToBytes.TryGetValue(c, out b)) { bytes[destIndex++] = b; } } return destIndex - byteIndex; } /// <inheritdoc /> public override int GetCharCount(byte[] bytes, int index, int count) { var result = 0; for (var i = 0; i != count; ++i) { var b = bytes[index + i]; var c = _bytesToChars[b]; if (c.HasValue) { result += 1; } } return result; } /// <inheritdoc /> public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { var destIndex = charIndex; for (var i = 0; i != byteCount; ++i) { var c = _bytesToChars[bytes[byteIndex + i]]; if (c.HasValue) { chars[destIndex++] = c.Value; } } return destIndex - charIndex; } /// <inheritdoc /> public override int GetMaxByteCount(int charCount) { return charCount; } /// <inheritdoc /> public override int GetMaxCharCount(int byteCount) { return byteCount; } } }
dataline-gmbh/ExtraStandard
src/Dataline.ExtraStandard/Din66303Drv8Encoding.cs
C#
mit
5,285
{"res":{"code":"S001","coupon_list":[]}}
Taebu/prq
prq/include/view/coupon_info.php
PHP
mit
40
<div class="event-wrap"> <div class="event-img-wrap"> <div class="card-image no-margin"> <a ui-sref="venvast.venues.details({slug: venue.slug})" style="background-image: url('{{ venue.getImageUrl() }}');"> <span><i class="fa fa-search"></i></span> </a> <div class="card-actions"> <a class="venue-open-hours" ng-class="{'open': venue.open}">{{venue.open ? 'Open' : 'Closed'}}</a> <a ng-click="favor(venue)"><i class="entypo-heart"></i> <span>Like</span></a> </div><!-- /.card-actions --> </div> </div><!-- Event Image Wrapper --> <!-- Event Detail Wrapper --> <div class="event-details"> <div class="event-category-wrap"> <!-- <img width="32" height="32" ng-src="{{ venue.getIcon() }}" class="img-responsive" alt="Course" data-pin-nopin="true"> --> </div> <h5>{{ venue.getCategoryName() }}</h5> <h4> <a ui-sref="venvast.venues.details({slug: venue.slug})">{{ venue.name }}</a> </h4> <p style="min-height: 80px">{{ venue.description.slice(0, 130) }}...</p> <div class="card-location" ng-if="distance !== false"> <span><i class="fa fa-map-marker"></i> {{ venue.distance.toString().substr(0, 4) }}km away</span> </div> <h4 style="margin: 0;"><small style="color: rgba(35,35,35,0.4);font-size: 10px; margin-left: 20px;">{{ venue.fullAddress }}</small></h4> <a ui-sref="venvast.venues.details({slug: venue.slug})" class="btn btn-secondary">Details</a> </div><!-- Event Meta --> </div>
hlogeon/venvatst-angular
app/templates/venues/directives/venue-card.html
HTML
mit
1,678
version https://git-lfs.github.com/spec/v1 oid sha256:9a780e07e8e76443bb024c3b81e3f0fd6b43faa74024bd26a78ac61292bc0c06 size 21167
yogeshsaroya/new-cdnjs
ajax/libs/spf/2.1.2/boot-debug.js
JavaScript
mit
130
<div class="commune_descr limited"> <p> Saint-Jeannet est une ville située dans le département des Alpes-Maritimes en Provence-Alpes-Côte d'Azur. Elle comptait 3&nbsp;634 habitants en 2008.</p> <p>À Saint-Jeannet le salaire moyen par mois par habitant se situe à approximativement 2&nbsp;704 &euro; net. C'est au dessus de la moyenne nationale.</p> <p>À coté de Saint-Jeannet sont positionnées géographiquement les communes de <a href="{{VLROOT}}/immobilier/broc_06025/">Le&nbsp;Broc</a> à 7&nbsp;km, 1&nbsp;237 habitants, <a href="{{VLROOT}}/immobilier/carros_06033/">Carros</a> située à 5&nbsp;km, 11&nbsp;379 habitants, <a href="{{VLROOT}}/immobilier/gaude_06065/">La&nbsp;Gaude</a> située à 2&nbsp;km, 6&nbsp;608 habitants, <a href="{{VLROOT}}/immobilier/colomars_06046/">Colomars</a> localisée à 6&nbsp;km, 3&nbsp;161 habitants, <a href="{{VLROOT}}/immobilier/bezaudun-les-alpes_06017/">Bézaudun-les-Alpes</a> à 7&nbsp;km, 178 habitants, <a href="{{VLROOT}}/immobilier/saint-paul_06128/">Saint-Paul</a> située à 5&nbsp;km, 3&nbsp;338 habitants, entre autres. De plus, Saint-Jeannet est située à seulement onze&nbsp;km de <a href="{{VLROOT}}/immobilier/nice_06088/">Nice</a>.</p> <p>Le parc d'habitations, à Saint-Jeannet, était réparti en 2011 en 298 appartements et 1&nbsp;456 maisons soit un marché plutôt équilibré.</p> <p>Saint-Jeannet est localisé à seulement 11 km de Nice, les élèves qui voudrons se loger à pas cher pourront envisager de louer un logement à Saint-Jeannet. Saint-Jeannet est aussi un bon placement locatif a cause de sa proximité de Nice et de ses Universités. Il sera envisageable de trouver un studio à acheter. </p> <p>À Saint-Jeannet, la valeur moyenne à l'achat d'un appartement s'évalue à 4&nbsp;157 &euro; du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 4&nbsp;752 &euro; du m². À la location la valeur moyenne se situe à 16 &euro; du m² mensuel.</p> <p> La localité dispose s'agissant de l'enseignement de un collège. Concernant les très jeunes, la commune est pourvue pour le bien être de sa population de deux maternelles et deux écoles primaires. Saint-Jeannet est équipée des équipements facilitant une bonne prise en charge des jeunes. Lors d'un projet d'acheter un bien immobilier à Saint-Jeannet, vous devrez impérativement évaluer la notoriété des équipements éducatifs</p> <p>La ville propose quelques aménagements, elle dispose, entre autres, de un terrain de tennis et deux terrains de sport.</p> </div>
donaldinou/frontend
src/Viteloge/CoreBundle/Resources/descriptions/06122.html
HTML
mit
2,551
/** * Created by NGUYENVU on 2/6/2016. */ var currentDir = window.location.origin + window.location.pathname + "#"; var urlUser = 'user'; var urlSearch = 'user/search'; var urlCreateUser = 'user/create'; var urlEditUser = 'user/edit'; var urlDeleteUser = 'user/delete'; var urlProject = 'project'; var urlProjectSearch = 'project/search'; var urlCreateProject = 'project/create'; var urlEditProject = 'project/edit'; var urlDeleteProject = 'project/delete'; var urlStakeholderProject = 'project/stakeholders';
vunguyenvu35/foxes
public/foxes/scripts/root.js
JavaScript
mit
514
<?php namespace DotPlant\Store\components\calculator; use DotPlant\Store\interfaces\PriceInterface; use DotPlant\Store\models\warehouse\Warehouse; /** * Class OptionCalculator * * @package app\vendor\dotplant\store\src\components\calculator */ class OptionCalculator extends GoodsCalculator { /** * @inheritdoc */ public static function calculate(PriceInterface $price) { $result = []; $warehouse = Warehouse::getWarehouse( $price->getGoods()->id, $price->getWarehouseId(), false ); if ($warehouse) { $result = self::applyExtendedPrice( $price->getGoods(), $warehouse->getPrice($price->getPriceType()) ); } return $result; } }
DevGroup-ru/dotplant-store
src/components/calculator/OptionCalculator.php
PHP
mit
800
# Settings specified here will take precedence over those in config/environment.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! config.cache_classes = true # Log error messages when you accidentally call methods on nil. config.whiny_nils = true # Show full error reports and disable caching config.action_controller.consider_all_requests_local = true config.action_controller.perform_caching = false # Disable request forgery protection in test environment config.action_controller.allow_forgery_protection = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. #config.action_mailer.delivery_method = :test
dclausen/barcamp-sarasota
config/environments/test.rb
Ruby
mit
975
using EdFiValidation.ApiProxy.Core.Models; using EdFiValidation.ApiProxy.Models; namespace EdFiValidation.ApiProxy.Helpers { public interface IUiModelMapper { T Mapper<T, TM>(T model) where T : ModelBase where TM : UiModelBase; } public class UiModelMapper : IUiModelMapper { public T Mapper<T, TM>(T model) where T : ModelBase where TM : UiModelBase { return AutoMapper.Mapper.Map<T>(model); } } }
ryanande/ApiProxy
src/ApiProxy/Helpers/UiModelMapper.cs
C#
mit
518
<?xml version="1.0" ?><!DOCTYPE TS><TS language="id_ID" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About phreak</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;phreak&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The phreak developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Klik-ganda untuk mengubah alamat atau label</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Buat alamat baru</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Salin alamat yang dipilih ke clipboard</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your phreak addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>&amp;Salin Alamat</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Hapus</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Salin &amp;Label</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Ubah</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>File CSV (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Label</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Alamat</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(tidak ada label)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Dialog Kata kunci</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Masukkan kata kunci</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Kata kunci baru</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Ulangi kata kunci baru</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Masukkan kata kunci baru ke dompet.&lt;br/&gt;Mohon gunakan kata kunci dengan &lt;b&gt;10 karakter atau lebih dengan acak&lt;/b&gt;, atau &lt;b&gt;delapan kata atau lebih&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Enkripsi dompet</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Operasi ini memerlukan kata kunci dompet Anda untuk membuka dompet ini.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Buka dompet</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Operasi ini memerlukan kata kunci dompet Anda untuk mendekripsi dompet ini.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Dekripsi dompet</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Ubah kata kunci</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Masukkan kata kunci lama dan baru ke dompet ini.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Konfirmasi enkripsi dompet</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Dompet terenkripsi</translation> </message> <message> <location line="-58"/> <source>phreak will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Enkripsi dompet gagal</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Enkripsi dompet gagal karena kesalahan internal. Dompet Anda tidak dienkripsi.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>Kata kunci yang dimasukkan tidak cocok.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>Gagal buka dompet</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Kata kunci yang dimasukkan untuk dekripsi dompet tidak cocok.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Dekripsi dompet gagal</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+282"/> <source>Sign &amp;message...</source> <translation>Pesan &amp;penanda...</translation> </message> <message> <location line="+251"/> <source>Synchronizing with network...</source> <translation>Sinkronisasi dengan jaringan...</translation> </message> <message> <location line="-319"/> <source>&amp;Overview</source> <translation>&amp;Kilasan</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Tampilkan kilasan umum dari dompet</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Transaksi</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Jelajah sejarah transaksi</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation>K&amp;eluar</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Keluar dari aplikasi</translation> </message> <message> <location line="+6"/> <source>Show information about phreak</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Mengenai &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Tampilkan informasi mengenai Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Pilihan...</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>%Enkripsi Dompet...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Cadangkan Dompet...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Ubah Kata Kunci...</translation> </message> <message numerus="yes"> <location line="+259"/> <source>~%n block(s) remaining</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"/> </message> <message> <location line="-256"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Send coins to a phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Modify configuration options for phreak</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation>Cadangkan dompet ke lokasi lain</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Ubah kata kunci yang digunakan untuk enkripsi dompet</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>&amp;Jendela Debug</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Buka konsol debug dan diagnosa</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>&amp;Verifikasi pesan...</translation> </message> <message> <location line="-202"/> <source>phreak</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation>Dompet</translation> </message> <message> <location line="+180"/> <source>&amp;About phreak</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>&amp;File</source> <translation>&amp;Berkas</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Pengaturan</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;Bantuan</translation> </message> <message> <location line="+12"/> <source>Tabs toolbar</source> <translation>Baris tab</translation> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+60"/> <source>phreak client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+75"/> <source>%n active connection(s) to phreak network</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-403"/> <source>%n second(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="-312"/> <source>About phreak card</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about phreak card</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+297"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation>Terbaru</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>Menyusul...</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Transaksi terkirim</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Transaksi diterima</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Tanggal: %1 Jumlah: %2 Jenis: %3 Alamat: %4 </translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid phreak address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Dompet saat ini &lt;b&gt;terenkripsi&lt;/b&gt; dan &lt;b&gt;terbuka&lt;/b&gt;</translation> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Dompet saat ini &lt;b&gt;terenkripsi&lt;/b&gt; dan &lt;b&gt;terkunci&lt;/b&gt;</translation> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. phreak can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation>Notifikasi Jaringan</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Jumlah:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Jumlah</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>Alamat</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Tanggal</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Terkonfirmasi</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Salin alamat</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Salin label</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Salin jumlah</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+317"/> <source>highest</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"/> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation>(tidak ada label)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Ubah Alamat</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Label</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Alamat</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation>Alamat menerima baru</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Alamat mengirim baru</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Ubah alamat menerima</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Ubah alamat mengirim</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Alamat yang dimasukkan &quot;%1&quot; sudah ada di dalam buku alamat.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid phreak address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Tidak dapat membuka dompet.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Pembuatan kunci baru gagal.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>phreak-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Pilihan</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Utama</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Bayar &amp;biaya transaksi</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start phreak after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start phreak on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>&amp;Jaringan</translation> </message> <message> <location line="+6"/> <source>Automatically open the phreak client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Petakan port dengan &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the phreak network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>IP Proxy:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Port:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Port proxy (cth. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>Versi &amp;SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versi SOCKS proxy (cth. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Jendela</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Hanya tampilkan ikon tray setelah meminilisasi jendela</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Meminilisasi ke tray daripada taskbar</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;eminilisasi saat tutup</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Tampilan</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Bahasa Antarmuka Pengguna:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting phreak.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unit untuk menunjukkan jumlah:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show phreak addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Tampilkan alamat dalam daftar transaksi</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;YA</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Batal</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation>standar</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting phreak.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Alamat proxy yang diisi tidak valid.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Formulir</translation> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the phreak network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation>Dompet</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Total:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transaksi sebelumnya&lt;/b&gt;</translation> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation>tidak tersinkron</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nama Klien</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation>T/S</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Versi Klien</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informasi</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Waktu nyala</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Jaringan</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Jumlah hubungan</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Rantai blok</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Jumlah blok terkini</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Perkiraan blok total</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Waktu blok terakhir</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Buka</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the phreak-Qt help message to get a list with possible phreak command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Konsol</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Tanggal pembuatan</translation> </message> <message> <location line="-104"/> <source>phreak - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>phreak Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the phreak debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Bersihkan konsol</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the phreak RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Gunakan panah keatas dan kebawah untuk menampilkan sejarah, dan &lt;b&gt;Ctrl-L&lt;/b&gt; untuk bersihkan layar.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Ketik &lt;b&gt;help&lt;/b&gt; untuk menampilkan perintah tersedia.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Kirim Koin</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Jumlah:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 PHR</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Kirim ke beberapa penerima sekaligus</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Hapus %Semua</translation> </message> <message> <location line="+28"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+16"/> <source>123.456 PHR</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Konfirmasi aksi pengiriman</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a phreak address (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Salin jumlah</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Konfirmasi pengiriman koin</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Jumlah yang dibayar harus lebih besar dari 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Jumlah melebihi saldo Anda.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Kelebihan total saldo Anda ketika biaya transaksi %1 ditambahkan.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Ditemukan alamat ganda, hanya dapat mengirim ke tiap alamat sekali per operasi pengiriman.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(tidak ada label)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>J&amp;umlah:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Kirim &amp;Ke:</translation> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation>Masukkan label bagi alamat ini untuk menambahkannya ke buku alamat Anda</translation> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation>&amp;Label:</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+J</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Tempel alamat dari salinan</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+B</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a phreak address (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+J</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Tempel alamat dari salinan</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+B</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Hapus %Semua</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified phreak address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a phreak address (e.g. PHR1xGeKnTkaAotEVgs2rnUfVsFv8LVSM)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter phreak signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Alamat yang dimasukkan tidak sesuai.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Silahkan periksa alamat dan coba lagi.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>Buka hingga %1</translation> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/tidak terkonfirmasi</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 konfirmasi</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Tanggal</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Dari</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Untuk</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation>Pesan:</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 110 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transaksi</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Jumlah</translation> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, belum berhasil disiarkan</translation> </message> <message> <location line="+35"/> <source>unknown</source> <translation>tidak diketahui</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Rincian transaksi</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Jendela ini menampilkan deskripsi rinci dari transaksi tersebut</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation>Tanggal</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Jenis</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Alamat</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Jumlah</translation> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation>Buka hingga %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Terkonfirmasi (%1 konfirmasi)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Blok ini tidak diterima oleh node lainnya dan kemungkinan tidak akan diterima!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Terbuat tetapi tidak diterima</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Diterima dengan</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Diterima dari</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Terkirim ke</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pembayaran ke Anda sendiri</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Tertambang</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(t/s)</translation> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status transaksi. Arahkan ke bagian ini untuk menampilkan jumlah konfrimasi.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Tanggal dan waktu transaksi tersebut diterima.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Jenis transaksi.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Alamat tujuan dari transaksi.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Jumlah terbuang dari atau ditambahkan ke saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>Semua</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Hari ini</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Minggu ini</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Bulan ini</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Bulan kemarin</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Tahun ini</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Jarak...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>DIterima dengan</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Terkirim ke</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Ke Anda sendiri</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Ditambang</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Lainnya</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Masukkan alamat atau label untuk mencari</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Jumlah min</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Salin alamat</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Salin label</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Salin jumlah</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Ubah label</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Tampilkan rincian transaksi</translation> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Berkas CSV (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Terkonfirmasi</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Tanggal</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Jenis</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Label</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Alamat</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Jumlah</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Jarak:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>ke</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>phreak version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Penggunaan:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or phreakd</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Daftar perintah</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Dapatkan bantuan untuk perintah</translation> </message> <message> <location line="+2"/> <source>Options:</source> <translation>Pilihan:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: phreak.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: phreakd.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Tentukan direktori data</translation> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Atur ukuran tembolok dalam megabyte (standar: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 25714)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Mengatur hubungan paling banyak &lt;n&gt; ke peer (standar: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Hubungkan ke node untuk menerima alamat peer, dan putuskan</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Tentukan alamat publik Anda sendiri</translation> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Batas untuk memutuskan peer buruk (standar: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Jumlah kedua untuk menjaga peer buruk dari hubung-ulang (standar: 86400)</translation> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15715 or testnet: 25715)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation>Menerima perintah baris perintah dan JSON-RPC</translation> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation>Berjalan dibelakang sebagai daemin dan menerima perintah</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Gunakan jaringan uji</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong phreak will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Kirim info lacak/debug ke konsol sebaliknya dari berkas debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation>Nama pengguna untuk hubungan JSON-RPC</translation> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation>Kata sandi untuk hubungan JSON-RPC</translation> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=phreakrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;phreak Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Izinkan hubungan JSON-RPC dari alamat IP yang ditentukan</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Kirim perintah ke node berjalan pada &lt;ip&gt; (standar: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Menjalankan perintah ketika perubahan blok terbaik (%s dalam cmd digantikan oleh hash blok)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Perbarui dompet ke format terbaru</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Kirim ukuran kolam kunci ke &lt;n&gt; (standar: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Pindai ulang rantai-blok untuk transaksi dompet yang hilang</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Gunakan OpenSSL (https) untuk hubungan JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Berkas sertifikat server (standar: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Kunci pribadi server (standar: server.pem)</translation> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation>Pesan bantuan ini</translation> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. phreak is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>phreak</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Tidak dapat mengikat ke %s dengan komputer ini (ikatan gagal %d, %s)</translation> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Izinkan peninjauan DNS untuk -addnote, -seednode dan -connect</translation> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation>Memuat alamat...</translation> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Gagal memuat wallet.dat: Dompet rusak</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of phreak</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart phreak to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Gagal memuat wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Alamat -proxy salah: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Jaringan tidak diketahui yang ditentukan dalam -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Diminta versi proxy -socks tidak diketahui: %i</translation> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Tidak dapat menyelesaikan alamat -bind: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Tidak dapat menyelesaikan alamat -externalip: &apos;%s&apos;</translation> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Jumlah salah untuk -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Jumlah salah</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Saldo tidak mencukupi</translation> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation>Memuat indeks blok...</translation> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Tambahkan node untuk dihubungkan dan upaya untuk menjaga hubungan tetap terbuka</translation> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. phreak is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation>Memuat dompet...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Tidak dapat menurunkan versi dompet</translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Tidak dapat menyimpan alamat standar</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Memindai ulang...</translation> </message> <message> <location line="+5"/> <source>Done loading</source> <translation>Memuat selesai</translation> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation>Gunakan pilihan %s</translation> </message> <message> <location line="+14"/> <source>Error</source> <translation>Gagal</translation> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Anda harus mengatur rpcpassword=&lt;kata sandi&gt; dalam berkas konfigurasi: %s Jika berkas tidak ada, buatlah dengan permisi berkas hanya-dapat-dibaca-oleh-pemilik.</translation> </message> </context> </TS>
qtvideofilter/streamingcoin
src/qt/locale/bitcoin_id_ID.ts
TypeScript
mit
112,552
--- title: "PiNet, a centralised user accounts and file storage system for a Raspberry Pi classroom." layout: article --- Editing the operating system outside of PiNet -------------------------------------------------- Although PiNet allows you to perform most actions a standard user would need to the Raspbian operating system from within PiNet, it is understandable if advanced users may want to directly modify configuration files or install programs on the Raspbian operating system manually. The key things you need to know are - The Raspbian operating system is stored at ```/opt/ltsp/armhf``` - To “chroot” into it (basically allows you to interact with it like a normal Raspberry Pi ```sudo ltsp-chroot --arch armhf``` To exit when you are finished, just type exit and hit enter. - The lts.conf file (LTSP armhf configuration file) is stored at ```/opt/ltsp/armhf/etc/lts.conf``` - To manually compress the operating system for use after a change ```ltsp-update-image /opt/ltsp/armhf``` **(this is extremely important you do this after a change!)** - The raw boot files before configuration changes have been made can be found at [here](https://github.com/gbaman/PiNet/tree/master/boot) ## An example - Deleting Minecraft Pi edtion Lets say you want to run a command in the Raspbian operating system, which is stored on the server (and each Pi boots from). For example, lets say you want to remove Minecraft-Pi edition (which is installed by default). To do this, open a terminal on the server and enter ```sudo ltsp-chroot --arch armhf``` (```sudo ltsp-chroot``` also works on its own if you have no other LTSP chroots). You are now inside the Raspbian OS which is running emulated on the server (via chroot). You can run nearly any command you could run on a Raspberry Pi here, including ```apt-get purge minecraft-pi``` which deletes Minecraft-Pi edition. When you have finished all your changes, enter ```exit``` and you will be returned to a normal server shell. Finally, **you must recompress the operating system!** You have 2 options on how to do this. 1. From the commandline with ```ltsp-update-image /opt/ltsp/armhf```. 2. From PiNet in the ```Other menu``` and ```NBD-recompress```.
vlee489/PiNet.github.io
articles/advanced/editing-outside.md
Markdown
mit
2,237
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="flayoutclass"><div class="flayoutclass_first"><table class="tableoutfmt2"><tr><th class="std1"><b>條目&nbsp;</b></th><td class="std2">東揚西蕩</td></tr> <tr><th class="std1"><b>注音&nbsp;</b></th><td class="std2">ㄉㄨㄥ |ㄤ<sup class="subfont">ˊ</sup> ㄒ| ㄉㄤ<sup class="subfont">ˋ</sup></td></tr> <tr><th class="std1"><b>漢語拼音&nbsp;</b></th><td class="std2"><font class="english_word">dōng yáng xī dàng</font></td></tr> <tr><th class="std1"><b>釋義&nbsp;</b></th><td class="std2">四處飄泊不定。比喻生活不安定。野叟曝言˙第四十一回:<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center>姐姐若能見憐,怎樣著落妹子死後魂靈,不至東揚西蕩。<img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center>亦作<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center>東飄西蕩<img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center>。</td></tr> <tr><th class="std1"><b><font class="fltypefont">附錄</font>&nbsp;</b></th><td class="std2">修訂本參考資料</td></tr> </td></tr></table></div> <!-- flayoutclass_first --><div class="flayoutclass_second"></div> <!-- flayoutclass_second --></div> <!-- flayoutclass --></td></tr></table>
BuzzAcademy/idioms-moe-unformatted-data
all-data/20000-20999/20265-22.html
HTML
mit
1,525
# buildout ## new buildout for mycarman * `Source code @ GitHub <https://github.com/a25kk/walter>`_ * `Releases @ PyPI <http://pypi.python.org/pypi/walter>`_ * `Documentation @ ReadTheDocs <http://walter.readthedocs.org>`_ * `Continuous Integration @ Travis-CI <http://travis-ci.org/kreativkombinat/walter>`_ ## How it works This project templates provides a full blown Plone project environment. It comes with a preconfigured project specific theme package located under the _src_ directory. ## Installation This buildout is intended to be used via the development profile to provide a ready to work on setup. To get started with a new development environment clone the buildout to your local machine and initialize the buildout: ``` bash $ git clone git@github.com:username/walter.git $ cd ./walter $ virtualenv-2.7 . $ ./bin/pip install zc.buildout $ bin/buildout -Nc development.cfg ``` ## Configuration The generated buildout asumes that the developer has setup a local egg cache and therefore provides a buildout 'default.cfg'.
vwc/buildout.mycarman
README.md
Markdown
mit
1,043
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.8/esri/copyright.txt for details. //>>built define({zoom:"Aplicar zoom a",next:"Pr\u00f3xima elemento",previous:"Elemento anterior",close:"Fechar",dock:"Doca",undock:"Desencaixar",menu:"Menu",untitled:"Sem t\u00edtulo",pageText:"{index} do {total}",selectedFeature:"Elemento selecionado",selectedFeatures:"{total} resultados",loading:"A Carregar",collapse:"Recolher",expand:"Expandir"});
ycabon/presentations
2018-user-conference/arcgis-js-api-road-ahead/demos/gamepad/api-snapshot/esri/widgets/Popup/nls/pt-pt/Popup.js
JavaScript
mit
499
'use strict'; var genBase = require('../genBase') , Generator; Generator = module.exports = genBase.extend(); Generator.prototype.prompting = function prompting() { this.askForModuleName(); }; Generator.prototype.writing = function writing() { var config = this.getConfig(); this.fs.copyTpl( this.templatePath('_constant.' + config.appScript), this.destinationPath(config.appDir + '/' + config.modulePath + '/' + config.hyphenName + '-constant.' + config.appScript), config ); this.fs.copyTpl( this.templatePath('_spec.' + config.testScript), this.destinationPath(config.testDir + '/' + config.modulePath + '/' + config.hyphenName + '-constant_test.' + config.testScript), config ); };
gdi2290/generator-ng-poly
constant/index.js
JavaScript
mit
740
/* ,i::, :;;;;;;; ;:,,::;. 1ft1;::;1tL t1;::;1, :;::; _____ __ ___ __ fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_ CLft11 :,, i1tffLi \__ \ ____ / /|_/ // __ `// ___// __ \ 1t1i .;; .1tf ___/ //___// / / // /_/ // /__ / / / / CLt1i :,: .1tfL. /____/ /_/ /_/ \__,_/ \___//_/ /_/ Lft1,:;: , 1tfL: ;it1i ,,,:::;;;::1tti s_mach.i18n .t1i .,::;;; ;1tt Copyright (c) 2016 S-Mach, Inc. Lft11ii;::;ii1tfL: Author: lance.gatlin@gmail.com .L1 1tt1ttt,,Li ...1LLLL... */ package s_mach.i18n.impl import s_mach.i18n._ import s_mach.i18n.messages.{MessageFormat, MessageResolver} import scala.util.control.NonFatal class LaxMessageResolver( missingKey: (Symbol,Seq[String]) => String, invalidFormat: (Symbol,Seq[String]) => String ) extends MessageResolver { def resolveLiteral(key: Symbol)(implicit cfg: I18NConfig) = { import cfg._ messages.get(key) match { case Some(MessageFormat.Literal(value)) => value case Some(MessageFormat.Interpolation(parts)) => interpolator.interpolate(parts) case Some(MessageFormat.Choice(_)) => invalidFormat(key,Nil) case None => missingKey(key,Nil) } }.asI18N def resolveInterpolation(key: Symbol, args: I18NString*)(implicit cfg: I18NConfig) = { import cfg._ messages.get(key) match { case Some(MessageFormat.Interpolation(parts)) => interpolator.interpolate(parts,args:_*) case Some(MessageFormat.Literal(value)) => value case Some(MessageFormat.Choice(choice)) => try { choice(BigDecimal(args.head)) } catch { case NonFatal(_) => invalidFormat(key,args) } case None => missingKey(key,args) } }.asI18N def resolveChoice(key: Symbol, value: BigDecimal)(implicit cfg: I18NConfig) = { import cfg._ messages.get(key) match { case Some(MessageFormat.Choice(choice)) => choice(value) case Some(MessageFormat.Interpolation(parts)) => interpolator.interpolate(parts,value.toString.asI18N) case Some(MessageFormat.Literal(literal)) => literal case None => missingKey(key,Seq(value.toString())) } }.asI18N override def toString = "LaxMessageResolver" }
S-Mach/s_mach.i18n
src/main/scala/s_mach/i18n/impl/LaxMessageResolver.scala
Scala
mit
2,502
require "unit_helper" require "revily/helpers/unique_token" module Revily::Helpers describe UniqueToken do describe ".generate_token" do it "defaults to a 64-character urlsafe_base64 token" do allow(SecureRandom).to receive(:urlsafe_base64) { "dummy" } token = UniqueToken.generate_token expect(SecureRandom).to have_received(:urlsafe_base64).with(64) end it "generates a hex token" do token = UniqueToken.generate_token(type: :hex) expect(token.length).to eq 64 expect(token).to match(/\b[a-f0-9]{64}\b/) end it "generates a custom length hex token" do token = UniqueToken.generate_token(type: :hex, length: 32) expect(token.length).to eq 32 expect(token).to match(/\b[a-f0-9]{32}\b/) end it "generates a base64 token" do token = UniqueToken.generate_token expect(token.length).to eq 64 expect(token).to match(/\b[a-zA-Z0-9]{64}\b/) end it "generates a custom length base64 token" do token = UniqueToken.generate_token(length: 8) expect(token.length).to eq 8 expect(token).to match(/\b[a-zA-Z0-9]{8}\b/) end end describe ".generate_token_for" do let(:attribute) { :uuid } let(:klass) { double("User") } let(:object) { double("User") } before do allow(klass).to receive(:is_a?).with(Class).and_return(true) allow(klass).to receive(:find_by).and_return(false) allow(object).to receive(:is_a?).with(Class).and_return(false) allow(object).to receive(:class).and_return(klass) end it "generates a unique token for a class" do token = UniqueToken.generate_token_for(klass, attribute, type: :hex) expect(klass).to have_received(:find_by).with(attribute => token) end it "generates a unique token for an object" do token = UniqueToken.generate_token_for(object, attribute, type: :hex) expect(object).to have_received(:class) expect(object.class).to have_received(:find_by).with(attribute => token) end end end end
revily/revily
spec/lib/revily/helpers/unique_token_spec.rb
Ruby
mit
2,146
'use strict'; angular.module('myApp.unit7', ['ngRoute']) .config(['$routeProvider', function($routeProvider) { $routeProvider.when('/unit7', { templateUrl: 'unit7/unit7.html', controller: 'Unit7Ctrl' }); }]).controller('Unit7Ctrl', ['Unit7', '$scope', function(Unit7, $scope) { $scope.ex = Unit7.ex; Unit7.refreshPage(); }]);
joelbarba/GRM_TEST
app/unit7/unit7.js
JavaScript
mit
348
<?xml version="1.0" encoding="utf-8"?> <!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>ordered_options.rb</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="../../../../../../../../../../../../css/reset.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../../../../../../../../../../css/main.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../../../../../../../../../../css/github.css" type="text/css" media="screen" /> <script src="../../../../../../../../../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script> <script src="../../../../../../../../../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script> <script src="../../../../../../../../../../../../js/main.js" type="text/javascript" charset="utf-8"></script> <script src="../../../../../../../../../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script> </head> <body> <div class="banner"> <span>Ruby on Rails 4.2.1</span><br /> <h1> ordered_options.rb </h1> <ul class="files"> <li> ../../../../.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/ordered_options.rb </li> <li>Last modified: 2015-05-15 20:49:47 +0100</li> </ul> </div> <div id="bodyContent"> <div id="content"> <!-- Namespace --> <div class="sectiontitle">Namespace</div> <ul> <li> <span class="type">MODULE</span> <a href="../../../../../../../../../../../../classes/ActiveSupport.html">ActiveSupport</a> </li> <li> <span class="type">CLASS</span> <a href="../../../../../../../../../../../../classes/ActiveSupport/InheritableOptions.html">ActiveSupport::InheritableOptions</a> </li> <li> <span class="type">CLASS</span> <a href="../../../../../../../../../../../../classes/ActiveSupport/OrderedOptions.html">ActiveSupport::OrderedOptions</a> </li> </ul> <!-- Methods --> </div> </div> </body> </html>
TomMulvaney/AudioFlow
doc/api/files/__/__/__/__/_rvm/gems/ruby-2_2_2/gems/activesupport-4_2_1/lib/active_support/ordered_options_rb.html
HTML
mit
2,523
# MAkefile from https://github.com/mbcrawfo/GenericMakefile #### PROJECT SETTINGS #### # The name of the executable to be created BIN_NAME := anac # Compiler used CC ?= gcc # Extension of source files used in the project SRC_EXT = c # Path to the source directory, relative to the makefile SRC_PATH = ./src # Space-separated pkg-config libraries used by this project LIBS = # General compiler flags COMPILE_FLAGS = -g -O3 -Wall -fstack-protector -ggdb # Additional release-specific flags RCOMPILE_FLAGS = -D NDEBUG # Additional debug-specific flags DCOMPILE_FLAGS = -D DEBUG # Add additional include paths INCLUDES = -I $(SRC_PATH)/ # General linker settings LINK_FLAGS = -lm -lcrypt -luuid # Additional release-specific linker settings RLINK_FLAGS = # Additional debug-specific linker settings DLINK_FLAGS = # Destination directory, like a jail or mounted system DESTDIR = / # Install path (bin/ is appended automatically) INSTALL_PREFIX = usr/local #### END PROJECT SETTINGS #### # Generally should not need to edit below this line # Function used to check variables. Use on the command line: # make print-VARNAME # Useful for debugging and adding features print-%: ; @echo $*=$($*) # Shell used in this makefile # bash is used for 'echo -en' SHELL = /bin/bash # Clear built-in rules .SUFFIXES: # Programs for installation INSTALL = install INSTALL_PROGRAM = $(INSTALL) INSTALL_DATA = $(INSTALL) -m 644 # Append pkg-config specific libraries if need be ifneq ($(LIBS),) COMPILE_FLAGS += $(shell pkg-config --cflags $(LIBS)) LINK_FLAGS += $(shell pkg-config --libs $(LIBS)) endif # Verbose option, to output compile and link commands export V := false export CMD_PREFIX := @ ifeq ($(V),true) CMD_PREFIX := endif # Combine compiler and linker flags release: export CFLAGS := $(CFLAGS) $(COMPILE_FLAGS) $(RCOMPILE_FLAGS) release: export LDFLAGS := $(LDFLAGS) $(LINK_FLAGS) $(RLINK_FLAGS) debug: export CFLAGS := $(CFLAGS) $(COMPILE_FLAGS) $(DCOMPILE_FLAGS) debug: export LDFLAGS := $(LDFLAGS) $(LINK_FLAGS) $(DLINK_FLAGS) # Build and output paths release: export BUILD_PATH := build/release release: export BIN_PATH := bin/release debug: export BUILD_PATH := build/debug debug: export BIN_PATH := bin/debug install: export BIN_PATH := bin/release # Find all source files in the source directory, sorted by most # recently modified SOURCES = $(shell find $(SRC_PATH)/ -name '*.$(SRC_EXT)' -printf '%T@\t%p\n' \ | sort -k 1nr | cut -f2-) # fallback in case the above fails rwildcard = $(foreach d, $(wildcard $1*), $(call rwildcard,$d/,$2) \ $(filter $(subst *,%,$2), $d)) ifeq ($(SOURCES),) SOURCES := $(call rwildcard, $(SRC_PATH)/, *.$(SRC_EXT)) endif # Set the object file names, with the source directory stripped # from the path, and the build path prepended in its place OBJECTS = $(SOURCES:$(SRC_PATH)/%.$(SRC_EXT)=$(BUILD_PATH)/%.o) # Set the dependency files that will be used to add header dependencies DEPS = $(OBJECTS:.o=.d) # Macros for timing compilation TIME_FILE = $(dir $@).$(notdir $@)_time START_TIME = date '+%s' > $(TIME_FILE) END_TIME = read st < $(TIME_FILE) ; \ $(RM) $(TIME_FILE) ; \ st=$$((`date '+%s'` - $$st - 86400)) ; \ echo `date -u -d @$$st '+%H:%M:%S'` # Version macros # Comment/remove this section to remove versioning USE_VERSION := false # If this isn't a git repo or the repo has no tags, git describe will return non-zero ifeq ($(shell git describe > /dev/null 2>&1 ; echo $$?), 0) USE_VERSION := true VERSION := $(shell git describe --tags --long --dirty --always | \ sed 's/v\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)-\?.*-\([0-9]*\)-\(.*\)/\1 \2 \3 \4 \5/g') VERSION_MAJOR := $(word 1, $(VERSION)) VERSION_MINOR := $(word 2, $(VERSION)) VERSION_PATCH := $(word 3, $(VERSION)) VERSION_REVISION := $(word 4, $(VERSION)) VERSION_HASH := $(word 5, $(VERSION)) VERSION_STRING := \ "$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH).$(VERSION_REVISION)-$(VERSION_HASH)" override CFLAGS := $(CFLAGS) \ -D VERSION_MAJOR=$(VERSION_MAJOR) \ -D VERSION_MINOR=$(VERSION_MINOR) \ -D VERSION_PATCH=$(VERSION_PATCH) \ -D VERSION_REVISION=$(VERSION_REVISION) \ -D VERSION_HASH=\"$(VERSION_HASH)\" endif # Standard, non-optimized release build .PHONY: release release: dirs ifeq ($(USE_VERSION), true) @echo "Beginning release build v$(VERSION_STRING)" else @echo "Beginning release build" endif @$(START_TIME) @$(MAKE) all --no-print-directory @echo -n "Total build time: " @$(END_TIME) # Debug build for gdb debugging .PHONY: debug debug: dirs ifeq ($(USE_VERSION), true) @echo "Beginning debug build v$(VERSION_STRING)" else @echo "Beginning debug build" endif @$(START_TIME) @$(MAKE) all --no-print-directory @echo -n "Total build time: " @$(END_TIME) # Create the directories used in the build .PHONY: dirs dirs: @echo "Creating directories" @mkdir -p $(dir $(OBJECTS)) @mkdir -p $(BIN_PATH) # Installs to the set path .PHONY: install install: @echo "Installing to $(DESTDIR)$(INSTALL_PREFIX)/bin" @$(INSTALL_PROGRAM) $(BIN_PATH)/$(BIN_NAME) $(DESTDIR)$(INSTALL_PREFIX)/bin # Uninstalls the program .PHONY: uninstall uninstall: @echo "Removing $(DESTDIR)$(INSTALL_PREFIX)/bin/$(BIN_NAME)" @$(RM) $(DESTDIR)$(INSTALL_PREFIX)/bin/$(BIN_NAME) # Removes all build files .PHONY: clean clean: @echo "Deleting $(BIN_NAME) symlink" @$(RM) $(BIN_NAME) @echo "Deleting directories" @$(RM) -r build @$(RM) -r bin # Main rule, checks the executable and symlinks to the output all: $(BIN_PATH)/$(BIN_NAME) @echo "Making symlink: $(BIN_NAME) -> $<" @$(RM) $(BIN_NAME) @ln -s $(BIN_PATH)/$(BIN_NAME) $(BIN_NAME) # Link the executable $(BIN_PATH)/$(BIN_NAME): $(OBJECTS) @echo "Linking: $@" @$(START_TIME) $(CMD_PREFIX)$(CC) $(OBJECTS) $(LDFLAGS) -o $@ @echo -en "\t Link time: " @$(END_TIME) # Add dependency files, if they exist -include $(DEPS) # Source file rules # After the first compilation they will be joined with the rules from the # dependency files to provide header dependencies $(BUILD_PATH)/%.o: $(SRC_PATH)/%.$(SRC_EXT) @echo "Compiling: $< -> $@" @$(START_TIME) $(CMD_PREFIX)$(CC) $(CFLAGS) $(INCLUDES) -MP -MMD -c $< -o $@ @echo -en "\t Compile time: " @$(END_TIME)
gnomex/C-Syllabus
FAA/3th_work/Makefile
Makefile
mit
6,188
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace mbise1993.ReaperSettingsImporterCLI { class Program { static void Main(string[] args) { Console.WriteLine("[args] {0}", args.Length); ReaperProject sourceProject = ReaperProject.Load(args[0]); Console.WriteLine("[LOAD] Loaded source project {0}", sourceProject.FilePath); if(!args[1].Equals("-d", StringComparison.InvariantCultureIgnoreCase)) { Console.WriteLine("[ERROR] No destination projects listed. USAGE: <sourceProject> -d <destProject destProject ...>"); return; } IList<ReaperProject> destProjects = new List<ReaperProject>(); IList<string> trackNames = new List<string>(); IList<TrackData> sourceTrackData = new List<TrackData>(); int i = 2; while(i < args.Length && !args[i].Equals("-t", StringComparison.InvariantCultureIgnoreCase)) { destProjects.Add(ReaperProject.Load(args[i])); Console.WriteLine("[LOAD] Loaded destination project {0}", args[i]); i++; } if(i < args.Length && args[i].Equals("-t", StringComparison.InvariantCultureIgnoreCase)) { i++; while(i < args.Length) { trackNames.Add($"\"{args[i]}\""); trackNames.Add(args[i]); i++; } } if(trackNames.Count > 0) { sourceTrackData = sourceProject.ReadTrackData(trackNames); } else { sourceTrackData = sourceProject.ReadTrackData(); } Console.WriteLine("[STATUS] Read source track data: {0} tracks found", sourceTrackData.Count); foreach(ReaperProject destProject in destProjects) { destProject.WriteTrackData(sourceTrackData); Console.WriteLine("[STATUS] Finished writing settings to {0}", destProject.FilePath); } } } }
mbise1993/ReaperSettingsImporter
ReaperSettingsImporter/ReaperSettingsImporterCLI/Program.cs
C#
mit
2,257
'use strict'; /* Controllers */ var phonecatControllers = angular.module('phonecatControllers', []); phonecatControllers.controller('PhoneListCtrl', ['$scope', '$http', function($scope, $http) { $http.get('phones/phones.json').success(function(data) { $scope.phones = data; }); $scope.orderProp = 'age'; }]); phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', function($scope, $routeParams, $http) { $http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) { $scope.phone = data; }); }]);
jasonlarke-uwa/git-sync
app/js/controllers.js
JavaScript
mit
610
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("UltimateKeyBoardService")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("UltimateKeyBoardService")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("7091e85a-4f32-4de1-b701-45dfaac1bb59")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
AshitakaLax/Ultimate_Developer_Keyboard
Software/WindowsCode/UltimateKeyBoardService/Properties/AssemblyInfo.cs
C#
mit
1,422
# ascii Render webcam video to the terminal, built with [opencv-python](https://pypi.org/project/opencv-python/) ## Quick start ``` $ python3.8 -m venv venv $ source venv/bin/activate $ pip install -r requirements.txt $ python ascii.py ``` ![](https://github.com/mackorone/ascii/blob/master/demo.gif)
mackorone/ascii
README.md
Markdown
mit
305
html, body { font-family: 'Raleway', sans-serif; overflow: hidden } pre, a { margin-left: 6px; color: aliceblue; } svg { z-index: -1; } #lyrics { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; color: #343434 !important; } .console { font-size: 12px; border: solid; border-width: 1px; border-color: azure; border-top-width: 18px; border-top-color: azure; border-top-left-radius: 4px; border-top-right-radius: 4px; background-color: black; width: 550px; height: 370px; } .background-lyrics { z-index: -2; top: 0; left: 0; position: absolute; } .z, .x, .v { stroke: blueviolet; } .n, .m, .e { stroke: darkslateblue; } .content { float: left; display: inline; width: 49%; } #panel p, #panel-right p, #panel-left p, #panel a, #panel-right a, #panel-left a { font-size: 12px; margin: 8px; } #panel { background-color: #111111; background-image: url("./../images/texture.png"); -webkit-font-smoothing: none; display: none; color: aliceblue; opacity: 0; height: 300px; width: 300px; border: 1px solid rgba(34, 34, 34, 0.7); position: absolute; top: 50%; left: 50%; -webkit-perspective-origin: center center; -webkit-transform: translateX(-50%) translateY(-50%); } .panel-side { background-color: #111111; z-index: -1; color: aliceblue; display: none; height: 250px; width: 300px; border: 2px solid rgba(34, 34, 34, 0.7); position: absolute; top: calc(50% - (250px / 2)); left: 0; right: 0; bottom: 0; margin-left: auto; margin-right: auto; } i { font-size: 24px; } p + ul { margin-top: -2px; } br + .multiline-panel-content { margin-top: -4px; } p.dimmer + p { margin-left: -8px; } p.dimmer { color: #313131; } .multiline-panel-content { margin-left: 8px; margin-top: 8px; position: relative; display: inline-block; } #panel-right .multiline-panel-content { padding-left: 46px; } a { display: inline-block; } .description { margin-top: -8px !important; } .multiline-panel-content i, .multiline-panel-content p, .multiline-panel-content img, .multiline-panel-content a { display: inline-block; vertical-align: middle; } .multiline-panel-content + .multiline-panel-content { margin-top: -4px; } .multiline-panel-content.indent { transform: translateX(-30px); margin-left: 42px; } #panel-left { border-right: none; text-align: left; } #panel-right { border-left: none; text-align: left; } #footer { position: absolute; text-align: center; bottom: 7.77%; left: 0; right: 0; height: 0; } #footer p, a { display: inline-block; margin-left: 6px; margin-right: 6px; color: aliceblue; } .center { position: absolute; margin: auto; top: 0; right: 0; left: 0; width: 512px; height: 256px; } .audio-left { } .audio-right { } .zxvnme { } .shadow { -webkit-filter: drop-shadow(0 0 0.75rem darkslateblue); filter: drop-shadow(0 0 0.75rem darkslateblue); }
zxvnme/zxvnme.github.io
resources/css/index.css
CSS
mit
3,413
# -*- encoding : utf-8 -*- require 'benchmark' module ActiveSupport # See ActiveSupport::Cache::Store for documentation. module Cache autoload :FileStore, 'active_support/cache/file_store' autoload :MemoryStore, 'active_support/cache/memory_store' autoload :SynchronizedMemoryStore, 'active_support/cache/synchronized_memory_store' autoload :DRbStore, 'active_support/cache/drb_store' autoload :MemCacheStore, 'active_support/cache/mem_cache_store' autoload :CompressedMemCacheStore, 'active_support/cache/compressed_mem_cache_store' module Strategy autoload :LocalCache, 'active_support/cache/strategy/local_cache' end # Creates a new CacheStore object according to the given options. # # If no arguments are passed to this method, then a new # ActiveSupport::Cache::MemoryStore object will be returned. # # If you pass a Symbol as the first argument, then a corresponding cache # store class under the ActiveSupport::Cache namespace will be created. # For example: # # ActiveSupport::Cache.lookup_store(:memory_store) # # => returns a new ActiveSupport::Cache::MemoryStore object # # ActiveSupport::Cache.lookup_store(:drb_store) # # => returns a new ActiveSupport::Cache::DRbStore object # # Any additional arguments will be passed to the corresponding cache store # class's constructor: # # ActiveSupport::Cache.lookup_store(:file_store, "/tmp/cache") # # => same as: ActiveSupport::Cache::FileStore.new("/tmp/cache") # # If the first argument is not a Symbol, then it will simply be returned: # # ActiveSupport::Cache.lookup_store(MyOwnCacheStore.new) # # => returns MyOwnCacheStore.new def self.lookup_store(*store_option) store, *parameters = *([ store_option ].flatten) case store when Symbol store_class_name = (store == :drb_store ? "DRbStore" : store.to_s.camelize) store_class = ActiveSupport::Cache.const_get(store_class_name) store_class.new(*parameters) when nil ActiveSupport::Cache::MemoryStore.new else store end end def self.expand_cache_key(key, namespace = nil) expanded_cache_key = namespace ? "#{namespace}/" : "" if ENV["RAILS_CACHE_ID"] || ENV["RAILS_APP_VERSION"] expanded_cache_key << "#{ENV["RAILS_CACHE_ID"] || ENV["RAILS_APP_VERSION"]}/" end expanded_cache_key << case when key.respond_to?(:cache_key) key.cache_key when key.is_a?(Array) key.collect { |element| expand_cache_key(element) }.to_param when key key.to_param end.to_s expanded_cache_key end # An abstract cache store class. There are multiple cache store # implementations, each having its own additional features. See the classes # under the ActiveSupport::Cache module, e.g. # ActiveSupport::Cache::MemCacheStore. MemCacheStore is currently the most # popular cache store for large production websites. # # ActiveSupport::Cache::Store is meant for caching strings. Some cache # store implementations, like MemoryStore, are able to cache arbitrary # Ruby objects, but don't count on every cache store to be able to do that. # # cache = ActiveSupport::Cache::MemoryStore.new # # cache.read("city") # => nil # cache.write("city", "Duckburgh") # cache.read("city") # => "Duckburgh" class Store cattr_accessor :logger def silence! @silence = true self end # Fetches data from the cache, using the given key. If there is data in # the cache with the given key, then that data is returned. # # If there is no such data in the cache (a cache miss occurred), then # then nil will be returned. However, if a block has been passed, then # that block will be run in the event of a cache miss. The return value # of the block will be written to the cache under the given cache key, # and that return value will be returned. # # cache.write("today", "Monday") # cache.fetch("today") # => "Monday" # # cache.fetch("city") # => nil # cache.fetch("city") do # "Duckburgh" # end # cache.fetch("city") # => "Duckburgh" # # You may also specify additional options via the +options+ argument. # Setting <tt>:force => true</tt> will force a cache miss: # # cache.write("today", "Monday") # cache.fetch("today", :force => true) # => nil # # Other options will be handled by the specific cache store implementation. # Internally, #fetch calls #read, and calls #write on a cache miss. # +options+ will be passed to the #read and #write calls. # # For example, MemCacheStore's #write method supports the +:expires_in+ # option, which tells the memcached server to automatically expire the # cache item after a certain period. We can use this option with #fetch # too: # # cache = ActiveSupport::Cache::MemCacheStore.new # cache.fetch("foo", :force => true, :expires_in => 5.seconds) do # "bar" # end # cache.fetch("foo") # => "bar" # sleep(6) # cache.fetch("foo") # => nil def fetch(key, options = {}) @logger_off = true if !options[:force] && value = read(key, options) @logger_off = false log("hit", key, options) value elsif block_given? @logger_off = false log("miss", key, options) value = nil ms = Benchmark.ms { value = yield } @logger_off = true write(key, value, options) @logger_off = false log('write (will save %.2fms)' % ms, key, nil) value end end # Fetches data from the cache, using the given key. If there is data in # the cache with the given key, then that data is returned. Otherwise, # nil is returned. # # You may also specify additional options via the +options+ argument. # The specific cache store implementation will decide what to do with # +options+. def read(key, options = nil) log("read", key, options) end # Writes the given value to the cache, with the given key. # # You may also specify additional options via the +options+ argument. # The specific cache store implementation will decide what to do with # +options+. # # For example, MemCacheStore supports the +:expires_in+ option, which # tells the memcached server to automatically expire the cache item after # a certain period: # # cache = ActiveSupport::Cache::MemCacheStore.new # cache.write("foo", "bar", :expires_in => 5.seconds) # cache.read("foo") # => "bar" # sleep(6) # cache.read("foo") # => nil def write(key, value, options = nil) log("write", key, options) end def delete(key, options = nil) log("delete", key, options) end def delete_matched(matcher, options = nil) log("delete matched", matcher.inspect, options) end def exist?(key, options = nil) log("exist?", key, options) end def increment(key, amount = 1) log("incrementing", key, amount) if num = read(key) write(key, num + amount) else nil end end def decrement(key, amount = 1) log("decrementing", key, amount) if num = read(key) write(key, num - amount) else nil end end private def log(operation, key, options) logger.debug("Cache #{operation}: #{key}#{options ? " (#{options.inspect})" : ""}") if logger && !@silence && !@logger_off end end end end
liquidware/saasy
vendor/rails/activesupport/lib/active_support/cache.rb
Ruby
mit
8,033
# bdt 简介 Blued Developer Tools 用于创建项目模板和部署的命令 [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![NPM downloads][downloads-image]][npm-url] [![Node.js dependencies][david-image]][david-url] ### Installation Prerequisites: [Node.js](https://nodejs.org/en/) (6.x preferred). ``` bash $ npm install -g bdt ``` ### Usage ``` bash $ bdt -h // 帮助文档 $ bdt init <template-name> <project-name> // 初始化项目 $ bdt deploy pro // 部署到正式环境 $ bdt deploy dev // 部署到测试环境 ``` Example: ``` bash $ bdt init node my-project $ bdt deploy dev ``` ### 实现原理 主要是利用了 commander 来实现命令行的功能 部署部分其实就是利用命令行来给项目打tag,而项目模板则是用的generator-bae来实现。 [npm-image]: https://img.shields.io/npm/v/bdt.svg?style=flat-square [npm-url]: https://npmjs.org/package/bdt [travis-image]: https://img.shields.io/travis/bluedapp/bdt/master.svg?style=flat-square [travis-url]: https://travis-ci.org/bluedapp/bdt [downloads-image]: https://img.shields.io/npm/dm/bdt.svg?style=flat-square [david-image]: https://img.shields.io/david/bluedapp/bdt.svg?style=flat-square [david-url]: https://david-dm.org/bluedapp/bdt
bluedapp/bdt
README.md
Markdown
mit
1,275
# rm
u9520107/rm
README.md
Markdown
mit
5
<?php ob_start(); session_start(); require_once('../lib/connection.php'); require_once('../lib/unleashed.lib.php'); require_once('../lib/login.php'); if(isset($_GET['id'])) { $id = escape($_GET['id']); $q = mysql_query("SELECT absensi.*, absensi.created_at as tanggal_absen, pelajaran.nama as nama_pelajaran, kelas.nama as nama_kelas, kelas.tingkat as tingkat_kelas, kelas.tahun as tahun_kelas FROM absensi JOIN pelajaran ON pelajaran.id=absensi.id_pelajaran JOIN kelas ON kelas.id=absensi.id_kelas WHERE absensi.id='$id' LIMIT 1"); $absensi = mysql_fetch_object($q); $q_absensi_detail = mysql_query("SELECT * FROM absensi_detail JOIN siswa ON siswa.id=absensi_detail.id_siswa WHERE absensi_detail.id_absensi='$id' ORDER BY absensi_detail.created_at DESC"); } // submitter if(array_key_exists('key', $_POST)) { $submit_type = $_POST['submit_type']; switch($submit_type) { case 'tambah_absensi': $q_t_event = sprintf("INSERT INTO absensi(id_guru, tanggal, keterangan, created_at) VALUES('%s', '%s', '%s', '%s')", $_SESSION['logged_id'], now(), escape($_POST['keterangan']), now() ); $r_t_event = mysql_query($q_t_event); if(!$r_t_event) $error = 'Gagal Tambah Absensi'; else { $id = mysql_insert_id(); redirect("abasensi_detail.php?id=$id"); } break; } } require_once('inc/header.php'); ?> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Absensi <?php echo $absensi->nama_pelajaran; ?> <?php echo $absensi->tingkat_kelas.'-'.$absensi->nama_kelas; ?> </h1> <ol class="breadcrumb"> <li><a href="home.php"><i class="fa fa-home"></i> Home</a></li> <li class="active">Absensi</li> </ol> </section> <!-- Main content --> <section class="content"> <!-- Main row --> <div class="row"> <!-- Left col --> <section class="col-lg-8"> <!-- TO DO List --> <div class="box box-primary"> <div class="box-header"> <i class="ion ion-clipboard"></i> <h3 class="box-title">List Siswa</h3> </div><!-- /.box-header --> <div class="box-body"> <table class="table datatable"> <thead> <tr> <th>Nama</th> <th>Jam Masuk</th> <th>Tanggal</th> </tr> </thead> <tbody id="list-siswa"> <?php $date_now = date('y-m-d'); while($d_absensi_detail = mysql_fetch_object($q_absensi_detail)): ?> <tr id="<?php echo $d_absensi_detail->id; ?>"> <td><?php echo $d_absensi_detail->nama; ?></td> <td><?php echo $d_absensi_detail->jam_masuk; ?></td> <td><?php echo tanggal_format_indonesia($d_absensi_detail->tanggal); ?></td> </tr> <?php endwhile; ?> </tbody> </table> </div> </div><!-- /.box --> </section><!-- /.Left col --> <!-- right col (We are only adding the ID to make the widgets sortable)--> <section class="col-lg-4 connectedSortable"> <!-- Kategori List List --> <div class="box box-warning"> <div class="box-header"> <i class="ion ion-clipboard"></i> <h3 class="box-title">Tambah Absensi</h3> </div><!-- /.box-header --> <div class="list-group"> <div class="clock"> <div id="Date"></div> <ul> <li id="hours"></li> <li id="point">:</li> <li id="min"></li> <li id="point">:</li> <li id="sec"></li> </ul> </div> <?php if(strtotime($absensi->tanggal_absen." +3 hours ") > strtotime(now())): ?> <input type="text" name="rfid" class="form-control input-lg" placeholder="Tap Kartu" readonly id="home-rfid"> <input type="hidden" name="id_absensi" id="id_absensi" value="<?php echo $absensi->id; ?>"> <?php endif; ?> <div class="list-group-item"> <h3>Detail Siswa</h3> </div> <div class="list-group-item"> <strong>NIS</strong> <h3 class="absensi-nis"></h3> </div> <div class="list-group-item"> <strong>Nama</strong> <h3 class="absensi-nama"></h3> </div> </div><!-- /.box-body --> </div><!-- /.box --> </section><!-- right col --> </div><!-- /.row (main row) --> </section><!-- /.content --> <?php include('inc/footer.php'); ?> <script type="text/javascript" src="../assets/js/jquery.rfid.js"></script> <script type="text/javascript"> var timer; function myTimer() { var sec = 0.5; clearInterval(timer); timer = setInterval(function() { $('#timer').text(sec--); if (sec == -0.5) { clearInterval(timer); $('#home-rfid').val(''); $('.absensi-nis').text(''); $('.absensi-nama').text(''); $('.absensi-kelas').text(''); $('.absensi-keterangan').text(''); $('#home-rfid').focus(); } } , 1000); } myTimer(); // Parses raw scan into name and ID number var rfidParser = function (rawData) { // console.log(rawData); if (rawData.length != 11) return null; else return rawData; }; // Called on a good scan (company card recognized) var goodScan = function (cardData) { $("#home-rfid").val(cardData.substr(0,10)); var rfid = $("#home-rfid").val(); var id_absensi = $("#id_absensi").val(); $.ajax({ url: base_url + 'services/absensi_kelas_by_rfid.php', type: 'post', data: { rfid: rfid, id_absensi: id_absensi }, dataType: 'json', success: function(data){ if(data.status == true) { $('.absensi-nis').text(data.nis); $('.absensi-nama').text(data.nama); $('.absensi-keterangan').text(data.keterangan); var tr = "<tr id='" + data.id_absensi + "'>" + "<td>" + data.nama +"</td>" + "<td>" + data.time_now +"</td>" + "<td>" + data.date_now +"</td>"; if(data.absensi == true) { $(tr).prependTo('#list-siswa'); } myTimer(); } else { $('#home-rfid').val(''); $('.absensi-nis').text(''); $('.absensi-nama').text(''); $('#home-rfid').focus(); } } }); }; // Called on a bad scan (company card not recognized) var badScan = function() { console.log("Bad Scan."); }; // Initialize the plugin. $.rfidscan({ parser: rfidParser, success: goodScan, error: badScan }); </script>
phi314/bulbasaur
guru/absensi_detail.php
PHP
mit
10,110
exports.config = { namespace: "better-img-stencil", outputTargets: [ { type: "dist" }, { type: "www", serviceWorker: false } ] }; exports.devServer = { root: "www", watchGlob: "**/**" };
pearlbea/better-img
packages/better-img-stencil/stencil.config.js
JavaScript
mit
232
<!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/> <meta charset="utf-8"/> <title> Phing API Documentation &raquo; \Ssh2MethodParam </title> <meta name="author" content=""/> <meta name="description" content=""/> <link href="../css/template.css" rel="stylesheet" media="all"/> <!--[if lt IE 9]> <script src="https://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script> <![endif]--> <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script> <script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script> <script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script> <script src="../js/bootstrap.js" type="text/javascript"></script> <script src="../js/template.js" type="text/javascript"></script> <script src="../js/prettify/prettify.min.js" type="text/javascript"></script> <link rel="shortcut icon" href="../img/favicon.ico"/> <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"/> <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"/> <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"/> </head> <body> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="../index.html">Phing API Documentation</a> <div class="nav-collapse"> <ul class="nav"> <li class="dropdown"> <a href="#api" class="dropdown-toggle" data-toggle="dropdown"> API Documentation <b class="caret"></b> </a> <ul class="dropdown-menu"> </ul> </li> <li class="dropdown" id="charts-menu"> <a href="#charts" class="dropdown-toggle" data-toggle="dropdown"> Charts <b class="caret"></b> </a> <ul class="dropdown-menu"> <li> <a href="../graph_class.html"> <i class="icon-list-alt"></i>&#160;Class hierarchy diagram </a> </li> </ul> </li> <li class="dropdown" id="reports-menu"> <a href="#reports" class="dropdown-toggle" data-toggle="dropdown"> Reports <b class="caret"></b> </a> <ul class="dropdown-menu"> <li> <a href="../errors.html"> <i class="icon-list-alt"></i>&#160;Errors </a> </li> <li> <a href="../markers.html"> <i class="icon-list-alt"></i>&#160;Markers </a> </li> <li> <a href="../deprecated.html"> <i class="icon-list-alt"></i>&#160;Deprecated </a> </li> </ul> </li> </ul> </div> </div> </div> <div class="go_to_top"> <a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a> </div> </div> <div id="___" class="container"> <noscript> <div class="alert alert-warning"> Javascript is disabled; several features are only available if Javascript is enabled. </div> </noscript> <style> .deprecated h2 { text-decoration: line-through; } </style> <div class="row"> <div class="span4"> <div class="btn-group view pull-right" data-toggle="buttons-radio"> <button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button> <button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button> </div> <div class="btn-group visibility" data-toggle="buttons-checkbox"> <button class="btn public active" title="Show public elements">Public</button> <button class="btn protected" title="Show protected elements">Protected</button> <button class="btn private" title="Show private elements">Private</button> <button class="btn inherited active" title="Show inherited elements">Inherited</button> </div> <ul class="side-nav nav nav-list"> <li class="nav-header"> <i class="icon-custom icon-method"></i> Methods <ul> <li class="method public inherited"> <a href="#method_circularReference" title="circularReference :: Creates an exception that indicates the user has generated a loop of data types referencing each other."> <span class="description">Creates an exception that indicates the user has generated a loop of data types referencing each other.</span><pre>circularReference</pre> </a> </li> <li class="method public"> <a href="#method_createClient" title="createClient :: Handles the &lt;client /&gt; nested element"> <span class="description">Handles the &lt;client /&gt; nested element</span><pre>createClient</pre> </a> </li> <li class="method public"> <a href="#method_createServer" title="createServer :: Handles the &lt;server /&gt; nested element"> <span class="description">Handles the &lt;server /&gt; nested element</span><pre>createServer</pre> </a> </li> <li class="method public inherited"> <a href="#method_dieOnCircularReference" title="dieOnCircularReference :: Check to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself)."> <span class="description">Check to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself).</span><pre>dieOnCircularReference</pre> </a> </li> <li class="method public inherited"> <a href="#method_getCheckedRef" title="getCheckedRef :: Performs the check for circular references and returns the referenced object."> <span class="description">Performs the check for circular references and returns the referenced object.</span><pre>getCheckedRef</pre> </a> </li> <li class="method public"> <a href="#method_getClientToServer" title="getClientToServer :: "> <span class="description"></span><pre>getClientToServer</pre> </a> </li> <li class="method public inherited"> <a href="#method_getDescription" title="getDescription :: Return the description for the current data type."> <span class="description">Return the description for the current data type.</span><pre>getDescription</pre> </a> </li> <li class="method public"> <a href="#method_getHostkey" title="getHostkey :: "> <span class="description"></span><pre>getHostkey</pre> </a> </li> <li class="method public"> <a href="#method_getKex" title="getKex :: "> <span class="description"></span><pre>getKex</pre> </a> </li> <li class="method public inherited"> <a href="#method_getProject" title="getProject :: Returns a reference to current project"> <span class="description">Returns a reference to current project</span><pre>getProject</pre> </a> </li> <li class="method public"> <a href="#method_getRef" title="getRef :: "> <span class="description"></span><pre>getRef</pre> </a> </li> <li class="method public"> <a href="#method_getServerToClient" title="getServerToClient :: "> <span class="description"></span><pre>getServerToClient</pre> </a> </li> <li class="method public inherited"> <a href="#method_isReference" title="isReference :: Has the refid attribute of this element been set?"> <span class="description">Has the refid attribute of this element been set?</span><pre>isReference</pre> </a> </li> <li class="method public inherited"> <a href="#method_log" title="log :: Logs a message with the given priority."> <span class="description">Logs a message with the given priority.</span><pre>log</pre> </a> </li> <li class="method public inherited"> <a href="#method_noChildrenAllowed" title="noChildrenAllowed :: Creates an exception that indicates that this XML element must not have child elements if the refid attribute is set."> <span class="description">Creates an exception that indicates that this XML element must not have child elements if the refid attribute is set.</span><pre>noChildrenAllowed</pre> </a> </li> <li class="method public inherited"> <a href="#method_parsingComplete" title="parsingComplete :: Template method being called when the data type has been parsed completely."> <span class="description">Template method being called when the data type has been parsed completely.</span><pre>parsingComplete</pre> </a> </li> <li class="method public inherited"> <a href="#method_pushAndInvokeCircularReferenceCheck" title="pushAndInvokeCircularReferenceCheck :: "> <span class="description"></span><pre>pushAndInvokeCircularReferenceCheck</pre> </a> </li> <li class="method public inherited"> <a href="#method_setDescription" title="setDescription :: Sets a description of the current data type. It will be useful in commenting what we are doing."> <span class="description">Sets a description of the current data type. It will be useful in commenting what we are doing.</span><pre>setDescription</pre> </a> </li> <li class="method public"> <a href="#method_setHostkey" title="setHostkey :: "> <span class="description"></span><pre>setHostkey</pre> </a> </li> <li class="method public"> <a href="#method_setKex" title="setKex :: "> <span class="description"></span><pre>setKex</pre> </a> </li> <li class="method public inherited"> <a href="#method_setProject" title="setProject :: References the project to the current component."> <span class="description">References the project to the current component.</span><pre>setProject</pre> </a> </li> <li class="method public inherited"> <a href="#method_setRefid" title="setRefid :: Set the value of the refid attribute."> <span class="description">Set the value of the refid attribute.</span><pre>setRefid</pre> </a> </li> <li class="method public"> <a href="#method_toArray" title="toArray :: Convert the params to an array that is suitable to be passed in the ssh2_connect $methods parameter"> <span class="description">Convert the params to an array that is suitable to be passed in the ssh2_connect $methods parameter</span><pre>toArray</pre> </a> </li> <li class="method public inherited"> <a href="#method_tooManyAttributes" title="tooManyAttributes :: Creates an exception that indicates that refid has to be the only attribute if it is set."> <span class="description">Creates an exception that indicates that refid has to be the only attribute if it is set.</span><pre>tooManyAttributes</pre> </a> </li> </ul> </li> <li class="nav-header protected">» Protected <ul> <li class="method protected"> <a href="#method__filterParam" title="_filterParam :: "> <span class="description"></span><pre>_filterParam</pre> </a> </li> </ul> </li> <li class="nav-header private">» Private <ul> </ul> </li> <li class="nav-header"> <i class="icon-custom icon-constant"></i> Constants <ul> </ul> </li> </ul> </div> <div class="span8"> <div class="element class"> <h1>Ssh2MethodParam</h1> <small style="display: block; text-align: right"> Extends <a href="../classes/DataType.html">\DataType</a> </small> <p class="short_description">Class that holds parameters for an ssh2_connect $methods parameter This corresponds to the optional $methods parameter for the ssh2_connect function</p> <div class="details"> <div class="long_description"> <p>This class handles the common description attribute and provides a default implementation for reference handling and checking for circular references that is appropriate for types that can not be nested inside elements of the same type (i.e. patternset but not path)</p> </div> <table class="table table-bordered"> <tr> <th> see </th> <td> </td> </tr> <tr> <th> author </th> <td> <p>Derek Gallo <a href="http://github.com/drock">http://github.com/drock</a></p> </td> </tr> <tr> <th> package </th> <td> <p>phing.tasks.ext</p> </td> </tr> </table> <h3><i class="icon-custom icon-method"></i> Methods</h3> <a id="method__filterParam"></a> <div class="element clickable method protected method__filterParam" data-toggle="collapse" data-target=".method__filterParam .collapse"> <h2>_filterParam</h2> <pre>_filterParam( $var) : boolean</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$var</h4> <code></code><p></p> </div> <h3>Response</h3> <code>boolean</code><p></p> </div> </div> </div> <a id="method_circularReference"></a> <div class="element clickable method public method_circularReference inherited" data-toggle="collapse" data-target=".method_circularReference .collapse"> <h2>Creates an exception that indicates the user has generated a loop of data types referencing each other.</h2> <pre>circularReference() : \BuildException</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/BuildException.html">\BuildException</a></code><p></p> </div> </div> </div> <a id="method_createClient"></a> <div class="element clickable method public method_createClient" data-toggle="collapse" data-target=".method_createClient .collapse"> <h2>Handles the &lt;client /&gt; nested element</h2> <pre>createClient() : \Ssh2MethodConnectionParam</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/Ssh2MethodConnectionParam.html">\Ssh2MethodConnectionParam</a></code><p></p> </div> </div> </div> <a id="method_createServer"></a> <div class="element clickable method public method_createServer" data-toggle="collapse" data-target=".method_createServer .collapse"> <h2>Handles the &lt;server /&gt; nested element</h2> <pre>createServer() : \Ssh2MethodConnectionParam</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/Ssh2MethodConnectionParam.html">\Ssh2MethodConnectionParam</a></code><p></p> </div> </div> </div> <a id="method_dieOnCircularReference"></a> <div class="element clickable method public method_dieOnCircularReference inherited" data-toggle="collapse" data-target=".method_dieOnCircularReference .collapse"> <h2>Check to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself).</h2> <pre>dieOnCircularReference( &$stk, \Project $p) : void</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"><p>If one is included, throw a BuildException created by circularReference</p> <p>This implementation is appropriate only for a DataType that cannot hold other DataTypes as children.</p> <p>The general contract of this method is that it shouldn't do anything if checked is true and set it to true on exit.</p></div> <table class="table"> <tr> <th> throws </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$stk</h4> <code></code><p></p> </div> <div class="subelement argument"> <h4>$p</h4> <code><a href="../classes/Project.html">\Project</a></code><p></p> </div> </div> </div> </div> <a id="method_getCheckedRef"></a> <div class="element clickable method public method_getCheckedRef inherited" data-toggle="collapse" data-target=".method_getCheckedRef .collapse"> <h2>Performs the check for circular references and returns the referenced object.</h2> <pre>getCheckedRef( $requiredClass, $dataTypeName) : mixed</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> throws </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$requiredClass</h4> <code></code><p></p> </div> <div class="subelement argument"> <h4>$dataTypeName</h4> <code></code><p></p> </div> <h3>Response</h3> <code>mixed</code><p></p> </div> </div> </div> <a id="method_getClientToServer"></a> <div class="element clickable method public method_getClientToServer" data-toggle="collapse" data-target=".method_getClientToServer .collapse"> <h2>getClientToServer</h2> <pre>getClientToServer(\Project $p) : \Ssh2MethodConnectionParam</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> throws </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$p</h4> <code><a href="../classes/Project.html">\Project</a></code><p></p> </div> <h3>Response</h3> <code><a href="../classes/Ssh2MethodConnectionParam.html">\Ssh2MethodConnectionParam</a></code><p></p> </div> </div> </div> <a id="method_getDescription"></a> <div class="element clickable method public method_getDescription inherited" data-toggle="collapse" data-target=".method_getDescription .collapse"> <h2>Return the description for the current data type.</h2> <pre>getDescription() </pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> retujrn </th> <td> <p>string</p> </td> </tr> <tr> <th> </th> <td> </td> </tr> <tr> <th> </th> <td> </td> </tr> </table> </div> </div> </div> <a id="method_getHostkey"></a> <div class="element clickable method public method_getHostkey" data-toggle="collapse" data-target=".method_getHostkey .collapse"> <h2>getHostkey</h2> <pre>getHostkey(\Project $p) : string</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> throws </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$p</h4> <code><a href="../classes/Project.html">\Project</a></code><p></p> </div> <h3>Response</h3> <code>string</code><p></p> </div> </div> </div> <a id="method_getKex"></a> <div class="element clickable method public method_getKex" data-toggle="collapse" data-target=".method_getKex .collapse"> <h2>getKex</h2> <pre>getKex(\Project $p) : string</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> throws </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$p</h4> <code><a href="../classes/Project.html">\Project</a></code><p></p> </div> <h3>Response</h3> <code>string</code><p></p> </div> </div> </div> <a id="method_getProject"></a> <div class="element clickable method public method_getProject inherited" data-toggle="collapse" data-target=".method_getProject .collapse"> <h2>Returns a reference to current project</h2> <pre>getProject() : \Project</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/Project.html">\Project</a></code><p><p>Reference to current porject object</p></p> </div> </div> </div> <a id="method_getRef"></a> <div class="element clickable method public method_getRef" data-toggle="collapse" data-target=".method_getRef .collapse"> <h2>getRef</h2> <pre>getRef(\Project $p) : \Ssh2MethodParam</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> throws </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$p</h4> <code><a href="../classes/Project.html">\Project</a></code><p></p> </div> <h3>Response</h3> <code><a href="../classes/Ssh2MethodParam.html">\Ssh2MethodParam</a></code><p></p> </div> </div> </div> <a id="method_getServerToClient"></a> <div class="element clickable method public method_getServerToClient" data-toggle="collapse" data-target=".method_getServerToClient .collapse"> <h2>getServerToClient</h2> <pre>getServerToClient(\Project $p) : \Ssh2MethodConnectionParam</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> throws </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$p</h4> <code><a href="../classes/Project.html">\Project</a></code><p></p> </div> <h3>Response</h3> <code><a href="../classes/Ssh2MethodConnectionParam.html">\Ssh2MethodConnectionParam</a></code><p></p> </div> </div> </div> <a id="method_isReference"></a> <div class="element clickable method public method_isReference inherited" data-toggle="collapse" data-target=".method_isReference .collapse"> <h2>Has the refid attribute of this element been set?</h2> <pre>isReference() : boolean</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code>boolean</code><p></p> </div> </div> </div> <a id="method_log"></a> <div class="element clickable method public method_log inherited" data-toggle="collapse" data-target=".method_log .collapse"> <h2>Logs a message with the given priority.</h2> <pre>log(string $msg, integer $level = \Project::MSG_INFO) : void</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$msg</h4> <code>string</code><p><p>The message to be logged.</p></p> </div> <div class="subelement argument"> <h4>$level</h4> <code>integer</code><p><p>The message's priority at this message should have</p></p> </div> </div> </div> </div> <a id="method_noChildrenAllowed"></a> <div class="element clickable method public method_noChildrenAllowed inherited" data-toggle="collapse" data-target=".method_noChildrenAllowed .collapse"> <h2>Creates an exception that indicates that this XML element must not have child elements if the refid attribute is set.</h2> <pre>noChildrenAllowed() : \BuildException</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/BuildException.html">\BuildException</a></code><p></p> </div> </div> </div> <a id="method_parsingComplete"></a> <div class="element clickable method public method_parsingComplete inherited" data-toggle="collapse" data-target=".method_parsingComplete .collapse"> <h2>Template method being called when the data type has been parsed completely.</h2> <pre>parsingComplete() : void</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"><p>{@inheritdoc}</p></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> </div> </div> </div> <a id="method_pushAndInvokeCircularReferenceCheck"></a> <div class="element clickable method public method_pushAndInvokeCircularReferenceCheck inherited" data-toggle="collapse" data-target=".method_pushAndInvokeCircularReferenceCheck .collapse"> <h2>pushAndInvokeCircularReferenceCheck</h2> <pre>pushAndInvokeCircularReferenceCheck(\DataType $dt, &$stk, \Project $p) </pre> <div class="labels"> <span class="label">inherited</span> <span class="label">static</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$dt</h4> <code><a href="../classes/DataType.html">\DataType</a></code><p></p> </div> <div class="subelement argument"> <h4>$stk</h4> <code></code><p></p> </div> <div class="subelement argument"> <h4>$p</h4> <code><a href="../classes/Project.html">\Project</a></code><p></p> </div> </div> </div> </div> <a id="method_setDescription"></a> <div class="element clickable method public method_setDescription inherited" data-toggle="collapse" data-target=".method_setDescription .collapse"> <h2>Sets a description of the current data type. It will be useful in commenting what we are doing.</h2> <pre>setDescription(string $desc) : void</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$desc</h4> <code>string</code><p></p> </div> </div> </div> </div> <a id="method_setHostkey"></a> <div class="element clickable method public method_setHostkey" data-toggle="collapse" data-target=".method_setHostkey .collapse"> <h2>setHostkey</h2> <pre>setHostkey(string $hostkey) </pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$hostkey</h4> <code>string</code><p></p> </div> </div> </div> </div> <a id="method_setKex"></a> <div class="element clickable method public method_setKex" data-toggle="collapse" data-target=".method_setKex .collapse"> <h2>setKex</h2> <pre>setKex(string $kex) </pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$kex</h4> <code>string</code><p></p> </div> </div> </div> </div> <a id="method_setProject"></a> <div class="element clickable method public method_setProject inherited" data-toggle="collapse" data-target=".method_setProject .collapse"> <h2>References the project to the current component.</h2> <pre>setProject(\Project $project) : void</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$project</h4> <code><a href="../classes/Project.html">\Project</a></code><p><p>The reference to the current project</p></p> </div> </div> </div> </div> <a id="method_setRefid"></a> <div class="element clickable method public method_setRefid inherited" data-toggle="collapse" data-target=".method_setRefid .collapse"> <h2>Set the value of the refid attribute.</h2> <pre>setRefid(\Reference $r) : void</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"><p>Subclasses may need to check whether any other attributes have been set as well or child elements have been created and thus override this method. if they do they must call parent::setRefid()</p></div> <table class="table"> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$r</h4> <code><a href="../classes/Reference.html">\Reference</a></code><p></p> </div> </div> </div> </div> <a id="method_toArray"></a> <div class="element clickable method public method_toArray" data-toggle="collapse" data-target=".method_toArray .collapse"> <h2>Convert the params to an array that is suitable to be passed in the ssh2_connect $methods parameter</h2> <pre>toArray(\Project $p) : array</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$p</h4> <code><a href="../classes/Project.html">\Project</a></code><p></p> </div> <h3>Response</h3> <code>array</code><p></p> </div> </div> </div> <a id="method_tooManyAttributes"></a> <div class="element clickable method public method_tooManyAttributes inherited" data-toggle="collapse" data-target=".method_tooManyAttributes .collapse"> <h2>Creates an exception that indicates that refid has to be the only attribute if it is set.</h2> <pre>tooManyAttributes() : \BuildException</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/BuildException.html">\BuildException</a></code><p></p> </div> </div> </div> <h3><i class="icon-custom icon-property"></i> Properties</h3> <a id="property_kex"> </a> <div class="element clickable property private property_kex" data-toggle="collapse" data-target=".property_kex .collapse"> <h2>kex</h2> <pre>kex : string</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code>string</code> </div> </div> </div> <a id="property_hostkey"> </a> <div class="element clickable property private property_hostkey" data-toggle="collapse" data-target=".property_hostkey .collapse"> <h2>hostkey</h2> <pre>hostkey : string</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code>string</code> </div> </div> </div> <a id="property_client_to_server"> </a> <div class="element clickable property private property_client_to_server" data-toggle="collapse" data-target=".property_client_to_server .collapse"> <h2>client_to_server</h2> <pre>client_to_server : \Ssh2MethodConnectionParam</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code><a href="../classes/Ssh2MethodConnectionParam.html">\Ssh2MethodConnectionParam</a></code> </div> </div> </div> <a id="property_server_to_client"> </a> <div class="element clickable property private property_server_to_client" data-toggle="collapse" data-target=".property_server_to_client .collapse"> <h2>server_to_client</h2> <pre>server_to_client : \Ssh2MethodConnectionParam</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code><a href="../classes/Ssh2MethodConnectionParam.html">\Ssh2MethodConnectionParam</a></code> </div> </div> </div> <a id="property_description"> </a> <div class="element clickable property public property_description inherited" data-toggle="collapse" data-target=".property_description .collapse"> <h2>The descriptin the user has set.</h2> <pre>description : string</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code>string</code> </div> </div> </div> <a id="property_ref"> </a> <div class="element clickable property public property_ref inherited" data-toggle="collapse" data-target=".property_ref .collapse"> <h2>Value to the refid attribute.</h2> <pre>ref : \Reference</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code><a href="../classes/Reference.html">\Reference</a></code> </div> </div> </div> <a id="property_checked"> </a> <div class="element clickable property protected property_checked inherited" data-toggle="collapse" data-target=".property_checked .collapse"> <h2>Are we sure we don&#039;t hold circular references?</h2> <pre>checked : boolean</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"><p>Subclasses are responsible for setting this value to false if we'd need to investigate this condition (usually because a child element has been added that is a subclass of DataType).</p></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code>boolean</code> </div> </div> </div> <a id="property_project"> </a> <div class="element clickable property protected property_project inherited" data-toggle="collapse" data-target=".property_project .collapse"> <h2>Holds a reference to the project that a project component (a task, a target, etc.) belongs to</h2> <pre>project : \Project</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> <p>A reference to the current project instance</p> </td> </tr> </table> <h3>Type(s)</h3> <code><a href="../classes/Project.html">\Project</a></code> </div> </div> </div> </div> </div> <a id="\Ssh2MethodParam"></a> <ul class="breadcrumb"> <li><a href="../index.html"><i class="icon-custom icon-class"></i></a></li> <li><span class="divider">\</span><a href="../namespaces/default.html">\</a></li> <li class="active"><span class="divider">\</span><a href="../classes/Ssh2MethodParam.html">Ssh2MethodParam</a></li> </ul> </div> </div> </div> <footer class="span12"> Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br/> Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and<br/> generated on Thu, 13 Oct 2016 11:14:52 +0200.<br/> </footer> </body> </html>
andyreis/mystyle
phing-2.15.2/docs/api/docs/classes/Ssh2MethodParam.html
HTML
mit
93,088
// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_SPLASHSCREEN_H #define BITCOIN_QT_SPLASHSCREEN_H #include <QSplashScreen> class NetworkStyle; /** Class for the splashscreen with information of the running client. * * @note this is intentionally not a QSplashScreen. Bitcoin Core initialization * can take a long time, and in that case a progress window that cannot be * moved around and minimized has turned out to be frustrating to the user. */ class SplashScreen : public QWidget { Q_OBJECT public: explicit SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle); ~SplashScreen(); protected: void paintEvent(QPaintEvent *event); void closeEvent(QCloseEvent *event); public Q_SLOTS: /** Slot to call finish() method as it's not defined as slot */ void slotFinish(QWidget *mainWin); /** Show message and progress */ void showMessage(const QString &message, int alignment, const QColor &color); private: /** Connect core signals to splash screen */ void subscribeToCoreSignals(); /** Disconnect core signals to splash screen */ void unsubscribeFromCoreSignals(); QPixmap pixmap; QString curMessage; QColor curColor; int curAlignment; }; #endif // BITCOIN_QT_SPLASHSCREEN_H
realzzt/BitCoin2013
src/qt/splashscreen.h
C
mit
1,481
Blockly.Language.message = { helpUrl: 'http://www.example.com/', init: function() { this.setColour(190); this.appendDummyInput("").appendTitle(new Blockly.FieldImage("img/message.png", 16, 16)).appendTitle("Message") this.setPreviousStatement(true, null); this.setNextStatement(true, null); this.appendValueInput("value", Text) this.setTooltip('message'); } }; Blockly.JavaScript.message = function() { var argument0 = Blockly.JavaScript.valueToCode(this, 'value', Blockly.JavaScript.ORDER_COMMA) || 'false'; if (!Blockly.JavaScript.definitions_['message']) { var functionName = Blockly.JavaScript.variableDB_.getDistinctName('message', Blockly.Generator.NAME_TYPE); Blockly.JavaScript.message.functionName = functionName; var func = []; func.push('function ' + functionName + '(message) {'); func.push(' console.log(message);'); func.push('}'); Blockly.JavaScript.definitions_['message'] = func.join('\n'); } var code = Blockly.JavaScript.message.functionName + '(' + argument0 + ');\n'; return code; };
fgu-cas/arenomat
public/js/blocks/message.js
JavaScript
mit
1,082
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.VisualStudio.Debugger.Interop; using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading; //////////////////////////////////////////////////////////////////////////////////////// // FILE SUMMARY // // This file defines the contract for the Microsoft.DebugEngineHost assembly. The // Microsoft.DebugEngineHost provides services to a debug engine. There are two // different implementations of this contract -- one for running the engine in Visual Studio, // and one for running in VS Code. // namespace Microsoft.DebugEngineHost { /// <summary> /// Enumeration of Host User Interfaces that an engine can be run from. /// This must be kept in sync with all DebugEngineHost implentations /// </summary> public enum HostUIIdentifier { /// <summary> /// Visual Studio IDE /// </summary> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] VSIDE = 0, /// <summary> /// Visual Studio Code /// </summary> VSCode = 1, /// <summary> /// Xamarin Studio /// </summary> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] XamarinStudio = 2 } /// <summary> /// Static class which provides the initialization method for /// Microsoft.DebugEngineHost. /// </summary> public static class Host { /// <summary> /// Called by a debug engine to ensure that the main thread is initialized. /// </summary> public static void EnsureMainThreadInitialized() { throw new NotImplementedException(); } /// <summary> /// Called by a debug engine to determine which UI is using it. /// </summary> /// <returns></returns> public static HostUIIdentifier GetHostUIIdentifier() { throw new NotImplementedException(); } } /// <summary> /// Abstraction over a named section within the HostConfigurationStore. This provides /// the ability to enumerate values within the section. /// </summary> public sealed class HostConfigurationSection : IDisposable { private HostConfigurationSection() { throw new NotImplementedException(); } /// <summary> /// Releases any resources held by the HostConfigurationSection. /// </summary> public void Dispose() { } /// <summary> /// Obtains the value of the specified valueName /// </summary> /// <param name="valueName">Name of the value to obtain</param> /// <returns>[Optional] null if the value doesn't exist, otherwise the value /// </returns> public object GetValue(string valueName) { throw new NotImplementedException(); } /// <summary> /// Enumerates the names of all the values defined in this section /// </summary> /// <returns>Enumerator of strings</returns> public IEnumerable<string> GetValueNames() { throw new NotImplementedException(); } } /// <summary> /// Provides access to settings for the engine /// </summary> public sealed class HostConfigurationStore { /// <summary> /// Constructs a new HostConfigurationStore object. This API should generally be /// called from an engine's implementation of IDebugEngine2.SetRegistryRoot. /// </summary> /// <param name="registryRoot">registryRoot value provided in SetRegistryRoot. /// In Visual Studio, this will be something like 'Software\\Microsoft\\VisualStudio\\14.0'. /// In VS Code this will not really be a registry value but rather a key used to /// find the right configuration file.</param> public HostConfigurationStore(string registryRoot) { throw new NotImplementedException(); } /// <summary> /// Sets the Guid of the engine being hosted. This should only be set once for each HostConfigurationStore instance. /// </summary> /// <param name="value">The new engine GUID to set</param> public void SetEngineGuid(Guid value) { throw new NotImplementedException(); } /// <summary> /// Provides the registry root string. This is NOT supported in VS Code, and this property may eventually be removed. /// </summary> public string RegistryRoot { get { throw new NotImplementedException(); } } /// <summary> /// Reads the specified engine metric. /// </summary> /// <param name="metric">The metric to read.</param> /// <returns>[Optional] value of the metric. Null if the metric is not defined.</returns> public object GetEngineMetric(string metric) { throw new NotImplementedException(); } /// <summary> /// Obtains exception settings for the specified exception category. /// </summary> /// <param name="categoryId">The GUID used to identify the exception category</param> /// <param name="categoryConfigSection">The configuration section where exception values can be obtained.</param> /// <param name="categoryName">The name of the exception category.</param> public void GetExceptionCategorySettings(Guid categoryId, out HostConfigurationSection categoryConfigSection, out string categoryName) { throw new NotImplementedException(); } /// <summary> /// Checks if logging is enabled, and if so returns a logger object. /// /// In VS, this is wired up to read from the registry and return a logger which writes a log file to %TMP%\log-file-name. /// In VS Code, this will check if the '--engineLogging' switch is enabled, and if so return a logger that will write to the Console. /// </summary> /// <param name="enableLoggingSettingName">[Optional] In VS, the name of the settings key to check if logging is enabled. /// If not specified, this will check 'EnableLogging' in the AD7 Metrics.</param> /// <param name="logFileName">[Required] name of the log file to open if logging is enabled.</param> /// <returns>[Optional] If logging is enabled, the logging object.</returns> public HostLogger GetLogger(string enableLoggingSettingName, string logFileName) { throw new NotImplementedException(); } /// <summary> /// Read the debugger setting /// /// In VS, this is wired up to read setting value from RegistryRoot\\Debugger\\ /// </summary> /// <returns>value of the setting</returns> public T GetDebuggerConfigurationSetting<T>(string settingName, T defaultValue) { throw new NotImplementedException(); } /// <summary> /// Load the launcher that understands these options /// </summary> /// <param name="launcherTypeName">launch options type name</param> /// <returns></returns> public object GetCustomLauncher(string launcherTypeName) { throw new NotImplementedException(); } } /// <summary> /// The host logger returned from HostConfigurationStore.GetLogger. /// </summary> public sealed class HostLogger { /// <summary> /// Callback for programmatic display of log messages /// </summary> /// <param name="outputMessage"></param> public delegate void OutputCallback(string outputMessage); private HostLogger() { throw new NotImplementedException(); } /// <summary> /// Writes a line to the log /// </summary> /// <param name="line">Line to write.</param> public void WriteLine(string line) { throw new NotImplementedException(); } /// <summary> /// If the log is implemented as a file, this flushes the file. /// </summary> public void Flush() { throw new NotImplementedException(); } /// <summary> /// If the log is implemented as a file, this closes the file. /// </summary> public void Close() { throw new NotImplementedException(); } /// <summary> /// Get a logger after the user has explicitly configured a log file/callback /// </summary> /// <param name="logFileName"></param> /// <param name="callback"></param> /// <returns>The host logger object</returns> public static HostLogger GetLoggerFromCmd(string logFileName, HostLogger.OutputCallback callback) { throw new NotImplementedException(); } } /// <summary> /// Provides support for loading dependent assemblies using information from the configuration store. /// </summary> public static class HostLoader { /// <summary> /// Looks up the specified CLSID in the VS registry and loads it /// </summary> /// <param name="configStore">Registry root to lookup the type</param> /// <param name="clsid">CLSID to CoCreate</param> /// <returns>[Optional] loaded object. Null if the type is not registered, or points to a type that doesn't exist</returns> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Co")] public static object VsCoCreateManagedObject(HostConfigurationStore configStore, Guid clsid) { throw new NotImplementedException(); } } /// <summary> /// This class provides marshalling helper methods to a debug engine. /// /// When run in Visual Studio, these methods deal with COM marshalling. /// /// When run in Visual Studio code, these methods are stubs to allow the AD7 API to function without COM. /// </summary> public static class HostMarshal { /// <summary> /// Registers the specified code context if it isn't already registered and returns an IntPtr that can be /// used by the host to get back to the object. /// </summary> /// <param name="codeContext">Object to register</param> /// <returns>In VS, the IntPtr to a native COM object which can be returned to VS. In VS Code, an identifier /// that allows VS Code to get back to the object.</returns> public static IntPtr RegisterCodeContext(IDebugCodeContext2 codeContext) { throw new NotImplementedException(); } /// <summary> /// Obtains a document position interface given the specified IntPtr of the document position. /// </summary> /// <param name="documentPositionId">In VS, the IUnknown pointer to QI for a document position. In VS Code, /// the identifier for the document position</param> /// <returns>Document position object</returns> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "ForInt")] public static IDebugDocumentPosition2 GetDocumentPositionForIntPtr(IntPtr documentPositionId) { throw new NotImplementedException(); } /// <summary> /// Obtains a function position interface given the specified IntPtr of the location. /// </summary> /// <param name="locationId">In VS, the IUnknown pointer to QI for a function position. In VS Code, /// the identifier for the function position</param> /// <returns>Function position object</returns> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "ForInt")] public static IDebugFunctionPosition2 GetDebugFunctionPositionForIntPtr(IntPtr locationId) { throw new NotImplementedException(); } /// <summary> /// Obtain the string expression from the bpLocation union for a BPLT_DATA_STRING breakpoint. /// </summary> /// <param name="stringId"></param> /// <returns></returns> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "ForInt")] public static string GetDataBreakpointStringForIntPtr(IntPtr stringId) { throw new NotImplementedException(); } /// <summary> /// Return the string form of the address of a bound data breakpoint /// </summary> /// <param name="address">address string</param> /// <returns>IntPtr to a BSTR which can be returned to VS.</returns> public static IntPtr GetIntPtrForDataBreakpointAddress(string address) { throw new NotImplementedException(); } /// <summary> /// Obtains a code context interface given the specified IntPtr of the location. /// </summary> /// <param name="contextId">In VS, the IUnknown pointer to QI for a code context. In VS Code, /// the identifier for the code context</param> /// <returns>code context object</returns> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "ForInt")] public static IDebugCodeContext2 GetDebugCodeContextForIntPtr(IntPtr contextId) { throw new NotImplementedException(); } /// <summary> /// Obtains an event callback interface that can be used to send events on any threads /// </summary> /// <param name="ad7Callback">The underlying event call back which was obtained from the port</param> /// <returns>In VS, a thread-safe wrapper on top of the underlying SDM event callback which allows /// sending events on any thread. In VS Code, this just returns the provided ad7Callback. </returns> public static IDebugEventCallback2 GetThreadSafeEventCallback(IDebugEventCallback2 ad7Callback) { throw new NotImplementedException(); } } /// <summary> /// Provides interactions with the host's source workspace to locate and load any natvis files /// in the project. /// </summary> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Natvis")] public static class HostNatvisProject { /// <summary> /// Delegate which is fired to process a natvis file. /// </summary> /// <param name="path"></param> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Natvis")] public delegate void NatvisLoader(string path); /// <summary> /// Searches the solution for natvis files, invoking the loader on any which are found. /// </summary> /// <param name="loader">Natvis loader method to invoke</param> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Natvis")] public static void FindNatvisInSolution(NatvisLoader loader) { throw new NotImplementedException(); } } /// <summary> /// Provides interactions with the host's debugger /// </summary> public static class HostDebugger { /// <summary> /// Ask the host to async spin up a new instance of the debug engine and go through the launch sequence using the specified options /// </summary> public static void StartDebugChildProcess(string filePath, string options, Guid engineId) { throw new NotImplementedException(); } } /// <summary> /// Provides direct access to the underlying output window without going through debug events /// </summary> public static class HostOutputWindow { /// <summary> /// Write text to the Debug VS Output window pane directly. This is used to write information before the session create event. /// </summary> /// <param name="outputMessage">Message to write</param> public static void WriteLaunchError(string outputMessage) { throw new NotImplementedException(); } } /// <summary> /// Provides an optional wait dialog to allow long running operations to be canceled. In VS Code, /// this is currently stubbed out to do nothing. /// </summary> public sealed class HostWaitDialog : IDisposable { /// <summary> /// Construct a new instance of the HostWaitDialog class /// </summary> /// <param name="format">Format string used to create the wait dialog's body along with the 'item' argument to ShowWaitDialog.</param> /// <param name="caption">Caption of the dialog</param> public HostWaitDialog(string format, string caption) { throw new NotImplementedException(); } /// <summary> /// Updates the wait dialog for a new item. /// </summary> /// <param name="item">Item argument to when formatting the format string to create the wait dialog text.</param> public void ShowWaitDialog(string item) { throw new NotImplementedException(); } /// <summary> /// Ends the wait dialog /// </summary> public void EndWaitDialog() { throw new NotImplementedException(); } /// <summary> /// Ends the wait dialog /// </summary> public void Dispose() { EndWaitDialog(); } } /// <summary> /// Provides an abstraction over a wait loop that shows a dialog. In VS Code, this is currently /// stubbed out to wait without a dialog. /// </summary> public sealed class HostWaitLoop { /// <summary> /// Constructs a new HostWaitLoop /// </summary> /// <param name="message">The text of the wait dialog</param> public HostWaitLoop(string message) { throw new NotImplementedException(); } /// <summary> /// Sets the text of the dialog without changing the progress. /// </summary> /// <param name="text">Text to set.</param> public void SetText(string text) { throw new NotImplementedException(); } /// <summary> /// Wait for the specified handle to be signaled. /// </summary> /// <param name="handle">Handle to wait on.</param> /// <param name="cancellationSource">Cancellation token source to cancel if the user hits the cancel button.</param> public void Wait(WaitHandle handle, CancellationTokenSource cancellationSource) { throw new NotImplementedException(); } /// <summary> /// Updates the progress of the dialog /// </summary> /// <param name="totalSteps">New total number of steps.</param> /// <param name="currentStep">The step that is currently finished.</param> /// <param name="progressText">Text describing the current progress.</param> public void SetProgress(int totalSteps, int currentStep, string progressText) { throw new NotImplementedException(); } } /// <summary> /// Static class providing telemetry reporting services to debug engines. Telemetry /// reports go to Microsoft, and so in general this functionality should not be used /// by non-Microsoft implemented debug engines. /// </summary> public static class HostTelemetry { /// <summary> /// Reports a telemetry event to Microsoft. This method is a nop in non-lab configurations. /// </summary> /// <param name="eventName">Name of the event. This should generally start with the /// prefix 'VS/Diagnostics/Debugger/'</param> /// <param name="eventProperties">0 or more properties of the event. Property names /// should generally start with the prefix 'VS.Diagnostics.Debugger.'</param> [Conditional("LAB")] public static void SendEvent(string eventName, params KeyValuePair<string, object>[] eventProperties) { throw new NotImplementedException(); } /// <summary> /// Reports the current exception to Microsoft's telemetry service. /// /// *NOTE*: This should only be called from a 'catch(...) when' handler. /// </summary> /// <param name="currentException">Exception object to report.</param> /// <param name="engineName">Name of the engine reporting the exception. Ex:Microsoft.MIEngine</param> public static void ReportCurrentException(Exception currentException, string engineName) { throw new NotImplementedException(); } } }
rajkumar42/MIEngine
src/DebugEngineHost.Stub/DebugEngineHost.ref.cs
C#
mit
21,657
<!DOCTYPE html> <html lang="zh"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Toa | A pithy and powerful web framework</title> <meta charset="utf-8"> <meta name="keywords" content="toa, web, app, http, application, framework, thunk, thunks"> <meta name="description" content="A pithy and powerful web framework."> <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="HandheldFriendly" content="true"> <link rel="stylesheet" href="static/css/lib.fff14453.css"/> <link rel="stylesheet" href="static/css/app.47bfeea6.css"/> </head> <body> <div class="page-index"> <section class="heading" id="heading"> <div class="logo">TOA</div> <p class="desc">A pithy and powerful web framework</p> <a href="https://github.com/toajs/toa" target="_blank" class="btn btn-lg btn-info main-handler"> Get TOA </a> </section> <section class="navbar navbar-default site-header"> <div class="container"> <div class="navbar-header"> <div class="clearfix"> <ul class="nav navbar-nav"> <li class="nav-handler"> <a href="#introduction" title="">Introduction</a> </li> <li class="nav-handler"> <a href="#get-started" title="">Get started</a> </li> <li class="nav-handler dropdown"> <a class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="#doc-application">Application</a></li> <li><a href="#doc-context">Context</a></li> <li><a href="#doc-request">Resuest</a></li> <li><a href="#doc-response">Response</a></li> </ul> </li> <li class="nav-handler"> <a href="#resources" title="">Resources</a> </li> <li class="nav-handler"> <a href="#thanks" title="">Thanks</a> </li> </ul> <ul class="nav navbar-nav more-handlers pull-right"> <li class="nav-handler with-icon dropdown"> <a class="dropdown-toggle" data-toggle="dropdown"> <i class="mdi-navigation-more-vert"></i> </a> <ul class="dropdown-menu"> <li><a class="cant-click">Follow author</a></li> <li class="divider"></li> <li><a href="https://github.com/zensh" target="_blank">On Github</a></li> <li><a href="http://weibo.com/zensh" target="_blank">On Weibo</a></li> </ul> </li> </div> </div> <div class="github-star-handler" title="Star on Github"> <a href="https://github.com/toajs/toa" target="_blank" class="btn btn-fab btn-info"> <i class="mdi-action-grade"></i> </a> </div> </div> </section> <section class="introduction" id="introduction"> <div class="container"> <div class="card"> <div class="card-main"> <div class="row features"> <div class="col-sm-4"> <div class="sub-card"> <div class="sub-card-header"> <div class="intro-icon icon-quick-start"></div> </div> <h3>快速上手</h3> <p><strong>Toa</strong> 与 <strong>Koa</strong> 学习成本和编程体验是一致的,两者之间几乎是无缝切换</p> </div> </div> <div class="col-sm-4"> <div class="sub-card"> <div class="sub-card-header"> <div class="intro-icon icon-thunks"></div> </div> <h3>基于 Thunks</h3> <p>由 Thunks 组合业务逻辑,用同步逻辑编写非阻塞的异步程序和异常处理</p> </div> </div> <div class="col-sm-4"> <div class="sub-card"> <div class="sub-card-header"> <div class="intro-icon icon-modularize"></div> </div> <h3>模块化</h3> <p>弱化中间件,强化模块化组件,使得编写大型应用的结构逻辑更清晰,也更安全</p> </div> </div> </div> </div> </div> </div> </section> <svg id="get-started-gap" xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100" viewBox="0 0 100 100" preserveAspectRatio="none"> <path d="M0 100 C 20 0 50 0 100 100 Z"></path> </svg> <section class="get-started" id="get-started"> <div class="container"> <div class="card"> <div class="card-header with-border"> <h2>Get started</h2> </div> <div class="card-main"> <h3>"Hello world" snippet</h3> <pre><code class="language-js"><span class="hljs-keyword">const</span> Toa = <span class="hljs-built_in">require</span>(<span class="hljs-string">'toa'</span>) <span class="hljs-keyword">const</span> app = <span class="hljs-number">new</span> Toa() app.use(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params"> ()</span> </span>{ <span class="hljs-keyword">this</span>.body = <span class="hljs-string">'Hello World!\n-- toa'</span> }) app.listen(<span class="hljs-number">3100</span>, <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params"> ()</span> </span>{ <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'\n'</span>, <span class="hljs-string">'listening on port'</span>, <span class="hljs-number">3100</span>, <span class="hljs-string">'in dev env'</span>) }) </code></pre> <h3>Install Toa & startup Toa</h3> <div class="app-frame terminal-window"> <header> <div class="button red"></div><div class="button yellow"></div><div class="button green"></div> <span class="title">Terminal</span> </header> <section class="frame-main terminal-main"> <div class="history"></div> $&nbsp;<span class="prompt"></span> <span class="typed-cursor"></span> </section> </div> <div class="app-frame-data terminal-data run-output"> <br>&nbsp; <span>&nbsp;&nbsp;listening on port <span class="orange">3100</span> in <span class="green">dev env</span></span> <br>&nbsp; </div> </div> </div> </div> </section> <section class="documentation" id="documentation"> <div class="card"> <div class="card-header with-border"> <h2>Documentation</h2> </div> <div class="card-main"> <div class="readable"> <h1>Toa</h1> <p>简洁而强大的 web 框架。</p> <h2>Thanks to <a href="https://github.com/koajs/koa">Koa</a> and it’s authors</h2> <h2 id="doc-summary">Summary</h2> <ul> <li><a href="#toa">Toa 简介</a></li> <li><a href="#application">Application 应用</a></li> <li><a href="#context">Context 对象</a></li> <li><a href="#request">Request 对象</a></li> <li><a href="#response">Response 对象</a></li> </ul> <h2>Toa 简介</h2> <p><strong>Toa</strong> 修改自 <strong>Koa</strong>,基本架构原理与 <strong>Koa</strong> 相似,<code>context</code>、<code>request</code>、<code>response</code> 三大基础对象几乎一样。</p> <p><strong>Toa</strong> 是基于 <a href="https://github.com/thunks/thunks">thunks</a> 组合业务逻辑,来实现异步流程控制和异常处理。<code>thunks</code> 是一个比 <code>co</code> 更强大的异步流程控制工具,支持所有形式的异步控制,包括 callback,promise,generator,async/await 等。</p> <p><strong>Toa</strong> 支持 <code>Node.js v0.12</code> 以上,但在高版本中将有更好的体验和性能,如 <code>&gt;=v4</code> 的版本支持 generator 函数,<code>&gt;=v7</code> 的版本支持 async/await 函数,这些特性支持<strong>用同步逻辑编写非阻塞的异步程序</strong>。</p> <p><strong>Toa</strong> 与 <strong>Koa</strong> 学习成本和编程体验是一致的,两者之间几乎是无缝切换。但 <strong>Toa</strong> 去掉了 <strong>Koa</strong> 的 <code>级联(Cascading)</code> 逻辑,强化中间件,尽量削弱第三方组件访问应用的能力,使得编写大型应用的结构逻辑更简洁明了,也更安全。</p> <h3>安装 Toa</h3> <pre><code class="language-sh">npm install toa </code></pre> <h2 id="doc-application">Application</h2> <p>一个 Toa Application(以下简称 <strong>app</strong>)由一系列 <strong>中间件</strong> 组成。<strong>中间件</strong> 是指通过 <code>app.use</code> 加载的同步函数、thunk 函数、generator 函数或 async/await 函数。</p> <p>对于 web server 的一次访问请求,app 会按照顺序先运行中间件,然后再运行业务逻辑中 <code>context.after(hook)</code> 动态添加的 hooks,最后运行内置的 <code>respond</code> 函数,将请求结果自动响应的客户端。由于 Toa 没有 <code>级联(Cascading)</code>,这些中间件或模块的运行不会有任何交叉,它们总是先运行完一个,再运行下一个。</p> <p>Toa 只有一个极简的内核,提供快捷的 HTTP 操作和异步流程控制能力。具体的业务功能逻辑则由中间件和模块组合实现。用户则可根据自己的业务需求,以最轻量级的方式组合自己的应用。</p> <p>让我们来看看 Toa 极其简单的 Hello World 应用程序:</p> <pre><code class="language-js"><span class="hljs-keyword">const</span> Toa = <span class="hljs-built_in">require</span>(<span class="hljs-string">'toa'</span>) <span class="hljs-keyword">const</span> app = <span class="hljs-keyword">new</span> Toa() app.use(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{ <span class="hljs-keyword">this</span>.body = <span class="hljs-string">'Hello World!\n-- toa'</span> }) app.listen(<span class="hljs-number">3000</span>) </code></pre> <h3>Class: Toa()</h3> <h3>Class: Toa(server)</h3> <h3>Class: Toa(options)</h3> <h3>Class: Toa(onerror)</h3> <h3>Class: Toa(server, options)</h3> <ul> <li><code>server</code>: {Object}, http server 或 https server 实例。</li> <li><code>options</code>: {Object} 类似 <code>thunks</code> 的 options,对于 server 的每一个 <strong>client request</strong>,toa app 均会用 <code>thunks</code> 生成一个的 <code>thunk</code>,挂载到 <code>context.thunk</code>,该 <code>thunk</code> 的作用域对该 <strong>client request</strong> 的整个生命周期生效。 <ul> <li><code>options.onerror</code>: {Function} 其 <code>this</code> 为 <strong>client request</strong> 的 <code>context</code> 对象。当 <strong>client request</strong> 处理流程出现异常时,会抛出到 <code>onerror</code>,原有处理流程会终止,<code>onerror</code> 运行完毕后再进入 toa 内置的异常处理流程,最后 <code>respond</code> 客户端。如果 <code>onerror</code> 返回 <code>true</code>,则会忽略该异常,异常不会进入内置异常处理流程,然后直接 <code>respond</code> 客户端。</li> </ul></li> </ul> <pre><code class="language-js"><span class="hljs-comment">// with full arguments</span> <span class="hljs-keyword">const</span> app = <span class="hljs-keyword">new</span> Toa(server, { <span class="hljs-attr">onerror</span>: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">error</span>) </span>{} }) </code></pre> <h4>app.keys = ['key1’, ‘key2’]</h4> <p>设置 cookie 签名密钥,参考 <a href="https://github.com/expressjs/keygrip">Keygrip</a>。<br> 注意,签名密钥只在配置项 <code>signed</code> 参数为真时才会生效:</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.cookies.set(<span class="hljs-string">'name'</span>, <span class="hljs-string">'test'</span>, {<span class="hljs-attr">signed</span>: <span class="hljs-literal">true</span>}) </code></pre> <h4>app.config = config</h4> <p>config 会被 <code>context.config</code> 继承,但 <code>context.config</code> 不会修改 <code>app.config</code>。</p> <pre><code class="language-js">app.config = config </code></pre> <p>app.config 默认值:</p> <pre><code class="language-js">{ <span class="hljs-attr">proxy</span>: <span class="hljs-literal">false</span>, <span class="hljs-comment">// 决定了哪些 `proxy header` 参数会被加到信任列表中</span> env: process.env.NODE_ENV || <span class="hljs-string">'development'</span>, <span class="hljs-comment">// node 执行环境</span> subdomainOffset: <span class="hljs-number">2</span>, <span class="hljs-attr">poweredBy</span>: <span class="hljs-string">'Toa'</span> } </code></pre> <h4>app.use(function () {})</h4> <h4>app.use(function (callback) {})</h4> <h4>app.use(function * () {})</h4> <h4>app.use(async function () {})</h4> <p>加载中间件,返回 <code>app</code>,<code>fn</code> 必须是 <code>thunk</code> 函数或 <code>generator</code> 函数,函数中的 <code>this</code> 值为 <code>context</code>。</p> <pre><code class="language-js">app.use(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">callback</span>) </span>{ <span class="hljs-comment">// task</span> <span class="hljs-comment">// this === context</span> callback(err, result) }) </code></pre> <pre><code class="language-js">app.use(<span class="hljs-function"><span class="hljs-keyword">function</span> * (<span class="hljs-params"></span>) </span>{ <span class="hljs-comment">// task</span> <span class="hljs-comment">// this === context</span> <span class="hljs-keyword">yield</span> result }) </code></pre> <h4>app.onerror = function (error) {}</h4> <p>设置 <code>onerror</code> 函数,当 app 捕捉到程序运行期间的错误时,会先使用 <code>options.onerror</code>(若提供)处理,再使用内置的 <code>onResError</code> 函数处理响应给客户端,最后抛出给 <code>app.onerror</code> 处理,应用通常可以在这里判断错误类型,根据情况将错误写入日志系统。</p> <pre><code class="language-js"><span class="hljs-comment">// default</span> app.onerror = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">err</span>) </span>{ <span class="hljs-comment">// ignore null and response error</span> <span class="hljs-keyword">if</span> (err == <span class="hljs-literal">null</span> || (err.status &amp;&amp; err.status &lt; <span class="hljs-number">500</span>)) <span class="hljs-keyword">return</span> <span class="hljs-keyword">if</span> (!util.isError(err)) err = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(<span class="hljs-string">'non-error thrown: '</span> + err) <span class="hljs-comment">// catch system error</span> <span class="hljs-keyword">let</span> msg = err.stack || err.toString() <span class="hljs-built_in">console</span>.error(msg.replace(<span class="hljs-regexp">/^/gm</span>, <span class="hljs-string">' '</span>)) } </code></pre> <h4>app.toListener()</h4> <p>返回 app request listener。</p> <pre><code class="language-js"><span class="hljs-keyword">const</span> http = <span class="hljs-built_in">require</span>(<span class="hljs-string">'http'</span>) <span class="hljs-keyword">const</span> toa = <span class="hljs-built_in">require</span>(<span class="hljs-string">'toa'</span>) <span class="hljs-keyword">const</span> app = toa() <span class="hljs-keyword">const</span> server = http.createServer(app.toListener()) server.listen(<span class="hljs-number">3000</span>) </code></pre> <p>等效于:</p> <pre><code class="language-js"><span class="hljs-keyword">const</span> toa = <span class="hljs-built_in">require</span>(<span class="hljs-string">'toa'</span>) <span class="hljs-keyword">const</span> app = toa() app.listen(<span class="hljs-number">3000</span>) </code></pre> <h4>app.listen(port, [hostname], [backlog], [callback])</h4> <h4>app.listen(path, [callback])</h4> <h4>app.listen(handle, [callback])</h4> <p>返回 <code>server</code>,用法与 <code>httpServer.listen</code> 一致。</p> <pre><code class="language-js"><span class="hljs-comment">// 与 httpServer.listen 一致</span> app.listen(<span class="hljs-number">3000</span>) </code></pre> <hr> <h2 id="doc-context">Context</h2> <p>Similar to <a href="https://github.com/koajs/koa/blob/master/docs/api/context.md">Koa’s Context</a></p> <h3>Difference from Koa</h3> <ul> <li>remove <code>ctx.app</code></li> <li>add <code>ctx.thunk</code> method, it is thunk function that bound a scope with <code>onerror</code>.</li> <li>add <code>ctx.end</code> method, use to stopping request process and respond immediately.</li> <li>add <code>ctx.after</code> method, use to add hooks that run after middlewares and before respond.</li> <li>add <code>ctx.catchStream</code> method, used to catch stream’s error or clean stream when some error.</li> <li>add <code>ctx.ended</code> property, indicates that the response ended.</li> <li>add <code>ctx.finished</code> property, indicates that the response finished successfully.</li> <li>add <code>ctx.closed</code> property, indicates that the response closed unexpectedly.</li> <li>context is a <code>EventEmitter</code> instance</li> </ul> <p><code>Context</code> object encapsulates node’s <code>request</code> and <code>response</code> objects into a single object which provides many helpful methods for writing web applications and APIs. These operations are used so frequently in HTTP server development that they are added at this level instead of a higher level framework, which would force middleware to re-implement this common functionality.</p> <p>A <code>Context</code> is created <em>per</em> request, and is referenced in middleware as the receiver, or the <code>this</code> identifier, as shown in the following snippet:</p> <pre><code class="language-js"><span class="hljs-keyword">const</span> app = Toa(<span class="hljs-function"><span class="hljs-keyword">function</span> * (<span class="hljs-params"></span>) </span>{ <span class="hljs-keyword">this</span> <span class="hljs-comment">// is the Context</span> <span class="hljs-keyword">this</span>.request <span class="hljs-comment">// is a toa Request</span> <span class="hljs-keyword">this</span>.response <span class="hljs-comment">// is a toa Response</span> }) app.use(<span class="hljs-function"><span class="hljs-keyword">function</span> * (<span class="hljs-params"></span>) </span>{ <span class="hljs-keyword">this</span> <span class="hljs-comment">// is the Context</span> <span class="hljs-keyword">this</span>.request <span class="hljs-comment">// is a toa Request</span> <span class="hljs-keyword">this</span>.response <span class="hljs-comment">// is a toa Response</span> }) </code></pre> <p>Many of the context’s accessors and methods simply delegate to their <code>ctx.request</code> or <code>ctx.response</code> equivalents for convenience, and are otherwise identical. For example <code>ctx.type</code> and <code>ctx.length</code> delegate to the <code>response</code> object, and <code>ctx.path</code> and <code>ctx.method</code> delegate to the <code>request</code>.</p> <h3>Events</h3> <h4>‘close’</h4> <p>Emitted after a HTTP request closed, indicates that the socket has been closed, and <code>context.closed</code> will be <code>true</code>.</p> <h4>‘end’</h4> <p>Emitted after respond() was called, indicates that body was sent. and <code>context.ended</code> will be <code>true</code></p> <h4>‘finish’</h4> <p>Emitted after a HTTP response finished. and <code>context.finished</code> will be <code>true</code>.</p> <h4>‘error’</h4> <p>A context always listen <code>'error'</code> event by <code>ctx.onerror</code>. <code>ctx.onerror</code> is a <strong>immutable</strong> error handle. So you can use <code>ctx.emit('error', error)</code> to deal with your exception or error.</p> <h3>API</h3> <p><code>Context</code> specific methods and accessors.</p> <h4>ctx.thunk([thunkable])</h4> <p>A thunk function that bound a scope.</p> <ul> <li><code>thunkable</code> thunkable value, see: <a href="https://github.com/thunks/thunks">https://github.com/thunks/thunks</a></li> </ul> <h4>ctx.end([message])</h4> <p>Use to stopping request process and respond immediately. <strong>It should not run in <code>try catch</code> block, otherwise <code>onstop</code> will not be trigger</strong>.</p> <ul> <li><code>message</code> String, see: <a href="https://github.com/thunks/thunks">https://github.com/thunks/thunks</a></li> </ul> <h4>ctx.after(function () {})</h4> <h4>ctx.after(function (callback) {})</h4> <h4>ctx.after(function * () {})</h4> <h4>ctx.after(async function () {})</h4> <p>Add hooks dynamicly. Hooks will be executed in LIFO order after middlewares, but before <code>respond</code>.</p> <h4>ctx.req</h4> <p>Node’s <code>request</code> object.</p> <h4>ctx.res</h4> <p>Node’s <code>response</code> object.</p> <p>Bypassing Toa’s response handling is <strong>not supported</strong>. Avoid using the following node properties:</p> <ul> <li><code>res.statusCode</code></li> <li><code>res.writeHead()</code></li> <li><code>res.write()</code></li> <li><code>res.end()</code></li> </ul> <h4>ctx.request</h4> <p>A Toa <code>Request</code> object.</p> <h4>ctx.response</h4> <p>A Toa <code>Response</code> object.</p> <h4>ctx.state</h4> <p>The recommended namespace for passing information through middleware and to your frontend views.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.state.user = <span class="hljs-keyword">yield</span> User.find(id) </code></pre> <h4>ctx.cookies.get(name, [options])</h4> <p>Get cookie <code>name</code> with <code>options</code>:</p> <ul> <li><code>signed</code> the cookie requested should be signed</li> </ul> <p>Toa uses the <a href="https://github.com/jed/cookies">cookies</a> module where options are simply passed.</p> <h4>ctx.cookies.set(name, value, [options])</h4> <p>Set cookie <code>name</code> to <code>value</code> with <code>options</code>:</p> <ul> <li><code>signed</code> sign the cookie value</li> <li><code>expires</code> a <code>Date</code> for cookie expiration</li> <li><code>path</code> cookie path, <code>/'</code> by default</li> <li><code>domain</code> cookie domain</li> <li><code>secure</code> secure cookie</li> <li><code>httpOnly</code> server-accessible cookie, <strong>true</strong> by default</li> </ul> <p>Toa uses the <a href="https://github.com/jed/cookies">cookies</a> module where options are simply passed.</p> <h4>ctx.throw([msg], [status], [properties])</h4> <p>Helper method to throw an error with a <code>.status</code> property defaulting to <code>500</code> that will allow Toa to respond appropriately. The following combinations are allowed:</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.throw(<span class="hljs-number">403</span>) <span class="hljs-keyword">this</span>.throw(<span class="hljs-string">'name required'</span>, <span class="hljs-number">400</span>) <span class="hljs-keyword">this</span>.throw(<span class="hljs-number">400</span>, <span class="hljs-string">'name required'</span>) <span class="hljs-keyword">this</span>.throw(<span class="hljs-string">'something exploded'</span>) </code></pre> <p>For example <code>this.throw('name required', 400)</code> is equivalent to:</p> <pre><code class="language-js"><span class="hljs-keyword">let</span> err = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(<span class="hljs-string">'name required'</span>) err.status = <span class="hljs-number">400</span> <span class="hljs-keyword">throw</span> err </code></pre> <p>Note that these are user-level errors and are flagged with <code>err.expose</code> meaning the messages are appropriate for client responses, which is typically not the case for error messages since you do not want to leak failure details.</p> <p>You may optionally pass a <code>properties</code> object which is merged into the error as-is, useful for decorating machine-friendly errors which are reported to the requester upstream.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.throw(<span class="hljs-number">401</span>, <span class="hljs-string">'access_denied'</span>, {<span class="hljs-attr">user</span>: user}) <span class="hljs-keyword">this</span>.throw(<span class="hljs-string">'access_denied'</span>, {<span class="hljs-attr">user</span>: user}) </code></pre> <p>Toa uses <a href="https://github.com/jshttp/http-errors">http-errors</a> to create errors.</p> <h4>ctx.createError([status], [msg], [properties])</h4> <p>Similar to <code>ctx.throw</code>, create a error object, but don’t throw.</p> <h4>ctx.assert(value, [status], [msg], [properties])</h4> <p>Helper method to throw an error similar to <code>.throw()</code> when <code>!value</code>. Similar to node’s <a href="http://nodejs.org/api/assert.html">assert()</a> method.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.assert(<span class="hljs-keyword">this</span>.state.user, <span class="hljs-number">401</span>, <span class="hljs-string">'User not found. Please login!'</span>) </code></pre> <p>Toa uses <a href="https://github.com/jshttp/http-assert">http-assert</a> for assertions.</p> <h4>ctx.respond</h4> <p>To bypass Toa’s built-in response handling, you may explicitly set <code>this.respond = false</code>. Use this if you want to write to the raw <code>res</code> object instead of letting Toa handle the response for you.</p> <p>Note that using this is <strong>not</strong> supported by Toa. This may break intended functionality of Toa middleware and Toa itself. Using this property is considered a hack and is only a convenience to those wishing to use traditional <code>fn(req, res)</code> functions and middleware within Toa.</p> <h4>ctx.catchStream(stream)</h4> <p>Catch a <code>stream</code>'s error, if ‘error’ event emit from the stream, the error will be throw to Thunk’s <code>onerror</code> and response it.</p> <h3>Request aliases</h3> <p>The following accessors and alias <a href="request.md">Request</a> equivalents:</p> <ul> <li><code>ctx.header</code></li> <li><code>ctx.headers</code></li> <li><code>ctx.method</code></li> <li><code>ctx.method=</code></li> <li><code>ctx.url</code></li> <li><code>ctx.url=</code></li> <li><code>ctx.origin</code></li> <li><code>ctx.originalUrl</code></li> <li><code>ctx.href</code></li> <li><code>ctx.path</code></li> <li><code>ctx.path=</code></li> <li><code>ctx.query</code></li> <li><code>ctx.query=</code></li> <li><code>ctx.querystring</code></li> <li><code>ctx.querystring=</code></li> <li><code>ctx.host</code></li> <li><code>ctx.hostname</code></li> <li><code>ctx.fresh</code></li> <li><code>ctx.stale</code></li> <li><code>ctx.socket</code></li> <li><code>ctx.protocol</code></li> <li><code>ctx.secure</code></li> <li><code>ctx.ip</code></li> <li><code>ctx.ips</code></li> <li><code>ctx.idempotent</code></li> <li><code>ctx.subdomains</code></li> <li><code>ctx.is()</code></li> <li><code>ctx.accepts()</code></li> <li><code>ctx.acceptsEncodings()</code></li> <li><code>ctx.acceptsCharsets()</code></li> <li><code>ctx.acceptsLanguages()</code></li> <li><code>ctx.get()</code></li> <li><code>ctx.search()</code></li> </ul> <h3>Response aliases</h3> <p>The following accessors and alias <a href="response.md">Response</a> equivalents:</p> <ul> <li><code>ctx.body</code></li> <li><code>ctx.body=</code></li> <li><code>ctx.status</code></li> <li><code>ctx.status=</code></li> <li><code>ctx.message</code></li> <li><code>ctx.message=</code></li> <li><code>ctx.length=</code></li> <li><code>ctx.length</code></li> <li><code>ctx.type=</code></li> <li><code>ctx.type</code></li> <li><code>ctx.headerSent</code></li> <li><code>ctx.redirect()</code></li> <li><code>ctx.attachment()</code></li> <li><code>ctx.set()</code></li> <li><code>ctx.append()</code></li> <li><code>ctx.remove()</code></li> <li><code>ctx.vary()</code></li> <li><code>ctx.lastModified=</code></li> <li><code>ctx.etag=</code></li> </ul> <hr> <h2 id="doc-request">Request</h2> <p>The same as <a href="https://github.com/koajs/koa/blob/master/docs/api/request.md">Koa’s Request</a></p> <p><code>Request</code> object is an abstraction on top of node’s vanilla request object, providing additional functionality that is useful for every day HTTP server development.</p> <h3>API</h3> <h4>request.header</h4> <p>Request header object.</p> <h4>request.headers</h4> <p>Request header object. Alias as <code>request.header</code>.</p> <h4>request.method</h4> <p>Request method.</p> <h4>request.method=</h4> <p>Set request method, useful for implementing middleware such as <code>methodOverride()</code>.</p> <h4>request.length</h4> <p>Return request Content-Length as a number when present, or <code>undefined</code>.</p> <h4>request.url</h4> <p>Get request URL.</p> <h4>request.url=</h4> <p>Set request URL, useful for url rewrites.</p> <h4>request.origin</h4> <p>Get origin of URL.</p> <h4>request.originalUrl</h4> <p>Get request original URL.</p> <h4>request.href</h4> <p>Get full request URL, include <code>protocol</code>, <code>host</code> and <code>url</code>.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.request.href <span class="hljs-comment">// =&gt; http://example.com/foo/bar?q=1</span> </code></pre> <h4>request.path</h4> <p>Get request pathname.</p> <h4>request.path=</h4> <p>Set request pathname and retain query-string when present.</p> <h4>request.querystring</h4> <p>Get raw query string void of <code>?</code>.</p> <h4>request.querystring=</h4> <p>Set raw query string.</p> <h4>request.search</h4> <p>Get raw query string with the <code>?</code>.</p> <h4>request.search=</h4> <p>Set raw query string.</p> <h4>request.host</h4> <p>Get host (hostname:port) when present. Supports <code>X-Forwarded-Host</code> when <code>app.proxy</code> is <strong>true</strong>, otherwise <code>Host</code> is used.</p> <h4>request.hostname</h4> <p>Get hostname when present. Supports <code>X-Forwarded-Host</code> when <code>app.proxy</code> is <strong>true</strong>, otherwise <code>Host</code> is used.</p> <h4>request.type</h4> <p>Get request <code>Content-Type</code> void of parameters such as &quot;charset&quot;.</p> <pre><code class="language-js"><span class="hljs-keyword">let</span> ct = <span class="hljs-keyword">this</span>.request.type <span class="hljs-comment">// =&gt; "image/png"</span> </code></pre> <h4>request.charset</h4> <p>Get request charset when present, or <code>undefined</code>:</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.request.charset <span class="hljs-comment">// =&gt; "utf-8"</span> </code></pre> <h4>request.query</h4> <p>Get parsed query-string, returning an empty object when no query-string is present. Note that this getter does <em>not</em> support nested parsing.</p> <p>For example &quot;color=blue&amp;size=small&quot;:</p> <pre><code class="language-js">{ <span class="hljs-attr">color</span>: <span class="hljs-string">'blue'</span>, <span class="hljs-attr">size</span>: <span class="hljs-string">'small'</span> } </code></pre> <h4>request.query=</h4> <p>Set query-string to the given object. Note that this setter does <em>not</em> support nested objects.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.query = {<span class="hljs-attr">next</span>: <span class="hljs-string">'/login'</span>} </code></pre> <h4>request.fresh</h4> <p>Check if a request cache is &quot;fresh&quot;, aka the contents have not changed. This method is for cache negotiation between <code>If-None-Match</code> / <code>ETag</code>, and <code>If-Modified-Since</code> and <code>Last-Modified</code>. It should be referenced after setting one or more of these response headers.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.status = <span class="hljs-number">200</span> <span class="hljs-keyword">this</span>.set(<span class="hljs-string">'ETag'</span>, <span class="hljs-string">'123'</span>) <span class="hljs-comment">// cache is ok</span> <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.fresh) { <span class="hljs-keyword">this</span>.status = <span class="hljs-number">304</span> <span class="hljs-keyword">return</span> } <span class="hljs-comment">// cache is stale</span> <span class="hljs-comment">// fetch new data</span> <span class="hljs-keyword">this</span>.body = <span class="hljs-keyword">yield</span> db.find(<span class="hljs-string">'something'</span>) </code></pre> <h4>request.stale</h4> <p>Inverse of <code>request.fresh</code>.</p> <h4>request.protocol</h4> <p>Return request protocol, “https” or &quot;http&quot;. Supports <code>X-Forwarded-Proto</code> when <code>app.proxy</code> is <strong>true</strong>.</p> <h4>request.secure</h4> <p>Shorthand for <code>this.protocol == &quot;https&quot;</code> to check if a request was issued via TLS.</p> <h4>request.ip</h4> <p>Request remote address. Supports <code>X-Forwarded-For</code> when <code>app.proxy</code> is <strong>true</strong>.</p> <h4>request.ips</h4> <p>When <code>X-Forwarded-For</code> is present and <code>app.proxy</code> is enabled an array of these ips is returned, ordered from upstream -&gt; downstream. When disabled an empty array is returned.</p> <h4>request.subdomains</h4> <p>Return subdomains as an array.</p> <p>Subdomains are the dot-separated parts of the host before the main domain of the app. By default, the domain of the app is assumed to be the last two parts of the host. This can be changed by setting <code>app.subdomainOffset</code>.</p> <p>For example, if the domain is &quot;tobi.ferrets.example.com&quot;:</p> <p>If <code>app.subdomainOffset</code> is not set, this.subdomains is <code>[&quot;ferrets&quot;, &quot;tobi&quot;]</code>.<br> If <code>app.subdomainOffset</code> is 3, this.subdomains is <code>[&quot;tobi&quot;]</code>.</p> <h4>request.is(types...)</h4> <p>Check if the incoming request contains the “Content-Type” header field, and it contains any of the give mime <code>type</code>s. If there is no request body, <code>null</code> is returned. If there is no content type, or the match fails <code>false</code> is returned. Otherwise, it returns the matching content-type.</p> <pre><code class="language-js"><span class="hljs-comment">// With Content-Type: text/html; charset=utf-8</span> <span class="hljs-keyword">this</span>.is(<span class="hljs-string">'html'</span>) <span class="hljs-comment">// =&gt; 'html'</span> <span class="hljs-keyword">this</span>.is(<span class="hljs-string">'text/html'</span>) <span class="hljs-comment">// =&gt; 'text/html'</span> <span class="hljs-keyword">this</span>.is(<span class="hljs-string">'text/*'</span>, <span class="hljs-string">'text/html'</span>) <span class="hljs-comment">// =&gt; 'text/html'</span> <span class="hljs-comment">// When Content-Type is application/json</span> <span class="hljs-keyword">this</span>.is(<span class="hljs-string">'json'</span>, <span class="hljs-string">'urlencoded'</span>) <span class="hljs-comment">// =&gt; 'json'</span> <span class="hljs-keyword">this</span>.is(<span class="hljs-string">'application/json'</span>) <span class="hljs-comment">// =&gt; 'application/json'</span> <span class="hljs-keyword">this</span>.is(<span class="hljs-string">'html'</span>, <span class="hljs-string">'application/*'</span>) <span class="hljs-comment">// =&gt; 'application/json'</span> <span class="hljs-keyword">this</span>.is(<span class="hljs-string">'html'</span>) <span class="hljs-comment">// =&gt; false</span> </code></pre> <p>For example if you want to ensure that only images are sent to a given route:</p> <pre><code class="language-js"><span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.is(<span class="hljs-string">'image/*'</span>)) { <span class="hljs-comment">// process</span> } <span class="hljs-keyword">else</span> { <span class="hljs-keyword">this</span>.throw(<span class="hljs-number">415</span>, <span class="hljs-string">'images only!'</span>) } </code></pre> <h4>Content Negotiation</h4> <p><code>Request</code> object includes helpful content negotiation utilities powered by <a href="http://github.com/expressjs/accepts">accepts</a> and <a href="https://github.com/federomero/negotiator">negotiator</a>. These utilities are:</p> <ul> <li><code>request.accepts(types)</code></li> <li><code>request.acceptsEncodings(types)</code></li> <li><code>request.acceptsCharsets(charsets)</code></li> <li><code>request.acceptsLanguages(langs)</code></li> </ul> <p>If no types are supplied, <strong>all</strong> acceptable types are returned.</p> <p>If multiple types are supplied, the best match will be returned. If no matches are found, a <code>false</code> is returned, and you should send a <code>406 &quot;Not Acceptable&quot;</code> response to the client.</p> <p>In the case of missing accept headers where any type is acceptable, the first type will be returned. Thus, the order of types you supply is important.</p> <h4>request.accepts(types)</h4> <p>Check if the given <code>type(s)</code> is acceptable, returning the best match when true, otherwise <code>false</code>. The <code>type</code> value may be one or more mime type string such as &quot;application/json&quot;, the extension name such as &quot;json&quot;, or an array <code>[&quot;json&quot;, &quot;html&quot;, &quot;text/plain&quot;]</code>.</p> <pre><code class="language-js"><span class="hljs-comment">// Accept: text/html</span> <span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'html'</span>) <span class="hljs-comment">// =&gt; "html"</span> <span class="hljs-comment">// Accept: text/*, application/json</span> <span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'html'</span>) <span class="hljs-comment">// =&gt; "html"</span> <span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'text/html'</span>) <span class="hljs-comment">// =&gt; "text/html"</span> <span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'json'</span>, <span class="hljs-string">'text'</span>) <span class="hljs-comment">// =&gt; "json"</span> <span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'application/json'</span>) <span class="hljs-comment">// =&gt; "application/json"</span> <span class="hljs-comment">// Accept: text/*, application/json</span> <span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'image/png'</span>) <span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'png'</span>) <span class="hljs-comment">// =&gt; false</span> <span class="hljs-comment">// Accept: text/*;q=.5, application/json</span> <span class="hljs-keyword">this</span>.accepts([<span class="hljs-string">'html'</span>, <span class="hljs-string">'json'</span>]) <span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'html'</span>, <span class="hljs-string">'json'</span>) <span class="hljs-comment">// =&gt; "json"</span> <span class="hljs-comment">// No Accept header</span> <span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'html'</span>, <span class="hljs-string">'json'</span>) <span class="hljs-comment">// =&gt; "html"</span> <span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'json'</span>, <span class="hljs-string">'html'</span>) <span class="hljs-comment">// =&gt; "json"</span> </code></pre> <p>You may call <code>this.accepts()</code> as many times as you like, or use a switch:</p> <pre><code class="language-js"><span class="hljs-keyword">switch</span> (<span class="hljs-keyword">this</span>.accepts(<span class="hljs-string">'json'</span>, <span class="hljs-string">'html'</span>, <span class="hljs-string">'text'</span>)) { <span class="hljs-keyword">case</span> <span class="hljs-string">'json'</span>: <span class="hljs-keyword">break</span> <span class="hljs-keyword">case</span> <span class="hljs-string">'html'</span>: <span class="hljs-keyword">break</span> <span class="hljs-keyword">case</span> <span class="hljs-string">'text'</span>: <span class="hljs-keyword">break</span> <span class="hljs-keyword">default</span>: <span class="hljs-keyword">this</span>.throw(<span class="hljs-number">406</span>, <span class="hljs-string">'json, html, or text only'</span>) } </code></pre> <h4>request.acceptsEncodings(encodings)</h4> <p>Check if <code>encodings</code> are acceptable, returning the best match when true, otherwise <code>false</code>. Note that you should include <code>identity</code> as one of the encodings!</p> <pre><code class="language-js"><span class="hljs-comment">// Accept-Encoding: gzip</span> <span class="hljs-keyword">this</span>.acceptsEncodings(<span class="hljs-string">'gzip'</span>, <span class="hljs-string">'deflate'</span>, <span class="hljs-string">'identity'</span>) <span class="hljs-comment">// =&gt; "gzip"</span> <span class="hljs-keyword">this</span>.acceptsEncodings([<span class="hljs-string">'gzip'</span>, <span class="hljs-string">'deflate'</span>, <span class="hljs-string">'identity'</span>]) <span class="hljs-comment">// =&gt; "gzip"</span> </code></pre> <p>When no arguments are given all accepted encodings are returned as an array:</p> <pre><code class="language-js"><span class="hljs-comment">// Accept-Encoding: gzip, deflate</span> <span class="hljs-keyword">this</span>.acceptsEncodings() <span class="hljs-comment">// =&gt; ["gzip", "deflate", "identity"]</span> </code></pre> <p>Note that the <code>identity</code> encoding (which means no encoding) could be unacceptable if the client explicitly sends <code>identity;q=0</code>. Although this is an edge case, you should still handle the case where this method returns <code>false</code>.</p> <h4>request.acceptsCharsets(charsets)</h4> <p>Check if <code>charsets</code> are acceptable, returning the best match when true, otherwise <code>false</code>.</p> <pre><code class="language-js"><span class="hljs-comment">// Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5</span> <span class="hljs-keyword">this</span>.acceptsCharsets(<span class="hljs-string">'utf-8'</span>, <span class="hljs-string">'utf-7'</span>) <span class="hljs-comment">// =&gt; "utf-8"</span> <span class="hljs-keyword">this</span>.acceptsCharsets([<span class="hljs-string">'utf-7'</span>, <span class="hljs-string">'utf-8'</span>]) <span class="hljs-comment">// =&gt; "utf-8"</span> </code></pre> <p>When no arguments are given all accepted charsets are returned as an array:</p> <pre><code class="language-js"><span class="hljs-comment">// Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5</span> <span class="hljs-keyword">this</span>.acceptsCharsets() <span class="hljs-comment">// =&gt; ["utf-8", "utf-7", "iso-8859-1"]</span> </code></pre> <h4>request.acceptsLanguages(langs)</h4> <p>Check if <code>langs</code> are acceptable, returning the best match when true, otherwise <code>false</code>.</p> <pre><code class="language-js"><span class="hljs-comment">// Accept-Language: en;q=0.8, es, pt</span> <span class="hljs-keyword">this</span>.acceptsLanguages(<span class="hljs-string">'es'</span>, <span class="hljs-string">'en'</span>) <span class="hljs-comment">// =&gt; "es"</span> <span class="hljs-keyword">this</span>.acceptsLanguages([<span class="hljs-string">'en'</span>, <span class="hljs-string">'es'</span>]) <span class="hljs-comment">// =&gt; "es"</span> </code></pre> <p>When no arguments are given all accepted languages are returned as an array:</p> <pre><code class="language-js"><span class="hljs-comment">// Accept-Language: en;q=0.8, es, pt</span> <span class="hljs-keyword">this</span>.acceptsLanguages() <span class="hljs-comment">// =&gt; ["es", "pt", "en"]</span> </code></pre> <h4>request.idempotent</h4> <p>Check if the request is idempotent.</p> <h4>request.socket</h4> <p>Return the request socket.</p> <h4>request.get(field)</h4> <p>Return request header.</p> <hr> <h2 id="doc-response">Response</h2> <p>The same as <a href="https://github.com/koajs/koa/blob/master/docs/api/response.md">Koa’s Response</a></p> <p><code>Response</code> object is an abstraction on top of node’s vanilla response object, providing additional functionality that is useful for every day HTTP server development.</p> <h3>API</h3> <h4>response.header</h4> <p>Response header object.</p> <h4>response.headers</h4> <p>Response header object. Alias as <code>response.header</code>.</p> <h4>response.socket</h4> <p>Request socket.</p> <h4>response.status</h4> <p>Get response status. By default, <code>response.status</code> is not set unlike node’s <code>res.statusCode</code> which defaults to <code>200</code>.</p> <h4>response.status=</h4> <p>Set response status via numeric code:</p> <ul> <li>100 “continue”</li> <li>101 “switching protocols”</li> <li>102 “processing”</li> <li>200 “ok”</li> <li>201 “created”</li> <li>202 “accepted”</li> <li>203 “non-authoritative information”</li> <li>204 “no content”</li> <li>205 “reset content”</li> <li>206 “partial content”</li> <li>207 “multi-status”</li> <li>300 “multiple choices”</li> <li>301 “moved permanently”</li> <li>302 “moved temporarily”</li> <li>303 “see other”</li> <li>304 “not modified”</li> <li>305 “use proxy”</li> <li>307 “temporary redirect”</li> <li>400 “bad request”</li> <li>401 “unauthorized”</li> <li>402 “payment required”</li> <li>403 “forbidden”</li> <li>404 “not found”</li> <li>405 “method not allowed”</li> <li>406 “not acceptable”</li> <li>407 “proxy authentication required”</li> <li>408 “request time-out”</li> <li>409 “conflict”</li> <li>410 “gone”</li> <li>411 “length required”</li> <li>412 “precondition failed”</li> <li>413 “request entity too large”</li> <li>414 “request-uri too large”</li> <li>415 “unsupported media type”</li> <li>416 “requested range not satisfiable”</li> <li>417 “expectation failed”</li> <li>418 “i’m a teapot”</li> <li>422 “unprocessable entity”</li> <li>423 “locked”</li> <li>424 “failed dependency”</li> <li>425 “unordered collection”</li> <li>426 “upgrade required”</li> <li>428 “precondition required”</li> <li>429 “too many requests”</li> <li>431 “request header fields too large”</li> <li>500 “internal server error”</li> <li>501 “not implemented”</li> <li>502 “bad gateway”</li> <li>503 “service unavailable”</li> <li>504 “gateway time-out”</li> <li>505 “http version not supported”</li> <li>506 “variant also negotiates”</li> <li>507 “insufficient storage”</li> <li>509 “bandwidth limit exceeded”</li> <li>510 “not extended”</li> <li>511 “network authentication required”</li> </ul> <p><strong>NOTE</strong>: don’t worry too much about memorizing these strings,<br> if you have a typo an error will be thrown, displaying this list<br> so you can make a correction.</p> <h4>response.message</h4> <p>Get response status message. By default, <code>response.message</code> is associated with <code>response.status</code>.</p> <h4>response.message=</h4> <p>Set response status message to the given value.</p> <h4>response.length=</h4> <p>Set response Content-Length to the given value.</p> <h4>response.length</h4> <p>Return response Content-Length as a number when present, or deduce from <code>this.body</code> when possible, or <code>undefined</code>.</p> <h4>response.body</h4> <p>Get response body.</p> <h4>response.body=</h4> <p>Set response body to one of the following:</p> <ul> <li><code>string</code> written</li> <li><code>Buffer</code> written</li> <li><code>Stream</code> piped</li> <li><code>Object</code> json-stringified</li> <li><code>null</code> no content response</li> </ul> <p>If <code>response.status</code> has not been set, Toa will automatically set the status to <code>200</code> or <code>204</code>.</p> <h5>String</h5> <p>The Content-Type is defaulted to text/html or text/plain, both with a default charset of utf-8. The Content-Length field is also set.</p> <h5>Buffer</h5> <p>The Content-Type is defaulted to application/octet-stream, and Content-Length is also set.</p> <h5>Stream</h5> <p>The Content-Type is defaulted to application/octet-stream.</p> <h5>Object</h5> <p>The Content-Type is defaulted to application/json.</p> <h4>response.get(field)</h4> <p>Get a response header field value with case-insensitive <code>field</code>.</p> <pre><code class="language-js"><span class="hljs-keyword">let</span> etag = <span class="hljs-keyword">this</span>.get(<span class="hljs-string">'etag'</span>) </code></pre> <h4>response.set(field, value)</h4> <p>Set response header <code>field</code> to <code>value</code>:</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.set(<span class="hljs-string">'Cache-Control'</span>, <span class="hljs-string">'no-cache'</span>) </code></pre> <h4>response.append(field, value)</h4> <p>Append additional header <code>field</code> with value <code>val</code>.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.append(<span class="hljs-string">'Link'</span>, <span class="hljs-string">'&lt;http://127.0.0.1/&gt;'</span>) </code></pre> <h4>response.set(fields)</h4> <p>Set several response header <code>fields</code> with an object:</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.set({ <span class="hljs-string">'ETag'</span>: <span class="hljs-string">'1234'</span>, <span class="hljs-string">'Last-Modified'</span>: date }) </code></pre> <h4>response.remove(field)</h4> <p>Remove header <code>field</code>.</p> <h4>response.type</h4> <p>Get response <code>Content-Type</code> void of parameters such as &quot;charset&quot;.</p> <pre><code class="language-js"><span class="hljs-keyword">let</span> ct = <span class="hljs-keyword">this</span>.type <span class="hljs-comment">// =&gt; "image/png"</span> </code></pre> <h4>response.type=</h4> <p>Set response <code>Content-Type</code> via mime string or file extension.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.type = <span class="hljs-string">'text/plain; charset=utf-8'</span> <span class="hljs-keyword">this</span>.type = <span class="hljs-string">'image/png'</span> <span class="hljs-keyword">this</span>.type = <span class="hljs-string">'.png'</span> <span class="hljs-keyword">this</span>.type = <span class="hljs-string">'png'</span> </code></pre> <p>Note: when appropriate a <code>charset</code> is selected for you, for example <code>response.type = 'html'</code> will default to &quot;utf-8&quot;, however when explicitly defined in full as <code>response.type = 'text/html'</code> no charset is assigned.</p> <h4>response.is(types...)</h4> <p>Very similar to <code>this.request.is()</code>. Check whether the response type is one of the supplied types. This is particularly useful for creating middleware that manipulate responses.</p> <h4>response.redirect(url, [alt])</h4> <p>Perform a [302] redirect to <code>url</code>.</p> <p>The string “back” is special-cased to provide Referrer support, when Referrer is not present <code>alt</code> or “/” is used.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.redirect(<span class="hljs-string">'back'</span>) <span class="hljs-keyword">this</span>.redirect(<span class="hljs-string">'back'</span>, <span class="hljs-string">'/index.html'</span>) <span class="hljs-keyword">this</span>.redirect(<span class="hljs-string">'/login'</span>) <span class="hljs-keyword">this</span>.redirect(<span class="hljs-string">'http://google.com'</span>) </code></pre> <p>To alter the default status of <code>302</code>, simply assign the status before or after this call. To alter the body, assign it after this call:</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.status = <span class="hljs-number">301</span> <span class="hljs-keyword">this</span>.redirect(<span class="hljs-string">'/cart'</span>) <span class="hljs-keyword">this</span>.body = <span class="hljs-string">'Redirecting to shopping cart'</span> </code></pre> <h4>response.attachment([filename])</h4> <p>Set <code>Content-Disposition</code> to “attachment” to signal the client to prompt for download. Optionally specify the <code>filename</code> of the download.</p> <h4>response.headerSent</h4> <p>Check if a response header has already been sent. Useful for seeing if the client may be notified on error.</p> <h4>response.lastModified</h4> <p>Return the <code>Last-Modified</code> header as a <code>Date</code>, if it exists.</p> <h4>response.lastModified=</h4> <p>Set the <code>Last-Modified</code> header as an appropriate UTC string. You can either set it as a <code>Date</code> or date string.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.response.lastModified = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Date</span>() </code></pre> <h4>response.etag=</h4> <p>Set the ETag of a response including the wrapped <code>&quot;</code>s. Note that there is no corresponding <code>response.etag</code> getter.</p> <pre><code class="language-js"><span class="hljs-keyword">this</span>.response.etag = crypto.createHash(<span class="hljs-string">'md5'</span>).update(<span class="hljs-keyword">this</span>.body).digest(<span class="hljs-string">'hex'</span>) </code></pre> <h4>response.vary(field)</h4> <p>Vary on <code>field</code>.</p> <hr> </div> </div> </div> </section> <section class="resources" id="resources"> <div class="container"> <div class="card"> <div class="card-header with-border"> <h2>Resources</h2> </div> <div class="card-main"> <p class="module-desc">与 Koa 一样, Toa 也没有绑定过多的功能,而仅仅提供了一个轻量优雅的函数库,和强大的扩展能力。<br> 使用者可以根据自己的需求选择独立的功能模块或中间件,或自己实现相关功能模块。<br> 以下是 <strong>Toajs</strong> 提供的基础性的功能模块。它们已能满足大多数的应用需求。</p> <div class="row modules-list"> <div class="col-xs-6"> <a href="https://github.com/toajs/toa-ejs" target="_blank" class="module"> <div class="module-icon icon-ejs">Ejs</div> Ejs render module for toa. </a> </div> <div class="col-xs-6"> <a href="https://github.com/toajs/toa-mejs" target="_blank" class="module"> <div class="module-icon icon-mejs">Mejs</div> Mejs render module for toa. </a> </div> <div class="col-xs-6"> <a href="https://github.com/toajs/toa-i18n" target="_blank" class="module"> <div class="module-icon icon-i18n">I18n</div> I18n middleware for toa. </a> </div> <div class="col-xs-6"> <a href="https://github.com/toajs/toa-body" target="_blank" class="module"> <div class="module-icon icon-body">Body</div> Request body parser for toa. </a> </div> <div class="col-xs-6"> <a href="https://github.com/toajs/toa-token" target="_blank" class="module"> <div class="module-icon icon-token">Token</div> Token based authentication for toa. </a> </div> <div class="col-xs-6"> <a href="https://github.com/toajs/toa-router" target="_blank" class="module"> <div class="module-icon icon-router">Router</div> A router for toa. </a> </div> <div class="col-xs-6"> <a href="https://github.com/toajs/toa-static" target="_blank" class="module"> <div class="module-icon icon-static">Static</div> A static server module for toa. </a> </div> <div class="col-xs-6"> <a href="https://github.com/toajs/toa-favicon" target="_blank" class="module"> <div class="module-icon icon-favicon">Favi..</div> Favicon middleware for toa. </a> </div> <div class="col-xs-6"> <a href="https://github.com/toajs/toa-session" target="_blank" class="module"> <div class="module-icon icon-session">Sess..</div> Session middleware for toa. </a> </div> <div class="col-xs-6"> <a href="https://github.com/toajs/toa-compress" target="_blank" class="module"> <div class="module-icon icon-compress">Comp..</div> Compress responses middleware for toa. </a> </div> </div> </div> </div> </div> </section> <svg id="thanks-gap" xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100" viewBox="0 0 100 100" preserveAspectRatio="none"> <path d="M-5 100 Q 0 20 5 100 Z M0 100 Q 5 0 10 100 M5 100 Q 10 30 15 100 M10 100 Q 15 10 20 100 M15 100 Q 20 30 25 100 M20 100 Q 25 -10 30 100 M25 100 Q 30 10 35 100 M30 100 Q 35 30 40 100 M35 100 Q 40 10 45 100 M40 100 Q 45 50 50 100 M45 100 Q 50 20 55 100 M50 100 Q 55 40 60 100 M55 100 Q 60 60 65 100 M60 100 Q 65 50 70 100 M65 100 Q 70 20 75 100 M70 100 Q 75 45 80 100 M75 100 Q 80 30 85 100 M80 100 Q 85 20 90 100 M85 100 Q 90 50 95 100 M90 100 Q 95 25 100 100 M95 100 Q 100 15 105 100 Z"> </path> </svg> <section class="thanks" id="thanks"> <div class="container"> <h2 class="title">Thanks to Koa and it’s authors</h2> <div class="row"> <div class="koa-wrap col-sm-3"> <a href="http://koajs.com" target="_blank"> <span class="koa-logo"> koa </span> </a> <hr> </div> <div class="col-sm-9"> <ul class="row authors-list"> <li class="col-sm-3"> <a href="https://github.com/tj" target="_blank"> <img src="/static/images/thanks/author-tj.1398cf7c.jpg"> <br> TJ Holowaychuk </a> </li> <li class="col-sm-3"> <a href="https://github.com/jonathanong" target="_blank"> <img src="/static/images/thanks/author-jo.b502dfe8.jpg"> <br> Jonathan Ong </a> <li class="col-sm-3"> <a href="https://github.com/juliangruber" target="_blank"> <img src="/static/images/thanks/author-jg.fce36d7f.jpg"> <br> Julian Gruber </a> </li> <li class="col-sm-3"> <a href="https://github.com/dead-horse" target="_blank"> <img src="/static/images/thanks/author-yyh.c0ef5e8a.jpg"> <br> Yiyu He </a> </li> </ul> </div> </div> </div> </section> <section class="copyright"> <div class="container"> <p>Copyright © 2015-2017 Toajs Released under the MIT license.</p> </div> </section> </div> <script src="static/js/lib.20bffa5c.js"></script> <script src="static/js/app.456c01e8.js"></script> </body> </html>
toajs/toajs.com
docs/index.html
HTML
mit
59,706
declare export type class A {}
motiz88/astring-flow
test/data/roundtrip/flow-parser-tests/test-171.js
JavaScript
mit
30
<?php namespace ILL\VisitBundle\Entity; use Doctrine\ORM\EntityRepository; /** * InstituteRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class InstituteRepository extends EntityRepository { //Tous les Instituts avec visites public function findAllInstituteWithVisit(){ $query = $this->createQueryBuilder('i') ->joint('i.id','v.institute'); return $query->getResult(); } //Tous les attendee d'un institut (NON OK) // public function findAllAttendeeByInstitute($id){ // $query = $this->createQueryBuilder('institutes') // ->where('id = :identifiant') // ->setParameter("identifiant", $id) // ->joint('institutes.id','visits.institute') // ->select('visits') // ->joint('visits.id','attendees.visit'); // ->select('attendees'); // ->joint('attendees.attendee','attendee.id') // ->select('attendee'); // } }
M0dM/GroupVis
src/ILL/VisitBundle/Entity/InstituteRepository.php
PHP
mit
942
import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {MatCardModule} from '@angular/material/card'; import {MatCheckboxModule} from '@angular/material/checkbox'; import {MatRadioModule} from '@angular/material/radio'; import {CheckboxConfigurableExample} from './checkbox-configurable/checkbox-configurable-example'; import {CheckboxOverviewExample} from './checkbox-overview/checkbox-overview-example'; import {CheckboxHarnessExample} from './checkbox-harness/checkbox-harness-example'; export { CheckboxConfigurableExample, CheckboxOverviewExample, CheckboxHarnessExample, }; const EXAMPLES = [ CheckboxConfigurableExample, CheckboxOverviewExample, CheckboxHarnessExample, ]; @NgModule({ imports: [ CommonModule, MatCardModule, MatCheckboxModule, MatRadioModule, FormsModule, ], declarations: EXAMPLES, exports: EXAMPLES, entryComponents: EXAMPLES, }) export class CheckboxExamplesModule { }
andrewseguin/material2
src/components-examples/material/checkbox/index.ts
TypeScript
mit
1,023
{% load static %} <footer class="footer container-fluid text-center"> <div class="row clearfix"> <div class="col-md-2">2016 PyCon Taiwan</div> <div class="col-md-8 hidden-xs hidden-sm"> <img width="133" height="24" src="{% static 'images/Logo_pycontw16_blue_footer@2x.png' %}" class="logo"> </div> <div class="social col-md-2 text-center"> <a href="https://www.facebook.com/pycontw" class="social-btn" target="_blank"> <i class="fa fa-facebook fa-lg"></i> </a> <a href="https://twitter.com/pycontw" class="social-btn" target="_blank"> <i class="fa fa-twitter fa-lg"></i> </a> </div> </div> </footer>
uranusjr/pycontw2016
src/templates/_includes/footer.html
HTML
mit
739
/***Generated Resource **/ var resource = require('resource'); var BusStop = resource.define('BusStop'); BusStop.schema.description = "A bus stop."; BusStop.persist('fs'); BusStop.property('additionalType', { "name" : "additionalType", "displayName" : "Additional Type", "description" : "An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the &#x27;typeof&#x27; attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.", "type": "string" }); BusStop.property('description', { "name" : "description", "displayName" : "Description", "description" : "A short description of the item.", "type": "string" }); BusStop.property('image', { "name" : "image", "displayName" : "Image", "description" : "URL of an image of the item.", "type": "string" }); BusStop.property('name', { "name" : "name", "displayName" : "Name", "description" : "The name of the item.", "type": "string" }); BusStop.property('sameAs', { "name" : "sameAs", "displayName" : "Same as", "description" : "URL of a reference Web page that unambiguously indicates the item&#x27;s identity. E.g. the URL of the item&#x27;s Wikipedia page, Freebase page, or official website.", "type": "string" }); BusStop.property('url', { "name" : "url", "displayName" : "Url", "description" : "URL of the item.", "type": "string" }); exports.BusStop = BusStop; BusStop.property('address', { "name" : "address", "displayName" : "Address", "description" : "Physical address of the item.", "type":"object","properties" : {"PostalAddress" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('aggregateRating', { "name" : "aggregateRating", "displayName" : "Aggregate Rating", "description" : "The overall rating, based on a collection of reviews or ratings, of the item.", "type":"object","properties" : {"AggregateRating" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('containedIn', { "name" : "containedIn", "displayName" : "Contained in", "description" : "The basic containment relation between places.", "type":"object","properties" : {"Place" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('event', { "name" : "event", "displayName" : "Event", "description" : "Upcoming or past event associated with this place or organization.", "type":"object","properties" : {"Event" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('events', { "name" : "events", "displayName" : "Events", "description" : "Upcoming or past events associated with this place or organization (legacy spelling; see singular form, event).", "type":"object","properties" : {"Event" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('faxNumber', { "name" : "faxNumber", "displayName" : "Fax Number", "description" : "The fax number.", "type": "string" }); BusStop.property('geo', { "name" : "geo", "displayName" : "Geo", "description" : "The geo coordinates of the place.", "type":"object","properties" : {"GeoCoordinates" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}},"GeoShape" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('globalLocationNumber', { "name" : "globalLocationNumber", "displayName" : "Global Locationnumber", "description" : "The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.", "type": "string" }); BusStop.property('interactionCount', { "name" : "interactionCount", "displayName" : "Interaction Count", "description" : "A count of a specific user interactions with this item—for example, 20 UserLikes, 5 UserComments, or 300 UserDownloads. The user interaction type should be one of the sub types of UserInteraction.", "type": "string" }); BusStop.property('isicV4', { "name" : "isicV4", "displayName" : "Isic v4", "description" : "The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.", "type": "string" }); BusStop.property('logo', { "name" : "logo", "displayName" : "Logo", "description" : "URL of an image for the logo of the item.", "type":"object","properties" : {"ImageObject" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('map', { "name" : "map", "displayName" : "Map", "description" : "A URL to a map of the place.", "type": "string" }); BusStop.property('maps', { "name" : "maps", "displayName" : "Maps", "description" : "A URL to a map of the place (legacy spelling; see singular form, map).", "type": "string" }); BusStop.property('openingHoursSpecification', { "name" : "openingHoursSpecification", "displayName" : "Opening Hoursspecification", "description" : "The opening hours of a certain place.", "type":"object","properties" : {"OpeningHoursSpecification" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('photo', { "name" : "photo", "displayName" : "Photo", "description" : "A photograph of this place.", "type":"object","properties" : {"ImageObject" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}},"Photograph" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('photos', { "name" : "photos", "displayName" : "Photos", "description" : "Photographs of this place (legacy spelling; see singular form, photo).", "type":"object","properties" : {"ImageObject" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}},"Photograph" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('review', { "name" : "review", "displayName" : "Review", "description" : "A review of the item.", "type":"object","properties" : {"Review" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('reviews', { "name" : "reviews", "displayName" : "Reviews", "description" : "Review of the item (legacy spelling; see singular form, review).", "type":"object","properties" : {"Review" : {"type" :"object", "properties" : { "id" : { "type" : "array" }}}} }); BusStop.property('telephone', { "name" : "telephone", "displayName" : "Telephone", "description" : "The telephone number.", "type": "string" }); exports.BusStop = BusStop; BusStop.property('openingHours', { "name" : "openingHours", "displayName" : "Opening Hours", "description" : "The opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas &#x27;,&#x27; separating each day. Day or time ranges are specified using a hyphen &#x27;-&#x27;.- Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su.- Times are specified using 24:00 time. For example, 3pm is specified as 15:00. - Here is an example: Tuesdays and Thursdays 4-8pm. - If a business is open 7 days a week, then it can be specified as Monday through Sunday, all day.", "type": "string" }); exports.BusStop = BusStop;
SkiftCreative/node-schema-org
resources/BusStop/index.js
JavaScript
mit
8,209
class AddNameToSubscriptions < ActiveRecord::Migration def change add_column :refinery_subscriptions, :first_name, :string add_column :refinery_subscriptions, :last_name, :string end end
refactorit/refinerycms-subscriptions
db/migrate/2_add_name_to_subscriptions.rb
Ruby
mit
200
#include <mysql2_ext.h> VALUE cMysql2Statement; extern VALUE mMysql2, cMysql2Error, cBigDecimal, cDateTime, cDate; static VALUE sym_stream, intern_error_number_eql, intern_sql_state_eql, intern_each; #define GET_STATEMENT(self) \ mysql_stmt_wrapper *stmt_wrapper; \ Data_Get_Struct(self, mysql_stmt_wrapper, stmt_wrapper); static void rb_mysql_stmt_mark(void * ptr) { mysql_stmt_wrapper* stmt_wrapper = (mysql_stmt_wrapper *)ptr; if(! stmt_wrapper) return; rb_gc_mark(stmt_wrapper->client); } static void rb_mysql_stmt_free(void * ptr) { mysql_stmt_wrapper* stmt_wrapper = (mysql_stmt_wrapper *)ptr; mysql_stmt_close(stmt_wrapper->stmt); xfree(ptr); } VALUE rb_raise_mysql2_stmt_error2(MYSQL_STMT *stmt #ifdef HAVE_RUBY_ENCODING_H , rb_encoding *conn_enc #endif ) { VALUE rb_error_msg = rb_str_new2(mysql_stmt_error(stmt)); VALUE rb_sql_state = rb_tainted_str_new2(mysql_stmt_sqlstate(stmt)); #ifdef HAVE_RUBY_ENCODING_H rb_encoding *default_internal_enc = rb_default_internal_encoding(); rb_enc_associate(rb_error_msg, conn_enc); rb_enc_associate(rb_sql_state, conn_enc); if (default_internal_enc) { rb_error_msg = rb_str_export_to_enc(rb_error_msg, default_internal_enc); rb_sql_state = rb_str_export_to_enc(rb_sql_state, default_internal_enc); } #endif VALUE e = rb_exc_new3(cMysql2Error, rb_error_msg); rb_funcall(e, intern_error_number_eql, 1, UINT2NUM(mysql_stmt_errno(stmt))); rb_funcall(e, intern_sql_state_eql, 1, rb_sql_state); rb_exc_raise(e); return Qnil; } static void rb_raise_mysql2_stmt_error(VALUE self) { #ifdef HAVE_RUBY_ENCODING_H rb_encoding *conn_enc; #endif GET_STATEMENT(self); { GET_CLIENT(stmt_wrapper->client); #ifdef HAVE_RUBY_ENCODING_H conn_enc = rb_to_encoding(wrapper->encoding); #endif } rb_raise_mysql2_stmt_error2(stmt_wrapper->stmt #ifdef HAVE_RUBY_ENCODING_H , conn_enc #endif ); } /* * used to pass all arguments to mysql_stmt_prepare while inside * nogvl_prepare_statement_args */ struct nogvl_prepare_statement_args { MYSQL_STMT *stmt; VALUE sql; const char *sql_ptr; unsigned long sql_len; }; static void *nogvl_prepare_statement(void *ptr) { struct nogvl_prepare_statement_args *args = ptr; if (mysql_stmt_prepare(args->stmt, args->sql_ptr, args->sql_len)) { return (void*)Qfalse; } else { return (void*)Qtrue; } } VALUE rb_mysql_stmt_new(VALUE rb_client, VALUE sql) { mysql_stmt_wrapper* stmt_wrapper; VALUE rb_stmt; #ifdef HAVE_RUBY_ENCODING_H rb_encoding *conn_enc; #endif Check_Type(sql, T_STRING); rb_stmt = Data_Make_Struct(cMysql2Statement, mysql_stmt_wrapper, rb_mysql_stmt_mark, rb_mysql_stmt_free, stmt_wrapper); { stmt_wrapper->client = rb_client; stmt_wrapper->stmt = NULL; } // instantiate stmt { GET_CLIENT(rb_client); stmt_wrapper->stmt = mysql_stmt_init(wrapper->client); #ifdef HAVE_RUBY_ENCODING_H conn_enc = rb_to_encoding(wrapper->encoding); #endif } if (stmt_wrapper->stmt == NULL) { rb_raise(cMysql2Error, "Unable to initialize prepared statement: out of memory"); } // set STMT_ATTR_UPDATE_MAX_LENGTH attr { my_bool truth = 1; if (mysql_stmt_attr_set(stmt_wrapper->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &truth)) { rb_raise(cMysql2Error, "Unable to initialize prepared statement: set STMT_ATTR_UPDATE_MAX_LENGTH"); } } // call mysql_stmt_prepare w/o gvl { struct nogvl_prepare_statement_args args; args.stmt = stmt_wrapper->stmt; args.sql = sql; #ifdef HAVE_RUBY_ENCODING_H // ensure the string is in the encoding the connection is expecting args.sql = rb_str_export_to_enc(args.sql, conn_enc); #endif args.sql_ptr = StringValuePtr(sql); args.sql_len = RSTRING_LEN(sql); if ((VALUE)rb_thread_call_without_gvl(nogvl_prepare_statement, &args, RUBY_UBF_IO, 0) == Qfalse) { rb_raise_mysql2_stmt_error(rb_stmt); } } return rb_stmt; } /* call-seq: stmt.param_count # => Numeric * * Returns the number of parameters the prepared statement expects. */ static VALUE param_count(VALUE self) { GET_STATEMENT(self); return ULL2NUM(mysql_stmt_param_count(stmt_wrapper->stmt)); } /* call-seq: stmt.field_count # => Numeric * * Returns the number of fields the prepared statement returns. */ static VALUE field_count(VALUE self) { GET_STATEMENT(self); return UINT2NUM(mysql_stmt_field_count(stmt_wrapper->stmt)); } static void *nogvl_execute(void *ptr) { MYSQL_STMT *stmt = ptr; if(mysql_stmt_execute(stmt)) { return (void*)Qfalse; } else { return (void*)Qtrue; } } static void *nogvl_stmt_store_result(void *ptr) { MYSQL_STMT *stmt = ptr; if(mysql_stmt_store_result(stmt)) { return (void *)Qfalse; } else { return (void *)Qtrue; } } /* Free each bind_buffer[i].buffer except when params_enc is non-nil, this means * the buffer is a Ruby string pointer and not our memory to manage. */ #define FREE_BINDS \ for (i = 0; i < argc; i++) { \ if (bind_buffers[i].buffer && NIL_P(params_enc[i])) { \ xfree(bind_buffers[i].buffer); \ } \ } \ if (argc > 0) { \ xfree(bind_buffers); \ xfree(length_buffers); \ } /* call-seq: stmt.execute * * Executes the current prepared statement, returns +result+. */ static VALUE execute(int argc, VALUE *argv, VALUE self) { MYSQL_BIND *bind_buffers = NULL; unsigned long bind_count; long i; MYSQL_STMT *stmt; MYSQL_RES *metadata; VALUE resultObj; VALUE *params_enc = alloca(sizeof(VALUE) * argc); unsigned long* length_buffers = NULL; int is_streaming = 0; #ifdef HAVE_RUBY_ENCODING_H rb_encoding *conn_enc; #endif GET_STATEMENT(self); #ifdef HAVE_RUBY_ENCODING_H { GET_CLIENT(stmt_wrapper->client); conn_enc = rb_to_encoding(wrapper->encoding); } #endif { VALUE valStreaming = rb_hash_aref(rb_iv_get(stmt_wrapper->client, "@query_options"), sym_stream); if(valStreaming == Qtrue) { is_streaming = 1; } } stmt = stmt_wrapper->stmt; bind_count = mysql_stmt_param_count(stmt); if (argc != (long)bind_count) { rb_raise(cMysql2Error, "Bind parameter count (%ld) doesn't match number of arguments (%d)", bind_count, argc); } // setup any bind variables in the query if (bind_count > 0) { bind_buffers = xcalloc(bind_count, sizeof(MYSQL_BIND)); length_buffers = xcalloc(bind_count, sizeof(unsigned long)); for (i = 0; i < argc; i++) { bind_buffers[i].buffer = NULL; params_enc[i] = Qnil; switch (TYPE(argv[i])) { case T_NIL: bind_buffers[i].buffer_type = MYSQL_TYPE_NULL; break; case T_FIXNUM: #if SIZEOF_INT < SIZEOF_LONG bind_buffers[i].buffer_type = MYSQL_TYPE_LONGLONG; bind_buffers[i].buffer = xmalloc(sizeof(long long int)); *(long*)(bind_buffers[i].buffer) = FIX2LONG(argv[i]); #else bind_buffers[i].buffer_type = MYSQL_TYPE_LONG; bind_buffers[i].buffer = xmalloc(sizeof(int)); *(long*)(bind_buffers[i].buffer) = FIX2INT(argv[i]); #endif break; case T_BIGNUM: bind_buffers[i].buffer_type = MYSQL_TYPE_LONGLONG; bind_buffers[i].buffer = xmalloc(sizeof(long long int)); *(LONG_LONG*)(bind_buffers[i].buffer) = rb_big2ll(argv[i]); break; case T_FLOAT: bind_buffers[i].buffer_type = MYSQL_TYPE_DOUBLE; bind_buffers[i].buffer = xmalloc(sizeof(double)); *(double*)(bind_buffers[i].buffer) = NUM2DBL(argv[i]); break; case T_STRING: { params_enc[i] = argv[i]; #ifdef HAVE_RUBY_ENCODING_H params_enc[i] = rb_str_export_to_enc(params_enc[i], conn_enc); #endif bind_buffers[i].buffer_type = MYSQL_TYPE_STRING; bind_buffers[i].buffer = RSTRING_PTR(params_enc[i]); bind_buffers[i].buffer_length = RSTRING_LEN(params_enc[i]); length_buffers[i] = bind_buffers[i].buffer_length; bind_buffers[i].length = &length_buffers[i]; } break; default: // TODO: what Ruby type should support MYSQL_TYPE_TIME if (CLASS_OF(argv[i]) == rb_cTime || CLASS_OF(argv[i]) == cDateTime) { bind_buffers[i].buffer_type = MYSQL_TYPE_DATETIME; bind_buffers[i].buffer = xmalloc(sizeof(MYSQL_TIME)); MYSQL_TIME t; VALUE rb_time = argv[i]; memset(&t, 0, sizeof(MYSQL_TIME)); t.neg = 0; t.second_part = FIX2INT(rb_funcall(rb_time, rb_intern("usec"), 0)); t.second = FIX2INT(rb_funcall(rb_time, rb_intern("sec"), 0)); t.minute = FIX2INT(rb_funcall(rb_time, rb_intern("min"), 0)); t.hour = FIX2INT(rb_funcall(rb_time, rb_intern("hour"), 0)); t.day = FIX2INT(rb_funcall(rb_time, rb_intern("day"), 0)); t.month = FIX2INT(rb_funcall(rb_time, rb_intern("month"), 0)); t.year = FIX2INT(rb_funcall(rb_time, rb_intern("year"), 0)); *(MYSQL_TIME*)(bind_buffers[i].buffer) = t; } else if (CLASS_OF(argv[i]) == cDate) { bind_buffers[i].buffer_type = MYSQL_TYPE_DATE; bind_buffers[i].buffer = xmalloc(sizeof(MYSQL_TIME)); MYSQL_TIME t; VALUE rb_time = argv[i]; memset(&t, 0, sizeof(MYSQL_TIME)); t.second_part = 0; t.neg = 0; t.day = FIX2INT(rb_funcall(rb_time, rb_intern("day"), 0)); t.month = FIX2INT(rb_funcall(rb_time, rb_intern("month"), 0)); t.year = FIX2INT(rb_funcall(rb_time, rb_intern("year"), 0)); *(MYSQL_TIME*)(bind_buffers[i].buffer) = t; } else if (CLASS_OF(argv[i]) == cBigDecimal) { bind_buffers[i].buffer_type = MYSQL_TYPE_NEWDECIMAL; } break; } } // copies bind_buffers into internal storage if (mysql_stmt_bind_param(stmt, bind_buffers)) { FREE_BINDS; rb_raise_mysql2_stmt_error(self); } } if ((VALUE)rb_thread_call_without_gvl(nogvl_execute, stmt, RUBY_UBF_IO, 0) == Qfalse) { FREE_BINDS; rb_raise_mysql2_stmt_error(self); } FREE_BINDS; metadata = mysql_stmt_result_metadata(stmt); if(metadata == NULL) { if(mysql_stmt_errno(stmt) != 0) { // either CR_OUT_OF_MEMORY or CR_UNKNOWN_ERROR. both fatal. MARK_CONN_INACTIVE(stmt_wrapper->client); rb_raise_mysql2_stmt_error(self); } // no data and no error, so query was not a SELECT return Qnil; } VALUE current; current = rb_hash_dup(rb_iv_get(stmt_wrapper->client, "@query_options")); GET_CLIENT(stmt_wrapper->client); if (!is_streaming) { // recieve the whole result set from the server if (rb_thread_call_without_gvl(nogvl_stmt_store_result, stmt, RUBY_UBF_IO, 0) == Qfalse) { rb_raise_mysql2_stmt_error(self); } MARK_CONN_INACTIVE(stmt_wrapper->client); } resultObj = rb_mysql_result_to_obj(stmt_wrapper->client, wrapper->encoding, current, metadata, stmt); #ifdef HAVE_RUBY_ENCODING_H { mysql2_result_wrapper *result_wrapper; GET_CLIENT(stmt_wrapper->client); GetMysql2Result(resultObj, result_wrapper); result_wrapper->encoding = wrapper->encoding; } #endif if (!is_streaming) { // cache all result rb_funcall(resultObj, intern_each, 0); } return resultObj; } /* call-seq: stmt.fields # => array * * Returns a list of fields that will be returned by this statement. */ static VALUE fields(VALUE self) { MYSQL_FIELD *fields; MYSQL_RES *metadata; unsigned int field_count; unsigned int i; VALUE field_list; MYSQL_STMT* stmt; #ifdef HAVE_RUBY_ENCODING_H rb_encoding *default_internal_enc, *conn_enc; #endif GET_STATEMENT(self); stmt = stmt_wrapper->stmt; #ifdef HAVE_RUBY_ENCODING_H default_internal_enc = rb_default_internal_encoding(); { GET_CLIENT(stmt_wrapper->client); conn_enc = rb_to_encoding(wrapper->encoding); } #endif metadata = mysql_stmt_result_metadata(stmt); fields = mysql_fetch_fields(metadata); field_count = mysql_stmt_field_count(stmt); field_list = rb_ary_new2((long)field_count); for(i = 0; i < field_count; i++) { VALUE rb_field; rb_field = rb_str_new(fields[i].name, fields[i].name_length); #ifdef HAVE_RUBY_ENCODING_H rb_enc_associate(rb_field, conn_enc); if (default_internal_enc) { rb_field = rb_str_export_to_enc(rb_field, default_internal_enc); } #endif rb_ary_store(field_list, (long)i, rb_field); } mysql_free_result(metadata); return field_list; } void init_mysql2_statement() { cMysql2Statement = rb_define_class_under(mMysql2, "Statement", rb_cObject); rb_define_method(cMysql2Statement, "param_count", param_count, 0); rb_define_method(cMysql2Statement, "field_count", field_count, 0); rb_define_method(cMysql2Statement, "execute", execute, -1); rb_define_method(cMysql2Statement, "fields", fields, 0); sym_stream = ID2SYM(rb_intern("stream")); intern_error_number_eql = rb_intern("error_number="); intern_sql_state_eql = rb_intern("sql_state="); intern_each = rb_intern("each"); }
PipelineDeals/mysql2
ext/mysql2/statement.c
C
mit
13,463
using System; namespace FamintusApi.Areas.HelpPage { /// <summary> /// This represents a preformatted text sample on the help page. There's a display template named TextSample associated with this class. /// </summary> public class TextSample { public TextSample(string text) { if (text == null) { throw new ArgumentNullException("text"); } Text = text; } public string Text { get; private set; } public override bool Equals(object obj) { TextSample other = obj as TextSample; return other != null && Text == other.Text; } public override int GetHashCode() { return Text.GetHashCode(); } public override string ToString() { return Text; } } }
DkoSoftware/WebPlataform
FamintusApi/Areas/HelpPage/SampleGeneration/TextSample.cs
C#
mit
887
//------------------------------------------------------------------------------ // <license file="QName.cs"> // // The use and distribution terms for this software are contained in the file // named 'LICENSE', which can be found in the resources directory of this // distribution. // // By using this software in any fashion, you are agreeing to be bound by the // terms of this license. // // </license> //------------------------------------------------------------------------------ using System; using EcmaScript.NET; using EcmaScript.NET.Types; namespace EcmaScript.NET.Types.E4X { /// <summary> Class QName /// /// </summary> [Serializable] sealed class QName : IdScriptableObject { override public string ClassName { get { return "QName"; } } protected override internal int MaxInstanceId { get { return base.MaxInstanceId + MAX_INSTANCE_ID; } } private static readonly object QNAME_TAG = new object (); internal XMLLib lib; private string prefix; private string localName; private string uri; internal QName (XMLLib lib) : base (lib.GlobalScope, lib.qnamePrototype) { this.lib = lib; } internal QName (XMLLib lib, QName qname) : this (lib, qname.Uri, qname.LocalName, qname.Prefix) { ; } internal QName (XMLLib lib, string uri, string localName, string prefix) : base (lib.GlobalScope, lib.qnamePrototype) { if (localName == null) throw new System.ArgumentException (); this.lib = lib; this.uri = uri; this.prefix = prefix; this.localName = localName; } internal void ExportAsJSClass (bool zealed) { ExportAsJSClass (MAX_PROTOTYPE_ID, lib.GlobalScope, zealed); } /// <summary> </summary> /// <returns> /// </returns> public override string ToString () { string result; if (uri == null) { result = string.Concat ("*::", localName); } else if (uri.Length == 0) { result = localName; } else { result = uri + "::" + localName; } return result; } public string LocalName { get { return localName; } } internal string Prefix { get { return (prefix == null) ? prefix : ""; } } internal string Uri { get { return uri; } } public override int GetHashCode () { return base.GetHashCode (); } public override bool Equals (object obj) { QName qName = (obj as QName); if (qName == null) return false; return Equals (qName); } protected internal override object EquivalentValues (object value) { QName qName = (value as QName); if (qName == null) return UniqueTag.NotFound; return Equals (qName); } private bool Equals (QName q) { return CliHelper.Equals (LocalName, q.LocalName) && CliHelper.Equals (Uri, q.Uri); } /// <summary> </summary> /// <param name="">hint /// </param> /// <returns> /// </returns> public override object GetDefaultValue (System.Type hint) { return ToString (); } #region InstanceIds private const int Id_localName = 1; private const int Id_uri = 2; private const int MAX_INSTANCE_ID = 2; #endregion protected internal override int FindInstanceIdInfo (string s) { int id; #region Generated InstanceId Switch L0: { id = 0; string X = null; int s_length = s.Length; if (s_length == 3) { X = "uri"; id = Id_uri; } else if (s_length == 9) { X = "localName"; id = Id_localName; } if (X != null && X != s && !X.Equals (s)) id = 0; } EL0: #endregion if (id == 0) return base.FindInstanceIdInfo (s); int attr; switch (id) { case Id_localName: case Id_uri: attr = PERMANENT | READONLY; break; default: throw new System.SystemException (); } return InstanceIdInfo (attr, base.MaxInstanceId + id); } protected internal override string GetInstanceIdName (int id) { switch (id - base.MaxInstanceId) { case Id_localName: return "localName"; case Id_uri: return "uri"; } return base.GetInstanceIdName (id); } protected internal override object GetInstanceIdValue (int id) { switch (id - base.MaxInstanceId) { case Id_localName: return localName; case Id_uri: return uri; } return base.GetInstanceIdValue (id); } #region PrototypeIds private const int Id_constructor = 1; private const int Id_toString = 2; private const int Id_toSource = 3; private const int MAX_PROTOTYPE_ID = 3; #endregion protected internal override int FindPrototypeId (string s) { int id; #region Generated PrototypeId Switch L0: { id = 0; string X = null; int c; int s_length = s.Length; if (s_length == 8) { c = s [3]; if (c == 'o') { X = "toSource"; id = Id_toSource; } else if (c == 't') { X = "toString"; id = Id_toString; } } else if (s_length == 11) { X = "constructor"; id = Id_constructor; } if (X != null && X != s && !X.Equals (s)) id = 0; } EL0: #endregion return id; } protected internal override void InitPrototypeId (int id) { string s; int arity; switch (id) { case Id_constructor: arity = 2; s = "constructor"; break; case Id_toString: arity = 0; s = "toString"; break; case Id_toSource: arity = 0; s = "toSource"; break; default: throw new ArgumentException (System.Convert.ToString (id)); } InitPrototypeMethod (QNAME_TAG, id, s, arity); } public override object ExecIdCall (IdFunctionObject f, Context cx, IScriptable scope, IScriptable thisObj, object [] args) { if (!f.HasTag (QNAME_TAG)) { return base.ExecIdCall (f, cx, scope, thisObj, args); } int id = f.MethodId; switch (id) { case Id_constructor: return jsConstructor (cx, (thisObj == null), args); case Id_toString: return realThis (thisObj, f).ToString (); case Id_toSource: return realThis (thisObj, f).js_toSource (); } throw new ArgumentException (System.Convert.ToString (id)); } private QName realThis (IScriptable thisObj, IdFunctionObject f) { if (!(thisObj is QName)) throw IncompatibleCallError (f); return (QName)thisObj; } private object jsConstructor (Context cx, bool inNewExpr, object [] args) { if (!inNewExpr && args.Length == 1) { return QName.Parse (lib, cx, args [0]); } if (args.Length == 0) { return QName.Parse (lib, cx, Undefined.Value); } else if (args.Length == 1) { return QName.Parse (lib, cx, args [0]); } else { return QName.Parse (lib, cx, args [0], args [1]); } } internal static QName Parse (XMLLib lib, Context cx, object value) { QName result; if (value is QName) { QName qname = (QName)value; result = new QName (lib, qname.Uri, qname.LocalName, qname.Prefix); } else { result = Parse (lib, cx, ScriptConvert.ToString (value)); } return result; } internal static QName Parse (XMLLib lib, Context cx, string localName) { if (localName == null) throw new ArgumentNullException ("localName"); String uri; String prefix; if ("*".Equals (localName)) { uri = null; prefix = null; } else { Namespace ns = lib.GetDefaultNamespace (cx); uri = ns.Uri; prefix = ns.Prefix; } return new QName (lib, uri, localName, prefix); } internal static QName Parse (XMLLib lib, Context cx, object namespaceValue, object nameValue) { String uri; String localName; String prefix; if (nameValue is QName) { QName qname = (QName)nameValue; localName = qname.LocalName; } else { localName = ScriptConvert.ToString (nameValue); } Namespace ns; if (namespaceValue == Undefined.Value) { if ("*".Equals (localName)) { ns = null; } else { ns = lib.GetDefaultNamespace (cx); } } else if (namespaceValue == null) { ns = null; } else if (namespaceValue is Namespace) { ns = (Namespace)namespaceValue; } else { ns = Namespace.Parse (lib, cx, namespaceValue); } if (ns == null) { uri = null; prefix = null; } else { uri = ns.Uri; prefix = ns.Prefix; } return new QName (lib, uri, localName, prefix); } private string js_toSource () { System.Text.StringBuilder sb = new System.Text.StringBuilder (); sb.Append ('('); toSourceImpl (uri, localName, prefix, sb); sb.Append (')'); return sb.ToString (); } private static void toSourceImpl (string uri, string localName, string prefix, System.Text.StringBuilder sb) { sb.Append ("new QName("); if (uri == null && prefix == null) { if (!"*".Equals (localName)) { sb.Append ("null, "); } } else { Namespace.toSourceImpl (prefix, uri, sb); sb.Append (", "); } sb.Append ('\''); sb.Append (ScriptRuntime.escapeString (localName, '\'')); sb.Append ("')"); } } }
jongha/winuglifier
src/WinUglifier.Plugin.YUI.js/EcmaScript.NET/Types/E4X/QName.cs
C#
mit
12,297
import { fork, join } from 'redux-saga/effects'; // This utility takes the array of sagas as a param, and maps it to an array of runnable tasks. export default sagas => function* waitAll() { const tasks = yield sagas.map(([saga, ...params]) => fork(saga, ...params)); yield join(...tasks); };
mjlaufer/cafe-tour-client
src/server/helpers/waitAll.js
JavaScript
mit
300
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="referrer" content="always"> <meta name="robots" content="index, follow"> <link rel="icon" href="about:blank" type="image/x-icon"> <title> 俄罗斯通信和传媒部长:国家不会考虑比特币合法化 </title> <meta name="title" content="俄罗斯通信和传媒部长:国家不会考虑比特币合法化"> <meta name="description" content="“据悉就在一周前,俄罗斯央行一位高级官员表示,首次代币发行(ICO)可能会为创业公司带来融资机会。而且,一周前,俄罗斯联邦旅游局负责人也预测说区块链可以改变该国的旅游业”"> <meta name="keywords" content="区块链;ICO;加密货币;俄罗斯"> <link rel="stylesheet" type="text/css" href="../css/article-font.css"> <link rel="stylesheet" href="../css/article.min.css"> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-109516558-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'UA-109516558-1'); var _hmt = _hmt || []; (function () { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?dc9c3afdb0d4ee781a538922a7c9aaa9"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </head> <body class="browser-chrome os-mac is-withMagicUnderlines v-glyph v-glyph--m2 v-enableBrandingButtons is-js postShowScreen"> <div class="site-main surface-container"> <div class="surface"> <div class="screenContent surface-content"> <div class="metabar u-clearfix u-boxShadowBottomThinLighter u-textColorDarker u-fixed u-backgroundTransparentWhiteDarkest u-xs-sizeFullViewportWidth u-tintBgColor u-tintSpectrum"> <div class="metabar-inner u-marginAuto u-maxWidth1000 u-flexCenter u-justifyContentSpaceBetween u-paddingLeft20 u-paddingRight20 u-height65 u-xs-height56"> <div class="metabar-block u-flex1 u-flexCenter"> <a href="../index_cn.html" class="link u-flex"> <img src="../images/icon/logo_black.svg" height="25px"> </a> </div> <div class="metabar-block u-flex0 u-flexCenter"> <div class="u-alignMiddle u-inlineBlock u-verticalAlignTop u-height65 u-xs-height56"> <div class="u-alignBlock"> <div class="buttonSet buttonSet--wide u-lineHeightInherit"> <!--<a class="button button&#45;&#45;primary button&#45;&#45;dark button&#45;&#45;chromeless u-accentColor&#45;&#45;buttonDark is-inSiteNavBar u-xs-hide js-signInButton" href="#">--> <!--中文</a>--> <a class="button button--primary button--dark button--withChrome u-accentColor--buttonDark is-inSiteNavBar" href="russian_minister_of_communications_and_mass_media.html"> EN</a> </div> </div> </div> </div> </div> <div class="metabar-inner u-marginAuto u-maxWidth1000"> <nav role="navigation" class="metabar-block metabar-block--below u-overflowHiddenY u-height40"> <ul class="u-textAlignLeft u-noWrap u-overflowX u-paddingBottom100 u-sm-paddingLeft20 u-sm-paddingRight20"> <li class="metabar-navItem u-uiTextMedium u-xs-fontSize11 u-fontSize14 u-inlineBlock u-textUppercase u-letterSpacing003 u-textColorNormal u-xs-paddingRight12 u-xs-marginRight0 u-paddingTop5 u-xs-paddingTop10"> <a class="link link--darken u-accentColor--textDarken " href="http://unitimes.media/category/unitalks/?lang=zh">独角访谈 </a></li> <li class="metabar-navItem u-uiTextMedium u-xs-fontSize11 u-fontSize14 u-inlineBlock u-textUppercase u-letterSpacing003 u-textColorNormal u-xs-paddingRight12 u-xs-marginRight0 u-paddingTop5 u-xs-paddingTop10"> <a class="link link--darker link--darken u-accentColor--textDarken link--noUnderline " href="http://unitimes.media/category/news/?lang=zh">新闻 </a></li> <li class="metabar-navItem u-uiTextMedium u-xs-fontSize11 u-fontSize14 u-inlineBlock u-textUppercase u-letterSpacing003 u-textColorNormal u-xs-paddingRight12 u-xs-marginRight0 u-paddingTop5 u-xs-paddingTop10"> <a class="link link--darken u-accentColor--textDarken link--noUnderline " href="http://unitimes.media/category/knowledge/?lang=zh">知识库 </a></li> <li class="metabar-navItem u-uiTextMedium u-xs-fontSize11 u-fontSize14 u-inlineBlock u-textUppercase u-letterSpacing003 u-textColorNormal u-xs-paddingRight12 u-xs-marginRight0 u-paddingTop5 u-xs-paddingTop10"> <a class="link link--darken u-accentColor--textDarken link--noUnderline " href="http://unitimes.media/category/events/?lang=zh">活动 </a></li> <span class="u-borderLeft1 u-paddingLeft22 u-xs-paddingLeft12 u-baseColor--borderLight"></span> <li class="metabar-navItem is-external u-uiTextMedium u-xs-fontSize11 u-fontSize14 u-inlineBlock u-textUppercase u-letterSpacing003 u-textColorNormal u-xs-paddingRight12 u-xs-marginRight0 u-paddingTop5 u-xs-paddingTop10"> <a class="link link--darken u-accentColor--textDarken link--noUnderline " href="http://unitimes.media/?lang=zh">首页 </a></li> </ul> </nav> </div> </div> <div class="metabar metabar--spacer u-tintBgColor u-height105 u-xs-height95"></div> <main role="main"> <article class="u-minHeight100vhOffset65 u-overflowHidden postArticle postArticle--full is-withAccentColors" lang="cn" data-scroll="native"> <header class="container u-maxWidth740"> <div class="uiScale uiScale-ui--regular uiScale-caption--regular postMetaHeader u-paddingBottom10 row"> <div class="col u-size12of12"> <div class="uiScale uiScale-ui--regular uiScale-caption--regular postMetaLockup postMetaLockup--authorWithBio u-flexCenter"> <div class="u-flex0"> <!--<a class="link avatar u-baseColor&#45;&#45;link ui-linkSubtle" href="#">--> <img src="../images/xue.jpg" width="50px" height="50px" class="avatar-image"> <!--</a>--> </div> <div class="u-flex1 u-paddingLeft15 u-overflowHidden"> <div class="u-lineHeightTightest u-xs-fontSize11 "> 徐雪 </div> <div class="ui-caption postMetaInline"> <time>2017.11.22</time> <!--<span class="middotDivider u-fontSize12"></span>--> <!--<span class="readingTime"title="3 min read"></span>--> </div> </div> </div> </div> </div> </header> <div class="postArticle-content" data-scroll="native"> <section class="section section--body section--first"> <div class="section-content"> <div class="section-inner sectionLayout--insetColumn"> <h1 class="graf graf--h3 graf--leading graf--title u-xs-fontSize24 u-fontSize30 u-lineHeightBase" style="font-family: 'Microsoft Yahei';"> 俄罗斯通信和传媒部长:国家不会考虑比特币合法化 </h1> <p class="graf graf--p graf-after--h3 u-xs-fontSize12 u-fontSize15" style="font-family: 'Microsoft Yahei';margin-top: 30px"> <em class="markup--em markup--p-em"> “据悉就在一周前,俄罗斯央行一位高级官员表示,首次代币发行(ICO)可能会为创业公司带来融资机会。而且,一周前,俄罗斯联邦旅游局负责人也预测说区块链可以改变该国的旅游业” </em> </p> <img class="graf--p graf-image" src="../images/news/russian_minister_of.jpg" width="100%"> <p class="graf graf--p graf-after--p u-xs-fontSize12 u-fontSize15" style="font-family: 'Microsoft Yahei';">俄罗斯通信和传媒部长Nikolai Nikiforov近日表示,该国不会考虑比特币等数字货币的合法化。 </p> <p class="graf graf--p graf-after--p u-xs-fontSize12 u-fontSize15" style="font-family: 'Microsoft Yahei';">根据俄罗斯国有新闻服务<a href="http://tass.com/economy/976510">TASS</a>的消息,Nikolai Nikiforov表示,比特币是使用区块链技术的外国项目,俄罗斯法律决不会将比特币视为俄罗斯联邦管辖范围内的法律实体。“不过俄罗斯很有可能使用区块链技术以及各种数字代币。”他补充说。 </p> <p class="graf graf--p graf-after--p u-xs-fontSize12 u-fontSize15" style="font-family: 'Microsoft Yahei';"> 据报道在今年10月份,俄罗斯通信部向政府起草了一份文件,规定了加密货币的合法采用,并且内容包含区块链及加密货币的相关技术细节。 </p> <p class="graf graf--p graf-after--p u-xs-fontSize12 u-fontSize15" style="font-family: 'Microsoft Yahei';">Nikolai Nikiforov表示,“我想我们应该从技术的角度出发提供这样的工具,在数字经济发展过程中几乎不可能通过限制来获得任何东西。” 而针对此俄罗斯银行和财政部将会做出最后的决定。 </p> <p class="graf graf--p graf-after--p u-xs-fontSize12 u-fontSize15" style="font-family: 'Microsoft Yahei';"> 俄罗斯政府官员最近已经发出了一系列支持区块链的声音。据悉就在一周前,俄罗斯央行一位高级官员<a href="https://www.coindesk.com/russian-central-bank-official-icos-have-huge-potential/">表示</a>,首次代币发行(ICO)可能会为创业公司带来融资机会。而且,一周前,俄罗斯联邦旅游局负责人也<a href="https://www.coindesk.com/russian-official-blockchain-will-seriously-change-tourism-industry/">预测</a>说区块链可以改变该国的旅游业。 </p> <p class="graf graf--p graf-after--p u-xs-fontSize10 u-fontSize13 u-textColorNormal" style="font-family: 'Microsoft Yahei';"> <em> 【声明:文章为作者独立观点,不代表UNITIMES官网立场。欢迎转载,转载请务必注明来源。如有不当之处请多指教】 </em> </p> </div> </div> </section> <!--<section name="5e3a"class="section section&#45;&#45;body section&#45;&#45;last"></section>--> </div> <footer class="u-paddingTop30"> <div class="container u-maxWidth740"> <div class="row"> <div class="col u-size12of12"> <div class="u-paddingBottom30"> <ul class="tags tags--postTags tags--borderless u-xs-fontSize10" style="font-family: 'Microsoft Yahei';"> 标签: <li class="u-xs-fontSize10" style="font-family: 'Microsoft Yahei';"> <a class="link "> 区块链 </a></li> <li class="u-xs-fontSize10" style="font-family: 'Microsoft Yahei';"> <a class="link "> ICO </a></li> <li class="u-xs-fontSize10" style="font-family: 'Microsoft Yahei';"> <a class="link "> 加密货币 </a></li> <li class="u-xs-fontSize10" style="font-family: 'Microsoft Yahei';"> <a class="link "> 俄罗斯 </a></li> </ul> </div> </div> </div> </div> <div class="streamItem streamItem--placementCardGrid"> <div class="u-clearfix u-backgroundGrayLightest"> <div class="row u-marginAuto u-maxWidth1000 u-paddingTop30 u-paddingBottom20"> <div class="col u-padding8 u-xs-size12of12 u-size4of12"> <div class="uiScale uiScale-ui--small uiScale-caption--regular u-height280 u-sizeFullWidth u-backgroundWhite u-borderCardBorder u-boxShadow u-borderBox u-borderRadius4" data-scroll="native"> <a class="link link--noUnderline " href="http://unitimes.media/?p=1719&lang=zh"> <div class="u-backgroundCover u-backgroundColorGrayLight u-height100 u-sizeFullWidth u-borderBottomLight u-borderRadiusTop4" style="background-image: url('../images/news/c2-thumb.jpg');"></div> </a> <div class="u-padding15 u-borderBox u-flexColumn u-height180"> <a class="link link--noUnderline u-flex1 " href="http://unitimes.media/?p=1719&lang=zh"> <div class="ui-caption postMetaInline u-noWrapWithEllipsis u-marginBottom7" style="font-size:15px !important;"> 新闻 </div> <div class="ui-heading ui-clamp2 u-textColorDarkest u-contentSansBold u-maxHeight2LineHeightTighter u-lineClamp2 u-textOverflowEllipsis u-letterSpacingTight u-paddingBottom2" style="font-size: 17px !important;"> 中国正式禁止各类代币发行融资活动,虚拟货币价格随后暴跌 </div> </a> <div class="u-paddingTop10 u-flex0 u-flexCenter"> <div class="u-flex1 u-minWidth0 u-marginRight10"> <div class="u-flexCenter"> <div class="postMetaInline-avatar u-flex0"> <!--<a class="link avatar u-baseColor&#45;&#45;link ui-linkSubtle" href="#">--> <img src="../images/xue.jpg" class="avatar-image u-size36x36"> <!--</a>--> </div> <div class="postMetaInline postMetaInline-authorLockup u-flex1 u-noWrapWithEllipsis u-xs-fontSize10"> <!--<a class="link link link&#45;&#45;darken link&#45;&#45;darker u-baseColor&#45;&#45;link ui-linkSubtle" href="#">--> 徐雪 <!--</a>--> <div class="u-fontSize12 u-baseColor--textNormal u-textColorNormal"> <time>2017.09.04</time> <!--<span class="readingTime u-textColorNormal" title="1 min read"></span>--> </div> </div> </div> </div> </div> </div> </div> </div> <div class="col u-padding8 u-xs-size12of12 u-size4of12"> <div class="uiScale uiScale-ui--small uiScale-caption--regular u-height280 u-sizeFullWidth u-backgroundWhite u-borderCardBorder u-boxShadow u-borderBox u-borderRadius4" data-scroll="native"> <a class="link link--noUnderline " href="http://unitimes.media/?p=1173&lang=zh"> <div class="u-backgroundCover u-backgroundColorGrayLight u-height100 u-sizeFullWidth u-borderBottomLight u-borderRadiusTop4" style="background-image: url('../images/news/c5-thumb.jpg');"></div> </a> <div class="u-padding15 u-borderBox u-flexColumn u-height180"> <a class="link link--noUnderline u-flex1 " href="http://unitimes.media/?p=1173&lang=zh"> <div class="ui-caption postMetaInline u-noWrapWithEllipsis u-marginBottom7" style="font-size:15px !important;"> 新闻 </div> <div class="ui-heading ui-clamp2 u-textColorDarkest u-contentSansBold u-maxHeight2LineHeightTighter u-lineClamp2 u-textOverflowEllipsis u-letterSpacingTight u-paddingBottom2" style="font-size: 17px !important;"> 第三届全球区块链峰会在上海成功召开 </div> </a> <div class="u-paddingTop10 u-flex0 u-flexCenter"> <div class="u-flex1 u-minWidth0 u-marginRight10"> <div class="u-flexCenter"> <div class="postMetaInline-avatar u-flex0"> <!--<a class="link avatar u-baseColor&#45;&#45;link ui-linkSubtle" href="#">--> <img src="../images/cat.jpg" class="avatar-image u-size36x36"> <!--</a>--> </div> <div class="postMetaInline postMetaInline-authorLockup u-flex1 u-noWrapWithEllipsis u-xs-fontSize10"> <!--<a class="link link link&#45;&#45;darken link&#45;&#45;darker u-baseColor&#45;&#45;link ui-linkSubtle" href="#">--> 清欢 <!--</a>--> <div class="u-fontSize12 u-baseColor--textNormal u-textColorNormal"> <time>2017.09.18</time> <!--<span class="readingTime u-textColorNormal" title="1 min read"></span>--> </div> </div> </div> </div> </div> </div> </div> </div> <div class="col u-padding8 u-xs-size12of12 u-size4of12"> <div class="uiScale uiScale-ui--small uiScale-caption--regular u-height280 u-sizeFullWidth u-backgroundWhite u-borderCardBorder u-boxShadow u-borderBox u-borderRadius4" data-scroll="native"> <a class="link link--noUnderline " href="http://unitimes.media/?p=1677&lang=zh"> <div class="u-backgroundCover u-backgroundColorGrayLight u-height100 u-sizeFullWidth u-borderBottomLight u-borderRadiusTop4" style="background-image: url('../images/news/w4-thumb.jpg');"></div> </a> <div class="u-padding15 u-borderBox u-flexColumn u-height180"> <a class="link link--noUnderline u-flex1 " href="http://unitimes.media/?p=1677&lang=zh"> <div class="ui-caption postMetaInline u-noWrapWithEllipsis u-marginBottom7" style="font-size:15px !important;"> 新闻 </div> <div class="ui-heading ui-clamp2 u-textColorDarkest u-contentSansBold u-maxHeight2LineHeightTighter u-lineClamp2 u-textOverflowEllipsis u-letterSpacingTight u-paddingBottom2" style="font-size: 17px !important;"> 以太坊ERC-20代币标准已正式确定 </div> </a> <div class="u-paddingTop10 u-flex0 u-flexCenter"> <div class="u-flex1 u-minWidth0 u-marginRight10"> <div class="u-flexCenter"> <div class="postMetaInline-avatar u-flex0"> <!--<a class="link avatar u-baseColor&#45;&#45;link ui-linkSubtle" href="#">--> <img src="../images/dog.jpg" class="avatar-image u-size36x36"> <!--</a>--> </div> <div class="postMetaInline postMetaInline-authorLockup u-flex1 u-noWrapWithEllipsis u-xs-fontSize10"> <!--<a class="link link link&#45;&#45;darken link&#45;&#45;darker u-baseColor&#45;&#45;link ui-linkSubtle" href="#">--> 浅汐 <!--</a>--> <div class="u-fontSize12 u-baseColor--textNormal u-textColorNormal"> <time>2017.09.11</time> <!--<span class="readingTime u-textColorNormal" title="1 min read"></span>--> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="u-textAlignCenter u-paddingBottom20 u-xs-fontSize10">&copy; UNITIMES. All Rights Reserved. </div> </div> </div> </footer> </article> </main> </div> </div> </div> <div class="surface-scrollOverlay"></div> </body> </html>
LinkTimeTech/website
unitimes/Unitimes Web 5/news/russian_minister_of_communications_and_mass_media_cn.html
HTML
mit
29,153
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="user-scalable=no, width=device-width, minimum-scale=1, maximum-scale=1" /> <title>Tween - Hilo Example</title> <link rel="stylesheet" type="text/css" href="css/style.css"> <script type="text/javascript" src="../build/standalone/hilo-standalone.min.js"></script> <script type="text/javascript" src="../build/flash/hilo-flash.min.js" data-auto="true"></script> <style type="text/css"> body{ /*background-color: #000;*/ } #game-container{ line-height: 0; /*-webkit-tranform: translateZ(0);*/ } .box{ position: relative; display: inline-block; width: 15px; height: 15px; border: 1px solid #fff; background-color: blue; } </style> </head> <body onload="init();"> <div id="header"> <h1>Tween</h1> <p>Tween类提供缓动动画功能,使用Tween和Ease函数库可创建各种各样丰富的缓动动画。</p> </div> <div id="game-container"></div> <script type="text/javascript" src="js/demo.js"></script> <script type="text/javascript"> var Ticker = Hilo.Ticker; var Tween = Hilo.Tween; var Ease = Hilo.Ease; var box; function init(){ //start ticker var ticker = new Ticker(60); ticker.addTick(Tween); ticker.start(); box = document.createElement('div'); box.id = 'box'; box.className = 'box'; box.x = 0; box.y = 0; gameContainer.appendChild(box); Tween.to(box, {x:50, y:50}, { duration: 500, onUpdate: onUpdateTransform, onComplete: runLink }); } function runLink(){ Tween.to(box, {x:50, y:150}, { duration: 500, onUpdate: onUpdateTransform }) .link(Tween.to(box, {x:150}, { duration: 500, onUpdate: onUpdateTransform, delay:'+0' })) .link(Tween.to(box, {y:50}, { duration: 500, onUpdate: onUpdateTransform, delay:'+0' })) .link(Tween.to(box, {x:50}, { duration: 500, onUpdate: onUpdateTransform, delay:'+0', onComplete:runLink })) } function onUpdateTransform(ratio, tween){ tween.target.style.webkitTransform = 'translate(' + tween.target.x + 'px,' + tween.target.y + 'px)'; } </script> </body> </html>
hiloteam/Hilo
examples/TweenLink.html
HTML
mit
2,728
/********************************************************************++ Copyright (c) Microsoft Corporation. All rights reserved. --********************************************************************/ using System.Collections; using System.Collections.Generic; using System.Management.Automation.Language; using System.Management.Automation.Runspaces; using Dbg = System.Management.Automation.Diagnostics; namespace System.Management.Automation { /// <summary> /// Holds the state of a Monad Shell session /// </summary> internal sealed partial class SessionStateInternal { #region Functions /// <summary> /// Add an new SessionState function entry to this session state object... /// </summary> /// <param name="entry">The entry to add</param> internal void AddSessionStateEntry(SessionStateFunctionEntry entry) { ScriptBlock sb = entry.ScriptBlock.Clone(); FunctionInfo fn = this.SetFunction(entry.Name, sb, null, entry.Options, false, CommandOrigin.Internal, this.ExecutionContext, entry.HelpFile, true); fn.Visibility = entry.Visibility; fn.Module = entry.Module; fn.ScriptBlock.LanguageMode = PSLanguageMode.FullLanguage; } #if !CORECLR // Workflow Not Supported On CSS internal void AddSessionStateEntry(InitialSessionState initialSessionState, SessionStateWorkflowEntry entry) { var converterInstance = Utils.GetAstToWorkflowConverterAndEnsureWorkflowModuleLoaded(null); var workflowInfo = entry.WorkflowInfo ?? converterInstance.CompileWorkflow(entry.Name, entry.Definition, initialSessionState); WorkflowInfo wf = new WorkflowInfo(workflowInfo); wf = this.SetWorkflowRaw(wf, CommandOrigin.Internal); wf.Visibility = entry.Visibility; wf.Module = entry.Module; } #endif /// <summary> /// Gets a flattened view of the functions that are visible using /// the current scope as a reference and filtering the functions in /// the other scopes based on the scoping rules. /// </summary> /// /// <returns> /// An IDictionary representing the visible functions. /// </returns> /// internal IDictionary GetFunctionTable() { SessionStateScopeEnumerator scopeEnumerator = new SessionStateScopeEnumerator(_currentScope); Dictionary<string, FunctionInfo> result = new Dictionary<string, FunctionInfo>(StringComparer.OrdinalIgnoreCase); foreach (SessionStateScope scope in scopeEnumerator) { foreach (FunctionInfo entry in scope.FunctionTable.Values) { if (!result.ContainsKey(entry.Name)) { result.Add(entry.Name, entry); } } } return result; } // GetFunctionTable /// <summary> /// Gets an IEnumerable for the function table for a given scope /// </summary> /// /// <param name="scopeID"> /// A scope identifier that is either one of the "special" scopes like /// "global", "script", "local", or "private, or a numeric ID of a relative scope /// to the current scope. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="scopeID"/> is less than zero, or not /// a number and not "script", "global", "local", or "private" /// </exception> /// /// <exception cref="ArgumentOutOfRangeException"> /// If <paramref name="scopeID"/> is less than zero or greater than the number of currently /// active scopes. /// </exception> /// internal IDictionary<string, FunctionInfo> GetFunctionTableAtScope(string scopeID) { Dictionary<string, FunctionInfo> result = new Dictionary<string, FunctionInfo>(StringComparer.OrdinalIgnoreCase); SessionStateScope scope = GetScopeByID(scopeID); foreach (FunctionInfo entry in scope.FunctionTable.Values) { // Make sure the function/filter isn't private or if it is that the current // scope is the same scope the alias was retrieved from. if ((entry.Options & ScopedItemOptions.Private) == 0 || scope == _currentScope) { result.Add(entry.Name, entry); } } return result; } // GetFunctionTableAtScope /// <summary> /// List of functions/filters to export from this session state object... /// </summary> internal List<FunctionInfo> ExportedFunctions { get; } = new List<FunctionInfo>(); /// <summary> /// List of workflows to export from this session state object... /// </summary> internal List<WorkflowInfo> ExportedWorkflows { get; } = new List<WorkflowInfo>(); internal bool UseExportList { get; set; } = false; /// <summary> /// Get a functions out of session state. /// </summary> /// /// <param name="name"> /// name of function to look up /// </param> /// /// <param name="origin"> /// Origin of the command that called this API... /// </param> /// /// <returns> /// The value of the specified function. /// </returns> /// /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// </exception> /// internal FunctionInfo GetFunction(string name, CommandOrigin origin) { if (String.IsNullOrEmpty(name)) { throw PSTraceSource.NewArgumentException("name"); } FunctionInfo result = null; FunctionLookupPath lookupPath = new FunctionLookupPath(name); FunctionScopeItemSearcher searcher = new FunctionScopeItemSearcher(this, lookupPath, origin); if (searcher.MoveNext()) { result = ((IEnumerator<FunctionInfo>)searcher).Current; } return result; } // GetFunction /// <summary> /// Get a functions out of session state. /// </summary> /// /// <param name="name"> /// name of function to look up /// </param> /// /// <returns> /// The value of the specified function. /// </returns> /// /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// </exception> /// internal FunctionInfo GetFunction(string name) { return GetFunction(name, CommandOrigin.Internal); } // GetFunction private IEnumerable<string> GetFunctionAliases(IParameterMetadataProvider ipmp) { if (ipmp == null || ipmp.Body.ParamBlock == null) yield break; var attributes = ipmp.Body.ParamBlock.Attributes; foreach (var attributeAst in attributes) { var attributeType = attributeAst.TypeName.GetReflectionAttributeType(); if (attributeType == typeof(AliasAttribute)) { var cvv = new ConstantValueVisitor { AttributeArgument = true }; for (int i = 0; i < attributeAst.PositionalArguments.Count; i++) { yield return Compiler._attrArgToStringConverter.Target(Compiler._attrArgToStringConverter, attributeAst.PositionalArguments[i].Accept(cvv)); } } } } /// <summary> /// Set a function in the current scope of session state. /// </summary> /// /// <param name="name"> /// The name of the function to set. /// </param> /// /// <param name="function"> /// The new value of the function being set. /// </param> /// /// <param name="origin"> /// Origin of the caller of this API /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="function"/> is null. /// </exception> /// /// <exception cref="SessionStateUnauthorizedAccessException"> /// If the function is read-only or constant. /// </exception> /// /// <exception cref="SessionStateOverflowException"> /// If the maximum number of functions have been reached for this scope. /// </exception> /// internal FunctionInfo SetFunctionRaw( string name, ScriptBlock function, CommandOrigin origin) { if (String.IsNullOrEmpty(name)) { throw PSTraceSource.NewArgumentException("name"); } if (function == null) { throw PSTraceSource.NewArgumentNullException("function"); } string originalName = name; FunctionLookupPath path = new FunctionLookupPath(name); name = path.UnqualifiedPath; if (String.IsNullOrEmpty(name)) { SessionStateException exception = new SessionStateException( originalName, SessionStateCategory.Function, "ScopedFunctionMustHaveName", SessionStateStrings.ScopedFunctionMustHaveName, ErrorCategory.InvalidArgument); throw exception; } ScopedItemOptions options = ScopedItemOptions.None; if (path.IsPrivate) { options |= ScopedItemOptions.Private; } FunctionScopeItemSearcher searcher = new FunctionScopeItemSearcher( this, path, origin); var functionInfo = searcher.InitialScope.SetFunction(name, function, null, options, false, origin, ExecutionContext); foreach (var aliasName in GetFunctionAliases(function.Ast as IParameterMetadataProvider)) { searcher.InitialScope.SetAliasValue(aliasName, name, ExecutionContext, false, origin); } return functionInfo; } // SetFunctionRaw internal WorkflowInfo SetWorkflowRaw( WorkflowInfo workflowInfo, CommandOrigin origin) { string originalName = workflowInfo.Name; string name = originalName; FunctionLookupPath path = new FunctionLookupPath(name); name = path.UnqualifiedPath; if (String.IsNullOrEmpty(name)) { SessionStateException exception = new SessionStateException( originalName, SessionStateCategory.Function, "ScopedFunctionMustHaveName", SessionStateStrings.ScopedFunctionMustHaveName, ErrorCategory.InvalidArgument); throw exception; } ScopedItemOptions options = ScopedItemOptions.None; if (path.IsPrivate) { options |= ScopedItemOptions.Private; } FunctionScopeItemSearcher searcher = new FunctionScopeItemSearcher( this, path, origin); // The script that defines a workflowInfo wrapper is fully trusted workflowInfo.ScriptBlock.LanguageMode = PSLanguageMode.FullLanguage; if (workflowInfo.Module == null && this.Module != null) { workflowInfo.Module = this.Module; } var wfInfo = (WorkflowInfo) searcher.InitialScope.SetFunction(name, workflowInfo.ScriptBlock, null, options, false, origin, ExecutionContext, null, (arg1, arg2, arg3, arg4, arg5, arg6) => workflowInfo); foreach (var aliasName in GetFunctionAliases(workflowInfo.ScriptBlock.Ast as IParameterMetadataProvider)) { searcher.InitialScope.SetAliasValue(aliasName, name, ExecutionContext, false, origin); } return wfInfo; } // SetWorkflowRaw /// <summary> /// Set a function in the current scope of session state. /// </summary> /// /// <param name="name"> /// The name of the function to set. /// </param> /// /// <param name="function"> /// The new value of the function being set. /// </param> /// /// <param name="originalFunction"> /// The original function (if any) from which the ScriptBlock is derived. /// </param> /// /// <param name="options"> /// The options to set on the function. /// </param> /// /// <param name="force"> /// If true, the function will be set even if its ReadOnly. /// </param> /// /// <param name="origin"> /// Origin of the caller of this API /// </param> /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="function"/> is null. /// </exception> /// /// <exception cref="SessionStateUnauthorizedAccessException"> /// If the function is read-only or constant. /// </exception> /// /// <exception cref="SessionStateOverflowException"> /// If the maximum number of functions have been reached for this scope. /// </exception> /// internal FunctionInfo SetFunction( string name, ScriptBlock function, FunctionInfo originalFunction, ScopedItemOptions options, bool force, CommandOrigin origin) { return SetFunction(name, function, originalFunction, options, force, origin, ExecutionContext, null); } // SetFunction /// <summary> /// Set a function in the current scope of session state. /// </summary> /// /// <param name="name"> /// The name of the function to set. /// </param> /// /// <param name="function"> /// The new value of the function being set. /// </param> /// /// <param name="originalFunction"> /// The original function (if any) from which the ScriptBlock is derived. /// </param> /// /// <param name="options"> /// The options to set on the function. /// </param> /// /// <param name="force"> /// If true, the function will be set even if its ReadOnly. /// </param> /// /// <param name="origin"> /// Origin of the caller of this API /// </param> /// /// <param name="helpFile"> /// The name of the help file associated with the function. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="function"/> is null. /// </exception> /// /// <exception cref="SessionStateUnauthorizedAccessException"> /// If the function is read-only or constant. /// </exception> /// /// <exception cref="SessionStateOverflowException"> /// If the maximum number of functions have been reached for this scope. /// </exception> /// internal FunctionInfo SetFunction( string name, ScriptBlock function, FunctionInfo originalFunction, ScopedItemOptions options, bool force, CommandOrigin origin, string helpFile) { return SetFunction(name, function, originalFunction, options, force, origin, ExecutionContext, helpFile, false); } // SetFunction /// <summary> /// Set a function in the current scope of session state. /// </summary> /// /// <param name="name"> /// The name of the function to set. /// </param> /// /// <param name="function"> /// The new value of the function being set. /// </param> /// /// <param name="originalFunction"> /// The original function (if any) from which the ScriptBlock is derived. /// </param> /// /// <param name="options"> /// The options to set on the function. /// </param> /// /// <param name="force"> /// If true, the function will be set even if its ReadOnly. /// </param> /// /// <param name="origin"> /// Origin of the caller of this API /// </param> /// /// <param name="context"> /// The execution context for the function. /// </param> /// /// <param name="helpFile"> /// The name of the help file associated with the function. /// </param> /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="function"/> is null. /// </exception> /// /// <exception cref="SessionStateUnauthorizedAccessException"> /// If the function is read-only or constant. /// </exception> /// /// <exception cref="SessionStateOverflowException"> /// If the maximum number of functions have been reached for this scope. /// </exception> /// internal FunctionInfo SetFunction( string name, ScriptBlock function, FunctionInfo originalFunction, ScopedItemOptions options, bool force, CommandOrigin origin, ExecutionContext context, string helpFile) { return SetFunction(name, function, originalFunction, options, force, origin, context, helpFile, false); } // SetFunction /// <summary> /// Set a function in the current scope of session state. /// </summary> /// /// <param name="name"> /// The name of the function to set. /// </param> /// /// <param name="function"> /// The new value of the function being set. /// </param> /// /// <param name="originalFunction"> /// The original function (if any) from which the ScriptBlock is derived. /// </param> /// /// <param name="options"> /// The options to set on the function. /// </param> /// /// <param name="force"> /// If true, the function will be set even if its ReadOnly. /// </param> /// /// <param name="origin"> /// Origin of the caller of this API /// </param> /// /// <param name="context"> /// The execution context for the function. /// </param> /// /// <param name="helpFile"> /// The name of the help file associated with the function. /// </param> /// /// <param name="isPreValidated"> /// Set to true if it is a regular function (meaning, we do not need to check this is a workflow or if the script contains JobDefinition Attribute and then process it) /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="function"/> is null. /// </exception> /// /// <exception cref="SessionStateUnauthorizedAccessException"> /// If the function is read-only or constant. /// </exception> /// /// <exception cref="SessionStateOverflowException"> /// If the maximum number of functions have been reached for this scope. /// </exception> /// internal FunctionInfo SetFunction( string name, ScriptBlock function, FunctionInfo originalFunction, ScopedItemOptions options, bool force, CommandOrigin origin, ExecutionContext context, string helpFile, bool isPreValidated) { if (String.IsNullOrEmpty(name)) { throw PSTraceSource.NewArgumentException("name"); } if (function == null) { throw PSTraceSource.NewArgumentNullException("function"); } string originalName = name; FunctionLookupPath path = new FunctionLookupPath(name); name = path.UnqualifiedPath; if (String.IsNullOrEmpty(name)) { SessionStateException exception = new SessionStateException( originalName, SessionStateCategory.Function, "ScopedFunctionMustHaveName", SessionStateStrings.ScopedFunctionMustHaveName, ErrorCategory.InvalidArgument); throw exception; } if (path.IsPrivate) { options |= ScopedItemOptions.Private; } FunctionScopeItemSearcher searcher = new FunctionScopeItemSearcher( this, path, origin); return searcher.InitialScope.SetFunction(name, function, originalFunction, options, force, origin, context, helpFile); } // SetFunction /// <summary> /// Set a function in the current scope of session state. /// </summary> /// /// <param name="name"> /// The name of the function to set. /// </param> /// /// <param name="function"> /// The new value of the function being set. /// </param> /// /// <param name="originalFunction"> /// The original function (if any) from which the ScriptBlock is derived. /// </param> /// /// <param name="force"> /// If true, the function will be set even if its ReadOnly. /// </param> /// /// <param name="origin"> /// The origin of the caller /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// or /// If <paramref name="function"/> is not a <see cref="FilterInfo">FilterInfo</see> /// or <see cref="FunctionInfo">FunctionInfo</see> /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="function"/> is null. /// </exception> /// /// <exception cref="SessionStateUnauthorizedAccessException"> /// If the function is read-only or constant. /// </exception> /// /// <exception cref="SessionStateOverflowException"> /// If the maximum number of functions have been reached for this scope. /// </exception> /// internal FunctionInfo SetFunction( string name, ScriptBlock function, FunctionInfo originalFunction, bool force, CommandOrigin origin) { if (String.IsNullOrEmpty(name)) { throw PSTraceSource.NewArgumentException("name"); } if (function == null) { throw PSTraceSource.NewArgumentNullException("function"); } string originalName = name; FunctionLookupPath path = new FunctionLookupPath(name); name = path.UnqualifiedPath; if (String.IsNullOrEmpty(name)) { SessionStateException exception = new SessionStateException( originalName, SessionStateCategory.Function, "ScopedFunctionMustHaveName", SessionStateStrings.ScopedFunctionMustHaveName, ErrorCategory.InvalidArgument); throw exception; } ScopedItemOptions options = ScopedItemOptions.None; if (path.IsPrivate) { options |= ScopedItemOptions.Private; } FunctionScopeItemSearcher searcher = new FunctionScopeItemSearcher( this, path, origin); FunctionInfo result = null; SessionStateScope scope = searcher.InitialScope; if (searcher.MoveNext()) { scope = searcher.CurrentLookupScope; name = searcher.Name; if (path.IsPrivate) { // Need to add the Private flag FunctionInfo existingFunction = scope.GetFunction(name); options |= existingFunction.Options; result = scope.SetFunction(name, function, originalFunction, options, force, origin, ExecutionContext); } else { result = scope.SetFunction(name, function, force, origin, ExecutionContext); } } else { if (path.IsPrivate) { result = scope.SetFunction(name, function, originalFunction, options, force, origin, ExecutionContext); } else { result = scope.SetFunction(name, function, force, origin, ExecutionContext); } } return result; } /// <summary> /// Set a function in the current scope of session state. /// /// BUGBUG: this overload is preserved because a lot of tests use reflection to /// call it. The tests should be fixed and this API eventually removed. /// </summary> /// /// <param name="name"> /// The name of the function to set. /// </param> /// /// <param name="function"> /// The new value of the function being set. /// </param> /// /// <param name="force"> /// If true, the function will be set even if its ReadOnly. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// or /// If <paramref name="function"/> is not a <see cref="FilterInfo">FilterInfo</see> /// or <see cref="FunctionInfo">FunctionInfo</see> /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="function"/> is null. /// </exception> /// /// <exception cref="SessionStateUnauthorizedAccessException"> /// If the function is read-only or constant. /// </exception> /// /// <exception cref="SessionStateOverflowException"> /// If the maximum number of functions have been reached for this scope. /// </exception> /// internal FunctionInfo SetFunction(string name, ScriptBlock function, bool force) { return SetFunction(name, function, null, force, CommandOrigin.Internal); } /// <summary> /// Removes a function from the function table. /// </summary> /// /// <param name="name"> /// The name of the function to remove. /// </param> /// /// <param name="origin"> /// THe origin of the caller of this API /// </param> /// /// <param name="force"> /// If true, the function is removed even if it is ReadOnly. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// </exception> /// /// <exception cref="SessionStateUnauthorizedAccessException"> /// If the function is constant. /// </exception> /// internal void RemoveFunction(string name, bool force, CommandOrigin origin) { if (String.IsNullOrEmpty(name)) { throw PSTraceSource.NewArgumentException("name"); } // Use the scope enumerator to find an existing function SessionStateScope scope = _currentScope; FunctionLookupPath path = new FunctionLookupPath(name); FunctionScopeItemSearcher searcher = new FunctionScopeItemSearcher( this, path, origin); if (searcher.MoveNext()) { scope = searcher.CurrentLookupScope; } scope.RemoveFunction(name, force); } // RemoveFunction /// <summary> /// Removes a function from the function table. /// </summary> /// /// <param name="name"> /// The name of the function to remove. /// </param> /// /// <param name="force"> /// If true, the function is removed even if it is ReadOnly. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="name"/> is null or empty. /// </exception> /// /// <exception cref="SessionStateUnauthorizedAccessException"> /// If the function is constant. /// </exception> /// internal void RemoveFunction(string name, bool force) { RemoveFunction(name, force, CommandOrigin.Internal); } /// <summary> /// Removes a function from the function table /// if the function was imported from the given module. /// /// BUGBUG: This is only used by the implict remoting functions... /// </summary> /// /// <param name="name"> /// The name of the function to remove. /// </param> /// /// <param name="module"> /// Module the function might be imported from. /// </param> /// /// <exception cref="SessionStateUnauthorizedAccessException"> /// If the function is constant. /// </exception> /// internal void RemoveFunction(string name, PSModuleInfo module) { Dbg.Assert(module != null, "Caller should verify that module parameter is not null"); FunctionInfo func = GetFunction(name) as FunctionInfo; if (func != null && func.ScriptBlock != null && func.ScriptBlock.File != null && func.ScriptBlock.File.Equals(module.Path, StringComparison.OrdinalIgnoreCase)) { RemoveFunction(name, true); } } #endregion Functions } // SessionStateInternal class }
kmosher/PowerShell
src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs
C#
mit
32,581
#!/bin/sh # Variables # Required paths # Global # ~ # |-.gitconfig # |-.git # Project <- place of execution # |-.git # |-hooks # | |-hook.sh # |-config # custom home used for development # HOME="home" globalGitDir="$HOME/.git" globalGitConfig="$HOME/.gitconfig" globalTemplateDir="$globalGitDir/templates" localDir="$(pwd)" localGitConfig=".git/config" # if the template folder doesn't exist, create it # Variable that contains the found template selectedTemplate="" # Prepare the usage message read -d '' usageMessage << EOF Git Passport, bash-only version Usage : ./git-passport [-hlr] [FILE] Help : ./git-passport -h EOF # Prepare the help message read -d '' helpMessage << EOF $usageMessage Examples : ./git-passport a => Use a.template as new configuration ./git-passport -l => a.template => b.template ./git-passport -r => Restore default configuration Flags : -h Print this help message -l List available templates configuration -r Reset configuration to default EOF # Functions # Get the user informations for display function GetConfigUser { fieldRegex="(.*) = (.*)" # parse the template while read -r line do if [[ $line =~ $fieldRegex ]]; then case ${BASH_REMATCH[1]} in "name") name="${BASH_REMATCH[2]}" ;; "email") email="${BASH_REMATCH[2]}" ;; *) echo "$line" esac fi done < "$1" # check for errors if [ -z "$name" ]; then echo "Bad configuration file, did not found the name for file $1, abort... " exit 1 elif [ -z "$email" ]; then echo "Bad configuration file, did not found the email for file $1, abort..." exit 1 else # display the informations echo "$name : $email" fi } # List existing templates in the global git directory function ListExistingTemplate { for file in "$globalTemplateDir"/* do # echo "$file" echo "$(GetConfigUser $file) in file $file" done } # Select the template to be used function SearchTemplate { found=0 cd "$globalTemplateDir" for file in * do if [[ "$file" =~ ^$1 ]]; then echo "Found file $file" selectedTemplate="$globalTemplateDir/$file" fi done cd "$localDir" if [ "$selectedTemplate" == "" ]; then echo "No file found matching '$1' in $globalGitDir" fi } # Apply the selected configuration # simply copy the template at the end of the config file function ApplyConfiguration { cat "$1" >> "$localGitConfig" } # Entry Point # Parse the standart input # http://stackoverflow.com/a/14203146/2558252 # A POSIX variable OPTIND=1 # Reset in case getopts has been used previously in the shell. if [ $# == 0 ]; then echo "$usageMessage" exit 0 fi while getopts "hlr" opt; do case "$opt" in h) echo "$helpMessage" ;; l) ListExistingTemplate ;; r) echo "TODO : should reset the configuration" ;; esac done shift $((OPTIND-1)) [ "$1" = "--" ] && shift # get trailing parameters as the possible filename if [[ "$@" ]]; then templateFile=$@ fi if [[ "$templateFile" ]]; then SearchTemplate "$templateFile" if [ "$selectedTemplate" != "" ]; then ApplyConfiguration "$selectedTemplate" fi fi
nobe4/git-passport.sh
git-passport.sh
Shell
mit
3,150
<img src="http://d361253.u161.fasthit.net/coldfusion/Property/properties/DOV0029000/000FRONT.jpg" height="150"> <div id="chart" class="floatright"> <svg style="height:330px;width: 450px;"> </svg> </div> <span class="property-details"> <ul class=""> <li> {{viewing.address}} </li> <li> 01/08/1995<span>Purchase Date</span> </li> <li> $115,000<span>Purchase Price</span> </li> </ul> </span> <span class="property-details-cell"> <ul class=""> <li> $35,000<span>Original Net Equity**</span> </li> <li>$80,000<span>Original Mortgage</span></li> <li>$570,000<span>Net Equity</span></li> <li>$80,000<span>Mortgage</span></li> <li>16.84%<span>Return on Equity</span></li> <li>10.14%<span>Return on Investment</span></li> <li>$22,164<span>Annual Rent</span></li> <li>19.27%<span>Rental Growth</span></li> </ul> </span> <em><strong>Market Median+</strong></em> <span ng-repeat="v in viewing.marketValues">{{v.marketMedian}}!</span> $675,000 $670,000 $680,000 $775,000 $825,000 $795,000 $745,000
gotaheads/pms3
app/views/partials/property-details.html
HTML
mit
1,121
GHGrabber ========= Grabs Images from GH Forum. Downloads Images with correct filenames from a Tinyboard + vichan Prepare on Linux ---------------- Install a recent ruby apt-get install ruby install the nokogiri gem gem install nokogiri if you run no transparent proxy you need to install the socksify gem too (Not needed for Tails or Whonix) gem install socksify If you want to upload you will also need to install the rest-client gem (OPTIONAL, only needed for posting/upload) gem install rest-client To have a better jpeg corruption check install jpeginfo (OPTIONAL) apt-get install jpeginfo Prepare on Tails ---------------- ### install packages via Synaptic Package Manager 1. ruby * ruby-nokogiri * ruby1.9.1 (for compatibility) * check is "libruby1.9.1" also marked for install ### To be sure your TAILS will start with ruby after reboot set ruby as additional-software 1. start nautilus as root * go to /live/persistent/TailsData_unlocked/ * open in gedit "live-additional-software.conf" * write per line: ``` ruby ruby1.9.1 ruby-nokogiri ``` * save the file * now you have done and it should work. Install instructions -------------------- Download the zip file and decompress it or clone the repository and it should be ready to run. https://github.com/TorCapybara/GHG/archive/master.zip Edit the config file if necessary. nano config.yml * For Tor Browser Bundle: works as is * As a standard Tor installation: Change port to 9050 * For Transparent Proxy (Tails, Whonix): use_proxy: false * For upload, you can configure username and password permanently. Run GHG ------- Help for runninng ./GHG.rb -h Grab images ./GHG.rb http://domain.tld/thread/1.html -f folder Update with corruption check ./GHG.rb http://domain.tld/thread/1.html -cf folder Upload folder of images ./GHG.rb http://domain.tld/thread/1.html -u "Image Set" -n username -p password -f folder Operating Systems ----------------- Should work on any platform supported by Ruby, and was sucessfully tested on: Windows, Linux (Whonix, Tails, Ubuntu, Debian) Versions ------- 2.0 * GHGrabber has been extended to be a batch uploader too. 1.6 * Try to convert html-entities correctly: filenames like "some &amp; other" will be converted to "some & other" 1.5 * Fix for Ruby 1.9.3 and before, and fix abort on Socks errors 1.4 * Supports Tor without a Transparent Proxy (Added config file with proxy settings) 1.3 * Remove files if download failed (empty file proble) * Udate files which are corrupt (Option -c) * Better instructions 1.2 * Support subfolders (folder/subfolder) 1.1 * Handle connection problems better (Retry option) 1.0 * Basic script with instructions
TorCapybara/GHG
README.md
Markdown
mit
2,764
/* Name: Mag-register v0.1.1 Description: run mag.module for by tagName(s) Example: var instances = mag.register( 'my-tag', component, props); Author: Michael Glazer License: MIT Homepage: https://github.com/magnumjs/mag.js @requires mag.js & mag addons (c) 2017 */ (function(mag, document) { 'use strict'; var nodeCache = []; //Allow for by TagName? //wrapper for mag.module for tagNames - returns multiple instances mag.register = function(tagName, mod, props) { //Are we in a parent run? // mag.mod.runningViewInstance var cacheId = tagName + (mag.mod.runningViewInstance ? mag.mod.runningViewInstance : 0); //Check if in cache? if (nodeCache[cacheId]) { //console.log('cached', cacheId, nodeCache[cacheId]); } var nodes = setIdByTagName(tagName); var instances = []; if (nodes.length) { for (var item of nodes) { var instance = mag.module(item, mod, props); instances.push(instance); } } return instances; }; function setIdByTagName(id) { var parentNode; if (typeof mag.mod.runningViewInstance != 'undefined') { var parentID = mag.utils.items.getItemVal(mag.mod.runningViewInstance); parentNode = getNode(parentID); } var nodes = (parentNode || mag.doc).getElementsByTagName(id); if (nodes.length) { for (var node of nodes) { if (!node.id) node.id = performance.now(); nodeCache[node.id] = node; } } return nodes; } })(mag, document);
magnumjs/mag.js
src/addons/mag-register.js
JavaScript
mit
1,528
import React from 'react'; import "./styles.css"; import logo from '../../../assets/logo.png' const PersluLogo = (props) => <img src={logo} alt="logo" className="PersluLogo" />; export default PersluLogo
Perslu/rerebrace
src/mobile/public/components/PersluLogo/index.js
JavaScript
mit
205
namespace ObscureWare.Console.Tests { using System; using System.Drawing; using System.IO; using System.Linq; using System.Reflection; using Xunit; public class ColoringVisualTests { private const string TEST_ROOT = @"C:\\TestResults\\ConsoleColors\\"; // This is obviously not possible to programmatically verify how "close" were colors matched - it's all manual testing required... // Therefore - help pages will be rendered for default and some customized results [Fact] public void PrintDefaultColorsTest() { string fName = "default_setup.html"; using (var colorHelper = CloseColorFinder.GetDefault()) { PrintAllNamedColorsToHtml(colorHelper, fName); } } [Fact] public void PrintCustomizedColorsBySeba() { string fName = "custom_setup_seba.html"; using (var colorHelper = CloseColorFinder.CustomizedDefault( new Tuple<ConsoleColor, Color>(ConsoleColor.DarkCyan, Color.Chocolate), new Tuple<ConsoleColor, Color>(ConsoleColor.Blue, Color.DodgerBlue), new Tuple<ConsoleColor, Color>(ConsoleColor.Yellow, Color.Gold), new Tuple<ConsoleColor, Color>(ConsoleColor.DarkBlue, Color.MidnightBlue))) { PrintAllNamedColorsToHtml(colorHelper, fName); } } [Fact] public void PrintCustomizedColorsByDnv() { var converter = new ColorConverter(); string fName = "custom_setup_dnv.html"; using ( var colorHelper = CloseColorFinder.CustomizedDefault( new Tuple<ConsoleColor, Color>(ConsoleColor.Cyan, (Color)converter.ConvertFromString("#99d9f0")), new Tuple<ConsoleColor, Color>(ConsoleColor.DarkCyan, (Color)converter.ConvertFromString("#e98300")), new Tuple<ConsoleColor, Color>(ConsoleColor.Blue, (Color)converter.ConvertFromString("#009fda")), new Tuple<ConsoleColor, Color>(ConsoleColor.Yellow, (Color)converter.ConvertFromString("#fecb00")), new Tuple<ConsoleColor, Color>(ConsoleColor.DarkGreen, (Color)converter.ConvertFromString("#36842d")), new Tuple<ConsoleColor, Color>(ConsoleColor.Blue, (Color)converter.ConvertFromString("#003591")), new Tuple<ConsoleColor, Color>(ConsoleColor.Magenta, (Color)converter.ConvertFromString("#635091")), new Tuple<ConsoleColor, Color>(ConsoleColor.DarkRed, (Color)converter.ConvertFromString("#c4262e")), new Tuple<ConsoleColor, Color>(ConsoleColor.DarkBlue, (Color)converter.ConvertFromString("#0f204b")), new Tuple<ConsoleColor, Color>(ConsoleColor.DarkGray, (Color)converter.ConvertFromString("#988f86")))) { PrintAllNamedColorsToHtml(colorHelper, fName); } } private static void PrintAllNamedColorsToHtml(CloseColorFinder helper, string fName) { var props = typeof(Color).GetProperties(BindingFlags.Static | BindingFlags.Public) .Where(p => p.PropertyType == typeof(Color)); var colorsVersionAtt = typeof(CloseColorFinder).Assembly.GetCustomAttributes().FirstOrDefault(att => att is AssemblyFileVersionAttribute) as AssemblyFileVersionAttribute; string colorsVersion = colorsVersionAtt?.Version ?? "unknown"; var dir = $"{TEST_ROOT}{colorsVersion}\\"; if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } var path = Path.Combine(dir, fName); using (var tw = new StreamWriter(path)) { tw.WriteLine("<html><body><table>"); tw.WriteLine("<tr><th>ColorName</th><th>Sys Color</th><th>Console Color</th></tr>"); foreach (var propertyInfo in props) { tw.WriteLine("<tr>"); Color c = (Color)propertyInfo.GetValue(null); ConsoleColor cc = helper.FindClosestColor(c); Color cCol = helper.GetCurrentConsoleColor(cc); var ccName = Enum.GetName(typeof(ConsoleColor), cc); tw.WriteLine($"<td>{propertyInfo.Name}</td><td bgcolor=\"{c.ToRgbHex()}\">{c.Name}</td><td bgcolor=\"{cCol.ToRgbHex()}\">{ccName}</td>"); tw.WriteLine("</tr>"); } tw.WriteLine("</table></body></html>"); tw.Close(); } } } }
ObscureWare/Console.Core
src/ObscureWare.Console.Tests/ColoringVisualTests.cs
C#
mit
4,750
import torch import torchvision.transforms as transforms import torch.utils.data as data import os import json import pickle import argparse from PIL import Image import numpy as np from utils import Vocabulary class CocoDataset(data.Dataset): def __init__(self, root, anns, vocab, mode='train',transform=None): self.root = root self.anns = json.load(open(anns)) self.vocab = pickle.load(open(vocab, 'rb')) self.transform = transform self.data = [ann for ann in self.anns if ann['split'] == mode] def __getitem__(self, index): data = self.data vocab = self.vocab # load image path = os.path.join(self.root, data[index]['file_path']) img = Image.open(path).convert('RGB') if self.transform is not None: img = self.transform(img) # load caption cap = data[index]['final_caption'] caption = [] caption.append(vocab('<start>')) caption.extend([vocab(word) for word in cap]) caption.append(vocab('<end>')) target = torch.IntTensor(caption) return img, target, data[index]['imgid'] def __len__(self): return len(self.data) def collate_fn(data): # sort the data in descending order data.sort(key=lambda x: len(x[1]), reverse=True) images, captions, imgids = zip(*data) # merge images (from tuple of 3D tensor to 4D tensor). images = torch.stack(images, 0) # merge captions (from tuple of 1D tensor to 2D tensor). lengths = [len(cap) for cap in captions] targets = torch.zeros(len(captions), max(lengths)).long() for i, cap in enumerate(captions): end = lengths[i] targets[i, :end] = cap[:end] return images, targets, lengths, imgids def get_loader(opt, mode='train', shuffle=True, num_workers=1, transform=None): coco = CocoDataset(root=opt.root_dir, anns=opt.data_json, vocab=opt.vocab_path, mode=mode, transform=transform) data_loader = torch.utils.data.DataLoader(dataset=coco, batch_size=opt.batch_size, shuffle=shuffle, num_workers=num_workers, collate_fn=collate_fn) return data_loader if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--root_dir', type=str, default='/home/myunggi/Research/show-and-tell', help="root directory of the project") parser.add_argument('--data_json', type=str, default='data/data.json', help='input data list which includes captions and image information') parser.add_argument('--vocab_path', type=str, default='data/vocab.pkl', help='vocabulary wrapper') parser.add_argument('--crop_size', type=int, default=224, help='image crop size') parser.add_argument('--batch_size', type=int, default=128, help='batch size') args = parser.parse_args() transform = transforms.Compose([ transforms.RandomCrop(args.crop_size), transforms.RandomHorizontalFlip(), transforms.ToTensor(), transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)) ]) data_loader = get_loader(args, transform=transform) total_iter = len(data_loader) for i, (img, target, length) in enumerate(data_loader): print('done')
incredible-vision/show-and-tell
data_loader.py
Python
mit
3,497
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="css/majstor-style.css"> <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,700,400"> <link rel="shortcut icon" href="favicon.ico"> <link rel="icon" type="image/png" href="img/math-master-48.png"> <script type="application/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"></script> <script type="application/javascript" src="bootstrap/js/bootstrap.min.js"></script> <script type="application/javascript" src="js/serviceURLs.js"></script> <script type="application/javascript"> $(document).ready(function() { $(".statusLoggedIn").hide(); $(".statusNotLoggedIn").hide(); $.get(URLSessionTest, function(data) { if (data != "") { var splitUsername = data.split(" "); $("#statusLoggedInUsername").html(splitUsername[1]); $(".statusNotLoggedIn").slideUp(250, function() { $(".statusLoggedIn").slideDown(250); }); // Offer to log out. $("#logged-username").html(splitUsername[1]); $("#logout-container-slider").slideDown(); $("#login-container-slider").slideUp(); $("#loginForm :input").prop("disabled", true); } else if (data == "") { $(".statusLoggedIn").slideUp(250, function() { $(".statusNotLoggedIn").slideDown(250); }); // OK. $("#logout-container-slider").slideUp(); $("#login-container-slider").slideDown(); $("#loginForm :input").prop("disabled", false); } }); }); function logout() { $.get(URLLogout, function() { $(".statusLoggedIn").slideUp(250, function() { $(".statusNotLoggedIn").slideDown(250); }); }); } </script> <title>Math Master</title> </head> <body> <div id="mainContainer"> <!-- Navigation bar --> <nav class="navbar navbar-default"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">Math Master</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li><a href="game.html">Play</a></li> <li><a href="stats.html">Statistics</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li id="statusNotLoggedIn"> <li class="statusNotLoggedIn"><a href="login.html">Login</a></li> <li class="statusNotLoggedIn"><a href="registration.html">Register</a></li> <li class="statusLoggedIn"><p class="navbar-text">You are logged in as:<p id="statusLoggedInUsername" class="navbar-text" style="font-weight: bold;">username</p></p></li> <li class="statusLoggedIn"><a href="#" onclick="logout();">Log out</a></li> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> <div class="login-container" style="width: 100%; margin:auto; text-align: center;"> <div class="panel panel-primary login"> <div class="panel-body"> <h1>Welcome to Math Master!</h1> <hr> <p class="mainP"> Math Master is a game about speed and accuracy. You will face other players in a multi-player game lobby and test you mathematics skills. Each player is presented the same problem and 4 possible answers. Be the fastest player to answer correctly in order to win the round. Win 3 rounds and you are the winner of the game! </p> <hr> <h2>Click <a href="game.html" class="btn btn-primary btn-lg">here</a> to start playing and then:</h2> <div class="row" style="max-width: 800px; margin: auto;"> <div class="col-md-6"> <h3>Find a game to join.</h3> <img src="img/tut1.png"> </div> <div class="col-md-6"> <h3>Or create your own.</h3> <img src="img/tut2.png"> </div> </div> <hr> <h2>Once in a room:</h2> <div class="row" style="max-width: 800px; margin: auto;"> <div class="col-md-6"> <h3>Click the switch to ready-up.</h3> <img src="img/tut3.png"> </div> <div class="col-md-6"> <h3>And wait for others to do so.</h3> <img src="img/tut4.png"> </div> </div> <hr> <h2>Game starts when everyone is ready.</h2> <h3>Monitor progress of yourself and other players.</h3> <img src="img/tut5.png"> <hr> <h2>Be the fastest and win the game!</h2> <img src="img/tut6.png"> <hr> <h2>Make sure to check your stats <a href="stats.html" class="btn btn-primary btn-lg">here</a></h2> <img src="img/tut7.png"> <h4>Note: you have to be logged in to see your stats.</h4> <hr> <h2>Some global stats are shown as well.</h2> <img src="img/tut8.png"> </div> </div> </div> </div> </body> </html>
fvoska/MatematickiMajstor
index.html
HTML
mit
6,720
using System; using Nancy; using log4net; using ReminderService.Router; using ReminderService.API.HTTP.BootStrap; using ReminderService.Messages; using ReminderService.Core.Startup; using ReminderService.Core.Persistence; using System.Collections.Generic; using ReminderService.Core.Persistence.Postgres; namespace ReminderService.API.HTTP.BootStrap { public class BootStrapper : DefaultNancyBootstrapper { private static readonly ILog Logger = LogManager.GetLogger("ReminderService.API.HTTP.Request"); protected override void ApplicationStartup (Nancy.TinyIoc.TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines) { base.ApplicationStartup (container, pipelines); var bus = container.Resolve<IBus> (); bus.Send (new SystemMessage.Start()); //wait here for the SystemMessage.InititializationCompletedEvent ?? } protected override void RequestStartup (Nancy.TinyIoc.TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines, NancyContext context) { pipelines.OnError.AddItemToEndOfPipeline((z, a) => { Logger.Error("Unhandled error on request: " + context.Request.Url + " : " + a.Message, a); return ErrorResponse.FromException(a); }); base.RequestStartup(container, pipelines, context); } protected override void ConfigureApplicationContainer (Nancy.TinyIoc.TinyIoCContainer container) { base.ConfigureApplicationContainer (container); var busInstance = (Bus)container.Resolve<IBusFactory> ().Build (); container.Register<IBus, Bus> (busInstance); } } }
dtrumpler/ForgetMeNot
src/ReminderService/ReminderService.API.HTTP/BootStrap/BootStrapper.cs
C#
mit
1,561
# ~/.xinitrc dotfiles_xorg=1 if [ -d /etc/X11/xinit/xinitrc.d ] ; then for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do [ -x "$f" ] && . "$f" done unset f fi source ~/.dotfilesrc
justinhoward/dotfiles
modules/xorg/xinitrc.sh
Shell
mit
183
<!-- Author: W3layouts Author URL: http://w3layouts.com License: Creative Commons Attribution 3.0 Unported License URL: http://creativecommons.org/licenses/by/3.0/ --> <!DOCTYPE html> <html> <body> <!-- CODE POUR METTRE LES MATCH ENSEMBLE CARREE + INSIDE BULLE AVEC NOM ET PROFIL --> <div style="background-color: #23527c"> <div> <div> <div style="background-color: red; height: 80%"> match </div> <div style="background-color: blue"> </div> </div> </div> </div> </body> </html>
mouradmamassi/com2you
application/views/test.php
PHP
mit
559
# Flux Universal Portal Demo ## Installation & Execution Install app using: ``` npm install ``` and run using: ``` npm start ``` You can access the application's server directly under http://localhost:6001 or via its BrowserSync access server http://localhost:3000. BrowserSync console is available under http://localhost:3001. ## Description Portal demo using Node/Express/React/React-Router Stack: * ES6 JS * Node/Express for web server * Handlebars for templating * Reac/React-Router for app f/e * Gulp/Webpack for packaging * Babel for transpiling * BrowserSync for live reload/development * ESLint # portalReact
btg5679/portalReact
README.md
Markdown
mit
627
--- author: admin comments: true date: 2011-03-06 12:19:48+00:00 layout: post slug: spoj694 title: SPOJ694 Distinct Substrings wordpress_id: 264 categories: - 解题报告 tags: - spoj - 后缀数组 - 解题报告 --- 后缀数组的题,详见罗穗骞2009年的论文以及[我对于倍增算法的批注](http://www.dxmtb.com/blog/suffixarray)。 /* ID: dxmtb PROG: Spoj694 Distinct Substrings TIME: 2011.03.06 STATE: Solved MEMO: 后缀数组 */ #include <cstdio> #include <cstring> const int MAXN=1005,MAXM=300; bool cmp(int *r,int a,int b,int l) { return (r[a]==r[b]&&r;[a+l]==r[b+l]); } int ta[MAXN],tb[MAXN],sum[MAXN],sa[MAXN]; void da(int *r,int *sa,int N,int M) { int *x=ta,*y=tb,*t,i,j,p; memset(sum,0,sizeof(sum)); for(i=0;i<N;i++) sum[x[i]=r[i]]++; for(i=1;i<M;i++) sum[i]+=sum[i-1]; for(i=N-1;i>=0;i--) sa[--sum[r[i]]]=i; for(j=1,p=1;p<N;j*=2,M=p) { for(p=0,i=N-j;i<N;i++) y[p++]=i; for(i=0;i<N;i++) if (sa[i]>=j) y[p++]=sa[i]-j; memset(sum,0,sizeof(sum)); for(i=0;i<N;i++) sum[x[i]]++; for(i=1;i<M;i++) sum[i]+=sum[i-1]; for(i=N-1;i>=0;i--) sa[--sum[x[y[i]]]]=y[i]; t=x;x=y;y=t; x[sa[0]]=0; for(i=1,p=1;i<N;i++) { if (cmp(y,sa[i-1],sa[i],j)) x[sa[i]]=p-1; else x[sa[i]]=p++; } } } int height[MAXN],rank[MAXN]; void calheight(int *r,int *sa,int N) { for(int i=1;i<=N;i++) rank[sa[i]]=i; for(int i=0,k=0;i<N;i++) { if (k>0) k--; int j=sa[rank[i]-1]; while(r[i+k]==r[j+k]) k++; height[rank[i]]=k; } } int r[MAXN]; char str[MAXN]; int main() { int T,m,n; scanf("%d",&T;); while(T--) { scanf("%s",str); n=strlen(str); for(int i=0;i<=n;i++) r[i]=str[i]; m=0; for(int i=0;i<n;i++) if (r[i]>m) m=r[i]; da(r,sa,n+1,m+1); calheight(r,sa,n); int ans=n*(n+1)/2; for(int i=1;i<=n;i++) ans-=height[i]; printf("%d\n",ans); } return 0; }
dxmtb/dxmtb.github.io
_posts/2011-03-06-spoj694.markdown
Markdown
mit
2,250
version https://git-lfs.github.com/spec/v1 oid sha256:60fd337fadc530fbb5cd2da62a2a80fa7da7dd9c2069599a1a1f61b6b57415a6 size 10836
yogeshsaroya/new-cdnjs
ajax/libs/semantic-ui/1.7.0/components/card.min.css
CSS
mit
130
/* Magic Mirror * Module: MMM-MovieListing * * By Christian Jens https://tueti.github.io * Modified by Kyle Johnson * MIT Licensed. */ Module.register('MMM-MovieListings', { // Default module config. defaults: { apiKey: '', region: 'DE', language: 'de-DE', interface: 'poster', //'list', 'poster', 'detailed' includeMoviePlot: false, maxPlotLength: 198, header: 'Kinofilme', moviesPerPage: 0, refreshInterval: 1000 * 60 * 60 * 24, //Once a day baseUrl: 'https://api.themoviedb.org/3/movie/now_playing', animationSpeed: 2.5 * 1000, pageChangeInterval: 30 * 1000 }, getStyles: function() { return ['MMM-MovieListings.css']; }, getTranslations: function() { return { en: "translations/en.json", de: "translations/de.json", sv: "translations/sv.json", es: "translations/es.json" } }, start: function() { Log.log(this.name + ' is started'); this.movies = {}; var self = this; self.sendSocketNotification('FETCH_MOVIE_LIST', this.config); //run once now, then set Interval for once a day setInterval(function() { self.sendSocketNotification('FETCH_MOVIE_LIST', this.config); }, this.config.refreshInterval); }, socketNotificationReceived: function(notification, payload) { Log.log(this.name + ': received socket notification ' + notification + ' with payload:', payload); if (notification === 'MOVIE_ERROR') { Log.log(this.name + ': Error'); } if (notification === 'MOVIE_LIST_DONE') { // Log.log(this.name + ': Got movies'); // Prepare DOM data this.movies = payload.results; this.prepareDomUpdate(this.movies); } if (notification === 'MOVIE_ID_DONE') { // Log.log(this.name + ': Got movie details', payload); this.posterToDisplay = payload this.updateDom(this.config.animationSpeed); } }, /* * DOM MANIPULATION */ getDom: function() { var wrapper = document.createElement('div') var header = document.createElement('header'); header.innerHTML = this.config.header; wrapper.appendChild(header); // No movies fetched yet if (!this.moviesToDisplay && !this.posterToDisplay) { var loadingPlaceholder = document.createElement('div'); loadingPlaceholder.className = 'small dimmed'; loadingPlaceholder.innerHTML = this.translate('LOADING'); wrapper.appendChild(loadingPlaceholder); return wrapper; } switch (this.config.interface) { case 'list': var tableContainer = document.createElement('div').appendChild(this.createTableView(this.moviesToDisplay)); wrapper.appendChild(tableContainer); return wrapper; case 'poster': var posterContainer = document.createElement('div').appendChild(this.createPosterView(this.posterToDisplay)); wrapper.appendChild(posterContainer); return wrapper; default: break; } }, // Different view styles createTableView: function(movies) { var table = document.createElement('table'); table.className = 'small'; for (var i = 0; i <= movies.length - 1; i++) { var movie = movies[i]; var tableRow = document.createElement('tr'); var tableData = document.createElement('td'); var cell = document.createElement('span'); cell.innerHTML = movie.title; tableData.appendChild(cell); tableRow.appendChild(tableData); table.appendChild(tableRow); } return table; }, createPosterView: function(movieSet) { var movie = movieSet.details; var credits = movieSet.credits; // create container var posterWrapper = document.createElement('div'); posterWrapper.className = 'xsmall'; // set up title var title = document.createElement('div'); title.classList = 'small'; title.innerHTML = movie.title; // set up tagline var tagline = document.createElement('div'); tagline.classList = 'dimmed'; tagline.innerHTML = movie.tagline; // set up plot if (this.config.includeMoviePlot) { var plot = document.createElement('div'); plot.classList = 'dimmed'; var plotContent = ""; if (this.config.maxPlotLength == 0) { plotContent = movie.overview } else { plotContent = movie.overviewShort; } plot.innerHTML = plotContent.split(/((?:\S+ ){10})/g).filter(Boolean).join("<br/>");; } // Set up details => image var image = document.createElement('img'); image.src = 'https://image.tmdb.org/t/p/w154/' + movie.poster_path; // "w92", "w154", "w185", "w342", "w500", "w780", or "original" // Set up details => textArea var detailsContainer = document.createElement('p'); detailsContainer.className = this.data.position.toLowerCase().indexOf('right') < 0 ? 'marginLeft' : 'marginRight'; // Set up details => rating var detailsRatingContainer = document.createElement('div'); detailsRatingContainer.className = 'xsmall'; var detailsRatingVote = document.createElement('span'); detailsRatingVote.innerHTML = movie.vote_average + ' / 10'; var detailsRatingVotings = document.createElement('span'); detailsRatingVotings.className = 'xsmall dimmed'; detailsRatingVotings.innerHTML = ' (' + movie.vote_count + ' ' + this.translate('RATINGS') + ')'; detailsRatingContainer.appendChild(detailsRatingVote); detailsRatingContainer.appendChild(detailsRatingVotings); // Set up details => runtime var runtimeContent = document.createElement('div'); runtimeContent.className = 'xsmall'; runtimeContent.innerHTML = movie.runtime + ' ' + this.translate('MIN'); // Set up details => credits actors var creditsContainer = document.createElement('div'); creditsContainer.className = 'marginTop xsmall'; /* Header(?) var castHeader = document.createElement('div'); castHeader.className = 'xsmall dimmed'; castHeader.innerHTML = this.translate('CAST'); creditsContainer.appendChild(castHeader); */ var castContent = document.createElement('div'); castContent.className = 'xsmall'; if (credits.cast && credits.cast.length > 0) { for (var i = 0; i < Math.min(6, credits.cast.length); i++) { castContent.innerHTML += credits.cast[i].name + '<br />'; } } creditsContainer.appendChild(castContent); // Set up details => credits director var directorContainer = document.createElement('div'); var directorHeader = document.createElement('span'); directorHeader.className = 'xsmall dimmed'; directorHeader.innerHTML = ', ' + this.translate('DIRECTOR'); var directorContent = document.createElement('span'); directorContent.className = 'xsmall'; if (credits.crew && credits.crew.length > 0) { for (var i = 0; i <= credits.crew.length - 1; i++) { if (credits.crew[i].job === 'Director') { directorContent.innerHTML = credits.crew[i].name; }; }; } directorContainer.appendChild(directorContent); directorContainer.appendChild(directorHeader); creditsContainer.appendChild(directorContainer); // Set up details => genres if (movie.genres) { var genres = ''; for (var i = 0; i <= movie.genres.length -1; i++) { genres += movie.genres[i].name; if (i < movie.genres.length - 1) { genres += ', '; } } } // Add all details detailsContainer.appendChild(detailsRatingContainer); detailsContainer.appendChild(runtimeContent); detailsContainer.appendChild(creditsContainer); // Set up details => table var detailsTable = document.createElement('table'); detailsTable.className = 'xsMarginTop'; var tableRow = document.createElement('tr'); var imageCell = document.createElement('td'); var textCell = document.createElement('td'); textCell.className = 'top'; imageCell.className = 'top'; imageCell.appendChild(image); textCell.appendChild(detailsContainer); if (this.data.position.toLowerCase().indexOf('right') < 0) { tableRow.appendChild(imageCell); textCell.className = 'top left'; tableRow.appendChild(textCell); } else { tableRow.appendChild(textCell); tableRow.appendChild(imageCell); }; detailsTable.appendChild(tableRow); // Set up entire view in container posterWrapper.appendChild(title); posterWrapper.appendChild(tagline); posterWrapper.appendChild(detailsTable); if (this.config.includeMoviePlot) { posterWrapper.appendChild(plot); } return posterWrapper; }, /* * HELPER */ prepareDomUpdate: function(movies) { switch (this.config.interface) { case 'list': // If pagination enabled, turn to DOM update scheduler, else just display all movies if (this.config.moviesPerPage > 0) { this.scheduleDomUpdatesForList(movies); } else { this.moviesToDisplay = movies this.updateDom(); } break; case 'poster': this.scheduleDomUpdatesForPoster(movies); default: break; } }, scheduleDomUpdatesForList: function(movies) { var self = this; var pages = Math.ceil(movies.length / self.config.moviesPerPage); self.movieChunks = []; self.nextIndex = 0; for (var i = 0; i < pages; i++) { self.movieChunks.push(movies.splice(0, self.config.moviesPerPage)) } self.moviesToDisplay = self.movieChunks[self.nextIndex]; self.nextIndex++; self.updateDom(); setInterval(function() { self.moviesToDisplay = self.movieChunks[self.nextIndex]; self.nextIndex++; // reset index if end is reached if (self.nextIndex > self.movieChunks.length - 1) { self.nextIndex = 0; } self.updateDom(self.config.animationSpeed); }, this.config.pageChangeInterval); }, scheduleDomUpdatesForPoster: function(movies) { var self = this; self.nextIndex = 0; self.sendSocketNotification('FETCH_MOVIE_ID', { movieId: movies[self.nextIndex].id, apiKey: self.config.apiKey, language: self.config.language, config: self.config }); self.nextIndex++; setInterval(function() { self.sendSocketNotification('FETCH_MOVIE_ID', { movieId: movies[self.nextIndex].id, apiKey: self.config.apiKey, language: self.config.language, config: self.config }); self.nextIndex++; // reset when end of array is reached if (self.nextIndex > movies.length - 1) { self.nextIndex = 0; } }, this.config.pageChangeInterval); }, });
Tueti/MMM-MovieListings
MMM-MovieListings.js
JavaScript
mit
10,723
var VERSION = '0.0.0', http = require('http'), querystring = require('querystring'), oauth = require('oauth'); function merge(defaults, options) { defaults = defaults || {}; if (options && typeof options === 'object') { var keys = Object.keys(options); for (var i = 0, len = keys.length; i < len; i++) { var k = keys[i]; if (options[k] !== undefined) defaults[k] = options[k]; } } return defaults; } function Withings(options) { if (!(this instanceof Withings)) return new Withings(options); var defaults = { consumer_key: null, consumer_secret: null, access_token_key: null, access_token_secret: null, headers: { 'Accept': '*/*', 'Connection': 'close', 'User-Agent': 'node-withings/' + VERSION }, callback_url: null, rest_base: 'http://wbsapi.withings.net', }; this.options = merge(defaults, options); this.oauth = new oauth.OAuth( this.options.request_token_url, this.options.access_token_url, this.options.consumer_key, this.options.consumer_secret, '1.0', this.options.callback_url, 'HMAC-SHA1', null, this.options.headers ); } Withings.prototype.get = function(url, params, callback) { if (typeof params === 'function') { callback = params; params = null; } if ( typeof callback !== 'function' ) { throw "FAIL: INVALID CALLBACK."; return this; } if (url.charAt(0) == '/') url = this.options.rest_base + url; this.oauth.get( url + '?' + querystring.stringify(params), this.options.access_token_key, this.options.access_token_secret, function(error, data, response) { if (error) { var err = new Error( 'HTTP Error ' + error.statusCode + ': ' + http.STATUS_CODES[error.statusCode] ); err.statusCode = error.statusCode; err.data = error.data; callback(err); } else { try { var json = JSON.parse(data); callback(json); } catch(err) { callback(err); } } } ); return this; } // CONVENIENCE METHODS // USER /* * User: Get by id */ Withings.prototype.user_getbyuserid = function(params, callback) { if (typeof params === 'function') { callback = params; params = null; } if ( typeof callback !== 'function' ) { throw "FAIL: INVALID CALLBACK."; return this; } params.action = 'getbyuserid'; this.get('/user', params, callback); return this; } // MEASURE /* * Measure: Get measurement */ Withings.prototype.measure_getmeas = function(params, callback) { if (typeof params === 'function') { callback = params; params = null; } if ( typeof callback !== 'function' ) { throw "FAIL: INVALID CALLBACK."; return this; } params.action = 'getmeas'; this.get('/measure', params, callback); return this; } /* * Measure: Get Activity */ Withings.prototype.measure_getactivity = function(params, callback) { if (typeof params === 'function') { callback = params; params = null; } if ( typeof callback !== 'function' ) { throw "FAIL: INVALID CALLBACK."; return this; } params.action = 'getactivity'; this.get('/v2/measure', params, callback); return this; } // NOTIFY /* * Notify: Subscribe */ Withings.prototype.notify_subscribe = function(params, callback) { if (typeof params === 'function') { callback = params; params = null; } if ( typeof callback !== 'function' ) { throw "FAIL: INVALID CALLBACK."; return this; } params.action = 'subscribe'; this.get('/notify', params, callback); return this; } /* * Notify: Get */ Withings.prototype.notify_get = function(params, callback) { if (typeof params === 'function') { callback = params; params = null; } if ( typeof callback !== 'function' ) { throw "FAIL: INVALID CALLBACK."; return this; } params.action = 'subscribe'; this.get('/notify', params, callback); return this; } /* * Notify: List */ Withings.prototype.notify_list = function(params, callback) { if (typeof params === 'function') { callback = params; params = null; } if ( typeof callback !== 'function' ) { throw "FAIL: INVALID CALLBACK."; return this; } params.action = 'subscribe'; this.get('/notify', params, callback); return this; } /* * Notify: Revoke */ Withings.prototype.notify_revoke = function(params, callback) { if (typeof params === 'function') { callback = params; params = null; } if ( typeof callback !== 'function' ) { throw "FAIL: INVALID CALLBACK."; return this; } params.action = 'subscribe'; this.get('/notify', params, callback); return this; } module.version = VERSION module.exports = Withings;
desmondmorris/node-withings
lib/withings.js
JavaScript
mit
4,802
class Solution { public: vector<vector<int> > zigzagLevelOrder(TreeNode *root) { vector<vector<int> > result; if(root == NULL) return result; queue<TreeNode*> q; q.push(root); vector<int> levelSet; int count1 = 1, count2 = 0, level = 1; while(!q.empty()){ TreeNode *tmp = q.front(); q.pop(); levelSet.push_back(tmp->val); count1 --; if(tmp->left != NULL){ q.push(tmp->left); count2 ++; } if(tmp->right != NULL){ q.push(tmp->right); count2 ++; } if(count1 == 0){ count1 = count2; count2 = 0; if(level % 2 == 0) reverse(levelSet.begin(), levelSet.end()); ++ level; result.push_back(levelSet); levelSet.clear(); } } return result; } };
mengjiaowang/leetcode
binary-tree-zigzag-level-order-traversal.cpp
C++
mit
1,051
package com.bornstone.stonehenge.core.notification.messagesender.email; import com.bornstone.stonehenge.core.notification.message.EmailMessage; import org.apache.log4j.Logger; import org.springframework.mail.javamail.JavaMailSenderImpl; import org.springframework.mail.javamail.MimeMessageHelper; import javax.mail.Session; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import java.util.Properties; /** * Created by king on 15-5-14. */ public class EmailMessageSender implements IEmailMessageSender { private static final Logger logger = Logger.getLogger(EmailMessageSender.class); private JavaMailSenderImpl mailSender; @Override public void send(EmailMessage message) { if (mailSender == null) { logger.error("mailSender can not be null"); return; } try { Session session = Session.getDefaultInstance(new Properties()); MimeMessage mime = new MimeMessage(session); MimeMessageHelper helper = new MimeMessageHelper(mime, true, "utf-8"); helper.setFrom(mailSender.getUsername());//发件人 helper.setTo(InternetAddress.parse(message.getTarget()));//收件人 //helper.setBcc("administrator@chinaptp.com");//暗送 helper.setReplyTo(mailSender.getUsername());//回复到 helper.setSubject(message.getSubject());//邮件主题 helper.setText(message.getMessage(), true);//true表示设定html格式 mailSender.send(mime); } catch (Exception e) { logger.error(e.getMessage(), e); } } public void setMailSender(JavaMailSenderImpl mailSender) { this.mailSender = mailSender; } }
AdonisTang/stonehenge
stonehenge-core/src/main/java/com/bornstone/stonehenge/core/notification/messagesender/email/EmailMessageSender.java
Java
mit
1,755
const express = require('express'); const router = express.Router(); const authHelpers = require('../controllers/signin'); const gameBoard = require('../controllers/gameBoard.js'); const players = require('../controllers/players.js'); const indexController = require('../controllers/index'); router.get('/', authHelpers.loginRequired, (req, res, next) => { const renderObject = {}; authHelpers.logCheck(renderObject, req); renderObject.sessionID = req.sessionID; renderObject.name = req.session.user.username; res.render('./pages/findGame', renderObject); }); router.post('/gameBoard', authHelpers.loginRequired, (req, res, next) => { gameBoard.setUpBoard(req.body.random).then((result) => { res.json(result[0].board); }).catch((err) => { console.log(err); }); }); router.get('/findGame', authHelpers.loginRequired, (req, res, next) => { gameBoard.findGame().then((results) => { res.json(results); }).catch((err) => { console.log(err); }); }); router.get('/:gameID', authHelpers.loginRequired, (req, res, next) => { const renderObject = {}; authHelpers.logCheck(renderObject, req); renderObject.title = 'Play!'; renderObject.sessionID = req.sessionID; renderObject.name = req.session.user.username; renderObject.first = true; res.render('./pages/play', renderObject); }); router.get('/:gameID/notFirst', authHelpers.loginRequired, (req, res, next) => { const renderObject = {}; authHelpers.logCheck(renderObject, req); renderObject.title = 'Play!'; renderObject.sessionID = req.sessionID; renderObject.name = req.session.user.username; renderObject.first = false; res.render('./pages/play', renderObject); }); router.get('/:gameID/join', authHelpers.loginRequired, (req, res, next) => { gameBoard.getBoard(req.params.gameID).then((result) => { console.log(result); res.json(result[0].board); }); }); router.get('/:gameID/player', authHelpers.loginRequired, (req, res, next) => { gameBoard.getPlayerBoard(req.params.gameID, req.session.user.user_id).then((result) => { res.json(result[0]); }); }); router.post('/player/new', authHelpers.loginRequired, (req, res, next) => { const playerObject = { color: req.body.color, avatar_url: req.body.avatar_url, user_id: req.session.user.user_id, game_id: req.body.game_id }; players.setUpPlayer(playerObject).then((result) => { res.json(result[0]); }).catch((err) => { console.log(err); return next(); }); }); router.get('/:gameID/yourPlace', authHelpers.loginRequired, (req, res, next) => { const playerPromise = gameBoard.getPlayerBoard(req.params.gameID, req.session.user.user_id); const boardPromise = gameBoard.getBoard(req.params.gameID); }); module.exports = router;
pittdogg/developers-of-galvanize
src/server/routes/play.js
JavaScript
mit
2,754
<!DOCTYPE html> <!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" dir="ltr"> <!--<![endif]--> <!-- Usage: /eic/site/ccc-rec.nsf/tpl-eng/template-1col.html?Open&id=3 (optional: ?Open&page=filename.html&id=x) --> <!-- Created: ; Product Code: 536; Server: stratnotes2.ic.gc.ca --> <head> <!-- Title begins / Début du titre --> <title> MRO Electronic Supply Ltd. - Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada </title> <!-- Title ends / Fin du titre --> <!-- Meta-data begins / Début des métadonnées --> <meta charset="utf-8" /> <meta name="dcterms.language" title="ISO639-2" content="eng" /> <meta name="dcterms.title" content="" /> <meta name="description" content="" /> <meta name="dcterms.description" content="" /> <meta name="dcterms.type" content="report, data set" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.issued" title="W3CDTF" content="" /> <meta name="dcterms.modified" title="W3CDTF" content="" /> <meta name="keywords" content="" /> <meta name="dcterms.creator" content="" /> <meta name="author" content="" /> <meta name="dcterms.created" title="W3CDTF" content="" /> <meta name="dcterms.publisher" content="" /> <meta name="dcterms.audience" title="icaudience" content="" /> <meta name="dcterms.spatial" title="ISO3166-1" content="" /> <meta name="dcterms.spatial" title="gcgeonames" content="" /> <meta name="dcterms.format" content="HTML" /> <meta name="dcterms.identifier" title="ICsiteProduct" content="536" /> <!-- EPI-11240 --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- MCG-202 --> <meta content="width=device-width,initial-scale=1" name="viewport"> <!-- EPI-11567 --> <meta name = "format-detection" content = "telephone=no"> <!-- EPI-12603 --> <meta name="robots" content="noarchive"> <!-- EPI-11190 - Webtrends --> <script> var startTime = new Date(); startTime = startTime.getTime(); </script> <!--[if gte IE 9 | !IE ]><!--> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon"> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css"> <!--<![endif]--> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css"> <!--[if lt IE 9]> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="shortcut icon" /> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/ie8-wet-boew.min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew.min.js"></script> <![endif]--> <!--[if lte IE 9]> <![endif]--> <noscript><link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" /></noscript> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <script>dataLayer1 = [];</script> <!-- End Google Tag Manager --> <!-- EPI-11235 --> <link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" /> </head> <body class="home" vocab="http://schema.org/" typeof="WebPage"> <!-- EPIC HEADER BEGIN --> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <noscript><iframe title="Google Tag Manager" src="//www.googletagmanager.com/ns.html?id=GTM-TLGQ9K" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer1'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer1','GTM-TLGQ9K');</script> <!-- End Google Tag Manager --> <!-- EPI-12801 --> <span typeof="Organization"><meta property="legalName" content="Department_of_Industry"></span> <ul id="wb-tphp"> <li class="wb-slc"> <a class="wb-sl" href="#wb-cont">Skip to main content</a> </li> <li class="wb-slc visible-sm visible-md visible-lg"> <a class="wb-sl" href="#wb-info">Skip to "About this site"</a> </li> </ul> <header role="banner"> <div id="wb-bnr" class="container"> <section id="wb-lng" class="visible-md visible-lg text-right"> <h2 class="wb-inv">Language selection</h2> <div class="row"> <div class="col-md-12"> <ul class="list-inline mrgn-bttm-0"> <li><a href="nvgt.do?V_TOKEN=1492305093003&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=31445&V_SEARCH.docsStart=31444&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn//magmi/web/download_file.php?_flId?_flxKy=e1s1&amp;estblmntNo=234567041301&amp;profileId=61&amp;_evId=bck&amp;lang=eng&amp;V_SEARCH.showStricts=false&amp;prtl=1&amp;_flId?_flId?_flxKy=e1s1" title="Français" lang="fr">Français</a></li> </ul> </div> </div> </section> <div class="row"> <div class="brand col-xs-8 col-sm-9 col-md-6"> <a href="http://www.canada.ca/en/index.html"><object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object><span class="wb-inv"> Government of Canada</span></a> </div> <section class="wb-mb-links col-xs-4 col-sm-3 visible-sm visible-xs" id="wb-glb-mn"> <h2>Search and menus</h2> <ul class="list-inline text-right chvrn"> <li><a href="#mb-pnl" title="Search and menus" aria-controls="mb-pnl" class="overlay-lnk" role="button"><span class="glyphicon glyphicon-search"><span class="glyphicon glyphicon-th-list"><span class="wb-inv">Search and menus</span></span></span></a></li> </ul> <div id="mb-pnl"></div> </section> <!-- Site Search Removed --> </div> </div> <nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" data-trgt="mb-pnl" data-ajax-fetch="//cdn.canada.ca/gcweb-cdn-dev/sitemenu/sitemenu-en.html" typeof="SiteNavigationElement"> <h2 class="wb-inv">Topics menu</h2> <div class="container nvbar"> <div class="row"> <ul class="list-inline menu"> <li><a href="https://www.canada.ca/en/services/jobs.html">Jobs</a></li> <li><a href="http://www.cic.gc.ca/english/index.asp">Immigration</a></li> <li><a href="https://travel.gc.ca/">Travel</a></li> <li><a href="https://www.canada.ca/en/services/business.html">Business</a></li> <li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li> <li><a href="http://healthycanadians.gc.ca/index-eng.php">Health</a></li> <li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li> <li><a href="https://www.canada.ca/en/services.html">More services</a></li> </ul> </div> </div> </nav> <!-- EPIC BODY BEGIN --> <nav role="navigation" id="wb-bc" class="" property="breadcrumb"> <h2 class="wb-inv">You are here:</h2> <div class="container"> <div class="row"> <ol class="breadcrumb"> <li><a href="/eic/site/icgc.nsf/eng/home" title="Home">Home</a></li> <li><a href="/eic/site/icgc.nsf/eng/h_07063.html" title="Industries and Business">Industries and Business</a></li> <li><a href="/eic/site/ccc-rec.nsf/tpl-eng/../eng/home" >Canadian Company Capabilities</a></li> </ol> </div> </div> </nav> </header> <main id="wb-cont" role="main" property="mainContentOfPage" class="container"> <!-- End Header --> <!-- Begin Body --> <!-- Begin Body Title --> <!-- End Body Title --> <!-- Begin Body Head --> <!-- End Body Head --> <!-- Begin Body Content --> <br> <!-- Complete Profile --> <!-- Company Information above tabbed area--> <input id="showMore" type="hidden" value='more'/> <input id="showLess" type="hidden" value='less'/> <h1 id="wb-cont"> Company profile - Canadian Company Capabilities </h1> <div class="profileInfo hidden-print"> <ul class="list-inline"> <li><a href="cccSrch.do?lang=eng&profileId=&prtl=1&key.hitsPerPage=25&searchPage=%252Fapp%252Fccc%252Fsrch%252FcccBscSrch.do%253Flang%253Deng%2526amp%253Bprtl%253D1%2526amp%253Btagid%253D&V_SEARCH.scopeCategory=CCC.Root&V_SEARCH.depth=1&V_SEARCH.showStricts=false&V_SEARCH.sortSpec=title+asc&amp;rstBtn.x=" class="btn btn-link">New Search</a>&nbsp;|</li> <li><form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do"> <input type="hidden" name="lang" value="eng" /> <input type="hidden" name="profileId" value="" /> <input type="hidden" name="prtl" value="1" /> <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D" /> <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" /> <input type="hidden" name="V_SEARCH.depth" value="1" /> <input type="hidden" name="V_SEARCH.showStricts" value="false" /> <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" /> </form></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=31443&amp;V_DOCUMENT.docRank=31444&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492305121669&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567058181&amp;profileId=&amp;key.newSearchLabel=">Previous Company</a></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=31445&amp;V_DOCUMENT.docRank=31446&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492305121669&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567015502&amp;profileId=&amp;key.newSearchLabel=">Next Company</a></li> </ul> </div> <details> <summary>Third-Party Information Liability Disclaimer</summary> <p>Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.</p> </details> <h2> MRO Electronic Supply Ltd. </h2> <div class="row"> <div class="col-md-5"> <h2 class="h5 mrgn-bttm-0">Legal/Operating Name:</h2> <p>MRO Electronic Supply Ltd.</p> <div class="mrgn-tp-md"></div> <p class="mrgn-bttm-0" ><a href="http://www.mroelectronics.com" target="_blank" title="Website URL">http://www.mroelectronics.com</a></p> <p><a href="mailto:sales@mroelectronics.com" title="sales@mroelectronics.com">sales@mroelectronics.com</a></p> </div> <div class="col-md-4 mrgn-sm-sm"> <h2 class="h5 mrgn-bttm-0">Mailing Address:</h2> <address class="mrgn-bttm-md"> 2240 Pegasus Rd NE<br/> CALGARY, Alberta<br/> T2E 8G8 <br/> </address> <h2 class="h5 mrgn-bttm-0">Location Address:</h2> <address class="mrgn-bttm-md"> 2240 Pegasus Rd NE<br/> CALGARY, Alberta<br/> T2E 8G8 <br/> </address> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (403) 291-0501 </p> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (800) 882-9301</p> <p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>: (403) 291-0530</p> </div> <div class="col-md-3 mrgn-tp-md"> <h2 class="wb-inv">Logo</h2> <img class="img-responsive text-left" src="https://www.ic.gc.ca/app/ccc/srch/media?estblmntNo=234567029512&amp;graphFileName=mro.gif&amp;applicationCode=AP&amp;lang=eng" alt="Logo" /> </div> </div> <div class="row mrgn-tp-md mrgn-bttm-md"> <div class="col-md-12"> <h2 class="wb-inv">Company Profile</h2> <br> Custom Cables, injection molding, Custom Antennas, Small Customized Panels, Electronics Parts Distributer. <br>Over molding cable assemblies with Macromelt low pressure or Polyurethane high pressure harsh environment cables.<br> </div> </div> <!-- <div class="wb-tabs ignore-session update-hash wb-eqht-off print-active"> --> <div class="wb-tabs ignore-session"> <div class="tabpanels"> <details id="details-panel1"> <summary> Full profile </summary> <!-- Tab 1 --> <h2 class="wb-invisible"> Full profile </h2> <!-- Contact Information --> <h3 class="page-header"> Contact information </h3> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Kevin Stiles </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> President </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Research/Development/Engineering. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 291-0501 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 291-0530 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> kevin@mroelectronics.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Mark Stiles </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Management Executive. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (604) 298-4941 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> mark@mroelectronics.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Diana Wildfong </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Management Executive. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (780) 444-7594 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (780) 444-9403 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> diana@mroelectronics.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Phil Stiles </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Manufacturing/Production/Operations. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 291-0501 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 291-0530 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> phil@mroelectronics.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Aileen Sison-Catahan </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Manufacturing/Production/Operations. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 291-0501 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 291-0530 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> aileen@mroelectronics.com </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Company Description --> <h3 class="page-header"> Company description </h3> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Country of Ownership: </strong> </div> <div class="col-md-7"> Canada &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Year Established: </strong> </div> <div class="col-md-7"> 1991 </div> </div> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> Yes &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 417320 - Electronic Components, Navigational and Communications Equipment and Supplies Wholesaler-Distributors </div> </div> <div class="row"> <div class="col-md-5"> <strong> Alternate Industries (NAICS): </strong> </div> <div class="col-md-7"> 335920 - Communication and Energy Wire and Cable Manufacturing<br> 416110 - Electrical Wiring and Construction Supplies Wholesaler-Distributors<br> 454111 - Internet Shopping<br> </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Trading House / Wholesaler / Agent and Distributor &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Total Sales ($CDN): </strong> </div> <div class="col-md-7"> $5,000,000 to $9,999,999&nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Number of Employees: </strong> </div> <div class="col-md-7"> 62&nbsp; </div> </div> </section> <!-- Products / Services / Licensing --> <h3 class="page-header"> Product / Service / Licensing </h3> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> Molded Custom Cables <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Custom RF Coax cable assemblies. All types of RF connectors and cable. <br> Custom Molded Cable assemblies. <br> Custom Antennas <br> Electronic assemblies. <br> <br> <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> FSC Code: </strong> </div> <div class="col-md-9"> 5995-Cable, Cord, and Wire Assemblies: Communication Equipment <br> </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Technology Profile --> <h3 class="page-header"> Technology profile </h3> <section class="container-fluid"> 1 injection molding machine for low pressure Macro Melt <br> 8 High pressure machines for polyurethane use in harsh environments. <br> </section> <!-- Market Profile --> <!-- Sector Information --> <h3 class="page-header"> Sector information </h3> <section class="container-fluid"> <h4> Classification codes </h4> <div class="row"> <div class="col-md-3"><strong>Dun and Bradstreet Number: </strong></div> <div class="col-md-9">249297052 + </div> </div> <div class="row"> <div class="col-md-3"><strong>CAGE Code:</strong></div> <div class="col-md-9">L1160</div> </div> <h4> Unique applications: </h4> The Canadian Hydrogen Intensity Mapping Experiment (CHIME) Cables supplied by MRO for the antennas. <br> CHIME will map the distribution of neutral Hydrogen over the redshift range from 0.8 to 2.5. These data will be used to produce a map of cosmic structure over the largest volume of the universe ever observed, This three-dimensional map will enable cosmologists to better discern the cause of the Universe&#39;s accelerating expansion. </section> <details class="mrgn-tp-md mrgn-bttm-md"> <summary> Third-Party Information Liability Disclaimer </summary> <p> Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements. </p> </details> </details> <details id="details-panel2"> <summary> Contacts </summary> <h2 class="wb-invisible"> Contact information </h2> <!-- Contact Information --> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Kevin Stiles </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> President </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Research/Development/Engineering. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 291-0501 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 291-0530 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> kevin@mroelectronics.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Mark Stiles </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Management Executive. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (604) 298-4941 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> mark@mroelectronics.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Diana Wildfong </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Management Executive. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (780) 444-7594 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (780) 444-9403 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> diana@mroelectronics.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Phil Stiles </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Manufacturing/Production/Operations. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 291-0501 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 291-0530 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> phil@mroelectronics.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Aileen Sison-Catahan </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Manufacturing/Production/Operations. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 291-0501 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 291-0530 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> aileen@mroelectronics.com </div> </div> </section> </details> <details id="details-panel3"> <summary> Description </summary> <h2 class="wb-invisible"> Company description </h2> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Country of Ownership: </strong> </div> <div class="col-md-7"> Canada &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Year Established: </strong> </div> <div class="col-md-7"> 1991 </div> </div> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> Yes &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 417320 - Electronic Components, Navigational and Communications Equipment and Supplies Wholesaler-Distributors </div> </div> <div class="row"> <div class="col-md-5"> <strong> Alternate Industries (NAICS): </strong> </div> <div class="col-md-7"> 335920 - Communication and Energy Wire and Cable Manufacturing<br> 416110 - Electrical Wiring and Construction Supplies Wholesaler-Distributors<br> 454111 - Internet Shopping<br> </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Trading House / Wholesaler / Agent and Distributor &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Total Sales ($CDN): </strong> </div> <div class="col-md-7"> $5,000,000 to $9,999,999&nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Number of Employees: </strong> </div> <div class="col-md-7"> 62&nbsp; </div> </div> </section> </details> <details id="details-panel4"> <summary> Products, services and licensing </summary> <h2 class="wb-invisible"> Product / Service / Licensing </h2> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> Molded Custom Cables <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Custom RF Coax cable assemblies. All types of RF connectors and cable. <br> Custom Molded Cable assemblies. <br> Custom Antennas <br> Electronic assemblies. <br> <br> <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> FSC Code: </strong> </div> <div class="col-md-9"> 5995-Cable, Cord, and Wire Assemblies: Communication Equipment <br> </div> </div> </section> </details> <details id="details-panel5"> <summary> Technology </summary> <h2 class="wb-invisible"> Technology profile </h2> <section class="container-fluid"> 1 injection molding machine for low pressure Macro Melt <br> 8 High pressure machines for polyurethane use in harsh environments. <br> </section> </details> <details id="details-panel7"> <summary> Sector </summary> <h2 class="wb-invisible"> Sector information </h2> <section class="container-fluid"> <h4> Classification codes </h4> <div class="row"> <div class="col-md-3"><strong>Dun and Bradstreet Number: </strong></div> <div class="col-md-9">249297052 + </div> </div> <div class="row"> <div class="col-md-3"><strong>CAGE Code:</strong></div> <div class="col-md-9">L1160</div> </div> <h4> Unique applications: </h4> The Canadian Hydrogen Intensity Mapping Experiment (CHIME) Cables supplied by MRO for the antennas. <br> CHIME will map the distribution of neutral Hydrogen over the redshift range from 0.8 to 2.5. These data will be used to produce a map of cosmic structure over the largest volume of the universe ever observed, This three-dimensional map will enable cosmologists to better discern the cause of the Universe&#39;s accelerating expansion. </section> </details> </div> </div> <div class="row"> <div class="col-md-12 text-right"> Last Update Date 2016-05-06 </div> </div> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z --> <!-- End Body Content --> <!-- Begin Body Foot --> <!-- End Body Foot --> <!-- END MAIN TABLE --> <!-- End body --> <!-- Begin footer --> <div class="row pagedetails"> <div class="col-sm-5 col-xs-12 datemod"> <dl id="wb-dtmd"> <dt class=" hidden-print">Date Modified:</dt> <dd class=" hidden-print"> <span><time>2017-03-02</time></span> </dd> </dl> </div> <div class="clear visible-xs"></div> <div class="col-sm-4 col-xs-6"> </div> <div class="col-sm-3 col-xs-6 text-right"> </div> <div class="clear visible-xs"></div> </div> </main> <footer role="contentinfo" id="wb-info"> <nav role="navigation" class="container wb-navcurr"> <h2 class="wb-inv">About government</h2> <!-- EPIC FOOTER BEGIN --> <!-- EPI-11638 Contact us --> <ul class="list-unstyled colcount-sm-2 colcount-md-3"> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07026.html#pageid=E048-H00000&amp;from=Industries">Contact us</a></li> <li><a href="https://www.canada.ca/en/government/dept.html">Departments and agencies</a></li> <li><a href="https://www.canada.ca/en/government/publicservice.html">Public service and military</a></li> <li><a href="https://www.canada.ca/en/news.html">News</a></li> <li><a href="https://www.canada.ca/en/government/system/laws.html">Treaties, laws and regulations</a></li> <li><a href="https://www.canada.ca/en/transparency/reporting.html">Government-wide reporting</a></li> <li><a href="http://pm.gc.ca/eng">Prime Minister</a></li> <li><a href="https://www.canada.ca/en/government/system.html">How government works</a></li> <li><a href="http://open.canada.ca/en/">Open government</a></li> </ul> </nav> <div class="brand"> <div class="container"> <div class="row"> <nav class="col-md-10 ftr-urlt-lnk"> <h2 class="wb-inv">About this site</h2> <ul> <li><a href="https://www.canada.ca/en/social.html">Social media</a></li> <li><a href="https://www.canada.ca/en/mobile.html">Mobile applications</a></li> <li><a href="http://www1.canada.ca/en/newsite.html">About Canada.ca</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html">Terms and conditions</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html#p1">Privacy</a></li> </ul> </nav> <div class="col-xs-6 visible-sm visible-xs tofpg"> <a href="#wb-cont">Top of Page <span class="glyphicon glyphicon-chevron-up"></span></a> </div> <div class="col-xs-6 col-md-2 text-right"> <object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object> </div> </div> </div> </div> </footer> <!--[if gte IE 9 | !IE ]><!--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/wet-boew.min.js"></script> <!--<![endif]--> <!--[if lt IE 9]> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew2.min.js"></script> <![endif]--> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/theme.min.js"></script> <!-- EPI-10519 --> <span class="wb-sessto" data-wb-sessto='{"inactivity": 1800000, "reactionTime": 180000, "sessionalive": 1800000, "logouturl": "/app/ccc/srch/cccSrch.do?lang=eng&prtl=1"}'></span> <script src="/eic/home.nsf/js/jQuery.externalOpensInNewWindow.js"></script> <!-- EPI-11190 - Webtrends --> <script src="/eic/home.nsf/js/webtrends.js"></script> <script>var endTime = new Date();</script> <noscript> <div><img alt="" id="DCSIMG" width="1" height="1" src="//wt-sdc.ic.gc.ca/dcs6v67hwe0ei7wsv8g9fv50d_3k6i/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=9.4.0&amp;dcssip=www.ic.gc.ca"/></div> </noscript> <!-- /Webtrends --> <!-- JS deps --> <script src="/eic/home.nsf/js/jquery.imagesloaded.js"></script> <!-- EPI-11262 - Util JS --> <script src="/eic/home.nsf/js/_WET_4-0_utils_canada.min.js"></script> <!-- EPI-11383 --> <script src="/eic/home.nsf/js/jQuery.icValidationErrors.js"></script> <span style="display:none;" id='app-info' data-project-groupid='' data-project-artifactid='' data-project-version='' data-project-build-timestamp='' data-issue-tracking='' data-scm-sha1='' data-scm-sha1-abbrev='' data-scm-branch='' data-scm-commit-date=''></span> </body></html> <!-- End Footer --> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z -->
GoC-Spending/data-corporations
html/234567029512.html
HTML
mit
64,419
require_dependency "epm_catalog/application_controller" module EpmCatalog class BaselineMeasuresController < ApplicationController before_filter :authenticate_user! # GET /baseline_measures # GET /baseline_measures.json def index # if called as nested resource get measures for project_type_id if params[:project_type_id] @baseline_measures = BaselineMeasure.where(:project_type_id => params[:project_type_id]) else @baseline_measures = BaselineMeasure.all end respond_to do |format| format.html # index.html.erb format.json { render json: @baseline_measures.as_json(:methods => [:code, :measure_text, :implementation_notes] ) } end end def show end def new end def edit end # POST /baseline_measures # POST /baseline_measures.json def create @baseline_measure = BaselineMeasure.new(params[:baseline_measure]) respond_to do |format| if @baseline_measure.save format.html { redirect_to @baseline_measure, notice: 'Baseline measure was successfully created.' } format.json { render json: @baseline_measure.as_json(:methods => [:code, :measure_text, :implementation_notes] ), status: :created, location: project_type_baseline_measure_url(@baseline_measure.project_type_id, @baseline_measure) } else format.html { render action: "new" } format.json { render json: @baseline_measure.errors, status: :unprocessable_entity } end end end def update end # DELETE /baseline_measures/1 # DELETE /baseline_measures/1.json def destroy @baseline_measure = BaselineMeasure.find(params[:id]) # acts_as_paranoid - Sets the deleted_at field to the current time. @baseline_measure.delete respond_to do |format| format.html { redirect_to projects_url } format.json { head :no_content } end end end end
kristenhazard/epm-catalog
app/controllers/epm_catalog/baseline_measures_controller.rb
Ruby
mit
1,976
from collections import namedtuple import select StreamEvent = namedtuple( 'StreamEvent', [ 'fd', 'stream', 'data', 'direction', 'num_bytes', 'eof' ] ) class StreamWatcher(object): def __init__( self ): if _best_backend is None: raise Exception( "No poll/queue backend could be found for your OS." ) self.backend = _best_backend( ) self.fd_map = {} self.stream_map = {} def watch( self, fd, data=None, read=True, write=False ): # allow python file-like objects that have a backing fd if hasattr(fd, 'fileno') and callable(fd.fileno): stream = fd fd = stream.fileno() self.stream_map[fd] = stream else: self.stream_map[fd] = None # associate user data with the fd self.fd_map[fd] = data # prepare any event filter additions if read: self.backend.watch_read( fd ) if write: self.backend.watch_write( fd ) def wait( self, timeout=None, max_events=4 ): return self.backend.wait( timeout=timeout, max_events=max_events, fd_data_map=self.fd_map, fd_stream_map=self.stream_map ) _best_backend = None try: from select import kqueue, kevent except ImportError: pass else: class KQueueBackend(object): def __init__( self ): self.kq = kqueue( ) def watch_read( self, fd ): event = kevent( fd, filter=select.KQ_FILTER_READ, flags=select.KQ_EV_ADD ) self._add_events( [event] ) def watch_write( self, fd ): event = kevent( fd, filter=select.KQ_FILTER_WRITE, flags=select.KQ_EV_ADD ) self._add_events( [event] ) def _add_events( self, new_events ): e = self.kq.control( new_events, 0, 0 ) assert len(e) == 0, "Not expecting to receive any events while adding filters." def wait( self, timeout=None, max_events=4, fd_data_map={}, fd_stream_map={} ): r_events = self.kq.control( None, max_events, timeout ) e = [] for event in r_events: fd = event.ident if fd in fd_data_map: stream = fd_stream_map.get( fd, None ) data = fd_data_map.get( fd, None ) direction = 'read' if event.filter == select.KQ_FILTER_READ else 'write' num_bytes = event.data eof = ( event.flags & select.KQ_EV_EOF != 0 ) e.append( StreamEvent( fd, stream, data, direction, num_bytes, eof ) ) return e if _best_backend is None: _best_backend = KQueueBackend try: from select import epoll from fcntl import ioctl import array import termios except ImportError: pass else: class EPollBackend(object): def __init__( self ): self.ep = epoll( ) def watch_read( self, fd ): self.ep.register( fd, select.EPOLLIN ) def watch_write( self, fd ): self.ep.register( fd, select.EPOLLOUT ) def wait( self, timeout=None, max_events=None, fd_data_map={}, fd_stream_map={} ): if max_events is None: max_events = -1 if timeout is None: timeout = -1 r_events = self.ep.poll( timeout, max_events ) e = [] for fd, event in r_events: if fd in fd_data_map: buf = array.array( 'i', [0] ) ioctl( fd, termios.FIONREAD, buf, 1 ) stream = fd_stream_map.get( fd, None ) data = fd_data_map.get( fd, None ) num_bytes = buf[0] eof = ( event & (select.EPOLLHUP | select.EPOLLERR) != 0 ) if event & select.EPOLLIN != 0: e.append( StreamEvent( fd, stream, data, 'read', num_bytes, eof ) ) if event & select.EPOLLOUT != 0: e.append( StreamEvent( fd, stream, data, 'write', num_bytes, eof ) ) return e if _best_backend is None: _best_backend = EPollBackend
theojulienne/pyio
pyio/io/StreamWatcher.py
Python
mit
3,517
USE TSQL_Koans EXEC tSQLt.NewTestClass 'AboutViews' GO
jpvantuyl/tSQL-Koans
src/AboutViews.sql
SQL
mit
56
class ChangeGoogleBooksLinkDefaultValue < ActiveRecord::Migration[5.0] def change change_column :books, :googlebooks, :string, default: "" end end
johan-andersson01/biblion
db/migrate/20180221201318_change_google_books_link_default_value.rb
Ruby
mit
155
#--- # Excerpted from "Agile Web Development with Rails", # published by The Pragmatic Bookshelf. # Copyrights apply to this code. It may not be used to create training material, # courses, books, articles, and the like. Contact us if you are in doubt. # We make no guarantees that this code is fit for any purpose. # Visit http://www.pragmaticprogrammer.com/titles/rails4 for more book information. #--- class LineItem < ActiveRecord::Base belongs_to :order belongs_to :product belongs_to :cart def total_price product.price * quantity end end
Baloo81/rails.depot
app/models/line_item.rb
Ruby
mit
561
package org.cafe.domain.financeiro; import java.util.ArrayList; import java.util.List; public class Conta { private long numero; private double saldo; private double limiteCartao; private List<Double> lancamentosCartao = new ArrayList<>(); public Conta(long numero, double saldo, double limiteCartao) { this.numero = numero; this.saldo = saldo; this.limiteCartao = limiteCartao; } public long getNumero() { return numero; } public boolean debitar(double valor) { // TODO return false; } public boolean creditar(double valor) { // TODO return false; } public double getSaldo() { return saldo; } public double limiteDisponivel() { // TODO return 0; } }
erickzanardo/javeando
panetteria/src/main/java/org/cafe/domain/financeiro/Conta.java
Java
mit
811
#include "minunit.h" #include <terror/instruction.h> #include <terror/vmmethod.h> #include <assert.h> static VMMethod *method = NULL; static long *literals = NULL; static Instruction **instructions = NULL; void setup() { literals = calloc(3, sizeof(long)); literals[0] = (long)"123"; literals[1] = (long)123; literals[2] = (long)"foo"; instructions = calloc(3, sizeof(Instruction*)); instructions[0] = Instruction_new(0x11223344); instructions[1] = Instruction_new(0x22334455); instructions[2] = Instruction_new(0x33445566); } char *test_create() { method = VMMethod_new(instructions, 3, literals, 3, 3); mu_assert(method != NULL, "VMMethod wasn't created correctly."); mu_assert(method->literals == literals, "Literals weren't assigned correctly") mu_assert(method->literals_count == 3, "Literals count wasn't assigned correctly") mu_assert(method->instructions == instructions, "Instructions weren't assigned correctly") mu_assert(method->instructions_count == 3, "Instructions count wasn't assigned correctly") mu_assert(method->arity == 3, "Arity wasn't assigned correctly") return NULL; } char *test_destroy() { VMMethod_destroy(method); return NULL; } char *all_tests() { mu_suite_start(); setup(); mu_run_test(test_create); mu_run_test(test_destroy); return NULL; } RUN_TESTS(all_tests);
txus/oldterror
tests/vmmethod_tests.c
C
mit
1,353
import { TreeView } from "@bosket/vue" import { dragndrop } from "@bosket/core" /* Model */ const dragModel = [ { name: "< Drag these items >" }, { name: 1, children: [{ name: 11 }, { name: 12 }, { name: 13 }]}, { name: 2, children: [{ name: 21 }, { name: 22 }]}, { name: 3 }, { name: 4 } ] /* Common conf. */ const conf = { category: "children", onSelect: function(_) { this.selection = _ }, display: i => i.name, strategies: { fold: [() => false]} } /* Drag only tree */ export const DragTree = { name: "DragTree", data: () => ({ selection: [], model: dragModel, ...conf }), render: function(h) { const props = { props: { ...this.$data }} return <div class="tree-sample"> <TreeView { ...props } // Pluck preset dragndrop={{ ...dragndrop.pluck(() => this.model, m => this.model = m) }} /> </div> } } /* Drop only tree */ export const DropTree = { name: "DropTree", data: () => ({ selection: [], model: [{ name: "< Drop items here >", children: []}], ...conf }), render: function(h) { const props = { props: { ...this.$data } } return <div class="tree-sample"> <TreeView { ...props } // Paste preset + only drop on items with children dragndrop={{ ...dragndrop.paste(() => this.model, m => this.model = m), droppable: item => item && item.children }} /> </div> } }
elbywan/bosket
docs/vue/plan/treeview/optional-properties/dragndrop/example.js
JavaScript
mit
1,661
<?php /** * @package examSignup * * @author Daniel Holzmann <d@velopment.at> * @date 04.12.13 * @time 13:19 */ namespace CodeLovers\ExamSignupBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class DeleteUserType extends AbstractType { /** * Returns the name of this type. * * @return string The name of this type */ public function getName() { return 'delete_user'; } public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'data_class' => 'CodeLovers\ExamSignupBundle\Form\Model\DeleteUser' )); } public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('confirm', 'checkbox', array( 'label' => 'deleteUser.confirm', 'required' => true )); } }
CodeLoversAt/ExamSignup
src/CodeLovers/ExamSignupBundle/Form/DeleteUserType.php
PHP
mit
992
<?php /** * Wingman * * @link http://github.com/mleko/wingman * @copyright Copyright (c) 2017 Daniel Król * @license MIT */ namespace Mleko\Wingman\Composer; use Composer\Config; use Composer\IO\BaseIO; use Composer\IO\BufferIO; use Composer\IO\IOInterface; class ArrayIO extends BufferIO { /** * Is this input means interactive? * * @return bool */ public function isInteractive() { // TODO: Implement isInteractive() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Is this output verbose? * * @return bool */ public function isVerbose() { // TODO: Implement isVerbose() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Is the output very verbose? * * @return bool */ public function isVeryVerbose() { // TODO: Implement isVeryVerbose() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Is the output in debug verbosity? * * @return bool */ public function isDebug() { // TODO: Implement isDebug() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Is this output decorated? * * @return bool */ public function isDecorated() { // TODO: Implement isDecorated() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Writes a message to the output. * * @param string|array $messages The message as an array of lines or a single string * @param bool $newline Whether to add a newline or not * @param int $verbosity Verbosity level from the VERBOSITY_* constants */ public function write($messages, $newline = true, $verbosity = self::NORMAL) { // TODO: Implement write() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Writes a message to the error output. * * @param string|array $messages The message as an array of lines or a single string * @param bool $newline Whether to add a newline or not * @param int $verbosity Verbosity level from the VERBOSITY_* constants */ public function writeError($messages, $newline = true, $verbosity = self::NORMAL) { // TODO: Implement writeError() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Overwrites a previous message to the output. * * @param string|array $messages The message as an array of lines or a single string * @param bool $newline Whether to add a newline or not * @param int $size The size of line * @param int $verbosity Verbosity level from the VERBOSITY_* constants */ public function overwrite($messages, $newline = true, $size = null, $verbosity = self::NORMAL) { // TODO: Implement overwrite() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Overwrites a previous message to the error output. * * @param string|array $messages The message as an array of lines or a single string * @param bool $newline Whether to add a newline or not * @param int $size The size of line * @param int $verbosity Verbosity level from the VERBOSITY_* constants */ public function overwriteError($messages, $newline = true, $size = null, $verbosity = self::NORMAL) { // TODO: Implement overwriteError() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Asks a question to the user. * * @param string|array $question The question to ask * @param string $default The default answer if none is given by the user * * @throws \RuntimeException If there is no data to read in the input stream * @return string The user answer */ public function ask($question, $default = null) { // TODO: Implement ask() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Asks a confirmation to the user. * * The question will be asked until the user answers by nothing, yes, or no. * * @param string|array $question The question to ask * @param bool $default The default answer if the user enters nothing * * @return bool true if the user has confirmed, false otherwise */ public function askConfirmation($question, $default = true) { // TODO: Implement askConfirmation() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Asks for a value and validates the response. * * The validator receives the data to validate. It must return the * validated data when the data is valid and throw an exception * otherwise. * * @param string|array $question The question to ask * @param callable $validator A PHP callback * @param null|int $attempts Max number of times to ask before giving up (default of null means infinite) * @param mixed $default The default answer if none is given by the user * * @throws \Exception When any of the validators return an error * @return mixed */ public function askAndValidate($question, $validator, $attempts = null, $default = null) { // TODO: Implement askAndValidate() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Asks a question to the user and hide the answer. * * @param string $question The question to ask * * @return string The answer */ public function askAndHideAnswer($question) { // TODO: Implement askAndHideAnswer() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Asks the user to select a value. * * @param string|array $question The question to ask * @param array $choices List of choices to pick from * @param bool|string $default The default answer if the user enters nothing * @param bool|int $attempts Max number of times to ask before giving up (false by default, which means infinite) * @param string $errorMessage Message which will be shown if invalid value from choice list would be picked * @param bool $multiselect Select more than one value separated by comma * * @throws \InvalidArgumentException * @return int|string|array The selected value or values (the key of the choices array) */ public function select($question, $choices, $default, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false) { // TODO: Implement select() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Get all authentication information entered. * * @return array The map of authentication data */ public function getAuthentications() { // TODO: Implement getAuthentications() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Verify if the repository has a authentication information. * * @param string $repositoryName The unique name of repository * * @return bool */ public function hasAuthentication($repositoryName) { // TODO: Implement hasAuthentication() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Get the username and password of repository. * * @param string $repositoryName The unique name of repository * * @return array The 'username' and 'password' */ public function getAuthentication($repositoryName) { // TODO: Implement getAuthentication() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Set the authentication information for the repository. * * @param string $repositoryName The unique name of repository * @param string $username The username * @param string $password The password */ public function setAuthentication($repositoryName, $username, $password = null) { // TODO: Implement setAuthentication() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } /** * Loads authentications from a config instance * * @param Config $config */ public function loadConfiguration(Config $config) { // TODO: Implement loadConfiguration() method. throw new \RuntimeException("Unimplemented method " . __CLASS__ . "::" . __METHOD__); } }
mleko/wingman
tests/Composer/ArrayIO.php
PHP
mit
9,241
<!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/> <meta charset="utf-8"/> <title> Phing API Documentation &raquo; \TypedefTask </title> <meta name="author" content=""/> <meta name="description" content=""/> <link href="../css/template.css" rel="stylesheet" media="all"/> <!--[if lt IE 9]> <script src="https://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script> <![endif]--> <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script> <script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script> <script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script> <script src="../js/bootstrap.js" type="text/javascript"></script> <script src="../js/template.js" type="text/javascript"></script> <script src="../js/prettify/prettify.min.js" type="text/javascript"></script> <link rel="shortcut icon" href="../img/favicon.ico"/> <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"/> <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"/> <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"/> </head> <body> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="../index.html">Phing API Documentation</a> <div class="nav-collapse"> <ul class="nav"> <li class="dropdown"> <a href="#api" class="dropdown-toggle" data-toggle="dropdown"> API Documentation <b class="caret"></b> </a> <ul class="dropdown-menu"> </ul> </li> <li class="dropdown" id="charts-menu"> <a href="#charts" class="dropdown-toggle" data-toggle="dropdown"> Charts <b class="caret"></b> </a> <ul class="dropdown-menu"> <li> <a href="../graph_class.html"> <i class="icon-list-alt"></i>&#160;Class hierarchy diagram </a> </li> </ul> </li> <li class="dropdown" id="reports-menu"> <a href="#reports" class="dropdown-toggle" data-toggle="dropdown"> Reports <b class="caret"></b> </a> <ul class="dropdown-menu"> <li> <a href="../errors.html"> <i class="icon-list-alt"></i>&#160;Errors </a> </li> <li> <a href="../markers.html"> <i class="icon-list-alt"></i>&#160;Markers </a> </li> <li> <a href="../deprecated.html"> <i class="icon-list-alt"></i>&#160;Deprecated </a> </li> </ul> </li> </ul> </div> </div> </div> <div class="go_to_top"> <a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a> </div> </div> <div id="___" class="container"> <noscript> <div class="alert alert-warning"> Javascript is disabled; several features are only available if Javascript is enabled. </div> </noscript> <style> .deprecated h2 { text-decoration: line-through; } </style> <div class="row"> <div class="span4"> <div class="btn-group view pull-right" data-toggle="buttons-radio"> <button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button> <button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button> </div> <div class="btn-group visibility" data-toggle="buttons-checkbox"> <button class="btn public active" title="Show public elements">Public</button> <button class="btn protected" title="Show protected elements">Protected</button> <button class="btn private" title="Show private elements">Private</button> <button class="btn inherited active" title="Show inherited elements">Inherited</button> </div> <ul class="side-nav nav nav-list"> <li class="nav-header"> <i class="icon-custom icon-method"></i> Methods <ul> <li class="method public"> <a href="#method_createClasspath" title="createClasspath :: Create the classpath to be used when searching for component being defined"> <span class="description">Create the classpath to be used when searching for component being defined</span><pre>createClasspath</pre> </a> </li> <li class="method public inherited"> <a href="#method_getDescription" title="getDescription :: Returns the textual description of the task"> <span class="description">Returns the textual description of the task</span><pre>getDescription</pre> </a> </li> <li class="method public inherited"> <a href="#method_getLocation" title="getLocation :: Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages."> <span class="description">Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.</span><pre>getLocation</pre> </a> </li> <li class="method public inherited"> <a href="#method_getOwningTarget" title="getOwningTarget :: Returns the owning target of this task."> <span class="description">Returns the owning target of this task.</span><pre>getOwningTarget</pre> </a> </li> <li class="method public inherited"> <a href="#method_getProject" title="getProject :: Returns a reference to current project"> <span class="description">Returns a reference to current project</span><pre>getProject</pre> </a> </li> <li class="method public inherited"> <a href="#method_getRuntimeConfigurableWrapper" title="getRuntimeConfigurableWrapper :: Returns the wrapper object for runtime configuration"> <span class="description">Returns the wrapper object for runtime configuration</span><pre>getRuntimeConfigurableWrapper</pre> </a> </li> <li class="method public inherited"> <a href="#method_getTaskName" title="getTaskName :: Returns the name of task, used only for log messages"> <span class="description">Returns the name of task, used only for log messages</span><pre>getTaskName</pre> </a> </li> <li class="method public inherited"> <a href="#method_getTaskType" title="getTaskType :: Returns the name of the task under which it was invoked, usually the XML tagname"> <span class="description">Returns the name of the task under which it was invoked, usually the XML tagname</span><pre>getTaskType</pre> </a> </li> <li class="method public inherited"> <a href="#method_init" title="init :: Called by the parser to let the task initialize properly."> <span class="description">Called by the parser to let the task initialize properly.</span><pre>init</pre> </a> </li> <li class="method public inherited"> <a href="#method_log" title="log :: Logs a message with the given priority."> <span class="description">Logs a message with the given priority.</span><pre>log</pre> </a> </li> <li class="method public inherited"> <a href="#method_main" title="main :: Called by the project to let the task do it&#039;s work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running &lt;em&gt;phing target1 target2&lt;/em&gt; will run all tasks in target3 twice."> <span class="description">Called by the project to let the task do it&#039;s work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running &lt;em&gt;phing target1 target2&lt;/em&gt; will run all tasks in target3 twice.</span><pre>main</pre> </a> </li> <li class="method public inherited"> <a href="#method_maybeConfigure" title="maybeConfigure :: Configure this task if it hasn&#039;t been done already."> <span class="description">Configure this task if it hasn&#039;t been done already.</span><pre>maybeConfigure</pre> </a> </li> <li class="method public inherited"> <a href="#method_perform" title="perform :: Perfrom this task"> <span class="description">Perfrom this task</span><pre>perform</pre> </a> </li> <li class="method public"> <a href="#method_setClassname" title="setClassname :: Sets the class name / dotpath to use."> <span class="description">Sets the class name / dotpath to use.</span><pre>setClassname</pre> </a> </li> <li class="method public"> <a href="#method_setClasspath" title="setClasspath :: Set the classpath to be used when searching for component being defined"> <span class="description">Set the classpath to be used when searching for component being defined</span><pre>setClasspath</pre> </a> </li> <li class="method public"> <a href="#method_setClasspathRef" title="setClasspathRef :: Reference to a classpath to use when loading the files."> <span class="description">Reference to a classpath to use when loading the files.</span><pre>setClasspathRef</pre> </a> </li> <li class="method public inherited"> <a href="#method_setDescription" title="setDescription :: Sets a textual description of the task"> <span class="description">Sets a textual description of the task</span><pre>setDescription</pre> </a> </li> <li class="method public inherited"> <a href="#method_setLocation" title="setLocation :: Sets the location within the buildfile this task occurs. Called by the parser to set location information."> <span class="description">Sets the location within the buildfile this task occurs. Called by the parser to set location information.</span><pre>setLocation</pre> </a> </li> <li class="method public"> <a href="#method_setName" title="setName :: Sets the name that will be used in XML buildfile."> <span class="description">Sets the name that will be used in XML buildfile.</span><pre>setName</pre> </a> </li> <li class="method public inherited"> <a href="#method_setOwningTarget" title="setOwningTarget :: Sets the owning target this task belongs to."> <span class="description">Sets the owning target this task belongs to.</span><pre>setOwningTarget</pre> </a> </li> <li class="method public inherited"> <a href="#method_setProject" title="setProject :: References the project to the current component."> <span class="description">References the project to the current component.</span><pre>setProject</pre> </a> </li> <li class="method public inherited"> <a href="#method_setRuntimeConfigurableWrapper" title="setRuntimeConfigurableWrapper :: Sets the wrapper object this task should use for runtime configurable elements."> <span class="description">Sets the wrapper object this task should use for runtime configurable elements.</span><pre>setRuntimeConfigurableWrapper</pre> </a> </li> <li class="method public inherited"> <a href="#method_setTaskName" title="setTaskName :: Sets the name of this task for log messages"> <span class="description">Sets the name of this task for log messages</span><pre>setTaskName</pre> </a> </li> <li class="method public inherited"> <a href="#method_setTaskType" title="setTaskType :: Sets the type of the task. Usually this is the name of the XML tag"> <span class="description">Sets the type of the task. Usually this is the name of the XML tag</span><pre>setTaskType</pre> </a> </li> </ul> </li> <li class="nav-header protected">» Protected <ul> <li class="method protected inherited"> <a href="#method_getRegisterSlot" title="getRegisterSlot :: Returns a name"> <span class="description">Returns a name</span><pre>getRegisterSlot</pre> </a> </li> </ul> </li> <li class="nav-header private">» Private <ul> </ul> </li> <li class="nav-header"> <i class="icon-custom icon-constant"></i> Constants <ul> </ul> </li> </ul> </div> <div class="span8"> <div class="element class"> <h1>TypedefTask</h1> <small style="display: block; text-align: right"> Extends <a href="../classes/Task.html">\Task</a> </small> <p class="short_description">Register a datatype for use within a buildfile.</p> <div class="details"> <div class="long_description"> <p>This is for registering your own datatypes for use within a buildfile.</p> <p>If you find that you are using a particular class frequently, you may want to edit the phing/types/defaults.properties file so that it is included by default. You may also want to submit it (if LGPL or compatible license) to be included in Phing distribution.</p> <pre> <typedef name="mytype" classname="path.to.MyHandlingClass"/> . <sometask ...> <mytype param1="val1" param2="val2"/> </sometask> </pre> <p>TODO: -- possibly refactor since this is almost the same as TaskDefTask (right now these are just too simple to really justify creating an abstract class)</p> </div> <table class="table table-bordered"> <tr> <th> author </th> <td> <p>Hans Lellelid <a href="mailto:hans@xmpl.org">hans@xmpl.org</a></p> </td> </tr> <tr> <th> version </th> <td> <p>$Id: f91ebca00240cc8f22e642115e0aa0da140dc4a4 $</p> </td> </tr> <tr> <th> package </th> <td> <p>phing.tasks.system</p> </td> </tr> </table> <h3><i class="icon-custom icon-method"></i> Methods</h3> <a id="method_createClasspath"></a> <div class="element clickable method public method_createClasspath" data-toggle="collapse" data-target=".method_createClasspath .collapse"> <h2>Create the classpath to be used when searching for component being defined</h2> <pre>createClasspath() : \Path</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/Path.html">\Path</a></code><p></p> </div> </div> </div> <a id="method_getDescription"></a> <div class="element clickable method public method_getDescription inherited" data-toggle="collapse" data-target=".method_getDescription .collapse"> <h2>Returns the textual description of the task</h2> <pre>getDescription() : string</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code>string</code><p><p>The text description of the task</p></p> </div> </div> </div> <a id="method_getLocation"></a> <div class="element clickable method public method_getLocation inherited" data-toggle="collapse" data-target=".method_getLocation .collapse"> <h2>Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.</h2> <pre>getLocation() : \Location</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/Location.html">\Location</a></code><p><p>The location object describing the position of this task within the buildfile.</p></p> </div> </div> </div> <a id="method_getOwningTarget"></a> <div class="element clickable method public method_getOwningTarget inherited" data-toggle="collapse" data-target=".method_getOwningTarget .collapse"> <h2>Returns the owning target of this task.</h2> <pre>getOwningTarget() : \Target</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/Target.html">\Target</a></code><p><p>The target object that owns this task</p></p> </div> </div> </div> <a id="method_getProject"></a> <div class="element clickable method public method_getProject inherited" data-toggle="collapse" data-target=".method_getProject .collapse"> <h2>Returns a reference to current project</h2> <pre>getProject() : \Project</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/Project.html">\Project</a></code><p><p>Reference to current porject object</p></p> </div> </div> </div> <a id="method_getRegisterSlot"></a> <div class="element clickable method protected method_getRegisterSlot inherited" data-toggle="collapse" data-target=".method_getRegisterSlot .collapse"> <h2>Returns a name</h2> <pre>getRegisterSlot(string $slotName) : \RegisterSlot</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$slotName</h4> <code>string</code><p></p> </div> <h3>Response</h3> <code><a href="../classes/RegisterSlot.html">\RegisterSlot</a></code><p></p> </div> </div> </div> <a id="method_getRuntimeConfigurableWrapper"></a> <div class="element clickable method public method_getRuntimeConfigurableWrapper inherited" data-toggle="collapse" data-target=".method_getRuntimeConfigurableWrapper .collapse"> <h2>Returns the wrapper object for runtime configuration</h2> <pre>getRuntimeConfigurableWrapper() : \RuntimeConfigurable</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code><a href="../classes/RuntimeConfigurable.html">\RuntimeConfigurable</a></code><p><p>The wrapper object used by this task</p></p> </div> </div> </div> <a id="method_getTaskName"></a> <div class="element clickable method public method_getTaskName inherited" data-toggle="collapse" data-target=".method_getTaskName .collapse"> <h2>Returns the name of task, used only for log messages</h2> <pre>getTaskName() : string</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code>string</code><p><p>Name of this task</p></p> </div> </div> </div> <a id="method_getTaskType"></a> <div class="element clickable method public method_getTaskType inherited" data-toggle="collapse" data-target=".method_getTaskType .collapse"> <h2>Returns the name of the task under which it was invoked, usually the XML tagname</h2> <pre>getTaskType() : string</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Response</h3> <code>string</code><p><p>The type of this task (XML Tag)</p></p> </div> </div> </div> <a id="method_init"></a> <div class="element clickable method public method_init inherited" data-toggle="collapse" data-target=".method_init .collapse"> <h2>Called by the parser to let the task initialize properly.</h2> <pre>init() </pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"><p>Should throw a BuildException if something goes wrong with the build</p> <p>This is abstract here, but may not be overloaded by subclasses.</p></div> <table class="table"> <tr> <th> throws </th> <td> </td> </tr> <tr> <th> </th> <td> </td> </tr> <tr> <th> </th> <td> </td> </tr> </table> </div> </div> </div> <a id="method_log"></a> <div class="element clickable method public method_log inherited" data-toggle="collapse" data-target=".method_log .collapse"> <h2>Logs a message with the given priority.</h2> <pre>log(string $msg, integer $level = \Project::MSG_INFO) : void</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$msg</h4> <code>string</code><p><p>The message to be logged.</p></p> </div> <div class="subelement argument"> <h4>$level</h4> <code>integer</code><p><p>The message's priority at this message should have</p></p> </div> </div> </div> </div> <a id="method_main"></a> <div class="element clickable method public method_main inherited" data-toggle="collapse" data-target=".method_main .collapse"> <h2>Called by the project to let the task do it&#039;s work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running &lt;em&gt;phing target1 target2&lt;/em&gt; will run all tasks in target3 twice.</h2> <pre>main() </pre> <div class="labels"> <span class="label">inherited</span> <span class="label">abstract</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"><p>Should throw a BuildException if someting goes wrong with the build</p> <p>This is abstract here. Must be overloaded by real tasks.</p></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> <tr> <th> </th> <td> </td> </tr> </table> </div> </div> </div> <a id="method_maybeConfigure"></a> <div class="element clickable method public method_maybeConfigure inherited" data-toggle="collapse" data-target=".method_maybeConfigure .collapse"> <h2>Configure this task if it hasn&#039;t been done already.</h2> <pre>maybeConfigure() </pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> <tr> <th> </th> <td> </td> </tr> </table> </div> </div> </div> <a id="method_perform"></a> <div class="element clickable method public method_perform inherited" data-toggle="collapse" data-target=".method_perform .collapse"> <h2>Perfrom this task</h2> <pre>perform() </pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> throws </th> <td> </td> </tr> <tr> <th> </th> <td> </td> </tr> <tr> <th> </th> <td> </td> </tr> </table> </div> </div> </div> <a id="method_setClassname"></a> <div class="element clickable method public method_setClassname" data-toggle="collapse" data-target=".method_setClassname .collapse"> <h2>Sets the class name / dotpath to use.</h2> <pre>setClassname(string $class) </pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$class</h4> <code>string</code><p></p> </div> </div> </div> </div> <a id="method_setClasspath"></a> <div class="element clickable method public method_setClasspath" data-toggle="collapse" data-target=".method_setClasspath .collapse"> <h2>Set the classpath to be used when searching for component being defined</h2> <pre>setClasspath(\Path $classpath) </pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$classpath</h4> <code><a href="../classes/Path.html">\Path</a></code><p><p>A Path object containing the classpath.</p></p> </div> </div> </div> </div> <a id="method_setClasspathRef"></a> <div class="element clickable method public method_setClasspathRef" data-toggle="collapse" data-target=".method_setClasspathRef .collapse"> <h2>Reference to a classpath to use when loading the files.</h2> <pre>setClasspathRef(\Reference $r) </pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$r</h4> <code><a href="../classes/Reference.html">\Reference</a></code><p></p> </div> </div> </div> </div> <a id="method_setDescription"></a> <div class="element clickable method public method_setDescription inherited" data-toggle="collapse" data-target=".method_setDescription .collapse"> <h2>Sets a textual description of the task</h2> <pre>setDescription(string $desc) </pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$desc</h4> <code>string</code><p><p>The text describing the task</p></p> </div> </div> </div> </div> <a id="method_setLocation"></a> <div class="element clickable method public method_setLocation inherited" data-toggle="collapse" data-target=".method_setLocation .collapse"> <h2>Sets the location within the buildfile this task occurs. Called by the parser to set location information.</h2> <pre>setLocation(\Location $location) </pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$location</h4> <code><a href="../classes/Location.html">\Location</a></code><p><p>The location object describing the position of this task within the buildfile.</p></p> </div> </div> </div> </div> <a id="method_setName"></a> <div class="element clickable method public method_setName" data-toggle="collapse" data-target=".method_setName .collapse"> <h2>Sets the name that will be used in XML buildfile.</h2> <pre>setName(string $name) </pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$name</h4> <code>string</code><p></p> </div> </div> </div> </div> <a id="method_setOwningTarget"></a> <div class="element clickable method public method_setOwningTarget inherited" data-toggle="collapse" data-target=".method_setOwningTarget .collapse"> <h2>Sets the owning target this task belongs to.</h2> <pre>setOwningTarget(\Target $target) </pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$target</h4> <code><a href="../classes/Target.html">\Target</a></code><p></p> </div> </div> </div> </div> <a id="method_setProject"></a> <div class="element clickable method public method_setProject inherited" data-toggle="collapse" data-target=".method_setProject .collapse"> <h2>References the project to the current component.</h2> <pre>setProject(\Project $project) : void</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$project</h4> <code><a href="../classes/Project.html">\Project</a></code><p><p>The reference to the current project</p></p> </div> </div> </div> </div> <a id="method_setRuntimeConfigurableWrapper"></a> <div class="element clickable method public method_setRuntimeConfigurableWrapper inherited" data-toggle="collapse" data-target=".method_setRuntimeConfigurableWrapper .collapse"> <h2>Sets the wrapper object this task should use for runtime configurable elements.</h2> <pre>setRuntimeConfigurableWrapper(\RuntimeConfigurable $wrapper) </pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$wrapper</h4> <code><a href="../classes/RuntimeConfigurable.html">\RuntimeConfigurable</a></code><p><p>The wrapper object this task should use</p></p> </div> </div> </div> </div> <a id="method_setTaskName"></a> <div class="element clickable method public method_setTaskName inherited" data-toggle="collapse" data-target=".method_setTaskName .collapse"> <h2>Sets the name of this task for log messages</h2> <pre>setTaskName(string $name) : string</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$name</h4> <code>string</code><p></p> </div> <h3>Response</h3> <code>string</code><p><p>A string representing the name of this task for log</p></p> </div> </div> </div> <a id="method_setTaskType"></a> <div class="element clickable method public method_setTaskType inherited" data-toggle="collapse" data-target=".method_setTaskType .collapse"> <h2>Sets the type of the task. Usually this is the name of the XML tag</h2> <pre>setTaskType( $name) </pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Arguments</h3> <div class="subelement argument"> <h4>$name</h4> <code></code><p></p> </div> </div> </div> </div> <h3><i class="icon-custom icon-property"></i> Properties</h3> <a id="property_name"> </a> <div class="element clickable property private property_name" data-toggle="collapse" data-target=".property_name .collapse"> <h2>Tag name for datatype that will be used in XML</h2> <pre>name : </pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code></code> </div> </div> </div> <a id="property_classname"> </a> <div class="element clickable property private property_classname" data-toggle="collapse" data-target=".property_classname .collapse"> <h2>Classname of task to register.</h2> <pre>classname : string</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"><p>This can be a dot-path -- relative to a location on PHP include_path. E.g. path.to.MyClass -&gt; path/to/MyClass.php</p></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code>string</code> </div> </div> </div> <a id="property_classpath"> </a> <div class="element clickable property private property_classpath" data-toggle="collapse" data-target=".property_classpath .collapse"> <h2>Path to add to PHP include_path to aid in finding specified class.</h2> <pre>classpath : \Path</pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code><a href="../classes/Path.html">\Path</a></code> </div> </div> </div> <a id="property_classpathId"> </a> <div class="element clickable property private property_classpathId" data-toggle="collapse" data-target=".property_classpathId .collapse"> <h2>Refid to already defined classpath</h2> <pre>classpathId : </pre> <div class="labels"> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code></code> </div> </div> </div> <a id="property_target"> </a> <div class="element clickable property protected property_target inherited" data-toggle="collapse" data-target=".property_target .collapse"> <h2>Owning Target object</h2> <pre>target : \Target</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code><a href="../classes/Target.html">\Target</a></code> </div> </div> </div> <a id="property_description"> </a> <div class="element clickable property protected property_description inherited" data-toggle="collapse" data-target=".property_description .collapse"> <h2>Description of the task</h2> <pre>description : string</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code>string</code> </div> </div> </div> <a id="property_taskType"> </a> <div class="element clickable property protected property_taskType inherited" data-toggle="collapse" data-target=".property_taskType .collapse"> <h2>Internal taskname (req)</h2> <pre>taskType : string</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code>string</code> </div> </div> </div> <a id="property_taskName"> </a> <div class="element clickable property protected property_taskName inherited" data-toggle="collapse" data-target=".property_taskName .collapse"> <h2>Taskname for logger</h2> <pre>taskName : string</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code>string</code> </div> </div> </div> <a id="property_location"> </a> <div class="element clickable property protected property_location inherited" data-toggle="collapse" data-target=".property_location .collapse"> <h2>Stored buildfile location</h2> <pre>location : \Location</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code><a href="../classes/Location.html">\Location</a></code> </div> </div> </div> <a id="property_wrapper"> </a> <div class="element clickable property protected property_wrapper inherited" data-toggle="collapse" data-target=".property_wrapper .collapse"> <h2>Wrapper of the task</h2> <pre>wrapper : \RuntimeConfigurable</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> </td> </tr> </table> <h3>Type(s)</h3> <code><a href="../classes/RuntimeConfigurable.html">\RuntimeConfigurable</a></code> </div> </div> </div> <a id="property_project"> </a> <div class="element clickable property protected property_project inherited" data-toggle="collapse" data-target=".property_project .collapse"> <h2>Holds a reference to the project that a project component (a task, a target, etc.) belongs to</h2> <pre>project : \Project</pre> <div class="labels"> <span class="label">inherited</span> </div> <div class="row collapse"> <div class="detail-description"> <div class="long_description"></div> <table class="table"> <tr> <th> var </th> <td> <p>A reference to the current project instance</p> </td> </tr> </table> <h3>Type(s)</h3> <code><a href="../classes/Project.html">\Project</a></code> </div> </div> </div> </div> </div> <a id="\TypedefTask"></a> <ul class="breadcrumb"> <li><a href="../index.html"><i class="icon-custom icon-class"></i></a></li> <li><span class="divider">\</span><a href="../namespaces/default.html">\</a></li> <li class="active"><span class="divider">\</span><a href="../classes/TypedefTask.html">TypedefTask</a></li> </ul> </div> </div> </div> <footer class="span12"> Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br/> Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and<br/> generated on Thu, 13 Oct 2016 11:14:57 +0200.<br/> </footer> </body> </html>
andyreis/mystyle
phing-2.15.2/docs/api/docs/classes/TypedefTask.html
HTML
mit
96,633
namespace OnlineAtelier.Services.Models { using System.Collections.Generic; using System.Linq; using AutoMapper; using AutoMapper.QueryableExtensions; using Contracts; using Data.Common.Repository; using OnlineAtelier.Models.Models; using Web.Models.BindingModels.Appearance; using Web.Models.ViewModels.AdminArea.Appearance; public class AppearancesService : IAppearanceService { private readonly IRepository<Appearance> appearances; public AppearancesService(IRepository<Appearance> appearances) { this.appearances = appearances; } public IEnumerable<string> GetAllNameOfAppearances() { var allAppearances = this.appearances .All() .Select(a => a.Name) .ToList(); return allAppearances; } public Appearance GetAppearence(string name) { var appearance = this.appearances .All() .FirstOrDefault(a => a.Name == name); return appearance; } public void AddAppearance(AppearanceCreateBm bind) { var entity = Mapper.Map<AppearanceCreateBm, Appearance>(bind); this.appearances.Add(entity); this.appearances.SaveChanges(); } public ICollection<AppearanceAllVm> All() { var all = this.appearances .All() .Project() .To<AppearanceAllVm>() .ToList(); return all; } public AppearanceAllVm GetAppearanceAllVm(int? id) { var entity = this.appearances.GetById((int)id); if (entity == null) { return null; } var model = Mapper.Map<Appearance, AppearanceAllVm>(entity); return model; } public void Edit(AppearanceEditBm bind) { var entity = this.appearances.GetById(bind.Id); entity.Name = bind.Name; entity.Price = bind.Price; this.appearances.Update(entity); this.appearances.SaveChanges(); } public void Delete(int id) { var entity = this.appearances.GetById(id); this.appearances.Delete(entity); this.appearances.SaveChanges(); } public AppearanceCreateVm GetAppearanceCreateVm(AppearanceCreateBm bm) { var model = Mapper.Map<AppearanceCreateBm, AppearanceCreateVm>(bm); return model; } public AppearanceEditVm GetAppearanceEditVm(int? id) { var entity = this.appearances.GetById((int)id); if (entity == null) { return null; } var model = Mapper.Map<Appearance, AppearanceEditVm>(entity); return model; } } }
IskraNikolova/OnlineAtelier
Source/Services/OnlineAtelier.Services/Models/AppearancesService.cs
C#
mit
2,975
# CoffeeGrid This is jQuery plugin, the main aim of it is to form tables with AJAX calls # Usage ## Dependencies Modern jQuery is required (versions 1.10.*, 2.* or above). This could be working with older versions. ## Installing As you have installed jQuery, you have to complete this simple steps: 1. Copy compiled version from repo or clone it. 2. Add _script_ tag, pointing to the library. ## Configuring plugin To initialize plugin you have to add this code $('css-selector-to-target-div').coffeegrid(); This will initialize CoffeeGrid with default parameters. To configure CoffeeGrid you should call this: $('css-selector-to-target-div').coffeegrid(params); Where 'params' is javascript object with all config you have to change. # Contributing To do so, you can : 1. Fork the project 2. Do your changes and commit them to your repository 3. Test your changes. We won't accept any untested contributions (except if they're not testable). 4. Send pull request And that's it! We'll soon take a look at your issue and review your changes. For more information check out [Github contribution guide](https://guides.github.com/activities/contributing-to-open-source/) # License Project is developed under MIT license. More info is available in LICENSE file.
Axblade/coffeegrid
README.md
Markdown
mit
1,284
<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>pymatgen.electronic_structure.core module &mdash; pymatgen 2020.4.2 documentation</title> <link rel="shortcut icon" href="_static/favicon.ico"/> <link rel="canonical" href="https://pymatgen.orgpymatgen.electronic_structure.core.html"/> <script type="text/javascript" src="_static/js/modernizr.min.js"></script> <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/language_data.js"></script> <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/javascript" src="_static/js/theme.js"></script> <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/css/custom.css" type="text/css" /> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="pymatgen.electronic_structure.dos module" href="pymatgen.electronic_structure.dos.html" /> <link rel="prev" title="pymatgen.electronic_structure.cohp module" href="pymatgen.electronic_structure.cohp.html" /> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-33990148-1']); _gaq.push(['_trackPageview']); </script> </head> <body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" > <a href="index.html" class="icon icon-home"> pymatgen </a> <div class="version"> 2020.4.2 </div> <div role="search"> <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li> <li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li> <li class="toctree-l1"><a class="reference internal" href="change_log.html">Change log</a></li> <li class="toctree-l1"><a class="reference internal" href="usage.html">Usage</a></li> <li class="toctree-l1"><a class="reference internal" href="team.html">Development Team</a></li> <li class="toctree-l1"><a class="reference internal" href="references.html">References</a></li> <li class="toctree-l1 current"><a class="reference internal" href="modules.html">API Docs</a><ul class="current"> <li class="toctree-l2 current"><a class="reference internal" href="pymatgen.html">pymatgen package</a><ul class="current"> <li class="toctree-l3 current"><a class="reference internal" href="pymatgen.html#subpackages">Subpackages</a><ul class="current"> <li class="toctree-l4"><a class="reference internal" href="pymatgen.alchemy.html">pymatgen.alchemy package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.analysis.html">pymatgen.analysis package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.apps.html">pymatgen.apps package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.cli.html">pymatgen.cli package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.command_line.html">pymatgen.command_line package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.core.html">pymatgen.core package</a></li> <li class="toctree-l4 current"><a class="reference internal" href="pymatgen.electronic_structure.html">pymatgen.electronic_structure package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.entries.html">pymatgen.entries package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.ext.html">pymatgen.ext package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.io.html">pymatgen.io package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.optimization.html">pymatgen.optimization package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.phonon.html">pymatgen.phonon package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.plugins.html">pymatgen.plugins package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.symmetry.html">pymatgen.symmetry package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.transformations.html">pymatgen.transformations package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.util.html">pymatgen.util package</a></li> <li class="toctree-l4"><a class="reference internal" href="pymatgen.vis.html">pymatgen.vis package</a></li> </ul> </li> <li class="toctree-l3"><a class="reference internal" href="pymatgen.html#submodules">Submodules</a></li> <li class="toctree-l3"><a class="reference internal" href="pymatgen.html#module-pymatgen">Module contents</a></li> </ul> </li> </ul> </li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="index.html">pymatgen</a> </nav> <div class="wy-nav-content"> <div class="rst-content style-external-links"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="index.html">Docs</a> &raquo;</li> <li><a href="modules.html">pymatgen</a> &raquo;</li> <li><a href="pymatgen.html">pymatgen package</a> &raquo;</li> <li><a href="pymatgen.electronic_structure.html">pymatgen.electronic_structure package</a> &raquo;</li> <li>pymatgen.electronic_structure.core module</li> <li class="wy-breadcrumbs-aside"> <a href="https://github.com/materialsproject/pymatgen/blob/master/docs_rst/pymatgen.electronic_structure.core.rst" class="fa fa-github"> Edit on GitHub</a> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <div class="section" id="module-pymatgen.electronic_structure.core"> <span id="pymatgen-electronic-structure-core-module"></span><h1>pymatgen.electronic_structure.core module<a class="headerlink" href="#module-pymatgen.electronic_structure.core" title="Permalink to this headline">¶</a></h1> <p>This module provides core classes needed by all define electronic structure, such as the Spin, Orbital, etc.</p> <dl class="class"> <dt id="pymatgen.electronic_structure.core.Magmom"> <em class="property">class </em><code class="sig-name descname">Magmom</code><span class="sig-paren">(</span><em class="sig-param">moment</em>, <em class="sig-param">saxis=(0</em>, <em class="sig-param">0</em>, <em class="sig-param">1)</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L95-L491"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">monty.json.MSONable</span></code></p> <p>New class in active development. Use with caution, feedback is appreciated.</p> <p>Class to handle magnetic moments. Defines the magnetic moment of a site or species relative to a spin quantization axis. Designed for use in electronic structure calculations.</p> <ul class="simple"> <li><p>For the general case, Magmom can be specified by a vector, e.g. m = Magmom([1.0, 1.0, 2.0]), and subscripts will work as expected, e.g. m[0] gives 1.0</p></li> <li><p>For collinear calculations, Magmom can assumed to be scalar-like, e.g. m = Magmom(5.0) will work as expected, e.g. float(m) gives 5.0</p></li> </ul> <p>Both of these cases should be safe and shouldn’t give any surprises, but more advanced functionality is available if required.</p> <p>There also exist useful static methods for lists of magmoms:</p> <ul class="simple"> <li><p>Magmom.are_collinear(magmoms) - if true, a collinear electronic structure calculation can be safely initialized, with float(Magmom) giving the expected scalar magnetic moment value</p></li> <li><p>Magmom.get_consistent_set_and_saxis(magmoms) - for non-collinear electronic structure calculations, a global, consistent spin axis has to be used. This method returns a list of Magmoms which all share a common spin axis, along with the global spin axis.</p></li> </ul> <p>All methods that take lists of magmoms will accept magmoms either as Magmom objects or as scalars/lists and will automatically convert to a Magmom representation internally.</p> <p>The following methods are also particularly useful in the context of VASP calculations:</p> <ul class="simple"> <li><p>Magmom.get_xyz_magmom_with_001_saxis()</p></li> <li><p>Magmom.get_00t_magmom_with_xyz_saxis()</p></li> </ul> <p>See VASP documentation for more information:</p> <p><a class="reference external" href="https://cms.mpi.univie.ac.at/wiki/index.php/SAXIS">https://cms.mpi.univie.ac.at/wiki/index.php/SAXIS</a></p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>moment</strong> – magnetic moment, supplied as float or list/np.ndarray</p></li> <li><p><strong>saxis</strong> – spin axis, supplied as list/np.ndarray, parameter will be converted to unit vector (default is [0, 0, 1])</p></li> </ul> </dd> <dt class="field-even">Returns</dt> <dd class="field-even"><p>Magmom object</p> </dd> </dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.are_collinear"> <em class="property">static </em><code class="sig-name descname">are_collinear</code><span class="sig-paren">(</span><em class="sig-param">magmoms</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L370-L395"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.are_collinear" title="Permalink to this definition">¶</a></dt> <dd><p>Method checks to see if a set of magnetic moments are collinear with each other. :param magmoms: list of magmoms (Magmoms, scalars or vectors) :return: bool</p> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.from_global_moment_and_saxis"> <em class="property">classmethod </em><code class="sig-name descname">from_global_moment_and_saxis</code><span class="sig-paren">(</span><em class="sig-param">global_moment</em>, <em class="sig-param">saxis</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L162-L177"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.from_global_moment_and_saxis" title="Permalink to this definition">¶</a></dt> <dd><p>Convenience method to initialize Magmom from a given global magnetic moment, i.e. magnetic moment with saxis=(0,0,1), and provided saxis.</p> <p>Method is useful if you do not know the components of your magnetic moment in frame of your desired saxis.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>global_moment</strong> – </p></li> <li><p><strong>saxis</strong> – desired saxis</p></li> </ul> </dd> <dt class="field-even">Returns</dt> <dd class="field-even"><p></p> </dd> </dl> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.from_moment_relative_to_crystal_axes"> <em class="property">classmethod </em><code class="sig-name descname">from_moment_relative_to_crystal_axes</code><span class="sig-paren">(</span><em class="sig-param">moment</em>, <em class="sig-param">lattice</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L397-L413"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.from_moment_relative_to_crystal_axes" title="Permalink to this definition">¶</a></dt> <dd><p>Obtaining a Magmom object from a magnetic moment provided relative to crystal axes.</p> <p>Used for obtaining moments from magCIF file. :param magmom: list of floats specifying vector magmom :param lattice: Lattice :return: Magmom</p> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.get_00t_magmom_with_xyz_saxis"> <code class="sig-name descname">get_00t_magmom_with_xyz_saxis</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L267-L304"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.get_00t_magmom_with_xyz_saxis" title="Permalink to this definition">¶</a></dt> <dd><p>For internal implementation reasons, in non-collinear calculations VASP prefers:</p> <p>MAGMOM = 0 0 total_magnetic_moment SAXIS = x y z</p> <p>to an equivalent:</p> <p>MAGMOM = x y z SAXIS = 0 0 1</p> <p>This method returns a Magmom object with magnetic moment [0, 0, t], where t is the total magnetic moment, and saxis rotated as required.</p> <p>A consistent direction of saxis is applied such that t might be positive or negative depending on the direction of the initial moment. This is useful in the case of collinear structures, rather than constraining assuming t is always positive.</p> <dl class="field-list simple"> <dt class="field-odd">Returns</dt> <dd class="field-odd"><p>Magmom</p> </dd> </dl> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.get_consistent_set_and_saxis"> <em class="property">static </em><code class="sig-name descname">get_consistent_set_and_saxis</code><span class="sig-paren">(</span><em class="sig-param">magmoms</em>, <em class="sig-param">saxis=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L326-L342"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.get_consistent_set_and_saxis" title="Permalink to this definition">¶</a></dt> <dd><p>Method to ensure a list of magmoms use the same spin axis. Returns a tuple of a list of Magmoms and their global spin axis.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>magmoms</strong> – list of magmoms (Magmoms, scalars or vectors)</p></li> <li><p><strong>saxis</strong> – can provide a specific global spin axis</p></li> </ul> </dd> <dt class="field-even">Returns</dt> <dd class="field-even"><p>(list of Magmoms, global spin axis) tuple</p> </dd> </dl> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.get_moment"> <code class="sig-name descname">get_moment</code><span class="sig-paren">(</span><em class="sig-param">saxis=(0</em>, <em class="sig-param">0</em>, <em class="sig-param">1)</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L215-L237"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.get_moment" title="Permalink to this definition">¶</a></dt> <dd><p>Get magnetic moment relative to a given spin quantization axis. If no axis is provided, moment will be given relative to the Magmom’s internal spin quantization axis, i.e. equivalent to Magmom.moment</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><p><strong>axis</strong> – (list/numpy array) spin quantization axis</p> </dd> <dt class="field-even">Returns</dt> <dd class="field-even"><p>np.ndarray of length 3</p> </dd> </dl> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.get_moment_relative_to_crystal_axes"> <code class="sig-name descname">get_moment_relative_to_crystal_axes</code><span class="sig-paren">(</span><em class="sig-param">lattice</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L415-L430"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.get_moment_relative_to_crystal_axes" title="Permalink to this definition">¶</a></dt> <dd><p>If scalar magmoms, moments will be given arbitrarily along z. Used for writing moments to magCIF file.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><ul class="simple"> <li><p><strong>magmom</strong> – Magmom</p></li> <li><p><strong>lattice</strong> – Lattice</p></li> </ul> </dd> <dt class="field-even">Returns</dt> <dd class="field-even"><p>vector as list of floats</p> </dd> </dl> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.get_suggested_saxis"> <em class="property">static </em><code class="sig-name descname">get_suggested_saxis</code><span class="sig-paren">(</span><em class="sig-param">magmoms</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L344-L368"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.get_suggested_saxis" title="Permalink to this definition">¶</a></dt> <dd><p>This method returns a suggested spin axis for a set of magmoms, taking the largest magnetic moment as the reference. For calculations with collinear spins, this would give a sensible saxis for a ncl calculation.</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><p><strong>magmoms</strong> – list of magmoms (Magmoms, scalars or vectors)</p> </dd> <dt class="field-even">Returns</dt> <dd class="field-even"><p>np.ndarray of length 3</p> </dd> </dl> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.get_xyz_magmom_with_001_saxis"> <code class="sig-name descname">get_xyz_magmom_with_001_saxis</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L258-L265"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.get_xyz_magmom_with_001_saxis" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a Magmom in the default setting of saxis = [0, 0, 1] and the magnetic moment rotated as required.</p> <dl class="field-list simple"> <dt class="field-odd">Returns</dt> <dd class="field-odd"><p>Magmom</p> </dd> </dl> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.global_moment"> <em class="property">property </em><code class="sig-name descname">global_moment</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.global_moment" title="Permalink to this definition">¶</a></dt> <dd><p>Get the magnetic moment defined in an arbitrary global reference frame.</p> <dl class="field-list simple"> <dt class="field-odd">Returns</dt> <dd class="field-odd"><p>np.ndarray of length 3</p> </dd> </dl> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.have_consistent_saxis"> <em class="property">static </em><code class="sig-name descname">have_consistent_saxis</code><span class="sig-paren">(</span><em class="sig-param">magmoms</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L306-L324"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.have_consistent_saxis" title="Permalink to this definition">¶</a></dt> <dd><p>This method checks that all Magmom objects in a list have a consistent spin quantization axis. To write MAGMOM tags to a VASP INCAR, a global SAXIS value for all magmoms has to be used. If saxis are inconsistent, can create consistent set with: Magmom.get_consistent_set(magmoms)</p> <dl class="field-list simple"> <dt class="field-odd">Parameters</dt> <dd class="field-odd"><p><strong>magmoms</strong> – list of magmoms (Magmoms, scalars or vectors)</p> </dd> <dt class="field-even">Returns</dt> <dd class="field-even"><p>bool</p> </dd> </dl> </dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Magmom.projection"> <em class="property">property </em><code class="sig-name descname">projection</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Magmom.projection" title="Permalink to this definition">¶</a></dt> <dd><p>Projects moment along spin quantisation axis. Useful for obtaining collinear approximation for slightly non-collinear magmoms.</p> <dl class="field-list simple"> <dt class="field-odd">Returns</dt> <dd class="field-odd"><p>float</p> </dd> </dl> </dd></dl> </dd></dl> <dl class="class"> <dt id="pymatgen.electronic_structure.core.Orbital"> <em class="property">class </em><code class="sig-name descname">Orbital</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L58-L92"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">enum.Enum</span></code></p> <p>Enum type for specific orbitals. The indices are basically the order in which the orbitals are reported in VASP and has no special meaning.</p> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.dx2"> <code class="sig-name descname">dx2</code><em class="property"> = 8</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.dx2" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.dxy"> <code class="sig-name descname">dxy</code><em class="property"> = 4</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.dxy" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.dxz"> <code class="sig-name descname">dxz</code><em class="property"> = 7</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.dxz" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.dyz"> <code class="sig-name descname">dyz</code><em class="property"> = 5</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.dyz" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.dz2"> <code class="sig-name descname">dz2</code><em class="property"> = 6</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.dz2" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.f0"> <code class="sig-name descname">f0</code><em class="property"> = 12</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.f0" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.f1"> <code class="sig-name descname">f1</code><em class="property"> = 13</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.f1" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.f2"> <code class="sig-name descname">f2</code><em class="property"> = 14</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.f2" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.f3"> <code class="sig-name descname">f3</code><em class="property"> = 15</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.f3" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.f_1"> <code class="sig-name descname">f_1</code><em class="property"> = 11</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.f_1" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.f_2"> <code class="sig-name descname">f_2</code><em class="property"> = 10</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.f_2" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.f_3"> <code class="sig-name descname">f_3</code><em class="property"> = 9</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.f_3" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="method"> <dt id="pymatgen.electronic_structure.core.Orbital.orbital_type"> <em class="property">property </em><code class="sig-name descname">orbital_type</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.orbital_type" title="Permalink to this definition">¶</a></dt> <dd><p>Returns OrbitalType of an orbital.</p> </dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.px"> <code class="sig-name descname">px</code><em class="property"> = 3</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.px" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.py"> <code class="sig-name descname">py</code><em class="property"> = 1</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.py" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.pz"> <code class="sig-name descname">pz</code><em class="property"> = 2</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.pz" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Orbital.s"> <code class="sig-name descname">s</code><em class="property"> = 0</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Orbital.s" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </dd></dl> <dl class="class"> <dt id="pymatgen.electronic_structure.core.OrbitalType"> <em class="property">class </em><code class="sig-name descname">OrbitalType</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L42-L54"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.OrbitalType" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">enum.Enum</span></code></p> <p>Enum type for orbital type. Indices are basically the azimuthal quantum number, l.</p> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.OrbitalType.d"> <code class="sig-name descname">d</code><em class="property"> = 2</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.OrbitalType.d" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.OrbitalType.f"> <code class="sig-name descname">f</code><em class="property"> = 3</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.OrbitalType.f" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.OrbitalType.p"> <code class="sig-name descname">p</code><em class="property"> = 1</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.OrbitalType.p" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.OrbitalType.s"> <code class="sig-name descname">s</code><em class="property"> = 0</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.OrbitalType.s" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </dd></dl> <dl class="class"> <dt id="pymatgen.electronic_structure.core.Spin"> <em class="property">class </em><code class="sig-name descname">Spin</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py#L24-L38"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Spin" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">enum.Enum</span></code></p> <p>Enum type for Spin. Only up and down. Usage: Spin.up, Spin.down.</p> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Spin.down"> <code class="sig-name descname">down</code><em class="property"> = -1</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Spin.down" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="pymatgen.electronic_structure.core.Spin.up"> <code class="sig-name descname">up</code><em class="property"> = 1</em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2020.4.2/pymatgen/electronic_structure/core.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.electronic_structure.core.Spin.up" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </dd></dl> </div> </div> </div> <footer> <hr/> <div role="contentinfo"> <p> &copy; Copyright 2011, Pymatgen Development Team </p> </div> Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. </footer> </div> </div> </section> </div> <script type="text/javascript"> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> <div class="footer">This page uses <a href="http://analytics.google.com/"> Google Analytics</a> to collect statistics. You can disable it by blocking the JavaScript coming from www.google-analytics.com. <script type="text/javascript"> (function() { var ga = document.createElement('script'); ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; ga.setAttribute('async', 'true'); document.documentElement.firstChild.appendChild(ga); })(); </script> </div> </body> </html>
gVallverdu/pymatgen
docs/pymatgen.electronic_structure.core.html
HTML
mit
38,034
// Copyright (c) 2011-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "walletmodeltransaction.h" #include "wallet.h" WalletModelTransaction::WalletModelTransaction(const QList<SendCoinsRecipient> &recipients) : recipients(recipients), walletTransaction(0), keyChange(0), fee(0) { walletTransaction = new CWalletTx(); } WalletModelTransaction::~WalletModelTransaction() { delete keyChange; delete walletTransaction; } QList<SendCoinsRecipient> WalletModelTransaction::getRecipients() { return recipients; } CWalletTx *WalletModelTransaction::getTransaction() { return walletTransaction; } qint64 WalletModelTransaction::getTotalTransactionAmount() { qint64 totalTransactionAmount = 0; foreach(const SendCoinsRecipient &rcp, recipients) { totalTransactionAmount += rcp.amount; } return totalTransactionAmount; } void WalletModelTransaction::newPossibleKeyChange(CWallet *wallet) { keyChange = new CReserveKey(wallet); } CReserveKey *WalletModelTransaction::getPossibleKeyChange() { return keyChange; }
salivan-ratcoin-dev-team/dims
src/qt/walletmodeltransaction.cpp
C++
mit
1,213
namespace Geocrest.Model { using System; using System.Collections.Generic; using System.Net; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Geocrest.Model.ArcGIS; /// <summary> /// Provides deserialization helper methods for working with RESTful web services. /// </summary> public class RestHelper : IRestHelper { /// <summary> /// Allows hydration of an object from a json string representation /// </summary> /// <typeparam name="T">The type of object to hydrate.</typeparam> /// <param name="json">The string representation of json used to deserialize.</param> /// <returns> /// The hydrated object. /// </returns> /// <exception cref="T:System.ArgumentNullException">json parameter is required.</exception> public T HydrateFromJson<T>(string json) { if (!string.IsNullOrEmpty(json)) { return JsonConvert.DeserializeObject<T>(json); } else { throw new ArgumentNullException("json parameter is required."); } } /// <summary> /// Helper method to hydrate an object from a json string representation /// and without requiring a <see cref="T:Geocrest.Model.RestHelper"/>. /// </summary> /// <typeparam name="T">The type of object to hydrate.</typeparam> /// <param name="json">The string representation of json used to deserialize.</param> /// <returns>The hydrated object.</returns> public static T HydrateObjectFromJson<T>(string json) { RestHelper helper = new RestHelper(); return helper.HydrateFromJson<T>(json); } /// <summary> /// Helper method to hydrate an object using the string response from the specified URL resource /// and without requiring a <see cref="T:Geocrest.Model.RestHelper" />. /// </summary> /// <typeparam name="T">The type of object to hydrate.</typeparam> /// <param name="url">The web service URL.</param> /// <param name="callback">A callback function that receives the result.</param> /// <returns> /// The hydrated object. /// </returns> public static void HydrateObject<T>(string url, Action<T> callback) { RestHelper helper = new RestHelper(); helper.HydrateAsync<T>(ForceJsonFormat(url), callback); } /// <summary> /// Helper method to hydrate an object using the string response from the specified URL resource /// and without requiring a <see cref="T:Geocrest.Model.RestHelper" />. /// </summary> /// <typeparam name="T">The type of object to hydrate.</typeparam> /// <param name="url">The web service URL.</param> /// <param name="callback">A callback function that receives the result.</param> /// <param name="userState">A user-defined object that is passed to the method invoked when the asynchronous operation completes.</param> public static void HydrateObject<T>(string url, Action<T, object> callback, object userState) { RestHelper helper = new RestHelper(); helper.HydrateAsync<T>(ForceJsonFormat(url), callback, userState); } /// <summary> /// Downloads a resource string resource asynchronously. /// </summary> /// <param name="uri">The <see cref="T:System.Uri" /> of the resource to download.</param> /// <param name="callback">An action that will be invoked when the string has been downloaded.</param> /// <param name="userState">A user-defined object that is passed to the method invoked when the asynchronous operation completes.</param> public virtual void DownloadStringAsync(Uri uri, Action<string, object> callback, object userState) { WebClient wc = GetWebClient(); wc.UseDefaultCredentials = true; wc.DownloadStringCompleted += (o, e) => { if (e.Error != null) { callback(null, e.UserState); return; } callback(e.Result, e.UserState); }; wc.DownloadStringAsync(uri, userState); } /// <summary> /// Creates a new web client. /// </summary> /// <returns> /// Returns an instance of <see cref="WebClient"/>. /// </returns> protected internal virtual WebClient GetWebClient() { return new WebClient(); } /// <summary> /// Hydrates an object using the string response from the specified URL resource. /// </summary> /// <typeparam name="T">The type of object to hydrate.</typeparam> /// <param name="url">The web service URL.</param> /// <param name="callback">A callback function that receives the result.</param> public void HydrateAsync<T>(string url, Action<T> callback) { HydrateAsync<T>(ForceJsonFormat(url), delegate(T cb, object token) { callback(cb); }, null); } /// <summary> /// Hydrates an object using the string response from the specified URL resource. /// </summary> /// <typeparam name="T">The type of object to hydrate.</typeparam> /// <param name="url">The web service URL.</param> /// <param name="callback">A callback function that receives the result.</param> /// <param name="userState">A user-defined object that is passed to the method invoked when the asynchronous operation completes.</param> /// <exception cref="System.InvalidOperationException">If the web service call to the resource fails. /// </exception> /// <exception cref="System.ArgumentNullException">url</exception> public void HydrateAsync<T>(string url, Action<T, object> callback, object userState) { if (!string.IsNullOrEmpty(url)) { string json = string.Empty; Uri uri = null; try { uri = new Uri(ForceJsonFormat(url), UriKind.RelativeOrAbsolute); DownloadStringAsync(uri, delegate(string cb, object token) { json = cb; if (string.IsNullOrEmpty(json)) { callback(default(T), token); return; //throw new InvalidProgramException( // string.Format("The underlying web service response from {0} was null.", url)); } else if (url.ToLower().Contains("arcgis/rest/services")) { ESRIException error = JsonConvert.DeserializeObject<ESRIException>(json); if (error.Error != null) { throw new InvalidOperationException( string.Format("The underlying ArcGIS service located at " + "{0} returned the following error: {1}: {2}", url, error.Error.Message, string.Join("; ", error.Error.Details))); } } callback((T)JsonConvert.DeserializeObject<T>(json, new StringEnumConverter()), token); }, userState); } catch (WebException ex) { switch ((ex.Response as HttpWebResponse).StatusCode) { case HttpStatusCode.NotFound: throw new InvalidOperationException( string.Format("The underlying web service located at {0} could not be found.", url)); case HttpStatusCode.BadGateway: throw new InvalidOperationException( string.Format("The underlying web service domain could not be resolved: {0}.", uri.Host)); } } } else { throw new ArgumentNullException("url", "Url parameter is required!"); } } /// <summary> /// Forces the json format using the query string 'f' parameter. /// </summary> /// <param name="url">The URL to check.</param> internal static string ForceJsonFormat(string url) { if (string.IsNullOrEmpty(url)) throw new ArgumentNullException("url"); string json = "json"; string f = "f"; string query = "?"; string root = string.Empty; // get root url using string manipulation instead of building a Uri so items like // port number and a trailing slash are not added. Want to return url as it was entered root = url.Contains("?") ? url.Replace(url.Substring(url.IndexOf("?")), "") : url; // set the 'f' parameter of query string Uri uri = new Uri(url); IDictionary<string, string> queryparams = ParseQueryString(uri.Query); if (queryparams.Keys.Contains(f)) { queryparams[f] = json; } else { queryparams.Add(f, json); } foreach (var kvp in queryparams) query += kvp.Key + "=" + kvp.Value + "&"; // build the new Uri return root + query.Substring(0, query.Length - 1); } /// <summary> /// Parses the query string into a key/value dictionary. /// </summary> /// <param name="query">The query.</param> /// <returns> /// Returns an instance of <see cref="T:System.Collections.Generic.IDictionary`2"/>. /// </returns> /// <exception cref="T:System.ArgumentNullException">url</exception> private static IDictionary<string, string> ParseQueryString(string query) { IDictionary<string, string> values = new Dictionary<string, string>(); if (string.IsNullOrEmpty(query) || !query.Contains("=")) return values; if (query.StartsWith("?")) { query = query.Substring(1); } var args = query.Split(new[] { "&" }, StringSplitOptions.RemoveEmptyEntries); foreach (var arg in args) { var pairs = arg.Split(new[] { "=" }, StringSplitOptions.None); if (pairs.Length == 2) { values.Add(pairs[0], pairs[1] == null ? string.Empty : pairs[1]); } } return values; } } }
geocrest/mvcpluggedin
src/Models/Silverlight/5/Geocrest.Model/RestHelper.cs
C#
mit
11,171
class ApplicationController < ActionController::Base # before_filter :authenticate_user!, :except => [:index] if not ENV['RAILS_TEST'] before_filter :authenticate_user! end protect_from_forgery end
pjotrp/lepra2
app/controllers/application_controller.rb
Ruby
mit
212
namespace Enterprise.Northwind { export namespace RegionService { export const baseUrl = 'Northwind/Region'; export declare function Create(request: Serenity.SaveRequest<RegionRow>, onSuccess?: (response: Serenity.SaveResponse) => void, opt?: Q.ServiceOptions<any>): JQueryXHR; export declare function Update(request: Serenity.SaveRequest<RegionRow>, onSuccess?: (response: Serenity.SaveResponse) => void, opt?: Q.ServiceOptions<any>): JQueryXHR; export declare function Delete(request: Serenity.DeleteRequest, onSuccess?: (response: Serenity.DeleteResponse) => void, opt?: Q.ServiceOptions<any>): JQueryXHR; export declare function Retrieve(request: Serenity.RetrieveRequest, onSuccess?: (response: Serenity.RetrieveResponse<RegionRow>) => void, opt?: Q.ServiceOptions<any>): JQueryXHR; export declare function List(request: Serenity.ListRequest, onSuccess?: (response: Serenity.ListResponse<RegionRow>) => void, opt?: Q.ServiceOptions<any>): JQueryXHR; export namespace Methods { export declare const Create: string; export declare const Update: string; export declare const Delete: string; export declare const Retrieve: string; export declare const List: string; } [ 'Create', 'Update', 'Delete', 'Retrieve', 'List' ].forEach(x => { (<any>RegionService)[x] = function (r, s, o) { return Q.serviceRequest(baseUrl + '/' + x, r, s, o); }; (<any>Methods)[x] = baseUrl + '/' + x; }); } }
neurral/enterprise
Enterprise/Enterprise.Web/Imports/ServerTypings/Northwind.RegionService.ts
TypeScript
mit
1,666
<!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> <link rel="stylesheet" href="components/bootstrap/dist/css/bootstrap.css"><link rel="stylesheet" href="components/font-awesome/css/font-awesome.css"> <!-- build:css({.tmp,app}) styles/app.css --> <link rel="stylesheet" href="components/angular-kb/docs/build/angular-kb.css"> <link href="components/select2/select2.css" rel="stylesheet" /> <link rel="stylesheet" href="components/ngprogress/ngProgress.css"> <link rel="stylesheet" href="styles/main.css"> <!-- endbuild --> </head> <body> <ng-view> <div class="jumbotron"> <div class="container"> <h1>kbc.tdeExporter</h1> <p> Start with obtaining Storage API token and paste it into URL <a href="http://localhost:9000/?token=YOUR_TOKEN"> http://localhost:9000/?token=YOUR_TOKEN </a> </p> </div> </div> </ng-view> <script src="components/jquery/jquery.js"></script> <!-- build:js({.tmp,app}) scripts/scripts.js --> <script src="components/underscore/underscore.js"></script> <script src="components/underscore.string/lib/underscore.string.js"></script> <script src="components/select2/select2.js"></script> <script src="components/angular/angular.js"></script> <script src="components/angular-ui-select2/src/select2.js"></script> <script src="components/bootstrap/js/tooltip.js"></script> <script src="components/bootstrap/js/popover.js"></script> <script src="components/angular-resource/angular-resource.js"></script> <script src="components/angular-sanitize/angular-sanitize.js"></script> <script src="components/angular-route/angular-route.js"></script> <script src="components/ngprogress/build/ngProgress.js"></script> <script src="components/angular-kb/docs/build/angular-kb.js"></script> <script src="components/angular-kb-accordion/dist/angular-kb-accordion.js"></script> <script src="components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.js"></script> <script src="scripts/app.js"></script> <script src="scripts/controllers/index.js"></script> <script src="scripts/controllers/add-table.js"></script> <script src="scripts/controllers/create-config.js"></script> <script src="scripts/controllers/table-controller.js"></script> <script src="scripts/controllers/add-orchestration.js"></script> <script src="scripts/controllers/upload-gdrive.js"></script> <script src="scripts/directives/popover-html-unsafe.js"></script> <script src="scripts/directives/date-format-hint.js"></script> <script src="scripts/directives/column-preview.js"></script> <script src="scripts/services/tde-exporter-service.js"></script> <!-- endbuild --> <script src="bootstrap.js"></script></body> </html>
keboola/kbc-ui-tde-exporter
app/index.html
HTML
mit
3,568
package io.backbeam; import java.util.List; public abstract class FetchCallback extends Callback { public abstract void success(List<BackbeamObject> objects, int totalCount, boolean fromCache); }
backbeam/BackbeamAndroid
src/io/backbeam/FetchCallback.java
Java
mit
202