code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
4
991
language
stringclasses
9 values
license
stringclasses
15 values
size
int32
3
1.05M
"use strict"; let datafire = require('datafire'); let openapi = require('./openapi.json'); module.exports = datafire.Integration.fromOpenAPI(openapi, "billbee");
DataFire/Integrations
integrations/generated/billbee/index.js
JavaScript
mit
161
$redis = Redis.new #Redis instance for cron jobs $redis_cron = Redis.new
GndFloor/Ruby-Quest
config/initializers/redis.rb
Ruby
mit
74
// Generated by CoffeeScript 1.6.3 /*! @author Branko Vukelic <branko@brankovukelic.com> @license MIT */ var _this = this; if (typeof define !== 'function' || !define.amd) { this.require = function(dep) { return (function() { switch (dep) { case 'jquery': return _this.jQuery; default: return null; } })() || (function() { throw new Error("Unmet dependency " + dep); })(); }; this.define = function(factory) { return _this.ribcage.utils.deserializeForm = factory(_this.require); }; } define(function(require) { var $; $ = require('jquery'); $.deserializeForm = function(form, data) { form = $(form); form.find(':input').each(function() { var currentValue, input, name, type; input = $(this); name = input.attr('name'); type = input.attr('type'); currentValue = input.val(); if (!name) { return; } switch (type) { case 'checkbox': return input.prop('checked', data[name] === 'on'); case 'radio': return input.prop('checked', data[name] === currentValue); default: return input.val(data[name]); } }); return form; }; $.fn.deserializeForm = function(data) { return $.deserializeForm(this, data); }; return $.deserializeForm; });
foxbunny/ribcage
utils/deserializeform.js
JavaScript
mit
1,357
# Concatenate Two Arrays # I worked on this challenge by myself. # Your Solution Below def array_concat(array_1, array_2) new_array = [] n = 0 array_1.each do |x| new_array[n] = x n = n + 1 end array_2.each do |x| new_array[n] = x n = n + 1 end return new_array end #method 2 (easiest, but no iteration) #new_array = array_1 + array_2 ##method 3 (easier, uses push) ##new_array = [] ##array_1.each do |x| ## new_array << x ##end ##array_2.each do |y| ## new_array << y ##end ##return new_array
dwoznicki/phase-0
week-4/concatenate-array/my_solution.rb
Ruby
mit
551
import datetime import re import sys from collections import deque from decimal import Decimal from enum import Enum from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network from pathlib import Path from types import GeneratorType from typing import Any, Callable, Dict, Type, Union from uuid import UUID if sys.version_info >= (3, 7): Pattern = re.Pattern else: # python 3.6 Pattern = re.compile('a').__class__ from .color import Color from .types import SecretBytes, SecretStr __all__ = 'pydantic_encoder', 'custom_pydantic_encoder', 'timedelta_isoformat' def isoformat(o: Union[datetime.date, datetime.time]) -> str: return o.isoformat() def decimal_encoder(dec_value: Decimal) -> Union[int, float]: """ Encodes a Decimal as int of there's no exponent, otherwise float This is useful when we use ConstrainedDecimal to represent Numeric(x,0) where a integer (but not int typed) is used. Encoding this as a float results in failed round-tripping between encode and prase. Our Id type is a prime example of this. >>> decimal_encoder(Decimal("1.0")) 1.0 >>> decimal_encoder(Decimal("1")) 1 """ if dec_value.as_tuple().exponent >= 0: return int(dec_value) else: return float(dec_value) ENCODERS_BY_TYPE: Dict[Type[Any], Callable[[Any], Any]] = { bytes: lambda o: o.decode(), Color: str, datetime.date: isoformat, datetime.datetime: isoformat, datetime.time: isoformat, datetime.timedelta: lambda td: td.total_seconds(), Decimal: decimal_encoder, Enum: lambda o: o.value, frozenset: list, deque: list, GeneratorType: list, IPv4Address: str, IPv4Interface: str, IPv4Network: str, IPv6Address: str, IPv6Interface: str, IPv6Network: str, Path: str, Pattern: lambda o: o.pattern, SecretBytes: str, SecretStr: str, set: list, UUID: str, } def pydantic_encoder(obj: Any) -> Any: from dataclasses import asdict, is_dataclass from .main import BaseModel if isinstance(obj, BaseModel): return obj.dict() elif is_dataclass(obj): return asdict(obj) # Check the class type and its superclasses for a matching encoder for base in obj.__class__.__mro__[:-1]: try: encoder = ENCODERS_BY_TYPE[base] except KeyError: continue return encoder(obj) else: # We have exited the for loop without finding a suitable encoder raise TypeError(f"Object of type '{obj.__class__.__name__}' is not JSON serializable") def custom_pydantic_encoder(type_encoders: Dict[Any, Callable[[Type[Any]], Any]], obj: Any) -> Any: # Check the class type and its superclasses for a matching encoder for base in obj.__class__.__mro__[:-1]: try: encoder = type_encoders[base] except KeyError: continue return encoder(obj) else: # We have exited the for loop without finding a suitable encoder return pydantic_encoder(obj) def timedelta_isoformat(td: datetime.timedelta) -> str: """ ISO 8601 encoding for timedeltas. """ minutes, seconds = divmod(td.seconds, 60) hours, minutes = divmod(minutes, 60) return f'P{td.days}DT{hours:d}H{minutes:d}M{seconds:d}.{td.microseconds:06d}S'
glenngillen/dotfiles
.vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/jedilsp/pydantic/json.py
Python
mit
3,365
import ROOT from math import pi, sqrt, pow, exp import scipy.integrate import numpy from array import array alpha = 7.2973e-3 m_e = 0.51099892 Z_Xe = 54 Q = 2.4578 def F(Z, KE): E = KE + m_e W = E/m_e Z0 = Z + 2 if W <= 1: W = 1 + 1e-4 if W > 2.2: a = -8.46e-2 + 2.48e-2*Z0 + 2.37e-4*Z0**2 b = 1.15e-2 + 3.58e-4*Z0 - 6.17e-5*Z0**2 else: a = -0.811 + 4.46e-2*Z0 + 1.08e-4*Z0**2 b = 0.673 - 1.82e-2*Z0 + 6.38e-5*Z0**2 x = sqrt(W-1) p = sqrt(W**2 - 1) if (p <= 0): result = 1 else: result = W/p*exp(a + b*x) return result def D(D, K, i): Z = Z_Xe T0 = Q/m_e E1 = 0.5*(K+D) + 1 E2 = 0.5*(K+D) + 1 p1 = sqrt(E1**2 - 1) p2 = sqrt(E2**2 - 1) T1 = E1 - 1 T2 = E2 - 1 return p1*E1*F(Z, T1*m_e)*p2*E2*F(Z, T1*m_e)*pow(T0 - K, i) def SumSpectrum(K, i): if K < 0: return 0 elif K > Q: return 0 a = -K/m_e b = K/m_e x = scipy.integrate.quad(D, a, b, (K/m_e, i))[0] if x < 0: return 0 else: return x def gauss_conv(x, y, res): N = len(x) mu = numpy.mean(x) s = res*mu gauss = [1.0/(s*sqrt(2*pi))*exp(-0.5*((a-mu)/s)**2) for a in x] convolution = numpy.convolve(y, gauss,'same') return convolution def normalize(y, eps, f): return [a*f for a in y] N = 1000 min_E = 0.0 max_E = 1.2 E_scaled = array('d', numpy.linspace(min_E, max_E, N, False)) Es = array('d', (E*Q for E in E_scaled)) eps = (max_E - min_E)/N bb0n = [0.5/eps if abs(E-Q)<eps else 0 for E in Es] bb2n = [SumSpectrum(E, 5) for E in Es] bb0n_smeared = gauss_conv(Es, bb0n, 0.02) bb2n_smeared = gauss_conv(Es, bb2n, 0.02) bb0n_int = scipy.integrate.simps(bb0n_smeared, None, eps) bb0n_norm = array('d', normalize(bb0n_smeared, eps, 1e-2/bb0n_int)) bb2n_int = scipy.integrate.simps(bb2n_smeared, None, eps) bb2n_norm = array('d', normalize(bb2n_smeared, eps, 1/bb2n_int)) g_bb0n = ROOT.TGraph(N, E_scaled, bb0n_norm) g_bb0n.SetTitle("") g_bb0n.SetLineStyle(ROOT.kDashed) g_bb2n = ROOT.TGraph(N, E_scaled, bb2n_norm) g_bb2n.SetTitle("") bb0nX = [] bb0nX.append([0.5/eps if abs(E-Q)<eps else 0 for E in Es]) for i in [1, 2, 3, 5, 7]: bb0nX.append([SumSpectrum(E, i) for E in Es]) bb0nX_graphs = [] for bb0nXn in bb0nX: bb0nX_int = scipy.integrate.simps(bb0nXn, None, eps) bb0nX_norm = array('d', normalize(bb0nXn, eps, 1/bb0nX_int)) g_bb0nX = ROOT.TGraph(N, E_scaled, bb0nX_norm) bb0nX_graphs.append(g_bb0nX) min_E = 0.9 max_E = 1.1 E_scaled_z = array('d', numpy.linspace(min_E, max_E, N, False)) Es_z = array('d', (E*Q for E in E_scaled_z)) eps_z = (max_E - min_E)/N bb0n_z = [0.5/eps_z if abs(E-Q)<eps_z else 0 for E in Es_z] bb2n_z = [SumSpectrum(E, 5) for E in Es_z] bb0n_smeared_z = gauss_conv(Es_z, bb0n_z, 0.02) bb2n_smeared_z = gauss_conv(Es_z, bb2n_z, 0.02) bb0n_norm_z = array('d', normalize(bb0n_smeared_z, eps, 1e-6/bb0n_int)) bb2n_norm_z = array('d', normalize(bb2n_smeared_z, eps, 1.0/bb2n_int)) g_bb0n_z = ROOT.TGraph(N, E_scaled_z, bb0n_norm_z) g_bb0n_z.SetTitle("") g_bb0n_z.SetLineStyle(ROOT.kDashed) g_bb2n_z = ROOT.TGraph(N, E_scaled_z, bb2n_norm_z) g_bb2n_z.SetTitle("") #print("bb0n %f"%(sum((y*eps for y in bb0n_norm)))) #print("bb2n %f"%(sum((y*eps for y in bb2n_norm)))) c_both = ROOT.TCanvas("c_both","c_both") p = ROOT.TPad("p", "p", 0, 0, 1, 1) p.SetRightMargin(0.02) p.SetTopMargin(0.02) p.Draw() p.cd() g_bb2n.Draw("AL") g_bb0n.Draw("L") g_bb2n.GetYaxis().SetTitle("dN/dE") g_bb2n.GetXaxis().SetTitle("Sum e^{-} Energy (E/Q)") c_both.cd() p_inset = ROOT.TPad("p_inset","p_inset",0.5, 0.5, 0.995, 0.995) p_inset.SetRightMargin(0.05) p_inset.SetTopMargin(0.05) p_inset.Draw() p_inset.cd() g_bb2n_z.Draw("AL") g_bb0n_z.Draw("L") g_bb2n_z.GetYaxis().SetTitle("dN/dE") g_bb2n_z.GetXaxis().SetTitle("Sum e^{-} Energy (E/Q)") g_bb2n_z.GetYaxis().SetNoExponent(False) # Zoom in so we can't see edge effects of the convolution g_bb2n_z.GetXaxis().SetRangeUser(1-0.25*(1-min_E), 1+0.25*(max_E-1)) g_bb2n_z.GetYaxis().SetRangeUser(0, 0.0004) c_z = ROOT.TCanvas("c_z","c_z") c_z.SetRightMargin(0.05) c_z.SetTopMargin(0.05) g_bb2n_z.Draw("AL") g_bb0n_z.Draw("L") c = ROOT.TCanvas("c","c") c.SetRightMargin(0.05) c.SetTopMargin(0.05) g_bb2n.Draw("AL") g_bb0n.Draw("L") c_majoron = ROOT.TCanvas("c_majoron") c_majoron.SetRightMargin(0.05) c_majoron.SetTopMargin(0.05) colors = [ROOT.kBlack, ROOT.kRed, ROOT.kGreen, ROOT.kBlue, ROOT.kMagenta, ROOT.kCyan] draw_opt = "AL" for i in xrange(len(bb0nX_graphs)): bb0nX_graphs[-(i+1)].SetLineColor(colors[-(i+1)]) bb0nX_graphs[-(i+1)].Draw(draw_opt) draw_opt = "L" # Draw bb0n last so it doesn't scale others to 0 bb0nX_graphs[-1].SetTitle("") bb0nX_graphs[-1].GetXaxis().SetRangeUser(0, 1.1) bb0nX_graphs[-1].GetXaxis().SetTitle("Sum e^{-} Energy (E/Q)") bb0nX_graphs[-1].GetYaxis().SetTitle("dN/dE") l_majoron = ROOT.TLegend(0.45, 0.77, 0.85, 0.94) l_majoron.SetFillColor(ROOT.kWhite) l_majoron.SetNColumns(2) l_majoron.AddEntry(bb0nX_graphs[0], "0#nu#beta#beta", "l") l_majoron.AddEntry(bb0nX_graphs[1], "0#nu#beta#beta#chi^{0} (n=1)", "l") l_majoron.AddEntry(bb0nX_graphs[4], "2#nu#beta#beta (n=5)", "l") l_majoron.AddEntry(bb0nX_graphs[2], "0#nu#beta#beta#chi^{0} (n=2)", "l") l_majoron.AddEntry(None, "", "") l_majoron.AddEntry(bb0nX_graphs[3], "0#nu#beta#beta#chi^{0}(#chi^{0}) (n=3)", "l") l_majoron.AddEntry(None, "", "") l_majoron.AddEntry(bb0nX_graphs[5], "0#nu#beta#beta#chi^{0}#chi^{0} (n=7)", "l") l_majoron.Draw() dummy = raw_input("Press Enter...")
steveherrin/PhDThesis
Thesis/scripts/make_bb_spectrum_plot.py
Python
mit
5,583
import { Component, OnInit, Inject } from '@angular/core'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; import { Materiaal, Reservering } from '../../models/index'; import { Subscription } from 'rxjs/Subscription'; import { MaterialenService, ReserveringService } from '../../services/index' @Component({ selector: 'cart', templateUrl: './cart.component.html', styleUrls: ['./cart.component.css'] }) export class CartComponent { subscription: Subscription; confirmStep1 = false; confirmStep2 = false; materiaalCart: Reservering [] =[]; materialenInCart: Materiaal[] = []; constructor( public materialenService: MaterialenService, public reserveringSerivce: ReserveringService, public dialogRef: MatDialogRef<CartComponent>, // data binnengekomen via de NavbarComponent @Inject(MAT_DIALOG_DATA) public data: Reservering[]) { this.confirmStep1 = false; this.confirmStep2 = false; this.materiaalCart = data; // haal de materialen op welke gereserveerd zijn this.materiaalCart.forEach(x => { this.materialenService.getMateriaalById(x.materiaal_id).subscribe(materiaal => { // voeg de $key toe, omdat deze niet wordt gereturned const addMateriaal = materiaal; addMateriaal.$key = x.materiaal_id; this.materialenInCart.push(materiaal); }); }); } /** sluiten van de dialog */ onNoClick(): void { this.dialogRef.close(); } /** aantal verlagen*/ checkRemove(key) { this.materiaalCart.forEach(x => { if (x.materiaal_id === key) { x.aantal = Number(x.aantal) - 1; this.pushToService(); } }); } /** aantal verhogen */ checkAdd(key) { this.materiaalCart.forEach(x => { if (x.materiaal_id === key) { x.aantal = Number(x.aantal) + 1; this.pushToService(); } }); } /** verwijderen van Reservering */ deleteReservering(key) { // delete Reservering van Cart this.materiaalCart.forEach(x => { if (x.materiaal_id === key) { const index = this.materiaalCart.indexOf(x); this.materiaalCart.splice(index, 1); this.pushToService(); } }); // delete Materiaal van materialenInCart this.materialenInCart.forEach(x => { if (x.$key === key) { const index = this.materialenInCart.indexOf(x); this.materialenInCart.splice(index, 1); } }); } /** bevestigen van Reservering */ confirmReservering() { if (this.reserveringSerivce.addReservering()) { this.onNoClick(); } } /** push Cart naar reserveringsService */ pushToService(): void { this.reserveringSerivce.addToCart(this.materiaalCart); } }
GewoonMaarten/FEP-eindopdracht
UitleenSysteem/src/app/components/cart/cart.component.ts
TypeScript
mit
2,736
module MyForum class LogReadMark < ActiveRecord::Base end end
vintyara/my_forum
app/models/my_forum/log_read_mark.rb
Ruby
mit
66
var xhrGet = function (url, callback) { var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.onload = callback; xhr.send(); };
denys-liubushkin/Elemental-Tower
js/xhr.js
JavaScript
mit
147
/*jslint browser: true*/ /*global Tangram, gui */ map = (function () { 'use strict'; var locations = { 'Yangon': [16.8313077,96.2187007,7] }; var map_start_location = locations['Yangon']; /*** Map ***/ var map = L.map('map', {"keyboardZoomOffset" : .05, maxZoom: 20 } ); var layer = Tangram.leafletLayer({ scene: 'cinnabar-style-more-labels.yaml?r=2', attribution: '<a href="https://mapzen.com/tangram" target="_blank">Tangram</a> | &copy; OSM contributors | <a href="https://mapzen.com/" target="_blank">Mapzen</a>' }); window.layer = layer; var scene = layer.scene; window.scene = scene; // setView expects format ([lat, long], zoom) map.setView(map_start_location.slice(0, 3), map_start_location[2]); function long2tile(lon,zoom) { return (Math.floor((lon+180)/360*Math.pow(2,zoom))); } function lat2tile(lat,zoom) { return (Math.floor((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom))); } /***** Render loop *****/ function addGUI () { // Link to edit in OSM - hold 'e' and click } // Feature selection function initFeatureSelection () { // Selection info shown on hover var selection_info = document.createElement('div'); selection_info.setAttribute('class', 'label'); selection_info.style.display = 'block'; // Show selected feature on hover scene.container.addEventListener('mousemove', function (event) { var pixel = { x: event.clientX, y: event.clientY }; scene.getFeatureAt(pixel).then(function(selection) { if (!selection) { return; } var feature = selection.feature; if (feature != null) { // console.log("selection map: " + JSON.stringify(feature)); var label = ''; if (feature.properties.name != null) { label = feature.properties.name; } if (label != '') { selection_info.style.left = (pixel.x + 5) + 'px'; selection_info.style.top = (pixel.y + 15) + 'px'; selection_info.innerHTML = '<span class="labelInner">' + label + '</span>'; scene.container.appendChild(selection_info); } else if (selection_info.parentNode != null) { selection_info.parentNode.removeChild(selection_info); } } else if (selection_info.parentNode != null) { selection_info.parentNode.removeChild(selection_info); } }); // Don't show labels while panning if (scene.panning == true) { if (selection_info.parentNode != null) { selection_info.parentNode.removeChild(selection_info); } } }); // Show selected feature on hover scene.container.addEventListener('click', function (event) { var pixel = { x: event.clientX, y: event.clientY }; scene.getFeatureAt(pixel).then(function(selection) { if (!selection) { return; } var feature = selection.feature; if (feature != null) { // console.log("selection map: " + JSON.stringify(feature)); var label = ''; if (feature.properties != null) { // console.log(feature.properties); var obj = JSON.parse(JSON.stringify(feature.properties)); for (var x in feature.properties) { var val = feature.properties[x] label += "<span class='labelLine' key="+x+" value="+val+" onclick='setValuesFromSpan(this)'>"+x+" : "+val+"</span><br>" } } if (label != '') { selection_info.style.left = (pixel.x + 5) + 'px'; selection_info.style.top = (pixel.y + 15) + 'px'; selection_info.innerHTML = '<span class="labelInner">' + label + '</span>'; scene.container.appendChild(selection_info); } else if (selection_info.parentNode != null) { selection_info.parentNode.removeChild(selection_info); } } else if (selection_info.parentNode != null) { selection_info.parentNode.removeChild(selection_info); } }); // Don't show labels while panning if (scene.panning == true) { if (selection_info.parentNode != null) { selection_info.parentNode.removeChild(selection_info); } } }); } window.addEventListener('load', function () { // Scene initialized layer.on('init', function() { addGUI(); //initFeatureSelection(); }); layer.addTo(map); }); return map; }());
mapmeld/mvoter-usage
main.js
JavaScript
mit
4,919
<?php return array ( 'id' => 'nokia_n8_00_ver1_subua', 'fallback' => 'nokia_n8_00_ver1', 'capabilities' => array ( 'image_inlining' => 'true', ), );
cuckata23/wurfl-data
data/nokia_n8_00_ver1_subua.php
PHP
mit
164
<?php defined( '_JEXEC' ) or die; /** * Abstraction of an instance resource from the Twilio API. * * @category Services * @package Services_Twilio * @author Neuman Vong <neuman@twilio.com> * @license http://creativecommons.org/licenses/MIT/ MIT * @link http://pear.php.net/package/Services_Twilio */ abstract class Services_Twilio_InstanceResource extends Services_Twilio_Resource { /** * @param mixed $params An array of updates, or a property name * @param mixed $value A value with which to update the resource * * @return null */ public function update($params, $value = null) { if (!is_array($params)) { $params = array($params => $value); } $this->proxy->updateData($params); } /** * Set this resource's proxy. * * @param Services_Twilio_DataProxy $proxy An instance of DataProxy * * @return null */ public function setProxy($proxy) { $this->proxy = $proxy; } /** * Get the value of a property on this resource. * * @param string $key The property name * * @return mixed Could be anything. */ public function __get($key) { if ($subresource = $this->getSubresources($key)) { return $subresource; } return $this->proxy->$key; } }
manoscrafted/Twilio-for-Joomla
Services/Twilio/InstanceResource.php
PHP
mit
1,373
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package helper; import bean.CorpDetat; import java.util.List; import javax.swing.JTable; /** * * @author kamal */ public class CorpDetatHelper extends AbstractViewHelper<CorpDetat>{ public CorpDetatHelper(JTable jTable, List<CorpDetat> corpDetats) { super(new String[]{ "Corp Detat"}); this.jTable = jTable; this.list = corpDetats; } @Override public Object getValueAt(int rowIndex, int columnIndex) { if (rowIndex < list.size()) { switch (columnIndex) { case 0: return list.get(rowIndex).getTitre(); case 1: return null; default: return null; } } return null; } }
ismailBsd/cdc
src/helper/CorpDetatHelper.java
Java
mit
1,011
<?php /** * Abstract class InvoiceOcean * * API class to communicate with the InvoiceOcean API * * @abstract * @author Chris Schalenborgh <chris@schalenborgh.be> * @version 1.0 * @link https://github.com/InvoiceOcean/api * */ abstract class InvoiceOcean { /** * @var bool */ private $_debug = false; /** * @var string */ private $_api_url_sample = 'https://[USERNAME].invoiceocean.com/'; /** * @var mixed */ private $_api_url; /** * @var */ private $_api_token; /** * @var array */ private $_api_methods = array( // clients 'getClient' => 'clients/[ID].json', 'addClient' => 'clients.json', 'updateClient' => 'clients/[ID].json', 'getClients' => 'clients.json', // invoices 'getInvoice' => 'invoices/[ID].json', 'addInvoice' => 'invoices.json', 'updateInvoice' => 'invoices/[ID].json', 'deleteInvoice' => 'invoices/[ID].json', 'sendInvoice' => 'invoices/[ID]/send_by_email.json', // products 'getProduct' => 'products/[ID].json', 'addProduct' => 'products.json', 'updateProduct' => 'products/[ID].json', 'getProducts' => 'products.json', ); /** * @param $username - InvoiceOcean username * @param $api_token - InvoiceOcean API token */ protected function __construct($username, $api_token) { $this->_api_url = str_replace('[USERNAME]', $username, $this->_api_url_sample); $this->_api_token = $api_token; } /** * return API token * * @return string */ protected function getApiToken() { return $this->_api_token; } /** * returns full API url * * @return string */ protected function getApiUrl() { return $this->_api_url; } /** * returns all available API methods * * @return array */ protected function getApiMethods() { return $this->_api_methods; } /** * return API method url if found in available methods array * * @param string $api_method_name * * @return bool|string */ protected function getApiMethod($api_method_name = '') { if(!Empty($api_method_name) && array_key_exists($api_method_name, $this->_api_methods)) { return $this->getApiUrl() . $this->_api_methods[$api_method_name]; } return false; } /** * Returns the HTTP method based on the first verb of the method name * * @param string $verb * @return string */ private function verbToHttpMethod($verb = '') { if(substr(strtolower($verb), 0, 3) == 'get') { return 'GET'; } elseif(substr(strtolower($verb), 0, 3) == 'add' || substr(strtolower($verb), 0, 4) == 'send') { return 'POST'; } elseif(substr(strtolower($verb), 0, 6) == 'update') { return 'PUT'; } elseif(substr(strtolower($verb), 0, 6) == 'delete') { return 'DELETE'; } } /** * Function to check if valid json * * @param $string * @return bool */ private function isJson($string) { json_decode($string); return (json_last_error() == JSON_ERROR_NONE); } /** * Send a RESTful request to the API via cURL * * @param string $api_method * @param array $body * @param int $id * @return array */ protected function request($api_method = '', $body = array(), $id = 0) { // construct API url $location = $this->getApiMethod($api_method); $http_method = $this->verbToHttpMethod($api_method); if($id > 0) { $location = str_replace('[ID]', $id, $location); } // let's only accept json $headers = array( 'Accept: application/json', 'Content-Type: application/json', ); // only get requests have the api_token in the url/location if($http_method == 'GET') { $location = $location. '?api_token=' .$this->getApiToken(); } else { $body['api_token'] = $this->getApiToken(); } $data = json_encode($body); // setup curl $handle = curl_init(); curl_setopt($handle, CURLOPT_URL, $location); curl_setopt($handle, CURLOPT_HTTPHEADER, $headers); curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false); switch($http_method) { case 'GET': break; case 'POST': curl_setopt($handle, CURLOPT_POST, true); curl_setopt($handle, CURLOPT_POSTFIELDS, $data); break; case 'PUT': curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($handle, CURLOPT_POSTFIELDS, $data); break; case 'DELETE': curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'DELETE'); curl_setopt($handle, CURLOPT_POSTFIELDS, $data); break; } $response = curl_exec($handle); $result = $response; // debug mode? let's return more information about this request if($this->_debug) { $code = curl_getinfo($handle, CURLINFO_HTTP_CODE); return array( 'api' => array( 'location' => $location, 'method' => $http_method, 'token' => $this->getApiToken(), ), 'input_body' => $body, 'response_code' => $code, 'response_body' => $result, ); } else { if($this->isJson($result)) { return array( 'success' => true, 'response' => json_decode($result) ); } else { return array( 'success' => false, 'response' => $result ); } } } }
cschalenborgh/php-invoiceocean
src/InvoiceOcean.php
PHP
mit
6,465
package soap import ( "bytes" "crypto/tls" "fmt" "io/ioutil" "net/http" "encoding/xml" "strings" "encoding/json" ) //BasicAuthGet adds basic auth and perform a request to path func BasicAuthGet(path, username, password string) ([]byte, int, error) { request, err := BasicAuthRequest(path, username, password) if err != nil { return nil, 0, err } return GetRequest(request, true) } //BasicAuthRequest creates a "GET" request with basic auth and return it func BasicAuthRequest(path, username, password string) (*http.Request, error) { request, err := http.NewRequest("GET", path, nil) if err != nil { return nil, err } request.SetBasicAuth(username, password) if err != nil { return nil, err } return request, nil } //Get makes a GET request to path func Get(path string) ([]byte, int, error) { request, err := http.NewRequest("GET", path, nil) if err != nil { return nil, 0, err } return GetRequest(request, true) } //GetRequest executes a request and returns an []byte response, response code, and error func GetRequest(request *http.Request, insecure bool) ([]byte, int, error) { client := &http.Client{ Transport: &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: insecure}, }, } response, err := client.Do(request) if err != nil { return nil, 0, err } return ResponseCheck(response) } //XMLBasicAuthGet adds basic auth and perform a request to path func XMLBasicAuthGet(path, username, password string) ([]byte, int, error) { request, err := BasicAuthRequest(path, username, password) if err != nil { return nil, 0, err } request.Header.Set("accept", "application/xml") return GetRequest(request, true) } //XMLBasicAuthGet adds basic auth and perform a request to path func XMLADXBasicAuthPost(path, method, payload, username, password string) ([]byte, int, error) { req, err := http.NewRequest("POST", path, bytes.NewBufferString(payload)) client := &http.Client{ Transport: &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, }, } req.SetBasicAuth(username, password) req.Header.Set("Content-Type", "text/xml; charset=utf-8") req.Header.Set("Accept", "text/xml") req.Header.Set("SOAPAction", fmt.Sprintf("\"urn:webservicesapi#%v\"", method)) resp, err := client.Do(req) if err != nil { return nil, 0, err } defer resp.Body.Close() return ResponseCheck(resp) } //XMLGet performs a "GET" request to the path and appends the application/xml func XMLGet(path string) ([]byte, int, error) { request, err := http.NewRequest("GET", path, nil) if err != nil { return nil, 0, err } request.Header.Set("accept", "application/xml") return Get(path) } //XMLGetRequest performs a get request and sets the application/xml header to accept func XMLGetRequest(request *http.Request) ([]byte, int, error) { request.Header.Set("accept", "application/xml") return GetRequest(request, true) } //ResponseCheck reads the response and return data, status code or error it encountered. func ResponseCheck(response *http.Response) ([]byte, int, error) { defer response.Body.Close() body, err := ioutil.ReadAll(response.Body) if err != nil { return nil, response.StatusCode, err } return body, response.StatusCode, nil } //Post will porform a post request with the data provided. func Post(payload []byte, path string, headers map[string]string, insecure bool) ([]byte, int, error) { req, err := http.NewRequest("POST", path, bytes.NewBuffer(payload)) for k, v := range headers { req.Header.Set(k, v) } client := &http.Client{Transport: &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: insecure}, }, } resp, err := client.Do(req) if err != nil { return nil, 0, err } defer resp.Body.Close() return ResponseCheck(resp) } //XMLPost will porform a post request with the data provided, it will add content-type header xml to the header map. func XMLPost(payload []byte, path string, headers map[string]string, insecure bool) ([]byte, int, error) { if headers == nil { headers = make(map[string]string) } headers["Content-Type"] = "application/xml" return Post(payload, path, headers, insecure) } // generic response writter for APIs type Response map[string]interface{} //This method returns a xml marshaled response func (r Response) XML() string { b, err := xml.MarshalIndent(r, "", " ") if err != nil { return "" } return strings.Replace(string(b), "%", "%%", -1) } // XMLWithHeader will take a structure and xml marshal with // the <?xml version="1.0" encoding="UTF-8"?> header prepended // to the XML request. func XMLMarshalHead(r interface{}) string { rv := []byte(xml.Header) b, err := xml.MarshalIndent(r, "", " ") if err != nil { return "" } rv = append(rv, b...) return strings.Replace(string(rv), "\\\"", "\"", -1) } //This method returns a json marshaled response func (r Response) String() string { b, err := json.Marshal(r) if err != nil { return "" } return strings.Replace(string(b), "%", "%%", -1) } //returns the resp map as a xml string with the error code provided func XMLErrHandler(w http.ResponseWriter, r *http.Request, resp Response, code int) { w.Header().Set("Content-Type", "application/xml") http.Error(w, resp.XML(), code) return } //returns the resp map as a xml string with a 200 OK func XMLResHandler(w http.ResponseWriter, r *http.Request, resp Response) { w.Header().Set("Content-Type", "application/xml") fmt.Fprintf(w, resp.XML()) return }
josh5276/brocade-adx-client
brocade/soap/soap.go
GO
mit
5,467
require 'spec_helper' RSpec.describe JwtMe do it 'has a version number' do expect(JwtMe::VERSION).not_to be nil end end
bodikqlar/jwt_me
spec/jwt_me_spec.rb
Ruby
mit
129
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("DatabaseDoc.Library")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DatabaseDoc.Library")] [assembly: AssemblyCopyright("Copyright © 2012")] [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("5ca16457-bfef-4558-81e1-2d18d60a0546")] // 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")]
devdigital/DatabaseDoc
DatabaseDoc.Library/Properties/AssemblyInfo.cs
C#
mit
1,414
var height = window.innerHeight; // console.log(height); var main = document.getElementById('main'); var btn = document.getElementById("btn"); main.style.height = height + 'px'; btn.style.top = (height-90) + 'px'; document.getElementById('usr_name').onkeydown = function(e) { e = e || event; if(e.keyCode === 13) { btn.click(); } }; btn.addEventListener("click", function() { var name = document.getElementById("usr_name").value; name = name.replace(/(^\s*)|(\s*$)/g, ""); if(name=='') { alert("请填写用户名哦!"); return false; } var url = window.location.href; var splited = url.split('/'); var roomID = splited[splited.length - 1]; ajax({ url: "/login/"+roomID, //请求地址 type: "POST", //请求方式 data: {new_topic:true,username: name}, //请求参数 dataType: "json", success: function (data) { data=JSON.parse(data); if(data.status==1){ //alert("登录成功"); window.location.href="/show"; } else if(data.status==0){ alert("已经有人登录了哦"); } // 此处放成功后执行的代码 }, fail: function (status) { // 此处放失败后执行的代码 } }); });
Jfmaily/Draw-Guess
public/javascripts/index.js
JavaScript
mit
1,201
/* * default/mouse-push-button.js */ "use strict"; var Q = require('q'), Button = require('./../../button'); var MousePushButton = function (options) { Button.prototype.constructor.call(this, options); this.delay = options.delay > 0 ? options.delay : 0; this.g = null; if(typeof options.g === 'function') this.g = options.g; this.promisef = null; this.boundaries = { minX : 0, maxX : 0, minY : 0, maxY : 0 }; this.leftOrEnded = false; }; MousePushButton.prototype = (function (proto) { function F() {}; F.prototype = proto; return new F(); })(Button.prototype); MousePushButton.prototype.constructor = MousePushButton; MousePushButton.prototype.setG = function (g) { if (typeof g !== 'function') throw new Error("Button setG method needs a g function as argument."); this.g = g; return this; }; MousePushButton.prototype._isInActiveZone = function (touch) { var x = touch.clientX, y = touch.clientY, b = this.boundaries; return x < b.maxX && x > b.minX && y < b.maxY && y > b.minY; }; MousePushButton.prototype.bind = function () { Button.prototype.bind.call(this); this.el.addEventListener('mousedown', this, false); this.binded = true; return this; }; MousePushButton.prototype.unbind = function () { Button.prototype.unbind.call(this); this.el.removeEventListener('mousedown', this, false); this.binded = false; return this; }; MousePushButton.prototype.handleEvent = function (evt) { switch (evt.type) { case 'mousedown': this.onMousedown(evt); break; case 'mousemove': this.onMousemove(evt); break; case 'mouseup': this.onMouseup(evt); break; } }; MousePushButton.prototype.onMousedown = function (evt) { if (!this.active) { if (evt.button === 0) { evt.preventDefault(); this.setActive(true); var boundingRect = this.el.getBoundingClientRect(); this.boundaries.minX = boundingRect.left; this.boundaries.maxX = boundingRect.left + boundingRect.width; this.boundaries.minY = boundingRect.top; this.boundaries.maxY = boundingRect.bottom; this.el.ownerDocument.addEventListener('mousemove', this, false); this.el.ownerDocument.addEventListener('mouseup', this, false); this.promisef = Q.delay(evt, this.delay).then(this.f); } } }; MousePushButton.prototype.onMousemove = function (evt) { if(this.active && !this.leftOrEnded) { evt.preventDefault(); if (!this._isInActiveZone(evt)) this.onMouseup(evt); } }; MousePushButton.prototype.onMouseup = function (evt) { if(this.active && !this.leftOrEnded) { this._removeCls(); this.leftOrEnded = true; this.promisef .then(evt) .then(this.g) .finally(this._done(evt)) .done(); } }; MousePushButton.prototype._done = function (evt) { var btn = this; return function () { btn.setActive(false); btn.leftOrEnded = false; btn.el.ownerDocument.removeEventListener('mousemove', btn, false); btn.el.ownerDocument.removeEventListener('mouseup', btn, false); }; }; module.exports = MousePushButton;
peutetre/mobile-button
lib/mouse/default/mouse-push-button.js
JavaScript
mit
3,393
const industry = [ { "name": "金融", "children": [ { "name": "银行" }, { "name": "保险" }, { "name": "证券公司" }, { "name": "会计/审计" }, { "name": "其它金融服务" } ] }, { "name": "专业服务", "children": [ { "name": "科研/教育" }, { "name": "顾问/咨询服务" }, { "name": "法律服务" }, { "name": "医疗/保健" }, { "name": "其它专业服务" } ] }, { "name": "政府", "children": [ { "name": "政府机关" }, { "name": "协会/非赢利性组织" } ] }, { "name": "IT/通信", "children": [ { "name": "计算机软/硬件" }, { "name": "系统集成/科技公司" }, { "name": "电信服务提供商" }, { "name": "电信增值服务商" }, { "name": "其它IT/通信业" } ] }, { "name": "媒体/娱乐", "children": [ { "name": "媒体/信息传播" }, { "name": "广告公司/展会公司" }, { "name": "印刷/出版" }, { "name": "酒店/饭店/旅游/餐饮" }, { "name": "文化/体育/娱乐" }, { "name": "其它媒体/娱乐" } ] }, { "name": "制造", "children": [ { "name": "汽车制造" }, { "name": "电子制造" }, { "name": "快速消费品制造" }, { "name": "制药/生物制造" }, { "name": "工业设备制造" }, { "name": "化工/石油制造" }, { "name": "其它制造业" } ] }, { "name": "建筑", "children": [ { "name": "建筑工程/建设服务" }, { "name": "楼宇" }, { "name": "房地产" }, { "name": "其它建筑业" } ] }, { "name": "能源/公共事业", "children": [ { "name": "能源开采" }, { "name": "水/电/气等" }, { "name": "公共事业" } ] }, { "name": "其它行业", "children": [ { "name": "交通运输/仓储物流" }, { "name": "批发/零售/分销" }, { "name": "贸易/进出口" }, { "name": "其它" } ] } ]; export default industry;
FTChinese/next-signup
client/js/data/industry.js
JavaScript
mit
2,311
# encoding: ascii-8bit module Bitcoin::Gui class TxView < TreeView def initialize gui, replace = nil super(gui, :tx_view, [ [GObject::TYPE_STRING, "Type"], [GObject::TYPE_STRING, "Hash"], [GObject::TYPE_STRING, "Value", :format_value_col], [GObject::TYPE_INT, "Confirmations"], [GObject::TYPE_STRING, "Direction"], ]) GObject.signal_connect(@view, "row-activated") do |view, path, column| res, iter = @model.get_iter(path) next unless res tx_hash = @model.get_value(iter, 1).get_string @gui.display_tx(tx_hash) end end def update txouts EM.defer do @model.clear txouts.each do |txout| row = @model.append(nil) @model.set_value(row, 0, txout.type.to_s) @model.set_value(row, 1, txout.get_tx.hash) @model.set_value(row, 2, txout.value.to_s) @model.set_value(row, 3, txout.get_tx.confirmations) @model.set_value(row, 4, "incoming") if txin = txout.get_next_in row = @model.append(nil) @model.set_value(row, 0, txout.type.to_s) @model.set_value(row, 1, txin.get_tx.hash) @model.set_value(row, 2, (0 - txout.value).to_s) @model.set_value(row, 3, txin.get_tx.confirmations) @model.set_value(row, 4, "outgoing") end end @view.set_model @model end end end class TxInView < TreeView def initialize gui, replace = nil super(gui, [ [GObject::TYPE_STRING, "Type"], [GObject::TYPE_STRING, "From"], [GObject::TYPE_STRING, "Value", :format_value_col] ]) old = @gui.builder.get_object("tx_view") end def update txins @model.clear txins.each do |txin| txout = txin.get_prev_out row = @model.append(nil) @model.set_value(row, 0, txout.type.to_s) @model.set_value(row, 1, txout.get_addresses.join(", ")) @model.set_value(row, 2, txout.value.to_s) end @view.set_model @model end end end
mhanne/bitcoin-ruby-gui
lib/gui/tx_view.rb
Ruby
mit
2,132
onst bcrypt = require('bcrypt-nodejs'); const crypto = require('crypto'); console.log('start'); bcrypt.genSalt(10, (err, salt) => { bcrypt.hash('passwd', salt, null, (err, hash) => { console.log(hash); }); });
mrwolfyu/meteo-bbb
xxx.js
JavaScript
mit
231
import { privatize as P } from '@ember/-internals/container'; import { getOwner } from '@ember/-internals/owner'; import { guidFor } from '@ember/-internals/utils'; import { addChildView, OwnedTemplateMeta, setElementView, setViewElement, } from '@ember/-internals/views'; import { assert, debugFreeze } from '@ember/debug'; import { _instrumentStart } from '@ember/instrumentation'; import { assign } from '@ember/polyfills'; import { DEBUG } from '@glimmer/env'; import { ComponentCapabilities, Dict, Option, ProgramSymbolTable, Simple, VMHandle, } from '@glimmer/interfaces'; import { combine, Tag, validate, value, VersionedPathReference } from '@glimmer/reference'; import { Arguments, Bounds, ComponentDefinition, ElementOperations, Invocation, PreparedArguments, PrimitiveReference, WithDynamicLayout, WithDynamicTagName, WithStaticLayout, } from '@glimmer/runtime'; import { Destroyable, EMPTY_ARRAY } from '@glimmer/util'; import { BOUNDS, DIRTY_TAG, HAS_BLOCK, IS_DISPATCHING_ATTRS, ROOT_REF } from '../component'; import Environment from '../environment'; import { DynamicScope } from '../renderer'; import RuntimeResolver from '../resolver'; import { Factory as TemplateFactory, isTemplateFactory, OwnedTemplate } from '../template'; import { AttributeBinding, ClassNameBinding, IsVisibleBinding, referenceForKey, SimpleClassNameBindingReference, } from '../utils/bindings'; import ComponentStateBucket, { Component } from '../utils/curly-component-state-bucket'; import { processComponentArgs } from '../utils/process-args'; import AbstractManager from './abstract'; import DefinitionState from './definition-state'; function aliasIdToElementId(args: Arguments, props: any) { if (args.named.has('id')) { // tslint:disable-next-line:max-line-length assert( `You cannot invoke a component with both 'id' and 'elementId' at the same time.`, !args.named.has('elementId') ); props.elementId = props.id; } } // We must traverse the attributeBindings in reverse keeping track of // what has already been applied. This is essentially refining the concatenated // properties applying right to left. function applyAttributeBindings( element: Simple.Element, attributeBindings: Array<string>, component: Component, operations: ElementOperations ) { let seen: string[] = []; let i = attributeBindings.length - 1; while (i !== -1) { let binding = attributeBindings[i]; let parsed: [string, string, boolean] = AttributeBinding.parse(binding); let attribute = parsed[1]; if (seen.indexOf(attribute) === -1) { seen.push(attribute); AttributeBinding.install(element, component, parsed, operations); } i--; } if (seen.indexOf('id') === -1) { let id = component.elementId ? component.elementId : guidFor(component); operations.setAttribute('id', PrimitiveReference.create(id), false, null); } if (seen.indexOf('style') === -1) { IsVisibleBinding.install(element, component, operations); } } const DEFAULT_LAYOUT = P`template:components/-default`; const EMPTY_POSITIONAL_ARGS: VersionedPathReference[] = []; debugFreeze(EMPTY_POSITIONAL_ARGS); export default class CurlyComponentManager extends AbstractManager<ComponentStateBucket, DefinitionState> implements WithStaticLayout<ComponentStateBucket, DefinitionState, OwnedTemplateMeta, RuntimeResolver>, WithDynamicTagName<ComponentStateBucket>, WithDynamicLayout<ComponentStateBucket, OwnedTemplateMeta, RuntimeResolver> { getLayout(state: DefinitionState, _resolver: RuntimeResolver): Invocation { return { // TODO fix handle: (state.handle as any) as number, symbolTable: state.symbolTable!, }; } protected templateFor(component: Component): OwnedTemplate { let { layout, layoutName } = component; let owner = getOwner(component); let factory: TemplateFactory; if (layout === undefined) { if (layoutName !== undefined) { let _factory = owner.lookup<TemplateFactory>(`template:${layoutName}`); assert(`Layout \`${layoutName}\` not found!`, _factory !== undefined); factory = _factory!; } else { factory = owner.lookup<TemplateFactory>(DEFAULT_LAYOUT)!; } } else if (isTemplateFactory(layout)) { factory = layout; } else { // we were provided an instance already return layout; } return factory(owner); } getDynamicLayout({ component }: ComponentStateBucket): Invocation { let template = this.templateFor(component); let layout = template.asWrappedLayout(); return { handle: layout.compile(), symbolTable: layout.symbolTable, }; } getTagName(state: ComponentStateBucket): Option<string> { let { component, hasWrappedElement } = state; if (!hasWrappedElement) { return null; } return (component && component.tagName) || 'div'; } getCapabilities(state: DefinitionState) { return state.capabilities; } prepareArgs(state: DefinitionState, args: Arguments): Option<PreparedArguments> { if (args.named.has('__ARGS__')) { let __args__ = args.named.get('__ARGS__').value() as Dict<VersionedPathReference>; let prepared = { positional: EMPTY_POSITIONAL_ARGS, named: { ...args.named.capture().map, ...__args__, }, }; if (DEBUG) { delete prepared.named.__ARGS__; } return prepared; } const { positionalParams } = state.ComponentClass.class!; // early exits if ( positionalParams === undefined || positionalParams === null || args.positional.length === 0 ) { return null; } let named: PreparedArguments['named']; if (typeof positionalParams === 'string') { assert( `You cannot specify positional parameters and the hash argument \`${positionalParams}\`.`, !args.named.has(positionalParams) ); named = { [positionalParams]: args.positional.capture() }; assign(named, args.named.capture().map); } else if (Array.isArray(positionalParams) && positionalParams.length > 0) { const count = Math.min(positionalParams.length, args.positional.length); named = {}; assign(named, args.named.capture().map); for (let i = 0; i < count; i++) { const name = positionalParams[i]; assert( `You cannot specify both a positional param (at position ${i}) and the hash argument \`${name}\`.`, !args.named.has(name) ); named[name] = args.positional.at(i); } } else { return null; } return { positional: EMPTY_ARRAY, named }; } /* * This hook is responsible for actually instantiating the component instance. * It also is where we perform additional bookkeeping to support legacy * features like exposed by view mixins like ChildViewSupport, ActionSupport, * etc. */ create( environment: Environment, state: DefinitionState, args: Arguments, dynamicScope: DynamicScope, callerSelfRef: VersionedPathReference, hasBlock: boolean ): ComponentStateBucket { if (DEBUG) { this._pushToDebugStack(`component:${state.name}`, environment); } // Get the nearest concrete component instance from the scope. "Virtual" // components will be skipped. let parentView = dynamicScope.view; // Get the Ember.Component subclass to instantiate for this component. let factory = state.ComponentClass; // Capture the arguments, which tells Glimmer to give us our own, stable // copy of the Arguments object that is safe to hold on to between renders. let capturedArgs = args.named.capture(); let props = processComponentArgs(capturedArgs); // Alias `id` argument to `elementId` property on the component instance. aliasIdToElementId(args, props); // Set component instance's parentView property to point to nearest concrete // component. props.parentView = parentView; // Set whether this component was invoked with a block // (`{{#my-component}}{{/my-component}}`) or without one // (`{{my-component}}`). props[HAS_BLOCK] = hasBlock; // Save the current `this` context of the template as the component's // `_target`, so bubbled actions are routed to the right place. props._target = callerSelfRef.value(); // static layout asserts CurriedDefinition if (state.template) { props.layout = state.template; } // Now that we've built up all of the properties to set on the component instance, // actually create it. let component = factory.create(props); let finalizer = _instrumentStart('render.component', initialRenderInstrumentDetails, component); // We become the new parentView for downstream components, so save our // component off on the dynamic scope. dynamicScope.view = component; // Unless we're the root component, we need to add ourselves to our parent // component's childViews array. if (parentView !== null && parentView !== undefined) { addChildView(parentView, component); } component.trigger('didReceiveAttrs'); let hasWrappedElement = component.tagName !== ''; // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components if (!hasWrappedElement) { if (environment.isInteractive) { component.trigger('willRender'); } component._transitionTo('hasElement'); if (environment.isInteractive) { component.trigger('willInsertElement'); } } // Track additional lifecycle metadata about this component in a state bucket. // Essentially we're saving off all the state we'll need in the future. let bucket = new ComponentStateBucket( environment, component, capturedArgs, finalizer, hasWrappedElement ); if (args.named.has('class')) { bucket.classRef = args.named.get('class'); } if (DEBUG) { processComponentInitializationAssertions(component, props); } if (environment.isInteractive && hasWrappedElement) { component.trigger('willRender'); } return bucket; } getSelf({ component }: ComponentStateBucket): VersionedPathReference { return component[ROOT_REF]; } didCreateElement( { component, classRef, environment }: ComponentStateBucket, element: Simple.Element, operations: ElementOperations ): void { setViewElement(component, element); setElementView(element, component); let { attributeBindings, classNames, classNameBindings } = component; if (attributeBindings && attributeBindings.length) { applyAttributeBindings(element, attributeBindings, component, operations); } else { let id = component.elementId ? component.elementId : guidFor(component); operations.setAttribute('id', PrimitiveReference.create(id), false, null); IsVisibleBinding.install(element, component, operations); } if (classRef) { const ref = new SimpleClassNameBindingReference(classRef, classRef['propertyKey']); operations.setAttribute('class', ref, false, null); } if (classNames && classNames.length) { classNames.forEach((name: string) => { operations.setAttribute('class', PrimitiveReference.create(name), false, null); }); } if (classNameBindings && classNameBindings.length) { classNameBindings.forEach((binding: string) => { ClassNameBinding.install(element, component, binding, operations); }); } operations.setAttribute('class', PrimitiveReference.create('ember-view'), false, null); if ('ariaRole' in component) { operations.setAttribute('role', referenceForKey(component, 'ariaRole'), false, null); } component._transitionTo('hasElement'); if (environment.isInteractive) { component.trigger('willInsertElement'); } } didRenderLayout(bucket: ComponentStateBucket, bounds: Bounds): void { bucket.component[BOUNDS] = bounds; bucket.finalize(); if (DEBUG) { this.debugStack.pop(); } } getTag({ args, component }: ComponentStateBucket): Tag { return args ? combine([args.tag, component[DIRTY_TAG]]) : component[DIRTY_TAG]; } didCreate({ component, environment }: ComponentStateBucket): void { if (environment.isInteractive) { component._transitionTo('inDOM'); component.trigger('didInsertElement'); component.trigger('didRender'); } } update(bucket: ComponentStateBucket): void { let { component, args, argsRevision, environment } = bucket; if (DEBUG) { this._pushToDebugStack(component._debugContainerKey, environment); } bucket.finalizer = _instrumentStart('render.component', rerenderInstrumentDetails, component); if (args && !validate(args.tag, argsRevision)) { let props = processComponentArgs(args!); bucket.argsRevision = value(args!.tag); component[IS_DISPATCHING_ATTRS] = true; component.setProperties(props); component[IS_DISPATCHING_ATTRS] = false; component.trigger('didUpdateAttrs'); component.trigger('didReceiveAttrs'); } if (environment.isInteractive) { component.trigger('willUpdate'); component.trigger('willRender'); } } didUpdateLayout(bucket: ComponentStateBucket): void { bucket.finalize(); if (DEBUG) { this.debugStack.pop(); } } didUpdate({ component, environment }: ComponentStateBucket): void { if (environment.isInteractive) { component.trigger('didUpdate'); component.trigger('didRender'); } } getDestructor(stateBucket: ComponentStateBucket): Option<Destroyable> { return stateBucket; } } export function validatePositionalParameters( named: { has(name: string): boolean }, positional: { length: number }, positionalParamsDefinition: any ) { if (DEBUG) { if (!named || !positional || !positional.length) { return; } let paramType = typeof positionalParamsDefinition; if (paramType === 'string') { // tslint:disable-next-line:max-line-length assert( `You cannot specify positional parameters and the hash argument \`${positionalParamsDefinition}\`.`, !named.has(positionalParamsDefinition) ); } else { if (positional.length < positionalParamsDefinition.length) { positionalParamsDefinition = positionalParamsDefinition.slice(0, positional.length); } for (let i = 0; i < positionalParamsDefinition.length; i++) { let name = positionalParamsDefinition[i]; assert( `You cannot specify both a positional param (at position ${i}) and the hash argument \`${name}\`.`, !named.has(name) ); } } } } export function processComponentInitializationAssertions(component: Component, props: any) { assert( `classNameBindings must be non-empty strings: ${component}`, (() => { let { classNameBindings } = component; for (let i = 0; i < classNameBindings.length; i++) { let binding = classNameBindings[i]; if (typeof binding !== 'string' || binding.length === 0) { return false; } } return true; })() ); assert( `classNameBindings must not have spaces in them: ${component}`, (() => { let { classNameBindings } = component; for (let i = 0; i < classNameBindings.length; i++) { let binding = classNameBindings[i]; if (binding.split(' ').length > 1) { return false; } } return true; })() ); assert( `You cannot use \`classNameBindings\` on a tag-less component: ${component}`, component.tagName !== '' || !component.classNameBindings || component.classNameBindings.length === 0 ); assert( `You cannot use \`elementId\` on a tag-less component: ${component}`, component.tagName !== '' || props.id === component.elementId || (!component.elementId && component.elementId !== '') ); assert( `You cannot use \`attributeBindings\` on a tag-less component: ${component}`, component.tagName !== '' || !component.attributeBindings || component.attributeBindings.length === 0 ); } export function initialRenderInstrumentDetails(component: any): any { return component.instrumentDetails({ initialRender: true }); } export function rerenderInstrumentDetails(component: any): any { return component.instrumentDetails({ initialRender: false }); } // This is not any of glimmer-vm's proper Argument types because we // don't have sufficient public constructors to conveniently // reassemble one after we mangle the various arguments. interface CurriedArgs { positional: any[]; named: any; } export const CURLY_CAPABILITIES: ComponentCapabilities = { dynamicLayout: true, dynamicTag: true, prepareArgs: true, createArgs: true, attributeHook: true, elementHook: true, createCaller: true, dynamicScope: true, updateHook: true, createInstance: true, }; const CURLY_COMPONENT_MANAGER = new CurlyComponentManager(); export class CurlyComponentDefinition implements ComponentDefinition { public args: CurriedArgs | undefined; public state: DefinitionState; public symbolTable: ProgramSymbolTable | undefined; public manager: CurlyComponentManager = CURLY_COMPONENT_MANAGER; // tslint:disable-next-line:no-shadowed-variable constructor( public name: string, public ComponentClass: any, public handle: Option<VMHandle>, public template: Option<OwnedTemplate>, args?: CurriedArgs ) { const layout = template && template.asLayout(); const symbolTable = layout ? layout.symbolTable : undefined; this.symbolTable = symbolTable; this.template = template; this.args = args; this.state = { name, ComponentClass, handle, template, capabilities: CURLY_CAPABILITIES, symbolTable, }; } }
intercom/ember.js
packages/@ember/-internals/glimmer/lib/component-managers/curly.ts
TypeScript
mit
18,111
class SubscriptionTracking(object): def __init__(self, enable=None, text=None, html=None, substitution_tag=None): self._enable = None self._text = None self._html = None self._substitution_tag = None if enable is not None: self.enable = enable if text is not None: self.text = text if html is not None: self.html = html if substitution_tag is not None: self.substitution_tag = substitution_tag @property def enable(self): return self._enable @enable.setter def enable(self, value): self._enable = value @property def text(self): return self._text @text.setter def text(self, value): self._text = value @property def html(self): return self._html @html.setter def html(self, value): self._html = value @property def substitution_tag(self): return self._substitution_tag @substitution_tag.setter def substitution_tag(self, value): self._substitution_tag = value def get(self): subscription_tracking = {} if self.enable is not None: subscription_tracking["enable"] = self.enable if self.text is not None: subscription_tracking["text"] = self.text if self.html is not None: subscription_tracking["html"] = self.html if self.substitution_tag is not None: subscription_tracking["substitution_tag"] = self.substitution_tag return subscription_tracking
galihmelon/sendgrid-python
sendgrid/helpers/mail/subscription_tracking.py
Python
mit
1,603
<?php namespace TCG\Voyager\Models; use Illuminate\Database\Eloquent\Model; use TCG\Voyager\Facades\Voyager; class Languages extends Model { protected $table = 'admin_language'; public function posts() { return $this->hasMany(Voyager::modelClass('Post'))->published(); } }
voodoostudio/One_admin
src/Models/Languages.php
PHP
mit
302
module Doc2mock VERSION = "0.0.1" end
DefactoSoftware/doc2mock
lib/doc2mock/version.rb
Ruby
mit
40
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Auction extends CI_Controller { public $id_auction; public $tabNav; public function __construct(){ parent::__construct(); if(!$this->session->userdata('admin')){ redirect(site_url()); } $this->load->model('auction_model','am'); if ($this->uri->segment(3) === FALSE) { $this->id_auction = 0; } else { $this->id_auction = $this->uri->segment(3); } $this->tabNav = array( 'tatacara' => array( 'url' => site_url('auction/ubah/'.$this->id_auction.'/tatacara/'), 'label' => 'Tata Cara' ), 'peserta' => array( 'url' => site_url('auction/ubah/'.$this->id_auction.'/peserta/'), 'label' =>'Peserta' ), 'kurs' => array( 'url' => site_url('auction/ubah/'.$this->id_auction.'/kurs/'), 'label' =>'Kurs' ), 'persyaratan' => array( 'url' => site_url('auction/ubah/'.$this->id_auction.'/persyaratan/'), 'label' =>'Persyaratan' ), 'barang' => array( 'url' => site_url('auction/ubah/'.$this->id_auction.'/barang/'), 'label' =>'Barang' ), ); } public function index(){ $this->load->library('form'); $search = ''; $page = ''; $post = $this->input->post(); $per_page =10; $sort = $this->utility->generateSort(array('name', 'auction_date', 'work_area')); $data['auction_list'] = $this->am->get_auction_list($search, $sort, $page, $per_page,TRUE); /*$data['filter_list'] = $this->form->group_filter_post($this->get_field());*/ $data['pagination'] = $this->utility->generate_page('auction',$sort, $per_page, $this->am->get_auction_list($search, $sort, '','',FALSE)); $data['sort'] = $sort; $layout['menu'] = $this->am->get_auction_list(); $layout['content'] = $this->load->view('auction/content',$data,TRUE); $layout['script'] = $this->load->view('auction/content_js',$data,TRUE); $layout['script'] = $this->load->view('auction/form_filter',$data,TRUE); $item['header'] = $this->load->view('auction/header',$this->session->userdata('admin'),TRUE); $item['content'] = $this->load->view('dashboard',$layout,TRUE); $this->load->view('template',$item); } public function view($id_lelang){ $data['id_lelang'] = $id_lelang; $data['fill'] = $fill = $this->pre_auction_model->select_data($id_lelang); $data['barang'] = $this->pre_auction_model->get_barang($id_lelang); if($fill['auction_type'] == "reverse") $data['symbol'] = '<'; else $data['symbol'] = '>'; $this->load->view('admin/master', $data); } public function duplikat($id){ $_POST = $this->securities->clean_input($_POST,'save'); $admin = $this->session->userdata('admin'); if($this->input->post('simpan')){ $res = $this->am->duplicate_data($this->input->post('total'),$id); $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses duplikat data!</p>'); redirect(site_url('auction')); } $layout['content'] = $this->load->view('auction/duplikat',NULL,TRUE); $item['header'] = $this->load->view('auction/header',$this->session->userdata('admin'),TRUE); $item['content'] = $this->load->view('dashboard',$layout,TRUE); $this->load->view('template',$item); } public function tambah(){ $_POST = $this->securities->clean_input($_POST,'save'); $admin = $this->session->userdata('admin'); $vld = array( array( 'field'=>'name', 'label'=>'Nama Paket Pengadaan', 'rules'=>'required' ), array( 'field'=>'budget_source', 'label'=>'Sumber Anggaran', 'rules'=>'required' ), array( 'field'=>'id_pejabat_pengadaan', 'label'=>'Pejabat Pengadaan', 'rules'=>'required' ), array( 'field'=>'auction_type', 'label'=>'Tipe Auction', 'rules'=>'required' ), array( 'field'=>'work_area', 'label'=>'Lokasi', 'rules'=>'required' ), array( 'field'=>'room', 'label'=>'Ruangan', 'rules'=>'required' ), array( 'field'=>'auction_date', 'label'=>'Tanggal', 'rules'=>'required' ), array( 'field'=>'auction_duration', 'label'=>'Durasi', 'rules'=>'required' ), array( 'field'=>'budget_holder', 'label'=>'Budget Holder', 'rules'=>'required' ), array( 'field'=>'budget_spender', 'label'=>'Budget Spender', 'rules'=>'required' ), ); $this->form_validation->set_rules($vld); if($this->form_validation->run()==TRUE){ $_POST['entry_stamp'] = date("Y-m-d H:i:s"); $_POST['id_mekanisme'] = 1; unset($_POST['Simpan']); $res = $this->am->save_data($this->input->post()); if($res){ $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menambah data!</p>'); redirect(site_url('auction/ubah/'.$res)); } } $data['pejabat_pengadaan'] = $this->am->get_pejabat(); $data['budget_holder'] = $this->am->get_budget_holder(); $data['budget_spender'] = $this->am->get_budget_spender(); $data['id_mekanisme'] = $this->am->get_mekanisme(); $layout['menu'] = $this->am->get_auction_list(); $layout['content'] = $this->load->view('auction/tambah',$data,TRUE); $item['header'] = $this->load->view('auction/header',$this->session->userdata('admin'),TRUE); $item['content'] = $this->load->view('dashboard',$layout,TRUE); $this->load->view('template',$item); } public function edit($id){ $_POST = $this->securities->clean_input($_POST,'save'); $admin = $this->session->userdata('admin'); $vld = array( array( 'field'=>'name', 'label'=>'Nama Paket Pengadaan', 'rules'=>'required' ), array( 'field'=>'budget_source', 'label'=>'Sumber Anggaran', 'rules'=>'required' ), array( 'field'=>'id_pejabat_pengadaan', 'label'=>'Pejabat Pengadaan', 'rules'=>'required' ), array( 'field'=>'auction_type', 'label'=>'Tipe Auction', 'rules'=>'required' ), array( 'field'=>'work_area', 'label'=>'Lokasi', 'rules'=>'required' ), array( 'field'=>'room', 'label'=>'Ruangan', 'rules'=>'required' ), array( 'field'=>'auction_date', 'label'=>'Tanggal', 'rules'=>'required' ), array( 'field'=>'auction_duration', 'label'=>'Durasi', 'rules'=>'required' ), array( 'field'=>'budget_holder', 'label'=>'Budget Holder', 'rules'=>'required' ), array( 'field'=>'budget_spender', 'label'=>'Budget Spender', 'rules'=>'required' ), ); $this->form_validation->set_rules($vld); if($this->form_validation->run()==TRUE){ $_POST['entry_stamp'] = date("Y-m-d H:i:s"); unset($_POST['Simpan']); unset($_POST['Update']); $res = $this->am->edit_data($this->input->post(),$id); if($res){ $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses mengubah data!</p>'); redirect(site_url('auction/ubah/'.$id.'/')); } } $data = $this->am->get_auction($id); $data['pejabat_pengadaan'] = $this->am->get_pejabat(); $data['budget_holder_list'] = $this->am->get_budget_holder(); $data['budget_spender_list'] = $this->am->get_budget_spender(); $data['id_mekanisme_list'] = $this->am->get_mekanisme(); $data['id'] = $id; $layout['menu'] = $this->am->get_auction_list(); $layout['content'] = $this->load->view('edit',$data,TRUE); $item['header'] = $this->load->view('auction/header',$this->session->userdata('admin'),TRUE); $item['content'] = $this->load->view('dashboard',$layout,TRUE); $this->load->view('template',$item); } public function hapus($id){ if($this->am->hapus($id,'ms_procurement')){ $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menghapus data!</p>'); redirect(site_url('auction')); }else{ $this->session->set_flashdata('msgSuccess','<p class="msgError">Gagal menghapus data!</p>'); redirect(site_url('auction')); } } public function ubah($id, $page='tatacara'){ $data = $this->am->get_auction($id); $data['id'] = $id; $data['table'] = $this->$page($id, $page); $layout['menu'] = $this->am->get_auction_list(); $layout['content'] = $this->load->view('auction/view',$data,TRUE); $layout['script'] = $this->load->view('auction/content_js',$data,TRUE); $item['header'] = $this->load->view('auction/header',$this->session->userdata('admin'),TRUE); $item['content'] = $this->load->view('dashboard',$layout,TRUE); $this->load->view('template',$item); } public function autocomplete(){ // $keyword = $this->input->post('keyword'); $data = $this->am->search_vendor(); echo json_encode($data); } //--------------------- // TATA CARA //--------------------- public function tatacara($id,$page){ $check = $this->am->get_tatacara_peserta($id); // echo print_r($check); if (!empty($check)){ $data = $this->am->get_procurement_tatacara($id); $data['id'] = $id; $data['sort'] = $this->utility->generateSort(array('metode_auction', 'metode_penawaran')); $data['tabNav'] = $this->tabNav; $data['id'] = $id; $per_page = 10; $data['pagination'] = $this->utility->generate_page('auction/ubah/'.$id.'/'.$page,$data['sort'], $per_page, $this->am->get_procurement_tatacara($id,'', $data['sort'], '','',FALSE)); $data['list'] = $this->am->get_procurement_tatacara($id,'', $data['sort'], '','',FALSE); if($this->input->post('edit')){ redirect(site_url('auction/ubah/'.$id.'/edit_tatacara/#edit')); } return $this->load->view('tab/tatacara',$data,TRUE); }else{ $this->session->keep_flashdata('msgSuccess'); redirect(site_url('auction/ubah/'.$id.'/tambah_tatacara')); } } public function tambah_tatacara($id,$page){ $form = ($this->session->userdata('form'))?$this->session->userdata('form'):array(); $fill = $this->securities->clean_input($_POST,'save'); $item = $vld = $save_data = array(); $admin = $this->session->userdata('admin'); $vld = array( array( 'field'=>'metode_auction', 'label'=>'Metode Auction', 'rules'=>'required' ), array( 'field'=>'metode_penawaran', 'label'=>'Metode Penawaran', 'rules'=>'required' ), ); $this->form_validation->set_rules($vld); if($this->input->post('simpan')){ if($this->form_validation->run()==TRUE){ // print_r($this->input->post('simpan')); $form['id_procurement'] = $id; $form['metode_auction'] = $this->input->post('metode_auction'); $form['metode_penawaran'] = $this->input->post('metode_penawaran'); $form['entry_stamp'] = date('Y-m-d H:i:s'); if($form['metode_penawaran'] =='lump_sum') $this->set_barang($id); // $this->session->set_userdata('form',array_merge($form,$this->input->post())); $result = $this->am->save_tatacara($form); if($result){ $this->set_syarat($id); $this->session->unset_userdata('form'); $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menambah Tata Cara </p>'); redirect(site_url('auction/ubah/'.$id.'/')); } } } $data['sort'] = $this->utility->generateSort(array('metode_auction', 'metode_penawaran')); $data['tabNav'] = $this->tabNav; $data['id'] = $id; $per_page = 10; $data['pagination'] = $this->utility->generate_page('auction/ubah/'.$id.'/'.$page,$data['sort'], $per_page, $this->am->get_procurement_tatacara($id,'', $data['sort'], '','',FALSE)); $data['list'] = $this->am->get_procurement_tatacara($id,'', $data['sort'], '','',FALSE); return $this->load->view('tab/tambah_tatacara',$data,TRUE); } public function edit_tatacara($id,$page){ $form = ($this->session->userdata('form'))?$this->session->userdata('form'):array(); $fill = $this->securities->clean_input($_POST,'save'); $item = $vld = $save_data = array(); $admin = $this->session->userdata('admin'); $vld = array( array( 'field'=>'metode_auction', 'label'=>'Metode Auction', 'rules'=>'required' ), array( 'field'=>'metode_penawaran', 'label'=>'Metode Penawaran', 'rules'=>'required' ), ); $this->form_validation->set_rules($vld); if($this->input->post('update')){ if($this->form_validation->run()==TRUE){ unset($_POST['update']); unset($form['update']); $form['id_procurement'] = $id; $form['metode_auction'] = $this->input->post('metode_auction'); $form['metode_penawaran'] = $this->input->post('metode_penawaran'); $form['edit_stamp'] = date('Y-m-d H:i:s'); $result = $this->am->edit_tatacara($id, $form); if($result){ $this->session->unset_userdata('form'); $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses Menngubah Tata Cara </p>'); redirect(site_url('auction/ubah/'.$id.'/')); } } } $data = $this->am->get_procurement_tatacara($id); $data['sort'] = $this->utility->generateSort(array('metode_auction', 'metode_penawaran')); $data['tabNav'] = $this->tabNav; $data['id'] = $id; return $this->load->view('tab/edit_tatacara',$data,TRUE); } function set_barang($id_lelang = ''){ $master = $this->am->get_auction($id_lelang); $param = array( 'id_procurement' => $id_lelang, 'nama_barang' => $master['name'], 'id_kurs' => '', 'nilai_hps' => '', // 'use_tax' => '', // 'volume' => '', 'entry_stamp' => date("Y-m-d H:i:s") ); $this->am->save_barang($param); } //--------------------- // BARANG //--------------------- public function barang($id,$page){ $data['sort'] = $this->utility->generateSort(array('nama_barang', 'id_kurs', 'nilai_hps')); $data['tabNav'] = $this->tabNav; $data['id'] = $id; $per_page = 10; $data['pagination'] = $this->utility->generate_page('auction/ubah/'.$id.'/'.$page,$data['sort'], $per_page, $this->am->get_procurement_barang($id,'', $data['sort'], '','',FALSE)); $data['list'] = $this->am->get_procurement_barang($id,'', $data['sort'], '','',FALSE); return $this->load->view('tab/barang',$data,TRUE); } public function tambah_barang($id){ $form = ($this->session->userdata('form'))?$this->session->userdata('form'):array(); $fill = $this->securities->clean_input($_POST,'save'); $item = $vld = $save_data = array(); $admin = $this->session->userdata('admin'); $vld = array( array( 'field'=>'nama_barang', 'label'=>'Nama Barang', 'rules'=>'required' ), array( 'field'=>'id_kurs', 'label'=>'Mata Uang', 'rules'=>'required' ), array( 'field'=>'nilai_hps', 'label'=>'Nilai HPS', 'rules'=>'required' ), array( 'field'=>'id_material', 'rules'=>'' ),array( 'field'=>'is_catalogue', 'rules'=>'' ), ); $this->form_validation->set_rules($vld); if($this->input->post('simpan')){ if($this->form_validation->run()==TRUE){ $form['id_procurement'] = $id; $form['nama_barang'] = $this->input->post('nama_barang'); $form['nilai_hps'] = preg_replace("/[,]/", "", $this->input->post('nilai_hps')); $form['id_kurs'] = $this->input->post('id_kurs'); $form['id_material'] = $this->input->post('id_material'); $form['is_catalogue'] = $this->input->post('is_catalogue'); $form['entry_stamp'] = date('Y-m-d H:i:s'); $result = $this->am->save_barang($form); if($result){ $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menambah Barang / Jasa!</p>'); redirect(site_url('auction/ubah/'.$id.'/barang')); } } } $kurs_list = $this->am->get_procurement_kurs($id,'', NULL, '','',FALSE); $where_in = array(); foreach ($kurs_list as $key => $value) { $where_in[] = $value['id_kurs']; } $data['id_kurs'] = $this->am->get_kurs_barang($where_in); $layout['menu'] = $this->am->get_auction_list(); $layout['content'] = $this->load->view('tab/tambah_barang',$data,TRUE); $layout['script'] = $this->load->view('tab/tambah_barang_js',$data,TRUE); $item['header'] = $this->load->view('header',$admin,TRUE); $item['content'] = $this->load->view('dashboard',$layout,TRUE); $this->load->view('template',$item); } public function edit_barang($id,$id_procurement){ $form = ($this->session->userdata('form'))?$this->session->userdata('form'):array(); $fill = $this->securities->clean_input($_POST,'save'); $item = $vld = $save_data = array(); $admin = $this->session->userdata('admin'); $data = $this->am->get_barang_data($id); $vld = array( array( 'field'=>'nama_barang', 'label'=>'Nama Barang', 'rules'=>'required' ), array( 'field'=>'id_kurs', 'label'=>'Mata Uang', 'rules'=>'required' ), array( 'field'=>'nilai_hps', 'label'=>'Nilai HPS', 'rules'=>'required' ), ); $this->form_validation->set_rules($vld); if($this->input->post('simpan')){ if($this->form_validation->run()==TRUE){ $form['nama_barang'] = $this->input->post('nama_barang'); $form['nilai_hps'] = preg_replace("/[,]/", "", $this->input->post('nilai_hps')); $form['id_kurs'] = $this->input->post('id_kurs'); $form['entry_stamp'] = date('Y-m-d H:i:s'); $result = $this->am->edit_barang($form,$id); if($result){ $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menambah Barang / Jasa!</p>'); redirect(site_url('auction/ubah/'.$id_procurement.'/barang')); } } } $kurs_list = $this->am->get_procurement_kurs($id_procurement,'', NULL, '','',FALSE); $where_in = array(); foreach ($kurs_list as $key => $value) { $where_in[] = $value['id_kurs']; } $data['kurs'] = $this->am->get_kurs_barang($where_in); $layout['menu'] = $this->am->get_auction_list(); $layout['content'] = $this->load->view('tab/edit_barang',$data,TRUE); $item['header'] = $this->load->view('header',$admin,TRUE); $item['content'] = $this->load->view('dashboard',$layout,TRUE); $this->load->view('template',$item); } public function hapus_barang($id,$id_procurement){ if($this->am->hapus($id,'ms_procurement_barang')){ $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menghapus data!</p>'); redirect(site_url('auction/ubah/'.$id_procurement.'/barang')); }else{ $this->session->set_flashdata('msgSuccess','<p class="msgError">Gagal menghapus data!</p>'); redirect(site_url('auction/ubah/'.$id_procurement.'/barang')); } } //--------------------- // PESERTA //--------------------- public function peserta($id,$page){ $data['sort'] = $this->utility->generateSort(array('name')); $data['tabNav'] = $this->tabNav; $data['id'] = $id; $per_page = 10; $data['pagination'] = $this->utility->generate_page('auction/view/'.$id.'/'.$page,$data['sort'], $per_page, $this->am->get_procurement_peserta($id,'', $data['sort'], '','',FALSE)); $data['list'] = $this->am->get_procurement_peserta($id,'', $data['sort'], '','',FALSE); return $this->load->view('tab/peserta',$data,TRUE); } public function tambah_peserta($id){ $fill = $this->securities->clean_input($_POST,'save'); if($this->input->post('id_vendor')){ $form['id_proc'] = $id; $form['id_vendor'] = $this->input->post('id_vendor'); $form['entry_stamp'] = date('Y-m-d H:i:s'); $result = $this->am->save_peserta($form); if($result){ $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menambah peserta!</p>'); } } redirect(site_url('auction/ubah/'.$id.'/peserta')); } public function hapus_peserta($id,$id_procurement){ if($this->am->hapus($id,'ms_procurement_peserta')){ $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menghapus data!</p>'); redirect(site_url('auction/ubah/'.$id_procurement.'/peserta')); }else{ $this->session->set_flashdata('msgSuccess','<p class="msgError">Gagal menghapus data!</p>'); redirect(site_url('auction/ubah/'.$id_procurement.'/peserta')); } } //--------------------- // KURS //--------------------- public function kurs($id,$page){ $data['sort'] = $this->utility->generateSort(array('name')); $data['tabNav'] = $this->tabNav; $data['id'] = $id; $per_page = 10; $data['pagination'] = $this->utility->generate_page('auction/view/'.$id.'/'.$page,$data['sort'], $per_page, $this->am->get_procurement_peserta($id,'', $data['sort'], '','',FALSE)); $data['list'] = $this->am->get_procurement_kurs($id,'', $data['sort'], '','',FALSE); // echo print_r($data['list']); return $this->load->view('tab/kurs',$data,TRUE); } public function tambah_kurs($id){ $form = ($this->session->userdata('form'))?$this->session->userdata('form'):array(); $fill = $this->securities->clean_input($_POST,'save'); $item = $vld = $save_data = array(); $admin = $this->session->userdata('admin'); $vld = array( array( 'field'=>'id_kurs', 'label'=>'Nama kurs', 'rules'=>'required' ), ); if($this->input->post('id_kurs')!='1'){ $vld[] = array( 'field'=>'rate', 'label'=>'Rate', 'rules'=>'required' ); } $this->form_validation->set_rules($vld); if($this->input->post('simpan')){ if($this->form_validation->run()==TRUE){ $form['id_procurement'] = $id; $form['id_kurs'] = $this->input->post('id_kurs'); $form['rate'] = ($this->input->post('id_kurs')=='1') ? 1:$this->input->post('rate'); $form['entry_stamp'] = date('Y-m-d H:i:s'); $result = $this->am->save_kurs($form); if($result){ $this->session->unset_userdata('form'); $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menambah kurs!</p>'); redirect(site_url('auction/ubah/'.$id.'/kurs')); } } } $kurs_list = $this->am->get_procurement_kurs($id,'', NULL, '','',FALSE); $where_in = array(); foreach ($kurs_list as $key => $value) { $where_in[] = $value['id_kurs']; } $data['kurs'] = $this->am->get_kurs_list($where_in); $layout['menu'] = $this->am->get_auction_list(); $layout['content'] = $this->load->view('tab/tambah_kurs',$data,TRUE); $layout['script'] = $this->load->view('content_js',$data,TRUE); $item['header'] = $this->load->view('header',$admin,TRUE); $item['content'] = $this->load->view('dashboard',$layout,TRUE); $this->load->view('template',$item); } public function hapus_kurs($id,$id_procurement){ if($this->am->hapus($id,'ms_procurement_kurs')){ $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menghapus data!</p>'); redirect(site_url('auction/ubah/'.$id_procurement.'/kurs')); }else{ $this->session->set_flashdata('msgSuccess','<p class="msgError">Gagal menghapus data!</p>'); redirect(site_url('auction/ubah/'.$id_procurement.'/kurs')); } } //--------------------- // PERSYARATAN //--------------------- public function persyaratan($id,$page){ $check = $this->am->get_persyaratan($id); // echo print_r($check); if (!empty($check)){ $form = ($this->session->userdata('form'))?$this->session->userdata('form'):array(); $fill = $this->securities->clean_input($_POST,'save'); $item = $vld = $save_data = array(); $admin = $this->session->userdata('admin'); $vld = array( array( 'field'=>'description', 'label'=>'Description', 'rules'=>'required' ), ); $this->form_validation->set_rules($vld); if($this->input->post('update')){ if($this->form_validation->run()==TRUE){ $form['id_proc'] = $id; $form['description'] = $_POST['description']; $form['edit_stamp'] = date('Y-m-d H:i:s'); unset($_POST['update']); $result = $this->am->edit_persyaratan($id, $form);; if($result){ $this->session->unset_userdata('form'); $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses mengubah persyaratan!</p>'); // redirect(site_url('auction/view/'.$id.'/persyaratan')); } }else{ echo validation_errors(); } } $data = $this->am->get_procurement_persyaratan($id); $data['tabNav'] = $this->tabNav; $data['id'] = $id; return $this->load->view('tab/persyaratan',$data,TRUE); }else{ redirect(site_url('auction/ubah/'.$id.'/tambah_persyaratan/')); } $data['tabNav'] = $this->tabNav; $data['id'] = $id; return $this->load->view('tab/persyaratan',$data,TRUE); } public function tambah_persyaratan($id,$page){ $check = $this->am->get_persyaratan($id); // echo print_r($check); if (empty($check)){ $form = ($this->session->userdata('form'))?$this->session->userdata('form'):array(); $fill = $this->securities->clean_input($_POST,'save'); $item = $vld = $save_data = array(); $admin = $this->session->userdata('admin'); $vld = array( array( 'field'=>'description', 'label'=>'Description', 'rules'=>'required' ), ); $this->form_validation->set_rules($vld); if($this->input->post('simpan')){ if($this->form_validation->run()==TRUE){ $_POST['id_proc'] = $id; $_POST['description'] = $this->input->post('description'); $_POST['entry_stamp'] = date('Y-m-d H:i:s'); $result = $this->am->save_persyaratan($this->input->post()); if($result){ $this->session->unset_userdata('form'); $this->session->set_flashdata('msgSuccess','<p class="msgSuccess">Sukses menambah persyaratan!</p>'); redirect(site_url('auction/ubah/'.$id.'/persyaratan')); } }else{ echo validation_errors(); } } $data['tabNav'] = $this->tabNav; $data['id'] = $id; return $this->load->view('tab/tambah_persyaratan',$data,TRUE); }else{ redirect(site_url('auction/ubah/'.$id.'/persyaratan/')); } } function set_syarat($id_lelang = '', $is_edit = false){ $master = $this->am->get_auction($id_lelang); if($master['auction_type'] == "reverse_auction"){ $limit = "minimum"; $indicator = "rendah"; $reverse = "tinggi"; } else if($master['auction_type'] == "forward_auction"){ $limit = "maximum"; $indicator = "tinggi"; $reverse = "rendah"; } $value = ' <ol> <li>Harga penawaran sudah termasuk pajak-pajak.</li> <li>Durasi auction selama '.$master['auction_duration'].' menit, tanpa ada penambahan waktu.</li> <li>'; if($master['metode_auction'] == "posisi") $value .= 'Metode auction menggunakan metode posisi/rangking, dimana para peserta e-auction hanya mengetahui posisi/rangking dari penawaran harga yang telah dimasukkan dibandingkan dengan penawaran harga peserta e-auction lainnya.'; if($master['metode_auction'] == "indikator") $value .= 'Metode auction menggunakan metode indikator, dimana para peserta e-auction akan diberikan indikator terhadap penawaran harga yang telah dimasukan, dibandingkan dengan penawaran harga peserta e-auction lainnya.'; $value .= '</li> <li>Tidak ada batas harga penawaran '.$limit.' yang dapat dimasukkan.</li> <li>Harga penawaran yang dimasukkan tidak boleh sama atau lebih '.$reverse.' dari harga penawaran yang telah dimasukkan sebelumnya.</li> <li>'; if($master['metode_auction'] == "posisi") $value .= 'Apabila terdapat penawaran harga yang sama, maka posisi/rangking yang lebih tinggi akan diberikan kepada penawar harga te'.$indicator.' yang masuk terlebih dahulu'; if($master['metode_auction'] == "indikator") $value .= 'Apabila terdapat penawaran harga yang sama, maka indikator lambang medali akan diberikan kepada penawar harga te'.$indicator.' yang masuk terlebih dahulu'; $value .= '</li> <li>Selama auction berlangsung, peserta tidak diperkenankan menggunakan tombol Back (backspace) dan Refresh (F5). </li> <li>Selama auction berlangsung, para peserta dilarang saling berkomunikasi dan dilarang menggunakan alat komunikasi apapun.</li> <li>Seluruh peserta auction wajib menjaga ketertiban.</li> </ol>'; $param = array( 'description'=>$value, 'id_proc'=>$id_lelang, 'entry_stamp'=>date("Y-m-d H:i:s") ); if($is_edit) $this->am->edit_persyaratan($param); else $this->am->save_persyaratan($param); } }
muarif/regas
application/modules/auction/controllers/auction.php
PHP
mit
28,463
/*! * \file * \brief Class module::Decoder_turbo. */ #ifndef DECODER_TURBO_HPP_ #define DECODER_TURBO_HPP_ #include <vector> #include <memory> #include <mipp.h> #include "Tools/Code/Turbo/Post_processing_SISO/Post_processing_SISO.hpp" #include "Module/Interleaver/Interleaver.hpp" #include "Module/Decoder/Decoder_SIHO.hpp" #include "Module/Decoder/Decoder_SISO.hpp" namespace aff3ct { namespace module { template <typename B = int, typename R = float> class Decoder_turbo : public Decoder_SIHO<B,R> { protected: const int n_ite; // number of iterations const bool buffered_encoding; std::shared_ptr<Interleaver<R>> pi; std::shared_ptr<Decoder_SISO<B,R>> siso_n; std::shared_ptr<Decoder_SISO<B,R>> siso_i; mipp::vector<R> l_sn; // systematic LLRs in the natural domain mipp::vector<R> l_si; // systematic LLRs in the interleaved domain mipp::vector<R> l_sen; // systematic LLRs + extrinsic LLRs in the natural domain mipp::vector<R> l_sei; // systematic LLRs + extrinsic LLRs in the interleaved domain mipp::vector<R> l_pn; // parity LLRs in the natural domain mipp::vector<R> l_pi; // parity LLRs in the interleaved domain mipp::vector<R> l_e1n; // extrinsic LLRs in the natural domain mipp::vector<R> l_e2n; // extrinsic LLRs in the natural domain mipp::vector<R> l_e1i; // extrinsic LLRs in the interleaved domain mipp::vector<R> l_e2i; // extrinsic LLRs in the interleaved domain mipp::vector<B> s; // bit decision std::vector<std::shared_ptr<tools::Post_processing_SISO<B,R>>> post_processings; public: Decoder_turbo(const int& K, const int& N, const int& n_ite, const Decoder_SISO<B,R> &siso_n, const Decoder_SISO<B,R> &siso_i, const Interleaver<R> &pi, const bool buffered_encoding = true); virtual ~Decoder_turbo() = default; virtual Decoder_turbo<B,R>* clone() const; void add_post_processing(const tools::Post_processing_SISO<B,R> &post_processing); virtual void set_n_frames(const size_t n_frames); protected: virtual void deep_copy(const Decoder_turbo<B,R> &m); virtual void _load (const R *Y_N, const size_t frame_id); virtual void _store( B *V_K ) const; private: void buffered_load(const R *Y_N, const size_t frame_id); void standard_load(const R *Y_N, const size_t frame_id); }; } } #endif /* DECODER_TURBO_HPP_ */
aff3ct/aff3ct
include/Module/Decoder/Turbo/Decoder_turbo.hpp
C++
mit
2,569
<?xml version="1.0" ?><!DOCTYPE TS><TS language="it" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About MyBroCoin</source> <translation>Info su MyBroCoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;MyBroCoin&lt;/b&gt; version</source> <translation>Versione di &lt;b&gt;MyBroCoin&lt;/b&gt;</translation> </message> <message> <location line="+57"/> <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> Questo è un software sperimentale. Distribuito sotto la licenza software MIT/X11, vedi il file COPYING incluso oppure su http://www.opensource.org/licenses/mit-license.php. Questo prodotto include software sviluppato dal progetto OpenSSL per l&apos;uso del Toolkit OpenSSL (http://www.openssl.org/), software crittografico scritto da Eric Young (eay@cryptsoft.com) e software UPnP scritto da Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Copyright</translation> </message> <message> <location line="+0"/> <source>The MyBroCoin developers</source> <translation>Sviluppatori di MyBroCoin</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Rubrica</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Fai doppio click per modificare o cancellare l&apos;etichetta</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Crea un nuovo indirizzo</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copia l&apos;indirizzo attualmente selezionato nella clipboard</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Nuovo indirizzo</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your MyBroCoin 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>Questi sono i tuoi indirizzi MyBroCoin per ricevere pagamenti. Potrai darne uno diverso ad ognuno per tenere così traccia di chi ti sta pagando.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Copia l&apos;indirizzo</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Mostra il codice &amp;QR</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a MyBroCoin address</source> <translation>Firma un messaggio per dimostrare di possedere questo indirizzo</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Firma il &amp;messaggio</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Cancella l&apos;indirizzo attualmente selezionato dalla lista</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Esporta i dati nella tabella corrente su un file</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Esporta...</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified MyBroCoin address</source> <translation>Verifica un messaggio per accertarsi che sia firmato con un indirizzo MyBroCoin specifico</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Verifica Messaggio</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Cancella</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your MyBroCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Copia &amp;l&apos;etichetta</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Modifica</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Invia &amp;MyBroCoin</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Esporta gli indirizzi della rubrica</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Testo CSV (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Errore nell&apos;esportazione</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Impossibile scrivere sul file %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Etichetta</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Indirizzo</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(nessuna etichetta)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Finestra passphrase</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Inserisci la passphrase</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nuova passphrase</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Ripeti la passphrase</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <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>Inserisci la passphrase per il portamonete.&lt;br/&gt;Per piacere usare unapassphrase di &lt;b&gt;10 o più caratteri casuali&lt;/b&gt;, o &lt;b&gt;otto o più parole&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Cifra il portamonete</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Quest&apos;operazione necessita della passphrase per sbloccare il portamonete.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Sblocca il portamonete</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Quest&apos;operazione necessita della passphrase per decifrare il portamonete,</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Decifra il portamonete</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Cambia la passphrase</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Inserisci la vecchia e la nuova passphrase per il portamonete.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Conferma la cifratura del portamonete</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 LITECOINS&lt;/b&gt;!</source> <translation>Attenzione: se si cifra il portamonete e si perde la frase d&apos;ordine, &lt;b&gt;SI PERDERANNO TUTTI I PROPRI LITECOIN&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Si è sicuri di voler cifrare il portamonete?</translation> </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>IMPORTANTE: qualsiasi backup del portafoglio effettuato precedentemente dovrebbe essere sostituito con il file del portafoglio criptato appena generato. Per ragioni di sicurezza, i backup precedenti del file del portafoglio non criptato diventeranno inservibili non appena si inizi ad usare il nuovo portafoglio criptato.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Attenzione: tasto Blocco maiuscole attivo.</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Portamonete cifrato</translation> </message> <message> <location line="-56"/> <source>MyBroCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your mariobroscoins from being stolen by malware infecting your computer.</source> <translation>MyBroCoin verrà ora chiuso per finire il processo di crittazione. Ricorda che criptare il tuo portamonete non può fornire una protezione totale contro furti causati da malware che dovessero infettare il tuo computer.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Cifratura del portamonete fallita</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Cifratura del portamonete fallita a causa di un errore interno. Il portamonete non è stato cifrato.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Le passphrase inserite non corrispondono.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Sblocco del portamonete fallito</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>La passphrase inserita per la decifrazione del portamonete è errata.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Decifrazione del portamonete fallita</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Passphrase del portamonete modificata con successo.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>Firma il &amp;messaggio...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Sto sincronizzando con la rete...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Sintesi</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Mostra lo stato generale del portamonete</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transazioni</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Cerca nelle transazioni</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Modifica la lista degli indirizzi salvati e delle etichette</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Mostra la lista di indirizzi su cui ricevere pagamenti</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>&amp;Esci</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Chiudi applicazione</translation> </message> <message> <location line="+4"/> <source>Show information about MyBroCoin</source> <translation>Mostra informazioni su MyBroCoin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Informazioni su &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Mostra informazioni su Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Opzioni...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Cifra il portamonete...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Backup Portamonete...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Cambia la passphrase...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Importa blocchi dal disco...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Re-indicizzazione blocchi su disco...</translation> </message> <message> <location line="-347"/> <source>Send coins to a MyBroCoin address</source> <translation>Invia monete ad un indirizzo mariobroscoin</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for MyBroCoin</source> <translation>Modifica configurazione opzioni per mariobroscoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Backup portamonete in un&apos;altra locazione</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Cambia la passphrase per la cifratura del portamonete</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>Finestra &amp;Debug</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Apri la console di degugging e diagnostica</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Verifica messaggio...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>MyBroCoin</source> <translation>MyBroCoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Portamonete</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Spedisci</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Ricevi</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Indirizzi</translation> </message> <message> <location line="+22"/> <source>&amp;About MyBroCoin</source> <translation>&amp;Info su MyBroCoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Mostra/Nascondi</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Mostra o nascondi la Finestra principale</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Crittografa le chiavi private che appartengono al tuo portafoglio</translation> </message> <message> <location line="+7"/> <source>Sign messages with your MyBroCoin addresses to prove you own them</source> <translation>Firma i messaggi con il tuo indirizzo MyBroCoin per dimostrare di possederli</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified MyBroCoin addresses</source> <translation>Verifica i messaggi per accertarsi che siano stati firmati con gli indirizzi MyBroCoin specificati</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;File</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Impostazioni</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Aiuto</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Barra degli strumenti &quot;Tabs&quot;</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>MyBroCoin client</source> <translation>MyBroCoin client</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to MyBroCoin network</source> <translation><numerusform>%n connessione attiva alla rete MyBroCoin</numerusform><numerusform>%n connessioni attive alla rete MyBroCoin</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>Processati %1 di %2 (circa) blocchi della cronologia transazioni.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Processati %1 blocchi della cronologia transazioni.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n ora</numerusform><numerusform>%n ore</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n giorno</numerusform><numerusform>%n giorni</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n settimana</numerusform><numerusform>%n settimane</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>L&apos;ultimo blocco ricevuto è stato generato %1 fa.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation>Errore</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Attenzione</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Informazione</translation> </message> <message> <location line="+70"/> <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>Questa transazione è superiore al limite di dimensione. È comunque possibile inviarla con una commissione di %1, che va ai nodi che processano la tua transazione e contribuisce a sostenere la rete. Vuoi pagare la commissione?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Aggiornato</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>In aggiornamento...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Conferma compenso transazione</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Transazione inviata</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Transazione ricevuta</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Data: %1 Quantità: %2 Tipo: %3 Indirizzo: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>Gestione URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid MyBroCoin address or malformed URI parameters.</source> <translation>Impossibile interpretare l&apos;URI! Ciò può essere causato da un indirizzo MyBroCoin invalido o da parametri URI non corretti.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Il portamonete è &lt;b&gt;cifrato&lt;/b&gt; e attualmente &lt;b&gt;sbloccato&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Il portamonete è &lt;b&gt;cifrato&lt;/b&gt; e attualmente &lt;b&gt;bloccato&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. MyBroCoin can no longer continue safely and will quit.</source> <translation>Riscontrato un errore irreversibile. MyBroCoin non può più continuare in sicurezza e verrà terminato.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Avviso di rete</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Modifica l&apos;indirizzo</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Etichetta</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>L&apos;etichetta associata a questo indirizzo nella rubrica</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Indirizzo</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>L&apos;indirizzo associato a questa voce della rubrica. Si può modificare solo negli indirizzi di spedizione.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Nuovo indirizzo di ricezione</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nuovo indirizzo d&apos;invio</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Modifica indirizzo di ricezione</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Modifica indirizzo d&apos;invio</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>L&apos;indirizzo inserito &quot;%1&quot; è già in rubrica.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid MyBroCoin address.</source> <translation>L&apos;indirizzo inserito &quot;%1&quot; non è un indirizzo mariobroscoin valido.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Impossibile sbloccare il portamonete.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Generazione della nuova chiave non riuscita.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>MyBroCoin-Qt</source> <translation>MyBroCoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>versione</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Utilizzo:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>opzioni riga di comando</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>UI opzioni</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Imposta lingua, ad esempio &quot;it_IT&quot; (predefinita: lingua di sistema)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Parti in icona </translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Mostra finestra di presentazione all&apos;avvio (default: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Opzioni</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Principale</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.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Paga la &amp;commissione</translation> </message> <message> <location line="+31"/> <source>Automatically start MyBroCoin after logging in to the system.</source> <translation>Avvia automaticamente MyBroCoin all&apos;accensione del computer</translation> </message> <message> <location line="+3"/> <source>&amp;Start MyBroCoin on system login</source> <translation>&amp;Fai partire MyBroCoin all&apos;avvio del sistema</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Ripristina tutte le opzioni del client alle predefinite.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Ripristina Opzioni</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>Rete</translation> </message> <message> <location line="+6"/> <source>Automatically open the MyBroCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Apri automaticamente la porta del client MyBroCoin sul router. Questo funziona solo se il router supporta UPnP ed è abilitato.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mappa le porte tramite l&apos;&amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the MyBroCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Connettiti alla rete Bitcon attraverso un proxy SOCKS (ad esempio quando ci si collega via Tor)</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Collegati tramite SOCKS proxy:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP del proxy:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>Indirizzo IP del proxy (ad esempio 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Porta:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Porta del proxy (es. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Version:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versione SOCKS del proxy (es. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Finestra</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Mostra solo un&apos;icona nel tray quando si minimizza la finestra</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizza sul tray invece che sulla barra delle applicazioni</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>Riduci ad icona, invece di uscire dall&apos;applicazione quando la finestra viene chiusa. Quando questa opzione è attivata, l&apos;applicazione verrà chiusa solo dopo aver selezionato Esci nel menu.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimizza alla chiusura</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Mostra</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Lingua Interfaccia Utente:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting MyBroCoin.</source> <translation>La lingua dell&apos;interfaccia utente può essere impostata qui. L&apos;impostazione avrà effetto dopo il riavvio di MyBroCoin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unità di misura degli importi in:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Scegli l&apos;unità di suddivisione di default per l&apos;interfaccia e per l&apos;invio di monete</translation> </message> <message> <location line="+9"/> <source>Whether to show MyBroCoin addresses in the transaction list or not.</source> <translation>Se mostrare l&apos;indirizzo MyBroCoin nella transazione o meno.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Mostra gli indirizzi nella lista delle transazioni</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancella</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Applica</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>default</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Conferma ripristino opzioni</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>Alcune modifiche necessitano del riavvio del programma per essere salvate.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>Vuoi procedere?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Attenzione</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting MyBroCoin.</source> <translation>L&apos;impostazione avrà effetto dopo il riavvio di MyBroCoin.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>L&apos;indirizzo proxy che hai fornito è invalido.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Modulo</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the MyBroCoin network after a connection is established, but this process has not completed yet.</source> <translation>Le informazioni visualizzate sono datate. Il tuo partafogli verrà sincronizzato automaticamente con il network MyBroCoin dopo che la connessione è stabilita, ma questo processo non può essere completato ora.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Saldo</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Non confermato:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Portamonete</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Immaturo:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Importo scavato che non è ancora maturato</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transazioni recenti&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Saldo attuale</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Totale delle transazioni in corso di conferma, che non sono ancora incluse nel saldo attuale</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>fuori sincrono</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start mariobroscoin: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Codice QR di dialogo</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Richiedi pagamento</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Importo:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Etichetta:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Messaggio:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Salva come...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Errore nella codifica URI nel codice QR</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>L&apos;importo specificato non è valido, prego verificare.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>L&apos;URI risulta troppo lungo, prova a ridurre il testo nell&apos;etichetta / messaggio.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Salva codice QR</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>Immagini PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nome del client</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="+339"/> <source>N/A</source> <translation>N/D</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Versione client</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informazione</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Versione OpenSSL in uso</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Tempo di avvio</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Rete</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Numero connessioni</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Nel testnet</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Block chain</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Numero attuale di blocchi</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Numero totale stimato di blocchi</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Ora dell blocco piu recente</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Apri</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>opzioni riga di comando</translation> </message> <message> <location line="+7"/> <source>Show the MyBroCoin-Qt help message to get a list with possible MyBroCoin command-line options.</source> <translation>Mostra il messaggio di aiuto di MyBroCoin-QT per avere la lista di tutte le opzioni della riga di comando di MyBroCoin.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Mostra</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Console</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Data di creazione</translation> </message> <message> <location line="-104"/> <source>MyBroCoin - Debug window</source> <translation>MyBroCoin - Finestra debug</translation> </message> <message> <location line="+25"/> <source>MyBroCoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>File log del Debug</translation> </message> <message> <location line="+7"/> <source>Open the MyBroCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Apri il file di log del debug di MyBroCoin dalla cartella attuale. Può richiedere alcuni secondi per file di log grandi.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Svuota console</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the MyBroCoin RPC console.</source> <translation>Benvenuto nella console RPC di MyBroCoin</translation> </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>Usa le frecce direzionali per navigare la cronologia, and &lt;b&gt;Ctrl-L&lt;/b&gt; per cancellarla.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Scrivi &lt;b&gt;help&lt;/b&gt; per un riassunto dei comandi disponibili</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Spedisci MyBroCoin</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Spedisci a diversi beneficiari in una volta sola</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>&amp;Aggiungi beneficiario</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Rimuovi tutti i campi della transazione</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Cancella &amp;tutto</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123,456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Conferma la spedizione</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Spedisci</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Conferma la spedizione di mariobroscoin</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Si è sicuri di voler spedire %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> e </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>L&apos;indirizzo del beneficiario non è valido, per cortesia controlla.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>L&apos;importo da pagare dev&apos;essere maggiore di 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>L&apos;importo è superiore al saldo attuale</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Il totale è superiore al saldo attuale includendo la commissione %1.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Trovato un indirizzo doppio, si può spedire solo una volta a ciascun indirizzo in una singola operazione.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Errore: Creazione transazione fallita!</translation> </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>Errore: la transazione è stata rifiutata. Ciò accade se alcuni mariobroscoin nel portamonete sono stati già spesi, ad esempio se è stata usata una copia del file wallet.dat e i mariobroscoin sono stati spesi dalla copia ma non segnati come spesi qui.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Modulo</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Importo:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Paga &amp;a:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>L&apos;indirizzo del beneficiario a cui inviare il pagamento (ad esempio Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Inserisci un&apos;etichetta per questo indirizzo, per aggiungerlo nella rubrica</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Etichetta</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Scegli l&apos;indirizzo dalla rubrica</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Incollare l&apos;indirizzo dagli appunti</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>Rimuovere questo beneficiario</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a MyBroCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Inserisci un indirizzo MyBroCoin (ad esempio Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Firme - Firma / Verifica un messaggio</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Firma il messaggio</translation> </message> <message> <location line="+6"/> <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>Puoi firmare messeggi con i tuoi indirizzi per dimostrare che sono tuoi. Fai attenzione a non firmare niente di vago, visto che gli attacchi di phishing potrebbero cercare di spingerti a mettere la tua firma su di loro. Firma solo dichiarazioni completamente dettagliate con cui sei d&apos;accordo.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Inserisci un indirizzo MyBroCoin (ad esempio Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Scegli l&apos;indirizzo dalla rubrica</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>Incollare l&apos;indirizzo dagli appunti</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Inserisci qui il messaggio che vuoi firmare</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Firma</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Copia la firma corrente nella clipboard</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this MyBroCoin address</source> <translation>Firma un messaggio per dimostrare di possedere questo indirizzo</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Firma &amp;messaggio</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Reimposta tutti i campi della firma</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Cancella &amp;tutto</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Verifica Messaggio</translation> </message> <message> <location line="+6"/> <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. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Inserisci un indirizzo MyBroCoin (ad esempio Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified MyBroCoin address</source> <translation>Verifica il messaggio per assicurarsi che sia stato firmato con l&apos;indirizzo MyBroCoin specificato</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>&amp;Verifica Messaggio</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Reimposta tutti i campi della verifica messaggio</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a MyBroCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Inserisci un indirizzo MyBroCoin (ad esempio Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Clicca &quot;Firma il messaggio&quot; per ottenere la firma</translation> </message> <message> <location line="+3"/> <source>Enter MyBroCoin signature</source> <translation>Inserisci firma MyBroCoin</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>L&apos;indirizzo inserito non è valido.</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>Per favore controlla l&apos;indirizzo e prova ancora</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>L&apos;indirizzo mariobroscoin inserito non è associato a nessuna chiave.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Sblocco del portafoglio annullato.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>La chiave privata per l&apos;indirizzo inserito non è disponibile.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Firma messaggio fallita.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Messaggio firmato.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Non è stato possibile decodificare la firma.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Per favore controlla la firma e prova ancora.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>La firma non corrisponde al sunto del messaggio.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Verifica messaggio fallita.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Messaggio verificato.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The MyBroCoin developers</source> <translation>Sviluppatori di MyBroCoin</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Aperto fino a %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/offline</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/non confermato</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 conferme</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Stato</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, trasmesso attraverso %n nodo</numerusform><numerusform>, trasmesso attraverso %n nodi</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Sorgente</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Generato</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Da</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>A</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>proprio indirizzo</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>etichetta</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Credito</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>matura in %n ulteriore blocco</numerusform><numerusform>matura in altri %n blocchi</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>non accettate</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Debito</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Tranzakciós díj</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Importo netto</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Messaggio</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Commento</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID della transazione</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 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>Bisogna attendere 120 blocchi prima di spendere I mariobroscoin generati. Quando è stato generato questo blocco, è stato trasmesso alla rete per aggiungerlo alla catena di blocchi. Se non riesce a entrare nella catena, verrà modificato in &quot;non accettato&quot; e non sarà spendibile. Questo può accadere a volte, se un altro nodo genera un blocco entro pochi secondi del tuo.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informazione di debug</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transazione</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Input</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Importo</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>vero</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>falso</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, non è stato ancora trasmesso con successo</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Aperto per %n altro blocco</numerusform><numerusform>Aperto per altri %n blocchi</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>sconosciuto</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Dettagli sulla transazione</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Questo pannello mostra una descrizione dettagliata della transazione</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Indirizzo</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Importo</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Aperto per %n altro blocco</numerusform><numerusform>Aperto per altri %n blocchi</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Aperto fino a %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Offline (%1 conferme)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Non confermati (%1 su %2 conferme)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Confermato (%1 conferme)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>Il saldo generato sarà disponibile quando maturerà in %n altro blocco</numerusform><numerusform>Il saldo generato sarà disponibile quando maturerà in altri %n blocchi</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Questo blocco non è stato ricevuto da altri nodi e probabilmente non sarà accettato!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generati, ma non accettati</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Ricevuto tramite</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Ricevuto da</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Spedito a</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pagamento a te stesso</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Ottenuto dal mining</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(N / a)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Stato della transazione. Passare con il mouse su questo campo per vedere il numero di conferme.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Data e ora in cui la transazione è stata ricevuta.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Tipo di transazione.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Indirizzo di destinazione della transazione.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Importo rimosso o aggiunto al saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Tutti</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Oggi</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Questa settimana</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Questo mese</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Il mese scorso</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Quest&apos;anno</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervallo...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Ricevuto tramite</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Spedito a</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>A te</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Ottenuto dal mining</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Altro</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Inserisci un indirizzo o un&apos;etichetta da cercare</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Importo minimo</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copia l&apos;indirizzo</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copia l&apos;etichetta</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copia l&apos;importo</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Modifica l&apos;etichetta</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Mostra i dettagli della transazione</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Esporta i dati della transazione</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Testo CSV (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confermato</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Etichetta</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Indirizzo</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Importo</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Errore nell&apos;esportazione</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Impossibile scrivere sul file %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervallo:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>a</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Spedisci MyBroCoin</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Esporta i dati nella tabella corrente su un file</translation> </message> <message> <location line="+193"/> <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>Backup fallito</translation> </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> <location line="+4"/> <source>Backup Successful</source> <translation>Backup eseguito con successo</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Il portafoglio è stato correttamente salvato nella nuova cartella.</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>MyBroCoin version</source> <translation>Versione di MyBroCoin</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Utilizzo:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or mariobroscoind</source> <translation>Manda il comando a -server o mariobroscoind </translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Lista comandi </translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Aiuto su un comando </translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Opzioni: </translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: mariobroscoin.conf)</source> <translation>Specifica il file di configurazione (di default: mariobroscoin.conf) </translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: mariobroscoind.pid)</source> <translation>Specifica il file pid (default: mariobroscoind.pid) </translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Specifica la cartella dati </translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Imposta la dimensione cache del database in megabyte (default: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation>Ascolta le connessioni JSON-RPC su &lt;porta&gt; (default: 9333 o testnet: 19333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Mantieni al massimo &lt;n&gt; connessioni ai peer (default: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Connessione ad un nodo per ricevere l&apos;indirizzo del peer, e disconnessione</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Specifica il tuo indirizzo pubblico</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Soglia di disconnessione dei peer di cattiva qualità (default: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Numero di secondi di sospensione che i peer di cattiva qualità devono trascorrere prima di riconnettersi (default: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Errore riscontrato durante l&apos;impostazione della porta RPC %u per l&apos;ascolto su IPv4: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation>Attendi le connessioni JSON-RPC su &lt;porta&gt; (default: 9332 or testnet: 19332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Accetta da linea di comando e da comandi JSON-RPC </translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Esegui in background come demone e accetta i comandi </translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Utilizza la rete di prova </translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accetta connessioni dall&apos;esterno (default: 1 se no -proxy o -connect)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=mariobroscoinrpc 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;MyBroCoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Errore riscontrato durante l&apos;impostazione della porta RPC %u per l&apos;ascolto su IPv6, tornando su IPv4: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Collega all&apos;indirizzo indicato e resta sempre in ascolto su questo. Usa la notazione [host]:porta per l&apos;IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. MyBroCoin is probably already running.</source> <translation>Non è possibile ottenere i dati sulla cartella %s. Probabilmente MyBroCoin è già in esecuzione.</translation> </message> <message> <location line="+3"/> <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>Errore: la transazione è stata rifiutata. Ciò accade se alcuni mariobroscoin nel portamonete sono stati già spesi, ad esempio se è stata usata una copia del file wallet.dat e i mariobroscoin sono stati spesi dalla copia ma non segnati come spesi qui.</translation> </message> <message> <location line="+4"/> <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>Errore: questa transazione necessita di una commissione di almeno %s a causa del suo ammontare, della sua complessità, o dell&apos;uso di fondi recentemente ricevuti!</translation> </message> <message> <location line="+3"/> <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>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Esegui comando quando una transazione del portafoglio cambia (%s in cmd è sostituito da TxID)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Imposta dimensione massima delle transazioni ad alta priorità/bassa-tassa in bytes (predefinito: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Questa versione è una compilazione pre-rilascio - usala a tuo rischio - non utilizzarla per la generazione o per applicazioni di commercio</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Attenzione: -paytxfee è molto alta. Questa è la commissione che si paga quando si invia una transazione.</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Attenzione: le transazioni mostrate potrebbero essere sbagliate! Potresti aver bisogno di aggiornare, o altri nodi ne hanno bisogno.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong MyBroCoin will not work properly.</source> <translation>Attenzione: si prega di controllare che la data del computer e l&apos;ora siano corrette. Se il vostro orologio è sbagliato MyBroCoin non funziona correttamente.</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Attenzione: errore di lettura di wallet.dat! Tutte le chiave lette correttamente, ma i dati delle transazioni o le voci in rubrica potrebbero mancare o non essere corretti.</translation> </message> <message> <location line="+3"/> <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>Attenzione: wallet.dat corrotto, dati salvati! Il wallet.dat originale salvato come wallet.{timestamp}.bak in %s; se il tuo bilancio o le transazioni non sono corrette dovresti ripristinare da un backup.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Tenta di recuperare le chiavi private da un wallet.dat corrotto</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Opzioni creazione blocco:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Connetti solo al nodo specificato</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Rilevato database blocchi corrotto</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Scopri proprio indirizzo IP (default: 1 se in ascolto e no -externalip)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Vuoi ricostruire ora il database dei blocchi?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Errore caricamento database blocchi</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Errore caricamento database blocchi</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Errore: la spazio libero sul disco è poco!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Errore: portafoglio bloccato, impossibile creare la transazione!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Errore: errore di sistema:</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Impossibile mettersi in ascolto su una porta. Usa -listen=0 se vuoi usare questa opzione.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>Lettura informazioni blocco fallita</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>Lettura blocco fallita</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>Scrittura informazioni blocco fallita</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>Scrittura blocco fallita</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>Scrittura informazioni file fallita</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>Scrittura nel database dei mariobroscoin fallita</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Trova peer utilizzando la ricerca DNS (predefinito: 1 finché utilizzato -connect)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Quanti blocchi da controllare all&apos;avvio (predefinito: 288, 0 = tutti)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Verifica blocchi...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Verifica portafoglio...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Importa blocchi da un file blk000??.dat esterno</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation>Informazione</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Indirizzo -tor non valido: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Buffer di ricezione massimo per connessione, &lt;n&gt;*1000 byte (default: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Buffer di invio massimo per connessione, &lt;n&gt;*1000 byte (default: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Connetti solo a nodi nella rete &lt;net&gt; (IPv4, IPv6 o Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Produci informazioni extra utili al debug. Implies all other -debug* options</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Genera informazioni extra utili al debug della rete</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Anteponi all&apos;output di debug una marca temporale</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the MyBroCoin Wiki for SSL setup instructions)</source> <translation>Opzioni SSL: (vedi il wiki di MyBroCoin per le istruzioni di configurazione SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Selezionare la versione del proxy socks da usare (4-5, default: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Invia le informazioni di trace/debug alla console invece che al file debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Invia le informazioni di trace/debug al debugger</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Imposta dimensione massima del blocco in bytes (predefinito: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Imposta dimensione minima del blocco in bytes (predefinito: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Riduci il file debug.log all&apos;avvio del client (predefinito: 1 se non impostato -debug)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Specifica il timeout di connessione in millisecondi (default: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Errore di sistema:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>UPnP-használat engedélyezése a figyelő port feltérképezésénél (default: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>UPnP-használat engedélyezése a figyelő port feltérképezésénél (default: 1 when listening)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Usa un proxy per raggiungere servizi nascosti di tor (predefinito: uguale a -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Nome utente per connessioni JSON-RPC </translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Attenzione</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Attenzione: questa versione è obsoleta, aggiornamento necessario!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrotto, salvataggio fallito</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Password per connessioni JSON-RPC </translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Consenti connessioni JSON-RPC dall&apos;indirizzo IP specificato </translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Inviare comandi al nodo in esecuzione su &lt;ip&gt; (default: 127.0.0.1) </translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Esegui il comando quando il miglior block cambia(%s nel cmd è sostituito dall&apos;hash del blocco)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Aggiorna il wallet all&apos;ultimo formato</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Impostare la quantità di chiavi di riserva a &lt;n&gt; (default: 100) </translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Ripeti analisi della catena dei blocchi per cercare le transazioni mancanti dal portamonete </translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Utilizzare OpenSSL (https) per le connessioni JSON-RPC </translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>File certificato del server (default: server.cert) </translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Chiave privata del server (default: server.pem) </translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Cifrari accettabili (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH) </translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Questo messaggio di aiuto </translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Impossibile collegarsi alla %s su questo computer (bind returned error %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Connessione tramite socks proxy</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Consenti ricerche DNS per aggiungere nodi e collegare </translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Caricamento indirizzi...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Errore caricamento wallet.dat: Wallet corrotto</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of MyBroCoin</source> <translation>Errore caricamento wallet.dat: il wallet richiede una versione nuova di MyBroCoin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart MyBroCoin to complete</source> <translation>Il portamonete deve essere riscritto: riavviare MyBroCoin per completare</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Errore caricamento wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Indirizzo -proxy non valido: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Rete sconosciuta specificata in -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Versione -socks proxy sconosciuta richiesta: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Impossibile risolvere -bind address: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Impossibile risolvere indirizzo -externalip: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Importo non valido per -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Importo non valido</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Fondi insufficienti</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Caricamento dell&apos;indice del blocco...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Elérendő csomópont megadása and attempt to keep the connection open</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. MyBroCoin is probably already running.</source> <translation>Impossibile collegarsi alla %s su questo computer. Probabilmente MyBroCoin è già in esecuzione.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Commissione per KB da aggiungere alle transazioni in uscita</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Caricamento portamonete...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Non è possibile retrocedere il wallet</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Non è possibile scrivere l&apos;indirizzo di default</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Ripetere la scansione...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Caricamento completato</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Per usare la opzione %s</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Errore</translation> </message> <message> <location line="-31"/> <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>Devi settare rpcpassword=&lt;password&gt; nel file di configurazione: %s Se il file non esiste, crealo con i permessi di amministratore</translation> </message> </context> </TS>
mybrocoin/mybrocoin
src/qt/locale/bitcoin_it.ts
TypeScript
mit
116,570
<?php namespace Brasa\RecursoHumanoBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Table(name="rhu_proyeccion") * @ORM\Entity(repositoryClass="Brasa\RecursoHumanoBundle\Repository\RhuProyeccionRepository") */ class RhuProyeccion { /** * @ORM\Id * @ORM\Column(name="codigo_proyeccion_pk", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ private $codigoProyeccionPk; /** * @ORM\Column(name="fecha_desde", type="date", nullable=true) */ private $fechaDesde; /** * @ORM\Column(name="fecha_hasta", type="date", nullable=true) */ private $fechaHasta; /** * @ORM\Column(name="codigo_empleado_fk", type="integer", nullable=true) */ private $codigoEmpleadoFk; /** * @ORM\Column(name="codigo_contrato_fk", type="integer", nullable=true) */ private $codigoContratoFk; /** * @ORM\Column(name="dias", type="integer") */ private $dias = 0; /** * @ORM\Column(name="dias_ausentismo", type="integer") */ private $diasAusentismo = 0; /** * @ORM\Column(name="vr_salario", type="float") */ private $vrSalario = 0; /** * @ORM\Column(name="vr_vacaciones", type="float") */ private $vrVacaciones = 0; /** * @ORM\Column(name="dias_prima", type="integer") */ private $diasPrima = 0; /** * @ORM\Column(name="fecha_desde_prima", type="date", nullable=true) */ private $fechaDesdePrima; /** * @ORM\Column(name="vr_primas", type="float") */ private $vrPrimas = 0; /** * @ORM\Column(name="vr_primas_real", type="float") */ private $vrPrimasReal = 0; /** * @ORM\Column(name="vr_salario_promedio_primas", type="float") */ private $vrSalarioPromedioPrimas = 0; /** * @ORM\Column(name="vr_salario_promedio_primas_real", type="float") */ private $vrSalarioPromedioPrimasReal = 0; /** * @ORM\Column(name="porcentaje_primas", type="float") */ private $porcentajePrimas = 0; /** * @ORM\Column(name="diferencia_primas", type="float") */ private $vrDiferenciaPrimas = 0; /** * @ORM\Column(name="dias_ausentismo_primas", type="integer") */ private $diasAusentismoPrimas = 0; /** * @ORM\Column(name="dias_cesantias", type="integer") */ private $diasCesantias = 0; /** * @ORM\Column(name="fecha_desde_cesantias", type="date", nullable=true) */ private $fechaDesdeCesantias; /** * @ORM\Column(name="vr_cesantias", type="float") */ private $vrCesantias = 0; /** * @ORM\Column(name="vr_cesantias_real", type="float") */ private $vrCesantiasReal = 0; /** * @ORM\Column(name="vr_intereses_cesantias", type="float") */ private $vrInteresesCesantias = 0; /** * @ORM\Column(name="vr_intereses_cesantias_real", type="float") */ private $vrInteresesCesantiasReal = 0; /** * @ORM\Column(name="vr_diferencia_intereses_cesantias", type="float") */ private $vrDiferenciaInteresesCesantias = 0; /** * @ORM\Column(name="vr_salario_promedio_cesantias", type="float") */ private $vrSalarioPromedioCesantias = 0; /** * @ORM\Column(name="vr_salario_promedio_cesantias_real", type="float") */ private $vrSalarioPromedioCesantiasReal = 0; /** * @ORM\Column(name="porcentaje_cesantias", type="float") */ private $porcentajeCesantias = 0; /** * @ORM\Column(name="diferencia_cesantias", type="float") */ private $vrDiferenciaCesantias = 0; /** * @ORM\ManyToOne(targetEntity="RhuEmpleado", inversedBy="proyeccionesEmpleadoRel") * @ORM\JoinColumn(name="codigo_empleado_fk", referencedColumnName="codigo_empleado_pk") */ protected $empleadoRel; /** * @ORM\ManyToOne(targetEntity="RhuContrato", inversedBy="proyeccionesContratoRel") * @ORM\JoinColumn(name="codigo_contrato_fk", referencedColumnName="codigo_contrato_pk") */ protected $contratoRel; /** * Get codigoProyeccionPk * * @return integer */ public function getCodigoProyeccionPk() { return $this->codigoProyeccionPk; } /** * Set fechaDesde * * @param \DateTime $fechaDesde * * @return RhuProyeccion */ public function setFechaDesde($fechaDesde) { $this->fechaDesde = $fechaDesde; return $this; } /** * Get fechaDesde * * @return \DateTime */ public function getFechaDesde() { return $this->fechaDesde; } /** * Set fechaHasta * * @param \DateTime $fechaHasta * * @return RhuProyeccion */ public function setFechaHasta($fechaHasta) { $this->fechaHasta = $fechaHasta; return $this; } /** * Get fechaHasta * * @return \DateTime */ public function getFechaHasta() { return $this->fechaHasta; } /** * Set codigoEmpleadoFk * * @param integer $codigoEmpleadoFk * * @return RhuProyeccion */ public function setCodigoEmpleadoFk($codigoEmpleadoFk) { $this->codigoEmpleadoFk = $codigoEmpleadoFk; return $this; } /** * Get codigoEmpleadoFk * * @return integer */ public function getCodigoEmpleadoFk() { return $this->codigoEmpleadoFk; } /** * Set codigoContratoFk * * @param integer $codigoContratoFk * * @return RhuProyeccion */ public function setCodigoContratoFk($codigoContratoFk) { $this->codigoContratoFk = $codigoContratoFk; return $this; } /** * Get codigoContratoFk * * @return integer */ public function getCodigoContratoFk() { return $this->codigoContratoFk; } /** * Set dias * * @param integer $dias * * @return RhuProyeccion */ public function setDias($dias) { $this->dias = $dias; return $this; } /** * Get dias * * @return integer */ public function getDias() { return $this->dias; } /** * Set diasAusentismo * * @param integer $diasAusentismo * * @return RhuProyeccion */ public function setDiasAusentismo($diasAusentismo) { $this->diasAusentismo = $diasAusentismo; return $this; } /** * Get diasAusentismo * * @return integer */ public function getDiasAusentismo() { return $this->diasAusentismo; } /** * Set vrSalario * * @param float $vrSalario * * @return RhuProyeccion */ public function setVrSalario($vrSalario) { $this->vrSalario = $vrSalario; return $this; } /** * Get vrSalario * * @return float */ public function getVrSalario() { return $this->vrSalario; } /** * Set vrVacaciones * * @param float $vrVacaciones * * @return RhuProyeccion */ public function setVrVacaciones($vrVacaciones) { $this->vrVacaciones = $vrVacaciones; return $this; } /** * Get vrVacaciones * * @return float */ public function getVrVacaciones() { return $this->vrVacaciones; } /** * Set diasPrima * * @param integer $diasPrima * * @return RhuProyeccion */ public function setDiasPrima($diasPrima) { $this->diasPrima = $diasPrima; return $this; } /** * Get diasPrima * * @return integer */ public function getDiasPrima() { return $this->diasPrima; } /** * Set fechaDesdePrima * * @param \DateTime $fechaDesdePrima * * @return RhuProyeccion */ public function setFechaDesdePrima($fechaDesdePrima) { $this->fechaDesdePrima = $fechaDesdePrima; return $this; } /** * Get fechaDesdePrima * * @return \DateTime */ public function getFechaDesdePrima() { return $this->fechaDesdePrima; } /** * Set vrPrimas * * @param float $vrPrimas * * @return RhuProyeccion */ public function setVrPrimas($vrPrimas) { $this->vrPrimas = $vrPrimas; return $this; } /** * Get vrPrimas * * @return float */ public function getVrPrimas() { return $this->vrPrimas; } /** * Set vrSalarioPromedioPrimas * * @param float $vrSalarioPromedioPrimas * * @return RhuProyeccion */ public function setVrSalarioPromedioPrimas($vrSalarioPromedioPrimas) { $this->vrSalarioPromedioPrimas = $vrSalarioPromedioPrimas; return $this; } /** * Get vrSalarioPromedioPrimas * * @return float */ public function getVrSalarioPromedioPrimas() { return $this->vrSalarioPromedioPrimas; } /** * Set vrSalarioPromedioPrimasReal * * @param float $vrSalarioPromedioPrimasReal * * @return RhuProyeccion */ public function setVrSalarioPromedioPrimasReal($vrSalarioPromedioPrimasReal) { $this->vrSalarioPromedioPrimasReal = $vrSalarioPromedioPrimasReal; return $this; } /** * Get vrSalarioPromedioPrimasReal * * @return float */ public function getVrSalarioPromedioPrimasReal() { return $this->vrSalarioPromedioPrimasReal; } /** * Set porcentajePrimas * * @param float $porcentajePrimas * * @return RhuProyeccion */ public function setPorcentajePrimas($porcentajePrimas) { $this->porcentajePrimas = $porcentajePrimas; return $this; } /** * Get porcentajePrimas * * @return float */ public function getPorcentajePrimas() { return $this->porcentajePrimas; } /** * Set vrDiferenciaPrimas * * @param float $vrDiferenciaPrimas * * @return RhuProyeccion */ public function setVrDiferenciaPrimas($vrDiferenciaPrimas) { $this->vrDiferenciaPrimas = $vrDiferenciaPrimas; return $this; } /** * Get vrDiferenciaPrimas * * @return float */ public function getVrDiferenciaPrimas() { return $this->vrDiferenciaPrimas; } /** * Set diasCesantias * * @param integer $diasCesantias * * @return RhuProyeccion */ public function setDiasCesantias($diasCesantias) { $this->diasCesantias = $diasCesantias; return $this; } /** * Get diasCesantias * * @return integer */ public function getDiasCesantias() { return $this->diasCesantias; } /** * Set fechaDesdeCesantias * * @param \DateTime $fechaDesdeCesantias * * @return RhuProyeccion */ public function setFechaDesdeCesantias($fechaDesdeCesantias) { $this->fechaDesdeCesantias = $fechaDesdeCesantias; return $this; } /** * Get fechaDesdeCesantias * * @return \DateTime */ public function getFechaDesdeCesantias() { return $this->fechaDesdeCesantias; } /** * Set vrCesantias * * @param float $vrCesantias * * @return RhuProyeccion */ public function setVrCesantias($vrCesantias) { $this->vrCesantias = $vrCesantias; return $this; } /** * Get vrCesantias * * @return float */ public function getVrCesantias() { return $this->vrCesantias; } /** * Set vrInteresesCesantias * * @param float $vrInteresesCesantias * * @return RhuProyeccion */ public function setVrInteresesCesantias($vrInteresesCesantias) { $this->vrInteresesCesantias = $vrInteresesCesantias; return $this; } /** * Get vrInteresesCesantias * * @return float */ public function getVrInteresesCesantias() { return $this->vrInteresesCesantias; } /** * Set vrSalarioPromedioCesantias * * @param float $vrSalarioPromedioCesantias * * @return RhuProyeccion */ public function setVrSalarioPromedioCesantias($vrSalarioPromedioCesantias) { $this->vrSalarioPromedioCesantias = $vrSalarioPromedioCesantias; return $this; } /** * Get vrSalarioPromedioCesantias * * @return float */ public function getVrSalarioPromedioCesantias() { return $this->vrSalarioPromedioCesantias; } /** * Set vrSalarioPromedioCesantiasReal * * @param float $vrSalarioPromedioCesantiasReal * * @return RhuProyeccion */ public function setVrSalarioPromedioCesantiasReal($vrSalarioPromedioCesantiasReal) { $this->vrSalarioPromedioCesantiasReal = $vrSalarioPromedioCesantiasReal; return $this; } /** * Get vrSalarioPromedioCesantiasReal * * @return float */ public function getVrSalarioPromedioCesantiasReal() { return $this->vrSalarioPromedioCesantiasReal; } /** * Set porcentajeCesantias * * @param float $porcentajeCesantias * * @return RhuProyeccion */ public function setPorcentajeCesantias($porcentajeCesantias) { $this->porcentajeCesantias = $porcentajeCesantias; return $this; } /** * Get porcentajeCesantias * * @return float */ public function getPorcentajeCesantias() { return $this->porcentajeCesantias; } /** * Set vrDiferenciaCesantias * * @param float $vrDiferenciaCesantias * * @return RhuProyeccion */ public function setVrDiferenciaCesantias($vrDiferenciaCesantias) { $this->vrDiferenciaCesantias = $vrDiferenciaCesantias; return $this; } /** * Get vrDiferenciaCesantias * * @return float */ public function getVrDiferenciaCesantias() { return $this->vrDiferenciaCesantias; } /** * Set empleadoRel * * @param \Brasa\RecursoHumanoBundle\Entity\RhuEmpleado $empleadoRel * * @return RhuProyeccion */ public function setEmpleadoRel(\Brasa\RecursoHumanoBundle\Entity\RhuEmpleado $empleadoRel = null) { $this->empleadoRel = $empleadoRel; return $this; } /** * Get empleadoRel * * @return \Brasa\RecursoHumanoBundle\Entity\RhuEmpleado */ public function getEmpleadoRel() { return $this->empleadoRel; } /** * Set contratoRel * * @param \Brasa\RecursoHumanoBundle\Entity\RhuContrato $contratoRel * * @return RhuProyeccion */ public function setContratoRel(\Brasa\RecursoHumanoBundle\Entity\RhuContrato $contratoRel = null) { $this->contratoRel = $contratoRel; return $this; } /** * Get contratoRel * * @return \Brasa\RecursoHumanoBundle\Entity\RhuContrato */ public function getContratoRel() { return $this->contratoRel; } /** * Set vrPrimasReal * * @param float $vrPrimasReal * * @return RhuProyeccion */ public function setVrPrimasReal($vrPrimasReal) { $this->vrPrimasReal = $vrPrimasReal; return $this; } /** * Get vrPrimasReal * * @return float */ public function getVrPrimasReal() { return $this->vrPrimasReal; } /** * Set vrCesantiasReal * * @param float $vrCesantiasReal * * @return RhuProyeccion */ public function setVrCesantiasReal($vrCesantiasReal) { $this->vrCesantiasReal = $vrCesantiasReal; return $this; } /** * Get vrCesantiasReal * * @return float */ public function getVrCesantiasReal() { return $this->vrCesantiasReal; } /** * Set vrInteresesCesantiasReal * * @param float $vrInteresesCesantiasReal * * @return RhuProyeccion */ public function setVrInteresesCesantiasReal($vrInteresesCesantiasReal) { $this->vrInteresesCesantiasReal = $vrInteresesCesantiasReal; return $this; } /** * Get vrInteresesCesantiasReal * * @return float */ public function getVrInteresesCesantiasReal() { return $this->vrInteresesCesantiasReal; } /** * Set vrDiferenciaInteresesCesantias * * @param float $vrDiferenciaInteresesCesantias * * @return RhuProyeccion */ public function setVrDiferenciaInteresesCesantias($vrDiferenciaInteresesCesantias) { $this->vrDiferenciaInteresesCesantias = $vrDiferenciaInteresesCesantias; return $this; } /** * Get vrDiferenciaInteresesCesantias * * @return float */ public function getVrDiferenciaInteresesCesantias() { return $this->vrDiferenciaInteresesCesantias; } /** * Set diasAusentismoPrimas * * @param integer $diasAusentismoPrimas * * @return RhuProyeccion */ public function setDiasAusentismoPrimas($diasAusentismoPrimas) { $this->diasAusentismoPrimas = $diasAusentismoPrimas; return $this; } /** * Get diasAusentismoPrimas * * @return integer */ public function getDiasAusentismoPrimas() { return $this->diasAusentismoPrimas; } }
wariox3/brasa
src/Brasa/RecursoHumanoBundle/Entity/RhuProyeccion.php
PHP
mit
18,149
<?php if(!App\Requests\Request::$ajax) { require ROOT . '/app/Layouts/Admin/Header.php'; require ROOT . '/app/Layouts/Admin/Menu.php'; } ?> <div class="content-wrapper" data-locales="admin_articles"> <div class="content-header"> <div class="header-mainline"> <h2 class="mainline-heading" data-locale="ARTICLES_TITLE"></h2> <div class="mainline-search"> <div class="input-box"> <input type="search" name="articles-search" data-placeholder="ARTICLES_SEARCH"> </div> <span class="mainline-edit"></span> </div> </div> <p class="header-description" data-locale="ARTICLES_DESCRIPTION"></p> </div> </div>
lamka02sk/wrinche
app/Layouts/Articles/Main.php
PHP
mit
757
using SSPES.BD; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; namespace SSPES.Models { public class VariableModel { private Conexion con = new Conexion(); protected string nombre { get; set; } protected string tipoDato { get; set; } protected string descripcion { get; set; } public VariableModel(string a, string b, string c) { nombre = a; tipoDato = b; descripcion = c; } public VariableModel() { } public bool registrarVariable() { string[] ar = new string[1]; ar[0] = "INSERT INTO variable (NOMBRE_VARIABLE, TIPO_DE_DATO, DESCRIPCION_VARIABLE, ESTADO) VALUES"; ar[0] += "('" + nombre + "', '" + tipoDato + "', '" + descripcion + "', 'A');"; return con.RealizarTransaccion(ar); } public DataTable consultarVariablesDisponibles(string pk_pro) { string sql = "SELECT idVARIABLE, NOMBRE_VARIABLE "; sql += "FROM variable WHERE NOT EXISTS ( "; sql += " SELECT * FROM variable_proyecto "; sql += " WHERE variable.idVARIABLE = variable_proyecto.FK_VARIABLE "; sql += " AND variable_proyecto.FK_PROYECTO = " + pk_pro; sql += ") "; sql += "ORDER BY NOMBRE_VARIABLE;"; return con.EjecutarConsulta(sql, CommandType.Text); } public bool asignarVariable(string pkProyecto, string pkVariable) { string[] sql = new string[1]; sql[0] = "INSERT INTO variable_proyecto (FK_PROYECTO, FK_VARIABLE)"; sql[0] += "VALUES(" + pkProyecto + ", " + pkVariable + ");"; return con.RealizarTransaccion(sql); } public DataTable consultarEstadoVariablesProyecto(string pk_pro) { string sql = @"SELECT idVARIABLE, NOMBRE_VARIABLE, if(EXISTS(SELECT FK_PROYECTO FROM variable_proyecto WHERE variable_proyecto.FK_PROYECTO='"+ pk_pro + @"' AND variable_proyecto.FK_VARIABLE = variable.idVARIABLE ), 'Si', 'No') as 'EXISTE' FROM variable ORDER BY NOMBRE_VARIABLE;"; return con.EjecutarConsulta(sql, CommandType.Text); } public DataTable consultarVariablesProyecto(string pk_pro) { string sql = @"SELECT NOMBRE_VARIABLE, TIPO_DE_DATO, DESCRIPCION_VARIABLE, PK_VARIABLE_PROYECTO FROM variable INNER JOIN variable_proyecto ON variable.idVARIABLE = variable_proyecto.FK_VARIABLE AND variable_proyecto.FK_PROYECTO = '" + pk_pro + @"' ORDER BY NOMBRE_VARIABLE;"; return con.EjecutarConsulta(sql, CommandType.Text); } public bool eliminarAsignacion(string pkProyecto, string pkVariable) { string[] sql = new string[1]; sql[0] = @"DELETE FROM variable_proyecto WHERE FK_PROYECTO = '" + pkProyecto + @"' AND FK_VARIABLE = '" + pkVariable + "' ;"; return con.RealizarTransaccion(sql); } public DataTable consultarVariables() { string sql = @"SELECT NOMBRE_VARIABLE, TIPO_DE_DATO, DESCRIPCION_VARIABLE FROM variable;"; return con.EjecutarConsulta(sql, CommandType.Text); } } }
manuelstuner/SSPES
SSPES/SSPES/Models/VariableModel.cs
C#
mit
3,402
'use strict' const { spawn } = require('@malept/cross-spawn-promise') const which = require('which') function updateExecutableMissingException (err, hasLogger) { if (hasLogger && err.code === 'ENOENT' && err.syscall === 'spawn mono') { let installer let pkg if (process.platform === 'darwin') { installer = 'brew' pkg = 'mono' } else if (which.sync('dnf', { nothrow: true })) { installer = 'dnf' pkg = 'mono-core' } else { // assume apt-based Linux distro installer = 'apt' pkg = 'mono-runtime' } err.message = `Your system is missing the ${pkg} package. Try, e.g. '${installer} install ${pkg}'` } } module.exports = async function (cmd, args, logger) { if (process.platform !== 'win32') { args.unshift(cmd) cmd = 'mono' } return spawn(cmd, args, { logger, updateErrorCallback: updateExecutableMissingException }) }
unindented/electron-installer-windows
src/spawn.js
JavaScript
mit
913
ETL::Engine.process(File.dirname(__FILE__) + '/store_dimension.ctl')
activewarehouse/activewarehouse
test/setup/store_dimension_populate.rb
Ruby
mit
68
import Ember from 'ember'; export default Ember.Object.extend({ animate($element, effect, duration) { }, finish($elements) { } });
null-null-null/ember-letter-by-letter
blueprints/lxl-tween-adapter/files/__root__/lxl-tween-adapters/__name__.js
JavaScript
mit
147
<?php # MantisBT - A PHP based bugtracking system # MantisBT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # MantisBT is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with MantisBT. If not, see <http://www.gnu.org/licenses/>. /** * This page updates the users profile information then redirects to * account_prof_menu_page.php * * @package MantisBT * @copyright Copyright 2000 - 2002 Kenzaburo Ito - kenito@300baud.org * @copyright Copyright 2002 MantisBT Team - mantisbt-dev@lists.sourceforge.net * @link http://www.mantisbt.org * * @uses core.php * @uses access_api.php * @uses authentication_api.php * @uses config_api.php * @uses constant_inc.php * @uses current_user_api.php * @uses form_api.php * @uses gpc_api.php * @uses print_api.php * @uses profile_api.php */ require_once( 'core.php' ); require_api( 'access_api.php' ); require_api( 'authentication_api.php' ); require_api( 'config_api.php' ); require_api( 'constant_inc.php' ); require_api( 'current_user_api.php' ); require_api( 'form_api.php' ); require_api( 'gpc_api.php' ); require_api( 'print_api.php' ); require_api( 'profile_api.php' ); if( !config_get( 'enable_profiles' ) ) { trigger_error( ERROR_ACCESS_DENIED, ERROR ); } form_security_validate( 'profile_update' ); auth_ensure_user_authenticated(); current_user_ensure_unprotected(); $f_action = gpc_get_string( 'action' ); if( $f_action != 'add' ) { $f_profile_id = gpc_get_int( 'profile_id' ); # Make sure user did select an existing profile from the list if( $f_action != 'make_default' && $f_profile_id == 0 ) { error_parameters( lang_get( 'select_profile' ) ); trigger_error( ERROR_EMPTY_FIELD, ERROR ); } } switch( $f_action ) { case 'edit': form_security_purge( 'profile_update' ); print_header_redirect( 'account_prof_edit_page.php?profile_id=' . $f_profile_id ); break; case 'add': $f_platform = gpc_get_string( 'platform' ); $f_os = gpc_get_string( 'os' ); $f_os_build = gpc_get_string( 'os_build' ); $f_description = gpc_get_string( 'description' ); $t_user_id = gpc_get_int( 'user_id' ); if( ALL_USERS != $t_user_id ) { $t_user_id = auth_get_current_user_id(); } if( ALL_USERS == $t_user_id ) { access_ensure_global_level( config_get( 'manage_global_profile_threshold' ) ); } else { access_ensure_global_level( config_get( 'add_profile_threshold' ) ); } profile_create( $t_user_id, $f_platform, $f_os, $f_os_build, $f_description ); form_security_purge( 'profile_update' ); if( ALL_USERS == $t_user_id ) { print_header_redirect( 'manage_prof_menu_page.php' ); } else { print_header_redirect( 'account_prof_menu_page.php' ); } break; case 'update': $f_platform = gpc_get_string( 'platform' ); $f_os = gpc_get_string( 'os' ); $f_os_build = gpc_get_string( 'os_build' ); $f_description = gpc_get_string( 'description' ); if( profile_is_global( $f_profile_id ) ) { access_ensure_global_level( config_get( 'manage_global_profile_threshold' ) ); profile_update( ALL_USERS, $f_profile_id, $f_platform, $f_os, $f_os_build, $f_description ); form_security_purge( 'profile_update' ); print_header_redirect( 'manage_prof_menu_page.php' ); } else { profile_update( auth_get_current_user_id(), $f_profile_id, $f_platform, $f_os, $f_os_build, $f_description ); form_security_purge( 'profile_update' ); print_header_redirect( 'account_prof_menu_page.php' ); } break; case 'delete': if( profile_is_global( $f_profile_id ) ) { access_ensure_global_level( config_get( 'manage_global_profile_threshold' ) ); profile_delete( ALL_USERS, $f_profile_id ); form_security_purge( 'profile_update' ); print_header_redirect( 'manage_prof_menu_page.php' ); } else { profile_delete( auth_get_current_user_id(), $f_profile_id ); form_security_purge( 'profile_update' ); print_header_redirect( 'account_prof_menu_page.php' ); } break; case 'make_default': current_user_set_pref( 'default_profile', $f_profile_id ); form_security_purge( 'profile_update' ); print_header_redirect( 'account_prof_menu_page.php' ); break; }
nabusas/Nabu
Mantis/account_prof_update.php
PHP
mit
4,558
/* * Flip API * * Description * * API version: 2.0.1 * Contact: cloudsupport@telestream.net * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package flip type FactoryBody struct { // AWS access key. AwsAccessKey string `json:"aws_access_key,omitempty"` // AWS secret key. AwsSecretKey string `json:"aws_secret_key,omitempty"` // A region where the factory is located. FactoryRegion string `json:"factory_region,omitempty"` // A pattern that will be used to locate files in the input bucket. Valid wildcards might be used. InputBucketFilePattern string `json:"input_bucket_file_pattern,omitempty"` // A name of an input bucket. InputBucketName string `json:"input_bucket_name,omitempty"` InputBucketRecursive bool `json:"input_bucket_recursive,omitempty"` // Determines how often the input bucket is synchronised. InputBucketSyncEveryNMin int32 `json:"input_bucket_sync_every_n_min,omitempty"` // Determines whether the Factory should be notified about new files added to the input bucket. InputBucketWatch bool `json:"input_bucket_watch,omitempty"` // Name of the Factory. Name string `json:"name"` // Specify the directory where the output files should be stored. By default it is not set. More info [here](https://cloud.telestream.net/docs#path-format---know-how). OutputsPathFormat string `json:"outputs_path_format,omitempty"` ProviderSpecificSettings *interface{} `json:"provider_specific_settings,omitempty"` // Specify if your files are public or private (private files need authorization url to access). By default this is not set. Acl string `json:"acl,omitempty"` // A bucket where processed files will be stored. OutputBucketName string `json:"output_bucket_name,omitempty"` // Specify if you want to use multi-factor server-side 256-bit AES-256 data encryption with Amazon S3-managed encryption keys (SSE-S3). Each object is encrypted using a unique key which as an additional safeguard is encrypted itself with a master key that S3 regularly rotates. By default this is not set. ServerSideEncryption bool `json:"server_side_encryption,omitempty"` StorageCredentialAttributes *FactoryBodyStorageCredentialAttributes `json:"storage_credential_attributes,omitempty"` // Specifies which storage provider the factory should use. Available options: S3: 0, Google Cloud Storage: 1, FTP storage: 2, Google Cloud Interoperability Storage: 5, Flip storage: 7, FASP storage: 8, Azure Blob Storage: 9 StorageProvider int32 `json:"storage_provider,omitempty"` }
Telestream/telestream-cloud-go-sdk
flip/factory_body.go
GO
mit
2,556
// validate and import user arguments (function(args){ for (_i = 0; _i < args.length; _i += 1) { // import arguments if defined, else defaults _settings[args[_i]] = options && options[args[_i]] ? options[args[_i]] : defaults[args[_i]]; // validate data types if(typeof _settings[args[_i]] !== "number") { throw "textStretch error. Argument \"" + args[_i] + "\" must be a number. Argument given was \"" + _settings[args[_i]] + "\"."; } } }(["minFontSize", "maxFontSize"])); _settings.maxFontSize = _settings.maxFontSize || Number.POSITIVE_INFINITY;
friday/textStretch.js
src/_validateArgs.js
JavaScript
mit
564
import MailPreview from '../components/MailPreview.vue'; import icons from "trumbowyg/dist/ui/icons.svg"; import "trumbowyg/dist/ui/trumbowyg.css"; import "trumbowyg/dist/trumbowyg.js"; import "./trumbowyg-snippets-plugin.js"; $.trumbowyg.svgPath = icons; window.remplib = typeof(remplib) === 'undefined' ? {} : window.remplib; let beautify = require('js-beautify').html; (function() { 'use strict'; remplib.templateForm = { textareaSelector: '.js-mail-body-html-input', codeMirror: (element) => { return CodeMirror( element, { value: beautify($(remplib.templateForm.textareaSelector).val()), theme: 'base16-dark', mode: 'htmlmixed', indentUnit: 4, indentWithTabs: true, lineNumbers: true, lineWrapping: false, styleActiveLine: true, styleSelectedText: true, continueComments: true, gutters:[ 'CodeMirror-lint-markers' ], lint: true, autoRefresh: true, autoCloseBrackets: true, autoCloseTags: true, matchBrackets: true, matchTags: { bothTags: true }, htmlhint: { 'doctype-first': false, 'alt-require': false, 'space-tab-mixed-disabled': 'tab' } }); }, trumbowyg: (element) => { let buttons = $.trumbowyg.defaultOptions.btns; let plugins = {}; const snippetsData = $(element).data('snippets'); const viewHTMLButton = 'viewHTML'; buttons = $.grep(buttons, function (value) { return value.toString() !== viewHTMLButton; }); if (snippetsData) { buttons.push([['snippets']]); for (const item in snippetsData) { // let html = `<div contentEditable="false">{{ include('${snippetsData[item].name}') }}</div>`; let html = `{{ include('${snippetsData[item].code}') }}`; snippetsData[item].html = html; } plugins.snippets = snippetsData; } return $(element).trumbowyg({ semanticKeepAttributes: true, semantic: false, autogrow: true, btns: buttons, plugins: plugins, }); }, codeMirrorChanged: false, trumbowygChanged: false, editorChoice: () => { return $('.js-editor-choice:checked').val(); }, previewInit: (element, mailLayoutSelect, layoutsHtmlTemplates, initialContent) => { const getLayoutValue = () => mailLayoutSelect[mailLayoutSelect.selectedIndex].value; const getLayoutTemplate = () => layoutsHtmlTemplates[getLayoutValue()]; const vue = new Vue({ el: element, data: function() { return { "htmlContent": initialContent, "htmlLayout": getLayoutTemplate().layout_html, } }, render: h => h(MailPreview), }); mailLayoutSelect.addEventListener('change', function(e) { vue.htmlLayout = getLayoutTemplate().layout_html; $('body').trigger('preview:change'); }); return vue; }, showTrumbowyg: (codeMirror, trumbowyg) => { trumbowyg.data('trumbowyg').$box.show(); // load changed data from codemirror if (remplib.templateForm.codeMirrorChanged) { trumbowyg.trumbowyg('html', codeMirror.doc.getValue()); remplib.templateForm.codeMirrorChanged = false; } $(codeMirror.display.wrapper).hide(); }, showCodemirror: (codeMirror, trumbowyg) => { trumbowyg.data('trumbowyg').$box.hide(); // load changed and beautified data from trumbowyg if (remplib.templateForm.trumbowygChanged) { codeMirror.doc.setValue(beautify(trumbowyg.trumbowyg('html'))); remplib.templateForm.trumbowygChanged = false; } setTimeout(function() { codeMirror.refresh(); }, 0); $(codeMirror.display.wrapper).show(); }, selectEditor: (codeMirror, trumbowyg) => { if (remplib.templateForm.editorChoice() === 'editor') remplib.templateForm.showTrumbowyg(codeMirror, trumbowyg); else { remplib.templateForm.showCodemirror(codeMirror, trumbowyg); } }, init: () => { // initialize preview right away so user can see the email const vue = remplib.templateForm.previewInit( '#js-mail-preview', $('[name="mail_layout_id"]')[0], $('.js-mail-layouts-templates').data('mail-layouts'), $('.js-mail-body-html-input').val(), ); const codeMirror = remplib.templateForm.codeMirror($('.js-codemirror')[0]); const trumbowyg = remplib.templateForm.trumbowyg('.js-html-editor'); remplib.templateForm.syncCodeMirrorWithPreview(vue, codeMirror); remplib.templateForm.syncTrumbowygWithPreview(vue, trumbowyg); // initialize code editors on tab change, prevents bugs with initialisation of invisible elements. $('a[data-toggle="tab"]').one('shown.bs.tab', function (e) { const target = $(e.target).attr("href") // activated tab if (target === '#email') { remplib.templateForm.selectEditor(codeMirror, trumbowyg); } }); // change editor when user wants to change it (radio buttons) $('.js-editor-choice').on('change', function(e) { e.stopPropagation(); remplib.templateForm.selectEditor(codeMirror, trumbowyg) }); }, syncTrumbowygWithPreview: (vue, trumbowyg) => { trumbowyg.on('tbwchange', () => { if (remplib.templateForm.editorChoice() !== 'editor') { return; } vue.htmlContent = trumbowyg.trumbowyg('html'); $('body').trigger('preview:change'); remplib.templateForm.trumbowygChanged = true; }); }, syncCodeMirrorWithPreview: (vue, codeMirror) => { codeMirror.on('change', function( editor, change ) { if (remplib.templateForm.editorChoice() !== 'code') { return; } // ignore if update is made programmatically and not by user (avoid circular loop) if ( change.origin === 'setValue' ) { return; } vue.htmlContent = editor.doc.getValue(); $(remplib.templateForm.textareaSelector).val(editor.doc.getValue()); $('body').trigger('preview:change'); remplib.templateForm.codeMirrorChanged = true; }); } } })();
remp2020/remp
Mailer/extensions/mailer-module/assets/js/forms/mailPreview.js
JavaScript
mit
7,471
var baseSortedIndex = require('./_baseSortedIndex'); /** * This method is like `_.sortedIndex` except that it returns the highest * index at which `value` should be inserted into `array` in order to * maintain its sort order. * * @static * @memberOf _ * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted into `array`. * @specs * * _.sortedLastIndex([4, 5], 4); * // => 1 */ function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } module.exports = sortedLastIndex;
mdchristopher/Protractor
node_modules/lodash/sortedLastIndex.js
JavaScript
mit
648
using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.Runtime.Serialization; namespace HTLib2 { [Serializable] public partial class MatrixByColRow : Matrix { ////////////////////////////////////////////////////////////////////////////////////////////////// // member variables double[][] arr; ////////////////////////////////////////////////////////////////////////////////////////////////// // Matrix public override int ColSize { get { return arr.Length; } } public override int RowSize { get { return arr[0].Length; } } public override double this[int c, int r] { get { return arr[c][r]; } set { arr[c][r] = value; } } public override double this[long c, long r] { get { return arr[c][r]; } set { arr[c][r] = value; } } public override Matrix Clone() { return CloneT(); } ////////////////////////////////////////////////////////////////////////////////////////////////// // others public MatrixByColRow(double[][] arr) { this.arr = arr; int colsize = arr.Length; int rowsize = arr[0].Length; for(int c=0; c<colsize; c++) if(arr[c].Length != rowsize) throw new HException(); } public MatrixByColRow CloneT() { double[][] narr = new double[arr.GetLength(0)][]; for(int i=0; i<arr.GetLength(0); i++) narr[i] = arr[i].HClone(); return new MatrixByColRow(narr); } public new static MatrixByColRow Zeros(int colsize, int rowsize) { double[][] arr = new double[colsize][]; for(int c=0; c<colsize; c++) arr[c] = new double[rowsize]; return new MatrixByColRow(arr); } public Vector GetRowVector(int col) { return arr[col]; } ////////////////////////////////////////////////////////////////////////////////////////////////// // IBinarySerializable public new void BinarySerialize(HBinaryWriter writer) { int leng = arr.Length; writer.Write(leng); for(int i=0; i<leng; i++) writer.Write(arr[i]); } public static new MatrixByColRow BinaryDeserialize(HBinaryReader reader) { int leng; reader.Read(out leng); double[][] arr = new double[leng][]; for(int i=0; i<leng; i++) reader.Read(out arr[i]); MatrixByColRow mat = new MatrixByColRow(arr); return mat; } // IBinarySerializable ////////////////////////////////////////////////////////////////////////////////////////////////// } }
htna/HCsbLib
HCsbLib/HCsbLib/HTLib2/HMath.Numerics.Matrix/MatrixByColRow.cs
C#
mit
3,062
package ua.com.fielden.platform.sample.domain; import ua.com.fielden.platform.entity.AbstractEntity; import ua.com.fielden.platform.entity.DynamicEntityKey; import ua.com.fielden.platform.entity.annotation.CompanionObject; import ua.com.fielden.platform.entity.annotation.CompositeKeyMember; import ua.com.fielden.platform.entity.annotation.IsProperty; import ua.com.fielden.platform.entity.annotation.KeyType; import ua.com.fielden.platform.entity.annotation.MapEntityTo; import ua.com.fielden.platform.entity.annotation.MapTo; import ua.com.fielden.platform.entity.annotation.Observable; import ua.com.fielden.platform.entity.annotation.Required; import ua.com.fielden.platform.entity.annotation.Title; @KeyType(DynamicEntityKey.class) @MapEntityTo @CompanionObject(ITgOrgUnit3.class) public class TgOrgUnit3 extends AbstractEntity<DynamicEntityKey> { private static final long serialVersionUID = 1L; @IsProperty @Required @MapTo @Title(value = "Parent", desc = "Parent") @CompositeKeyMember(1) private TgOrgUnit2 parent; @IsProperty @MapTo @Title(value = "Name", desc = "Desc") @CompositeKeyMember(2) private String name; @Observable public TgOrgUnit3 setName(final String name) { this.name = name; return this; } public String getName() { return name; } @Observable public TgOrgUnit3 setParent(final TgOrgUnit2 parent) { this.parent = parent; return this; } public TgOrgUnit2 getParent() { return parent; } }
fieldenms/tg
platform-pojo-bl/src/main/java/ua/com/fielden/platform/sample/domain/TgOrgUnit3.java
Java
mit
1,556
module.exports = function(grunt) { 'use strict'; // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), bowercopy: { options: { clean: false }, glob: { files: { 'static/libs/js': [ 'sprintf/dist/*.js', 'mocha/*.js', 'assert/*.js' ], 'static/libs/css': [ 'mocha/*.css' ], 'static/libs/fonts': [ ] } } } }) grunt.loadNpmTasks('grunt-bowercopy'); // Default tasks grunt.registerTask('default', ['bowercopy']); }
if1live/new-life
Gruntfile.js
JavaScript
mit
626
package util import ( "net/http" "github.com/dgrijalva/jwt-go" "github.com/mb-dev/godo/config" ) func JWTMiddleware(rw http.ResponseWriter, req *http.Request, next http.HandlerFunc) { token, err := jwt.ParseFromRequest(req, func(token *jwt.Token) ([]byte, error) { return []byte(config.CurrentConfiguration.KeySecret), nil }) if err != nil || !token.Valid { rw.WriteHeader(http.StatusForbidden) return } ContextSetUserId(req, token.Claims["id"].(string)) next(rw, req) }
mb-dev/godo
util/jwt.go
GO
mit
505
package net.blay09.mods.bmc.chat; import com.google.common.collect.Maps; import net.minecraft.util.text.TextFormatting; import java.util.Map; import java.util.Random; public class RandomNameColors { private static final Random random = new Random(); private static final TextFormatting[] VALID_COLORS = new TextFormatting[] { TextFormatting.DARK_BLUE, TextFormatting.DARK_GREEN, TextFormatting.DARK_AQUA, TextFormatting.DARK_RED, TextFormatting.DARK_PURPLE, TextFormatting.GOLD, TextFormatting.GRAY, TextFormatting.BLUE, TextFormatting.GREEN, TextFormatting.AQUA, TextFormatting.RED, TextFormatting.LIGHT_PURPLE, TextFormatting.YELLOW, TextFormatting.WHITE }; private static Map<String, TextFormatting> nameColorMap = Maps.newHashMap(); public static TextFormatting getRandomNameColor(String senderName) { TextFormatting color = nameColorMap.get(senderName); if(color == null) { color = VALID_COLORS[random.nextInt(VALID_COLORS.length)]; nameColorMap.put(senderName, color); } return color; } }
blay09/BetterMinecraftChat
src/main/java/net/blay09/mods/bmc/chat/RandomNameColors.java
Java
mit
1,064
<?php namespace Pinq\Analysis; use Pinq\Expressions as O; /** * Interface of a type. * * @author Elliot Levin <elliotlevin@hotmail.com> */ interface IType { /** * Whether the type has a parent type. * * @return boolean */ public function hasParentType(); /** * Gets the parent type or null if their is no parent. * * @return IType|null */ public function getParentType(); /** * Whether the supplied type is equivalent to the current type. * * @param IType $type * * @return boolean */ public function isEqualTo(IType $type); /** * Whether the supplied type is a subtype of or equal to the current type. * * @param IType $type * * @return boolean */ public function isParentTypeOf(IType $type); /** * Gets a unique string representation of the type. * * @return string */ public function getIdentifier(); /** * Gets the supplied expression matches the type's constructor. * * @param O\NewExpression $expression * * @return IConstructor * @throws TypeException if the constructor is not supported. */ public function getConstructor(O\NewExpression $expression); /** * Gets the matched method of the supplied expression. * * @param O\MethodCallExpression $expression * * @return IMethod * @throws TypeException if the method is not supported. */ public function getMethod(O\MethodCallExpression $expression); /** * Gets the matched method of the supplied expression. * * @param O\StaticMethodCallExpression $expression * * @return IMethod * @throws TypeException if the static method is not supported. */ public function getStaticMethod(O\StaticMethodCallExpression $expression); /** * Gets the matched field of the supplied expression. * * @param O\FieldExpression $expression * * @return IField * @throws TypeException if the field is not supported. */ public function getField(O\FieldExpression $expression); /** * Gets the matched field of the supplied expression. * * @param O\StaticFieldExpression $expression * * @return IField * @throws TypeException if the static field is not supported. */ public function getStaticField(O\StaticFieldExpression $expression); /** * Get the supplied index expression matches the type. * * @param O\IndexExpression $expression * * @return ITypeOperation * @throws TypeException if the indexer is not supported. */ public function getIndex(O\IndexExpression $expression); /** * Gets the invocation expression matches the type. * * @param O\InvocationExpression $expression * * @return ITypeOperation|IMethod * @throws TypeException if the invocation is not supported. */ public function getInvocation(O\InvocationExpression $expression); /** * Gets the matched unary operator from the supplied expression. * * @param O\CastExpression $expression * * @return ITypeOperation|IMethod * @throws TypeException if the cast is not supported. */ public function getCast(O\CastExpression $expression); /** * Gets the matched unary operator from the supplied expression. * * @param O\UnaryOperationExpression $expression * * @return ITypeOperation|IMethod * @throws TypeException if the unary operation is not supported. */ public function getUnaryOperation(O\UnaryOperationExpression $expression); }
TimeToogo/Pinq
Source/Analysis/IType.php
PHP
mit
3,723
public class Heap { public static <E extends Comparable<E>> void sort(E[] array) { constructHeap(array); sortHeap(array); String debug = ""; } private static <E extends Comparable<E>> void sortHeap(E[] array) { for (int i = array.length - 1; i >= 1; i--) { swap(array, 0, i); heapifyDown(array, 0, i); } } private static <E extends Comparable<E>> void constructHeap(E[] array) { for (int i = array.length / 2; i >= 0; i--) { heapifyDown(array, i, array.length); } } private static <E extends Comparable<E>> void heapifyDown(E[] array, int index, int limit) { while (index < array.length / 2) { int childIndex = (2 * index) + 1; if(childIndex >= limit){ break; } if (childIndex + 1 < limit && array[childIndex].compareTo(array[childIndex + 1]) < 0) { childIndex += 1; } int compare = array[index].compareTo(array[childIndex]); if (compare > 0) { break; } swap(array, index, childIndex); index = childIndex; } } private static <E extends Comparable<E>> void swap(E[] array, int index, int childIndex) { E element = array[index]; array[index] = array[childIndex]; array[childIndex] = element; } }
yangra/SoftUni
DataStructures/BinaryHeap/src/main/java/Heap.java
Java
mit
1,445
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package HW09_101044044; /** * CSE241_HW09 Samet Sait Talayhan 101044044 */ /** * @author talayhan * */ public class Family { // Data fields private Person father = null; private Person mother = null; private Person [] children; /** The current size of the children array */ private int size = 0; /** The current size of the array */ private final static int INITIAL_CAPACITY = 10; /** T */ private int capacity = INITIAL_CAPACITY; public static int numberOfFamilies = 0; /** * No parameter constructor. */ public Family(){ ++numberOfFamilies; //increase family number children = new Person [INITIAL_CAPACITY]; } /** * Two paramater constructor. */ public Family(Person father, Person mother){ if(father.getGender().equals(mother.getGender())){ throw new IllegalArgumentException("Father and Mother should have different" + " gender!"); } this.father = father; this.mother = mother; children = new Person [INITIAL_CAPACITY]; ++numberOfFamilies; } /** * Allocate a new array to hold */ private void reallocate(){ capacity = capacity * 2; Person[] newArray = new Person[capacity]; System.arraycopy(children, 0, newArray, 0, children.length); children = newArray; } /** * Method at() returns the child at the given index. * @param int index * @return Person at the given index. */ public Person at(int index){ // Validty check if(index < 0 || index >= size){ throw new IndexOutOfBoundsException("Invalid index!"); } return children[index]; } /** * Method add() that adds the Person as a child * to the family. * @param Person as a child. */ public void add(Person child){ if (size >= capacity) { reallocate(); } children[size] = child; ++size; } /* * Method compareTo() comparing two families, and * returns true if two families are equal. * @return boolean * @param Family object * **/ public boolean compareTo(Family other){ if(this.hashCode() == other.hashCode()){ return true; } return false; } /** * Override method toString() * @return String * */ public String toString(){ String s = "\t\tFamily Informations\n"; s += "Father: \n" + father.toString(); s += "Mother: \n" + mother.toString(); for (int i = 0; i < size; i++) { s += "Child" + i + ":\n" + children[i].toString(); } return s; } /** * Method isRelative() returns true if one of the persons is a * relative of the other by equals sirname the family array list. * @param get two person objects and family objects array * @return boolean type, true or false. * */ public static boolean isRelative(Person one, Person two, Family[] families){ if(one.getLastName() == two.getLastName()) return true; for (int i = 0; i < families.length; i++) { String comp = families[i].father.getLastName(); if(comp == one.getLastName() || comp == two.getLastName()){ return true; } } return false; } //Gettters and setters methods. public Person getFather() { return father; } public void setFather(Person father) { this.father = father; } public Person getMother() { return mother; } public void setMother(Person mother) { this.mother = mother; } public Person[] getChildren() { return children; } public void setChildren(Person[] children) { this.children = children; } public static int getNumberOfFamilies() { return numberOfFamilies; } // Actually, Java take cares of all clean up resources, // But we should decrease number of families in destructor, protected void finalize(){ --numberOfFamilies; } }
stalayhan/OOP
cse241hw09/Family.java
Java
mit
3,888
namespace LEDLIB { public class LED3DObjectSet { public LED3DObject obj; public ILED3DCanvas filter; public LED3DObjectSet(LED3DObject obj, ILED3DCanvas filter) { this.obj = obj; this.filter = filter; } public LED3DObjectSet(LED3DObject obj) : this(obj, null) { } } }
hiroshi-mikuriya/3d_led_cube
content/cs/tatsuo98se_ledlib/tatsuo98se_ledlib/LED3DObjectSet.cs
C#
mit
387
package io.github.anantharajuc; public class IfStatement { public static void main(String[] args) { int age = 19; if (age > 18) { System.out.println("Eligible to Vote"); } } }
AnanthaRajuC/Core-Java-Concepts
Selection Statements/src/io/github/anantharajuc/IfStatement.java
Java
mit
198
class UserPolicy < ApplicationPolicy def create? user.admin? end def update? user.admin? || is_self? end def destroy? return false if is_guest? user.admin? || is_self? end private def is_self? user == record end end
thiago-sydow/secret-real-estate
app/policies/user_policy.rb
Ruby
mit
260
#include "include/MockIRRangeFinderSensor.h" #include "include/MockIRRangeFinderSensorMessage.h" MockIRRangeFinderSensor::MockIRRangeFinderSensor() { // Constructor } MockIRRangeFinderSensor::~MockIRRangeFinderSensor() { // Destructor } void MockIRRangeFinderSensor::updateSensor(IMessage* msg) { this->data = ((MockIRRangeFinderSensorMessage*)msg)->getData(); delete msg; } double MockIRRangeFinderSensor::getDistanceCM() { // No-Op return -1; } std::string MockIRRangeFinderSensor::getData() { return this->data; }
arthurlockman/wyatt
test/mocks/MockIRRangeFinderSensor.cpp
C++
mit
550
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class AboutUs extends CI_Controller { /** * AboutUs constructor. */ public function __construct() { parent::__construct(); if(!is_validated()){ redirect(BASEURL); } $this->load->model('about_m'); $this->load->model('content_m'); $this->load->library('user_agent'); date_default_timezone_set("Africa/Lagos"); } /** *Function to load the index page */ public function index() { $data = array( 'data' => array( 'title' => 'About us', 'page_title' => 'About Us', 'abouts' => $this->about_m->getAllAbout(), 'contents' => $this->content_m->getAllContents() ), 'content' => 'about/index', 'pageFooter' => 'about/footer' ); $this->load->view('template', $data); } /** * Function to add a new record */ public function add() { //get all posted data $content = $this->security->xss_clean($this->input->post('content')); $title = $this->security->xss_clean($this->input->post('title')); $description = $this->security->xss_clean($this->input->post('description')); $id = $this->security->xss_clean($this->input->post('id')); if($this->input->is_ajax_request()){ /** * If ID is set, update the data */ if($id != ""){ $about = $this->about_m->getAboutById(base64_decode($id)); $about->setContentid($content); $about->setTitle($title); $about->setDescription($description); $result = $this->about_m->updateAbout($about); if($result){ $check = true; }else{ $check = false; } echo json_encode($check); exit(); } /** * Insert a new content if ID not set. */ $about = new About(); $about->setContentid($content); $about->setTitle($title); $about->setDescription($description); $about->setStatus(1); $result = $this->about_m->addAbout($about); if($result){ $check = true; echo json_encode($check); exit(); } $check = false; echo json_encode($check); exit(); }else{ redirect($this->agent->referrer()); } } /** * Function to get data by id */ public function get_data() { //get content id $id = base64_decode($this->security->xss_clean($this->input->get('id'))); //check if it is an ajax request if($this->input->is_ajax_request()){ $about = $this->about_m->getAboutById($id); $data = [ 'content' => $about->getContentid(), 'title' => $about->getTitle(), 'description' => $about->getDescription() ]; echo json_encode($data); }else{ redirect($this->agent->referrer()); } } /** * Function to delete a record */ public function delete() { $id = base64_decode($this->security->xss_clean($this->input->get('id'))); if($this->input->is_ajax_request()){ $result = $this->about_m->delete($id); if($result){ $check = true; echo json_encode($check); exit(); } $check = false; echo json_encode($check); exit(); }else{ redirect($this->agent->referrer()); } } /** * Function to change status */ public function changeStatus() { $id = base64_decode($this->security->xss_clean($this->input->get('id'))); if($this->input->is_ajax_request()){ $about = $this->about_m->getAboutById($id); if($about){ if($about->getStatus() == 1){ //change status to 0 $about->setStatus(0); $update = $this->about_m->updateAbout($about); }else{ //change status to 1 $about->setStatus(1); $update = $this->about_m->updateAbout($about); } if($update){ $status = true; }else{ $status = false; } echo json_encode($status); exit(); } }else{ redirect($this->agent->referrer()); } } }
chinice/CodeigniterCMS
application/controllers/AboutUs.php
PHP
mit
4,906
export const plus = (f, l) => { let next = {}; if (typeof l === 'number') { next.low = l; next.high = 0; } else if (typeof l === 'object') { if (l.high && l.low && l.unsigned) { next = l; } else { throw new Error('Not a uint64 data'); } } return { high: f.high + next.high, low: f.low + next.low, unsigned: true }; }; export const generateKeyString = (uint64Object) => { if (typeof uint64Object === 'number') { return uint64Object.toString(); } if (typeof uint64Object === 'object' && typeof uint64Object.high === 'number') { return `${uint64Object.high}${uint64Object.low}`; } return Symbol(uint64Object).toString(); };
Jawnkuin/electron-618-im
app/utils/uint64.js
JavaScript
mit
697
import { Component } from '@angular/core'; import { NavController, NavParams, LoadingController, ToastController } from 'ionic-angular'; import { FilePath, Transfer } from 'ionic-native'; import { File } from '@ionic-native/file'; import { Http, Headers } from '@angular/http'; /* Generated class for the Download page. See http://ionicframework.com/docs/v2/components/#navigation for more info on Ionic pages and navigation. */ @Component({ selector: 'page-download', templateUrl: 'download.html' }) export class DownloadPage { items: any; hostname: string; filelist: any; loading: any; constructor(public navCtrl: NavController, public navParams: NavParams, public http: Http, public loadingCtrl: LoadingController, public toastCtrl: ToastController, public file: File) { this.http = http; this.http.get("assets/server.json") .subscribe(data =>{ this.items = JSON.parse(data['_body']);//get ip from server.json this.hostname = this.items.ip; //put ip into hostname this.http.get(this.hostname + 'download_dir') .subscribe(data =>{ this.filelist = JSON.parse(data['_body']); console.log(this.filelist); }) }); } presentToast(text) { let toast = this.toastCtrl.create({ message: text, duration: 3000, position: 'bottom' }); toast.present(); } download(file){ console.log(file); const fileTransfer = new Transfer(); var uri= encodeURI(this.hostname + 'download/' + file); this.loading = this.loadingCtrl.create({ content: 'Downloading...', }); this.loading.present(); fileTransfer.download(uri, this.file.externalRootDirectory+ '/Download/' + file).then((entry) => { console.log('download complete: ' + entry.toURL()); this.loading.dismissAll() this.presentToast('File succesful downloaded.'); }, err => { console.log(err); this.loading.dismissAll() this.presentToast('Error while downloading file.'); }); } ionViewDidLoad() { console.log('ionViewDidLoad DownloadPage'); } }
YMistake/Application-for-Industrial-Training-Course
src/pages/download/download.ts
TypeScript
mit
2,135
<legend> Frete grátis para entrega - {ACAO} <div class="pull-right"> <a href="{URLLISTAR}" title="Listar frete grátis de formas de entrega" class="btn">Voltar</a> </div> </legend> <form action="{ACAOFORM}" method="post" class="form-horizontal"> <input type="hidden" name="codfaixacepfretegratis" id="codfaixacepfretegratis" value="{codfaixacepfretegratis}"> <input type="hidden" name="codformaentrega" id="codformaentrega" value="{codformaentrega}"> <div class="control-group"> <label class="control-label" for="cepinicialfaixacepfretegratis">CEP Inicial <span class="required">*</span>:</label> <div class="controls"> <input type="text" class="cep" id="cepinicialfaixacepfretegratis" name="cepinicialfaixacepfretegratis" value="{cepinicialfaixacepfretegratis}" required="required" maxlength="9"> </div> </div> <div class="control-group"> <label class="control-label" for="cepfinalfaixacepfretegratis">CEP Final <span class="required">*</span>:</label> <div class="controls"> <input type="text" class="cep" id="cepfinalfaixacepfretegratis" name="cepfinalfaixacepfretegratis" value="{cepfinalfaixacepfretegratis}" required="required" maxlength="9"> </div> </div> <div class="control-group"> <label class="control-label" for="pesoinicialfaixacepfretegratis">Peso Inicial:</label> <div class="controls"> <input type="text" class="set-peso" id="pesoinicialfaixacepfretegratis" name="pesoinicialfaixacepfretegratis" value="{pesoinicialfaixacepfretegratis}"> </div> </div> <div class="control-group"> <label class="control-label" for="pesofinalfaixacepfretegratis">Peso Final:</label> <div class="controls"> <input type="text" class="set-peso" id="pesofinalfaixacepfretegratis" name="pesofinalfaixacepfretegratis" value="{pesofinalfaixacepfretegratis}"> </div> </div> <div class="control-group"> <label class="control-label" for="valorminimofaixacepfretegratis">Valor:</label> <div class="controls"> <input type="text" class="set-numeric" id="valorminimofaixacepfretegratis" name="valorminimofaixacepfretegratis" value="{valorminimofaixacepfretegratis}"> </div> </div> <div class="control-group"> <label class="control-label" for="habilitafaixacepfretegratis"></label> <div class="controls"> <label class="checkbox"> <input type="checkbox" {chk_habilitafaixacepfretegratis} name="habilitafaixacepfretegratis" value="S" /> Habilitar </label> </div> </div> <div class="well"> <button type="submit" class="btn">Salvar</button> </div> </form>
Orlando-Neto/loja_codeigniter
application/views/painel/faixacepfretegratis_form.php
PHP
mit
2,518
<?php class IndexController extends Zend_Controller_Action { /** * @var Zend_Auth * */ protected $_auth = null; public function init() { $this->_auth = Zend_Auth::getInstance(); } public function indexAction() { //$this->view->current_date_and_time = date('M d, Y - H:i:s'); //$form = new Application_Form_Register(); //$users = new Application_Model_DbTable_User(); //$this->view->users = $users->fetchAll(); } public function datagraphAction() { if(!$this->_auth->hasIdentity()){ $this->redirect('default/index/login'); } } public function overAction() { // action body } public function loginAction() { // action body } }
Sylvareth/DataSpotGhent
application/controllers/IndexController.php
PHP
mit
807
class CreateDesks < ActiveRecord::Migration def change create_table :desks do |t| t.string :style t.integer :price t.text :description t.timestamps end end end
joshjeong/deskspace
db/migrate/20141107211340_create_desks.rb
Ruby
mit
196
'use strict'; var maxBot = 11; var mode; var mw = {}; var mwId; function getMwId() { mwId = $.url().segment(4); } function isNewMicroworld() { return ($.url().segment(3) === 'new'); } function showStatusTableOptions() { var behaviour_name = $(this).attr('id'); var behaviour_type = $(this).text(); $(this).closest('.dropdown').find('span#btn_txt').text(behaviour_type+" ") $("."+behaviour_name).removeClass('hide'); if(behaviour_name == "static_option"){ $(".dynamic_option").addClass('hide'); } else { $(".static_option").addClass('hide'); } } function readyTooltips() { $('#early-end-tooltip').tooltip(); $('#max-fish-tooltip').tooltip(); $('#available-mystery-tooltip').tooltip(); $('#reported-mystery-tooltip').tooltip(); $('#spawn-factor-tooltip').tooltip(); $('#chance-catch-tooltip').tooltip(); $('#show-fisher-status-tooltip').tooltip(); $('#erratic-tooltip').tooltip(); $('#greed-tooltip').tooltip(); $('#greed-spread-tooltip').tooltip(); $('#trend-tooltip').tooltip(); $('#predictability-tooltip').tooltip(); $('#prob-action-tooltip').tooltip(); $('#attempts-second-tooltip').tooltip(); } function changeBotRowVisibility() { var numFishers = parseInt($('#num-fishers').val(), 10); var numHumans = parseInt($('#num-humans').val(), 10); if (numFishers < 1) numFishers = 1; if (numFishers > maxBot + numHumans) { numFishers = maxBot + numHumans; } if (numHumans > numFishers) numHumans = numFishers; for (var i = 1; i <= numFishers - numHumans; i++) { $('#bot-' + i + '-row').removeClass('collapse'); } for (var i = numFishers - numHumans + 1; i <= maxBot; i++) { $('#bot-' + i + '-row').addClass('collapse'); } } function changeGreedUniformity() { if ($('#uniform-greed').prop('checked') === true) { var greed = $('#bot-1-greed').val(); for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-greed').val(greed).attr('disabled', true); } } else { for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-greed').attr('disabled', false); } } } function changeGreedSpreadUniformity() { if ($('#uniform-greed-spread').prop('checked') === true) { var greedSpread = $('#bot-1-greed-spread').val(); for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-greed-spread').val(greedSpread).attr('disabled', true); } } else { for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-greedSpread').attr('disabled', false); } } } function changeTrendUniformity() { if ($('#uniform-trend').prop('checked') === true) { var trend = $('#bot-1-trend').val(); for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-trend').val(trend).attr('disabled', true); } } else { for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-trend').attr('disabled', false); } } } function changePredictabilityUniformity() { if ($('#uniform-predictability').prop('checked') === true) { var predictability = $('#bot-1-predictability').val(); for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-predictability').val(predictability).attr('disabled', true); } } else { for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-predictability').attr('disabled', false); } } } function changeProbActionUniformity() { if ($('#uniform-prob-action').prop('checked') === true) { var probAction = $('#bot-1-prob-action').val(); for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-prob-action').val(probAction).attr('disabled', true); } } else { for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-prob-action').attr('disabled', false); } } } function changeAttemptsSecondUniformity() { if ($('#uniform-attempts-second').prop('checked') === true) { var attemptsSecond = $('#bot-1-attempts-second').val(); for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-attempts-second').val(attemptsSecond).attr('disabled', true); } } else { for (var i = 2; i <= maxBot; i++) { $('#bot-' + i + '-attempts-second').attr('disabled', false); } } } function validate() { var errors = []; if ($('#name').val().length < 1) { errors.push('The microworld name is missing.'); } var numFishers = parseInt($('#num-fishers').val(), 10); if (numFishers < 1) { errors.push('There must be at least one fisher per simulation'); } if (numFishers > 12) { errors.push('The maximum number of fishers per simulation is twelve.'); } var numHumans = parseInt($('#num-humans').val(), 10); if (numHumans < 0) { errors.push('There must be zero or more humans per simulation.'); } if (numHumans > numFishers) { errors.push('There cannot be more human fishers than total fishers.'); } if (parseInt($('#num-seasons').val(), 10) < 1) { errors.push('There must be at least one season per simulation.'); } if (parseInt($('#season-duration').val(), 10) < 1) { errors.push('Seasons must have a duration of at least one second.'); } if (parseInt($('#initial-delay').val(), 10) < 1) { errors.push('The initial delay must be at least one second long.'); } if (parseInt($('#season-delay').val(), 10) < 1) { errors.push('The delay between seasons must be at least one second.'); } if (parseFloat($('#fish-value').val()) < 0) { errors.push('The value per fish cannot be negative'); } if (parseFloat($('#cost-cast').val()) < 0) { errors.push('The cost to attempt to fish cannot be negative.'); } if (parseFloat($('#cost-departure').val()) < 0) { errors.push('The cost to set sail cannot be negative.'); } if (parseFloat($('#cost-second').val()) < 0) { errors.push('The cost per second at sea cannot be negative.'); } var certainFish = parseInt($('#certain-fish').val(), 10); if (certainFish < 1) { errors.push('There must be at least one initial fish.'); } var availMysteryFish = parseInt($('#available-mystery-fish').val(), 10); if (availMysteryFish < 0) { errors.push('The number of available mystery fish cannot be negative'); } var repMysteryFish = parseInt($('#reported-mystery-fish').val(), 10); if (repMysteryFish < availMysteryFish) { errors.push('The number of reported mystery fish must be equal or ' + 'greater than the number of actually available mystery fish.'); } var maxFish = parseInt($('#max-fish').val(), 10); if (maxFish < certainFish + availMysteryFish) { errors.push('The maximum fish capacity must be equal or greater ' + 'than the sum of certain and available mystery fish.'); } if (parseFloat($('#spawn-factor').val()) < 0) { errors.push('The spawn factor cannot be negative.'); } var chanceCatch = parseFloat($('#chance-catch').val()); if (chanceCatch < 0 || chanceCatch > 1) { errors.push('The chance of catch must be a number between 0 and 1.'); } if ($('#preparation-text').val().length < 1) { errors.push('The preparation text is missing.'); } if ($('#end-time-text').val().length < 1) { errors.push('The text for ending on time is missing.'); } if ($('#end-depletion-text').val().length < 1) { errors.push('The text for ending on depletion is missing.'); } for (var i = 1; i <= (numFishers - numHumans); i++) { if ($('#bot-' + i + '-name').val().length < 1) { errors.push('Bot ' + i + ' needs a name.'); } var botGreed = parseFloat($('#bot-' + i + '-greed').val()); if (botGreed < 0 || botGreed > 1) { errors.push('The greed of bot ' + i + ' must be between 0 and 1.'); } var botGreedSpread = parseFloat($('#bot-' + i + '-greed-spread').val()); if (botGreedSpread < 0) { errors.push('The greed spread of bot ' + i + ' must be greater than 0.'); } if (botGreedSpread > 2 * botGreed) { errors.push('The greed spread of bot ' + i + ' must be less than twice its greed.'); } var botProbAction = parseFloat($('#bot-' + i + '-prob-action').val()); if (botProbAction < 0 || botProbAction > 1) { errors.push('The probability of action of bot ' + i + ' must be between 0 and 1.'); } var botAttempts = parseFloat($('#bot-' + i + '-attempts-second').val()); if (botAttempts < 1) { errors.push('The attempts per second of bot ' + i + ' must be between at least 1.'); } } if (errors.length === 0) return null; return errors; } function prepareMicroworldObject() { var mw = {}; mw.name = $('#name').val(); mw.desc = $('#desc').val(); mw.numFishers = $('#num-fishers').val(); mw.numHumans = $('#num-humans').val(); mw.numSeasons = $('#num-seasons').val(); mw.seasonDuration = $('#season-duration').val(); mw.initialDelay = $('#initial-delay').val(); mw.seasonDelay = $('#season-delay').val(); mw.enablePause = $('#enable-pause').prop('checked'); mw.enableEarlyEnd = $('#enable-early-end').prop('checked'); mw.enableTutorial = $('#enable-tutorial').prop('checked'); mw.enableRespawnWarning = $('#change-ocean-colour').prop('checked'); mw.fishValue = $('#fish-value').val(); mw.costCast = $('#cost-cast').val(); mw.costDeparture = $('#cost-departure').val(); mw.costSecond = $('#cost-second').val(); mw.currencySymbol = $('#currency-symbol').val(); mw.certainFish = $('#certain-fish').val(); mw.availableMysteryFish = $('#available-mystery-fish').val(); mw.reportedMysteryFish = $('#reported-mystery-fish').val(); mw.maxFish = $('#max-fish').val(); mw.spawnFactor = $('#spawn-factor').val(); mw.chanceCatch = $('#chance-catch').val(); mw.showFishers = $('#show-fishers').prop('checked'); mw.showFisherNames = $('#show-fisher-names').prop('checked'); mw.showFisherStatus = $('#show-fisher-status').prop('checked'); mw.showNumCaught = $('#show-num-caught').prop('checked'); mw.showFisherBalance = $('#show-fisher-balance').prop('checked'); mw.preparationText = $('#preparation-text').val(); mw.endTimeText = $('#end-time-text').val(); mw.endDepletionText = $('#end-depletion-text').val(); mw.bots = []; for (var i = 1; i <= mw.numFishers - mw.numHumans; i++) { var botPrefix = '#bot-' + i + '-'; mw.bots.push({ name: $(botPrefix + 'name').val(), greed: $(botPrefix + 'greed').val(), greedSpread: $(botPrefix + 'greed-spread').val(), trend: $(botPrefix + 'trend').val(), predictability: $(botPrefix + 'predictability').val(), probAction: $(botPrefix + 'prob-action').val(), attemptsSecond: $(botPrefix + 'attempts-second').val() }); } mw.oceanOrder = $("input[name=ocean_order]:checked").val(); return mw; } function reportErrors(err) { var errMessage = 'The form has the following errors:\n\n'; for (var i in err) { errMessage += err[i] + '\n'; } alert(errMessage); return; } function badMicroworld(jqXHR) { reportErrors(JSON.parse(jqXHR.responseText).errors); return; } function goodMicroworld() { location.href = '../dashboard'; } function createMicroworld() { var err = validate(); if (err) { reportErrors(err); return; } var mw = prepareMicroworldObject(); $.ajax({ type: 'POST', url: '/microworlds', data: mw, error: badMicroworld, success: goodMicroworld }); } function cloneMicroworld() { var err = validate(); if (err) { reportErrors(err); return; } var mw = prepareMicroworldObject(); mw.clone = true; $.ajax({ type: 'POST', url: '/microworlds', data: mw, error: badMicroworld, success: goodMicroworld }); } function updateMicroworld(changeTo) { var err = validate(); if (err) { reportErrors(err); return; } var mw = prepareMicroworldObject(); if (changeTo) mw.changeTo = changeTo; $.ajax({ type: 'PUT', url: '/microworlds/' + mwId, data: mw, error: badMicroworld, success: goodMicroworld }); } function saveMicroworld() { updateMicroworld(); } function activateMicroworld() { updateMicroworld('active'); } function archiveMicroworld() { updateMicroworld('archived'); } function deleteMicroworld() { $.ajax({ type: 'DELETE', url: '/microworlds/' + mwId, error: badMicroworld, success: goodMicroworld }); } function populatePage() { $('#name').val(mw.name); $('#desc').val(mw.desc); $('#num-fishers').val(mw.params.numFishers); $('#num-humans').val(mw.params.numHumans); $('#num-seasons').val(mw.params.numSeasons); $('#season-duration').val(mw.params.seasonDuration); $('#initial-delay').val(mw.params.initialDelay); $('#season-delay').val(mw.params.seasonDelay); $('#enable-pause').prop('checked', mw.params.enablePause); $('#enable-early-end').prop('checked', mw.params.enableEarlyEnd); $('#enable-tutorial').prop('checked', mw.params.enableTutorial); $('#change-ocean-colour').prop('checked', mw.params.enableRespawnWarning); $('#fish-value').val(mw.params.fishValue); $('#cost-cast').val(mw.params.costCast); $('#cost-departure').val(mw.params.costDeparture); $('#cost-second').val(mw.params.costSecond); $('#currency-symbol').val(mw.params.currencySymbol); $('#certain-fish').val(mw.params.certainFish); $('#available-mystery-fish').val(mw.params.availableMysteryFish); $('#reported-mystery-fish').val(mw.params.reportedMysteryFish); $('#max-fish').val(mw.params.maxFish); $('#spawn-factor').val(mw.params.spawnFactor); $('#chance-catch').val(mw.params.chanceCatch); $('#preparation-text').val(mw.params.preparationText); $('#end-time-text').val(mw.params.endTimeText); $('#end-depletion-text').val(mw.params.endDepletionText); $('#show-fishers').prop('checked', mw.params.showFishers); $('#show-fisher-names').prop('checked', mw.params.showFisherNames); $('#show-fisher-status').prop('checked', mw.params.showFisherStatus); $('#show-num-caught').prop('checked', mw.params.showNumCaught); $('#show-fisher-balance').prop('checked', mw.params.showFisherBalance); $('#uniform-greed').prop('checked', false); $('#uniform-greed-spread').prop('checked', false); $('#uniform-trend').prop('checked', false); $('#uniform-predictability').prop('checked', false); $('#uniform-prob-action').prop('checked', false); $('#uniform-attempts-second').prop('checked', false); for (var i = 1; i <= mw.params.numFishers - mw.params.numHumans; i++) { var botPrefix = '#bot-' + i + '-'; $(botPrefix + 'name').val(mw.params.bots[i - 1].name); $(botPrefix + 'greed').val(mw.params.bots[i - 1].greed); $(botPrefix + 'greed-spread').val(mw.params.bots[i - 1].greedSpread); $(botPrefix + 'trend').val(mw.params.bots[i - 1].trend); $(botPrefix + 'predictability').val(mw.params.bots[i - 1].predictability); $(botPrefix + 'prob-action').val(mw.params.bots[i - 1].probAction); $(botPrefix + 'attempts-second').val(mw.params.bots[i - 1].attemptsSecond); } $("#"+mw.params.oceanOrder).prop('checked', true); changeBotRowVisibility(); } function noMicroworld(jqXHR) { alert(jqXHR.responseText); } function gotMicroworld(m) { mw = m; mode = mw.status; populatePage(); prepareControls(); } function getMicroworld() { $.ajax({ type: 'GET', url: '/microworlds/' + mwId, error: noMicroworld, success: gotMicroworld }); } function noRuns(jqXHR) { alert(jqXHR.responseText); } function gotRuns(r) { var table = ''; for (var i in r) { var button = '<button class="btn btn-sm btn-info" type="submit" onclick=location.href=\'/runs/' + r[i]._id + '?csv=true\'>Download <span class="glyphicon glyphicon-download-alt"></span></button>'; table += '<tr><td><a href="../runs/' + r[i]._id + '">' + moment(r[i].time).format('llll') + '</a></td>' + '<td>' + r[i].participants + '</td>' + '<td>' + button + '</tr>'; } $('#microworld-runs-table-rows').html(table); // enabled or disable the download all button depending on if there are any completed runs if (r.length == 0) { $('#download-all-button').attr("disabled", "disabled"); } else { $('#download-all-button').removeAttr("disabled"); } setTimeout(getRuns, 60000); } function getRuns() { $.ajax({ type: 'GET', url: '/runs/?mw=' + mwId, error: noRuns, success: gotRuns }); } function backToList() { location.href = '../dashboard'; } // Makes downloading all runs possible function initDownloadAll() { $('#download-all-button').attr("onclick", "location.href='/runs?csv=true&mw="+mwId+"'"); } function setButtons() { $('#create').click(createMicroworld); $('#create-2').click(createMicroworld); $('#save').click(saveMicroworld); $('#save-2').click(saveMicroworld); $('#cancel').click(backToList); $('#cancel-2').click(backToList); $('#clone-confirmed').click(cloneMicroworld) $('#activate-confirmed').click(activateMicroworld); $('#archive-confirmed').click(archiveMicroworld); $('#delete-confirmed').click(deleteMicroworld); $(".behaviour_group_select").click(showStatusTableOptions); initDownloadAll(); } function setOnPageChanges() { $('#num-fishers').on('change', changeBotRowVisibility); $('#num-humans').on('change', changeBotRowVisibility); $('#uniform-greed').on('change', changeGreedUniformity); $('#bot-1-greed').on('input', changeGreedUniformity); $('#uniform-greed-spread').on('change', changeGreedSpreadUniformity); $('#bot-1-greed-spread').on('input', changeGreedSpreadUniformity); $('#uniform-trend').on('change', changeTrendUniformity); $('#bot-1-trend').on('change', changeTrendUniformity); $('#uniform-predictability').on('change', changePredictabilityUniformity); $('#bot-1-predictability').on('change', changePredictabilityUniformity); $('#uniform-prob-action').on('change', changeProbActionUniformity); $('#bot-1-prob-action').on('input', changeProbActionUniformity); $('#uniform-attempts-second').on('change', changeAttemptsSecondUniformity); $('#bot-1-attempts-second').on('input', changeAttemptsSecondUniformity); } function loadTexts() { $('#preparation-text').val(prepText); $('#end-time-text').val(endTimeText); $('#end-depletion-text').val(endDepletedText); } function prepareControls() { $('#microworld-panel-body-text').text(panelBody[mode]); $('#microworld-panel-2-body-text').text(panelBody[mode]); if (mode === 'new') { $('#microworld-header').text(pageHeader[mode]); $('#microworld-panel-title').text(panelTitle[mode]); $('#microworld-panel-2-title').text(panelTitle[mode]); loadTexts(); $('#create').removeClass('collapse'); $('#create-2').removeClass('collapse'); $("#ocean_order_user_top").prop("checked", true); uniformityChanges(); } else if (mode === 'test') { $('title').text('Fish - Microworld in Test'); $('#microworld-header').text(pageHeader[mode] + mw.code); $('#microworld-panel-title').text(panelTitle[mode] + mw.code); $('#microworld-panel-2-title').text(panelTitle[mode] + mw.code); $('#save').removeClass('collapse'); $('#save-2').removeClass('collapse'); $('#clone').removeClass('collapse'); $('#clone-2').removeClass('collapse'); $('#activate').removeClass('collapse'); $('#activate-2').removeClass('collapse'); $('#delete').removeClass('collapse'); $('#delete-2').removeClass('collapse'); if($('input[type="radio"]:checked').parent().parent().hasClass('dynamic_option')) { $(".static_option").addClass('hide'); $(".dynamic_option").removeClass("hide"); $('span#btn_txt').text("Dynamic Behaviour\xa0\xa0"); //\xa0 is the char &nbsp; makes } uniformityChanges(); } else if (mode === 'active') { $('title').text('Fish - Active Microworld'); $('#microworld-header').text(pageHeader[mode] + mw.code); $('#microworld-panel-title').text(panelTitle[mode] + mw.code); $('#microworld-panel-2-title').text(panelTitle[mode] + mw.code); $('#clone').removeClass('collapse'); $('#clone-2').removeClass('collapse'); $('#archive').removeClass('collapse'); $('#archive-2').removeClass('collapse'); $('#delete').removeClass('collapse'); $('#delete-2').removeClass('collapse'); $('.to-disable').each( function() { $(this).prop('disabled', true); }); $('#results').removeClass('collapse'); $(".dynamic_option").removeClass("hide"); } else if (mode === 'archived') { $('title').text('Fish - Archived Microworld'); $('#microworld-header').text(pageHeader[mode]); $('#microworld-panel-title').text(panelTitle[mode]); $('#microworld-panel-2-title').text(panelTitle[mode]); $('#clone').removeClass('collapse'); $('#clone-2').removeClass('collapse'); $('#activate').removeClass('collapse'); $('#activate-2').removeClass('collapse'); $('#delete').removeClass('collapse'); $('#delete-2').removeClass('collapse'); $('.to-disable').each( function() { $(this).prop('disabled', true); }); $('#results').removeClass('collapse'); $(".dynamic_option").removeClass("hide"); } } function loadData() { if (isNewMicroworld()) { mode = 'new'; prepareControls(); } else { getMicroworld(); // will eventually call prepareControls() getRuns(); } } function uniformityChanges() { changeGreedUniformity(); changeGreedSpreadUniformity(); changeTrendUniformity(); changePredictabilityUniformity(); changeProbActionUniformity(); changeAttemptsSecondUniformity(); } function main() { getMwId(); isNewMicroworld() readyTooltips(); setButtons(); setOnPageChanges(); loadData(); } $(document).ready(main);
jorgearanda/fish
public/js/microworld.js
JavaScript
mit
23,070
<?php namespace Bixie\Userprofile\User; use Bixie\Userprofile\Model\Profilevalue; use Pagekit\Application as App; use Pagekit\User\Model\User; use Pagekit\Util\Arr; class ProfileUser implements \JsonSerializable { use ProfileUserTrait; /** * @var integer */ public $id; /** * @var User */ protected $user; /** * @var array */ protected $data; /** * @var Profilevalue[] */ protected $fieldValues; protected static $instances = []; /** * proxy load for emailsender module * @return ProfileUser */ public static function create () { return self::load(); } /** * @param User|null $user * @return ProfileUser */ public static function load (User $user = null) { $user = $user ?: App::user(); $class = get_called_class(); if (!isset(self::$instances[$user->id]) || !(self::$instances[$user->id] instanceof $class)) { self::$instances[$user->id] = new $class($user); } return self::$instances[$user->id]; } /** * ProfileUser constructor. * @param $user */ public function __construct (User $user) { $this->id = $user->id ?: 0; $this->user = $user; } /** * @return array */ public function getProfile () { if (!isset($this->data)) { $this->data = []; $this->fieldValues = App::module('bixie/userprofile')->getProfile($this->user, false, false); foreach ($this->fieldValues as $slug => $fieldValue) { $this->data[$slug] = $fieldValue->getValue(false); } } return $this->data; } /** * @return array */ public function getProfileValues () { $this->getProfile(); $data = []; foreach ($this->fieldValues as $slug => $fieldValue) { $data[$slug] = $fieldValue->toFormattedArray(['id' => $fieldValue->id]); } return $data; } /** * @param array $profilevalues FormattedArray of profilevalues */ public function setProfileValues ($profilevalues) { $this->getProfile(); foreach ($profilevalues as $field_value) { if (!isset($field_value['value']) || !isset($this->fieldValues[$field_value['slug']])) { continue; } $this->fieldValues[$field_value['slug']]->setValue($field_value['value'], @$field_value['data']); } } /** * Gets a data value. * @param string $key * @param mixed $default * @return mixed */ public function get ($key, $default = null) { if (property_exists($this->user, $key)) { return $this->user->$key; } $this->getProfile(); return Arr::get((array)$this->data, $key, $default); } /** * Sets a data value. * @param string $key * @param mixed $value * @param array $valuedata */ public function set ($key, $value, $valuedata = []) { $this->getProfile(); Arr::set($this->data, $key, $value); if (isset($this->fieldValues[$key])) { $this->fieldValues[$key]->setValue($value, $valuedata); } } /** * @param array $data raw profile values (na data possible) */ public function saveProfile ($data = []) { foreach ($data as $key => $value) { $this->set($key, $value); } foreach ($this->fieldValues as $fieldValue) { $fieldValue->save(['data' => $fieldValue->getValuedata()]); } } /** * Proxy isAuthenticated * @return bool */ public function isAuthenticated () { return $this->user->isAuthenticated(); } /** * @param \Pagekit\Site\Model\Node $node * @return string */ public function getProfileUrl ($node = null) { if ($node && $node->type == 'user_profiles') { return App::url($node->link . '/id', ['id' => $this->id]); } return App::url('@userprofile/profiles/id', ['id' => $this->id]); } /** * @param int $width * @param int $height * @return string */ public function getAvatar ($width = 280, $height = 280) { $config = App::module('bixie/userprofile')->config(); $this->getProfile(); if ($avatar_field = $config['avatar_field'] and $fieldValue = $this->fieldValues[$avatar_field]) { $files = $fieldValue->getValuedata(); $file = reset($files); if ($file['url']) { return sprintf('<img height="%d" width="%d" alt="%s" src="%s">', $height, $width, $this->get('username'), $file['url']); } } if ($config['use_gravatar']) { return sprintf('<img height="%d" width="%d" alt="%s" v-gravatar.literal="%s">', $height, $width, $this->get('username'), $this->get('email')); } $fallback = $config['fallback_image_src'] ?: 'packages/bixie/pk-framework/assets/noimage.jpg'; return sprintf('<img height="%d" width="%d" alt="%s" src="%s">', $height, $width, $this->get('username'), App::url()->getStatic($fallback, [], 'base')); } /** * Proxy permissioncheck * @param $permission * @return bool */ public function hasAccess ($permission) { return $this->user->hasAccess($permission); } /** * @param array $data * @return array */ public function toArray ($data = []) { $this->getProfile(); $data['avatar_image'] = $this->getAvatar(); return array_merge($this->user->toArray($data, ['password', 'activation']), $this->data); } /** * @return array */ function jsonSerialize () { return $this->toArray(); } }
yaelduckwen/e-pagekit
packages/bixie/userprofile/src/User/ProfileUser.php
PHP
mit
5,307
namespace ModuleHost { using System.Web.Http; public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Web API configuration and services // Web API routes config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } } }
protomatter/modular-scripts
Module Host/App_Start/WebApiConfig.cs
C#
mit
524
<!DOCTYPE HTML> <html> <head> <title>Admin Panel</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="Shoppy Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" /> <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <link href="<?php echo base_url();?>/assets/css/bootstrap.css" rel="stylesheet" type="text/css" media="all"> <!-- Custom Theme files --> <link href="<?php echo base_url();?>/assets/css/style.css" rel="stylesheet" type="text/css" media="all"/> <!--js--> <script src="<?php echo base_url();?>/assets/js/jquery-2.1.1.min.js"></script> <!--icons-css--> <link href="<?php echo base_url();?>/assets/css/font-awesome.css" rel="stylesheet"> <!--Google Fonts--> <link href='//fonts.googleapis.com/css?family=Carrois+Gothic' rel='stylesheet' type='text/css'> <link href='//fonts.googleapis.com/css?family=Work+Sans:400,500,600' rel='stylesheet' type='text/css'> <!--static chart--> </head> <body> <div class="login-page"> <div class="login-main"> <div class="login-head"> <h1>Login</h1> </div> <div class="login-block"> <form method="post" action="<?php echo base_url().'index.php/MyController/login'?>" > <input type="text" name="username" placeholder="Username" required=""> <input type="password" name="password" class="lock" placeholder="Password"> <input type="submit" name="Sign In" value="Login"> <td colspan="2"><?php echo $err_message;?></td> </form> </div> </div> </div> <!--inner block end here--> <!--copy rights start here--> <div class="copyrights"> <p>© 2017 Pemadam Kelaparan | Design by <a href="http://w3layouts.com/" target="_blank">W3layouts</a> </p> </div> <!--COPY rights end here--> <!--scrolling js--> <script src="<?php echo base_url();?>/assets/js/jquery.nicescroll.js"></script> <script src="<?php echo base_url();?>/assets/js/scripts.js"></script> <!--//scrolling js--> <script src="<?php echo base_url();?>/assets/js/bootstrap.js"> </script> <!-- mother grid end here--> </body> </html>
ericamaulidina/pemadam
application/views/adminmasuk.php
PHP
mit
2,531
package jqian.sootex.location; import soot.SootField; import soot.Type; /** Model a static class field */ public class GlobalLocation extends Location{ protected final SootField _field; GlobalLocation(SootField field){ this._field=field; } public SootField getSootField(){ return _field; } public String toString(){ return _field.getDeclaringClass().getShortName()+"."+_field.getName(); } public Type getType(){ return _field.getType(); } }
juqian/Slithice
Slithice/src/jqian/sootex/location/GlobalLocation.java
Java
mit
558
/** * The MIT License (MIT) * * Copyright (c) 2014-2017 Marc de Verdelhan & respective authors (see AUTHORS) * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package eu.verdelhan.ta4j.indicators.trackers; import eu.verdelhan.ta4j.Decimal; import eu.verdelhan.ta4j.TimeSeries; import eu.verdelhan.ta4j.indicators.CachedIndicator; import eu.verdelhan.ta4j.indicators.helpers.DirectionalDownIndicator; import eu.verdelhan.ta4j.indicators.helpers.DirectionalUpIndicator; /** * Directional movement indicator. * <p> */ public class DirectionalMovementIndicator extends CachedIndicator<Decimal>{ private final int timeFrame; private final DirectionalUpIndicator dup; private final DirectionalDownIndicator ddown; public DirectionalMovementIndicator(TimeSeries series, int timeFrame) { super(series); this.timeFrame = timeFrame; dup = new DirectionalUpIndicator(series, timeFrame); ddown = new DirectionalDownIndicator(series, timeFrame); } @Override protected Decimal calculate(int index) { Decimal dupValue = dup.getValue(index); Decimal ddownValue = ddown.getValue(index); Decimal difference = dupValue.minus(ddownValue); return difference.abs().dividedBy(dupValue.plus(ddownValue)).multipliedBy(Decimal.HUNDRED); } @Override public String toString() { return getClass().getSimpleName() + " timeFrame: " + timeFrame; } }
enkara/ta4j
ta4j/src/main/java/eu/verdelhan/ta4j/indicators/trackers/DirectionalMovementIndicator.java
Java
mit
2,472
<?php /** * SiteCLI - Help you manage Nginx local development configuration * * @author panlatent@gmail.com * @link https://github.com/panlatent/site-cli * @license https://opensource.org/licenses/MIT */ namespace Panlatent\SiteCli\Site; use ArrayIterator; use InvalidArgumentException; abstract class Node extends ArrayIterator implements NodeInterface { const PRETTY_SEPARATOR = '/'; /** * @var string */ protected $name; /** * @var string */ protected $path; /** * @var \Panlatent\SiteCli\Site\NodeInterface|null */ protected $parent; public function getName() { if (empty($this->name)) { throw new InvalidArgumentException('Undefined repository name'); } return $this->name; } public function getPrettyName() { $parentPrettyName = $this->parent ? $this->parent->getPrettyName() : ''; return ltrim($parentPrettyName . self::PRETTY_SEPARATOR . $this->name, self::PRETTY_SEPARATOR); } public function getPath() { return $this->path; } public function getParent() { return $this->parent; } public function getParents() { $parents = []; for ($parent = $this->parent; $parent; $parent = $parent->getParent()) { $parents[] = $parent; } return $parents; } public function filter() { return new Filter($this->getArrayCopy()); } }
panlatent/site-cli
src/Site/Node.php
PHP
mit
1,496
# coding: utf-8 """ Модуль с преднастроенными панелями-деевьями """ from __future__ import absolute_import from m3.actions.urls import get_url from m3_ext.ui import containers from m3_ext.ui import controls from m3_ext.ui import menus from m3_ext.ui import render_component from m3_ext.ui.fields import ExtSearchField class ExtObjectTree(containers.ExtTree): """ Панель с деревом для управления списком объектов. """ #========================================================================== # Внутренние классы для ExtObjectTree #========================================================================== class TreeContextMenu(menus.ExtContextMenu): """ Внутренний класс для удобной работы с контекстным меню дерева """ def __init__(self, *args, **kwargs): super( ExtObjectTree.TreeContextMenu, self ).__init__( *args, **kwargs ) self.menuitem_new = menus.ExtContextMenuItem( text=u'Новый в корне', icon_cls='add_item', handler='contextMenuNewRoot' ) self.menuitem_new_child = menus.ExtContextMenuItem( text=u'Новый дочерний', icon_cls='add_item', handler='contextMenuNewChild' ) self.menuitem_edit = menus.ExtContextMenuItem( text=u'Изменить', icon_cls='edit_item', handler='contextMenuEdit' ) self.menuitem_delete = menus.ExtContextMenuItem( text=u'Удалить', icon_cls='delete_item', handler='contextMenuDelete' ) self.menuitem_separator = menus.ExtContextMenuSeparator() self.init_component() class TreeTopBar(containers.ExtToolBar): """ Внутренний класс для удобной работы топбаром грида """ def __init__(self, *args, **kwargs): super(ExtObjectTree.TreeTopBar, self).__init__(*args, **kwargs) self.button_new = menus.ExtContextMenuItem( text=u'Новый в корне', icon_cls='add_item', handler='topBarNewRoot' ) self.button_new_child = menus.ExtContextMenuItem( text=u'Новый дочерний', icon_cls='add_item', handler='topBarNewChild' ) self.button_edit = controls.ExtButton( text=u'Изменить', icon_cls='edit_item', handler='topBarEdit' ) self.button_delete = controls.ExtButton( text=u'Удалить', icon_cls='delete_item', handler='topBarDelete' ) self.button_refresh = controls.ExtButton( text=u'Обновить', icon_cls='refresh-icon-16', handler='topBarRefresh' ) menu = menus.ExtContextMenu() menu.items.append(self.button_new) menu.items.append(self.button_new_child) self.add_menu = containers.ExtToolbarMenu( icon_cls="add_item", menu=menu, text=u'Добавить' ) self.init_component() #========================================================================== # Собственно определение класса ExtObjectTree #========================================================================== def __init__(self, *args, **kwargs): super(ExtObjectTree, self).__init__(*args, **kwargs) self.template = 'ext-trees/ext-object-tree.js' #====================================================================== # Действия, выполняемые изнутри грида #====================================================================== self.action_new = None self.action_edit = None self.action_delete = None self.action_data = None #====================================================================== # Источник данных для грида #====================================================================== self.load_mask = True self.row_id_name = 'id' self.parent_id_name = 'parent_id' self.allow_paging = False #====================================================================== # Контекстное меню и бары дерева #====================================================================== self.context_menu_row = ExtObjectTree.TreeContextMenu() self.context_menu_tree = ExtObjectTree.TreeContextMenu() self.top_bar = ExtObjectTree.TreeTopBar() self.top_bar.items.append(self.top_bar.add_menu) self.top_bar.items.append(self.top_bar.button_edit) self.top_bar.items.append(self.top_bar.button_delete) self.top_bar.items.append(self.top_bar.button_refresh) self.dblclick_handler = 'onEditRecord' # Признак "Сортировки папок" # если true, то папки всегда будут выше простых элементов # иначе, сортируются как элементы self.folder_sort = True # Возможность сортировки в дереве self.enable_tree_sort = True # После редактирования и добавления обновляется только тот узел дерева, # в котором произошли изменения self.incremental_update = False # Список исключений для make_read_only self._mro_exclude_list = [] self.init_component() def add_search_field(self): u"""Добавляет строку поиска в гриде.""" self.top_bar.search_field = ExtSearchField( empty_text=u'Поиск', width=200, component_for_search=self) self.top_bar.add_fill() self.top_bar.items.append(self.top_bar.search_field) self._mro_exclude_list.append(self.top_bar.search_field) def render(self): """ Переопределяем рендер дерева для того, чтобы модифицировать содержимое его панелей и контекстных меню """ if self.action_new: self.context_menu_row.items.append( self.context_menu_row.menuitem_new) self.context_menu_row.items.append( self.context_menu_row.menuitem_new_child) self.context_menu_tree.items.append( self.context_menu_tree.menuitem_new) if self.action_edit: self.context_menu_row.items.append( self.context_menu_row.menuitem_edit) self.handler_dblclick = self.dblclick_handler if self.action_delete: self.context_menu_row.items.append( self.context_menu_row.menuitem_delete) # контекстное меню прицепляется к гриду только в том случае, если # в нем есть хотя бы один пункт if self.context_menu_tree.items: self.handler_contextmenu = self.context_menu_tree if self.context_menu_row.items: self.handler_rowcontextmenu = self.context_menu_row #====================================================================== # Настройка top bar #====================================================================== for action, btn in ( (self.action_new, self.top_bar.add_menu), (self.action_edit, self.top_bar.button_edit), (self.action_delete, self.top_bar.button_delete), (self.action_data, self.top_bar.button_refresh), ): if not action and btn in self.top_bar.items: self.top_bar.items.remove(btn) # тонкая настройка self.store if not self.url and self.action_data: self.url = get_url(self.action_data) self.render_base_config() self.render_params() return render_component(self) def render_params(self): super(ExtObjectTree, self).render_params() get_url_or_none = lambda x: get_url(x) if x else None new_url = get_url_or_none(self.action_new) edit_url = get_url_or_none(self.action_edit) delete_url = get_url_or_none(self.action_delete) data_url = get_url_or_none(self.action_data) context_json = ( self.action_context.json if self.action_context else None ) self._put_params_value( 'actions', { 'newUrl': new_url, 'editUrl': edit_url, 'deleteUrl': delete_url, 'dataUrl': data_url, 'contextJson': context_json } ) self._put_params_value('rowIdName', self.row_id_name) self._put_params_value('parentIdName', self.parent_id_name) self._put_params_value('folderSort', self.folder_sort) self._put_params_value('enableTreeSort', self.enable_tree_sort) self._put_params_value('incrementalUpdate', self.incremental_update) def t_render_base_config(self): return self._get_config_str() def t_render_params(self): return self._get_params_str()
barsgroup/m3-ext
src/m3_ext/ui/panels/trees.py
Python
mit
9,988
<?php /* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the MIT license. For more information, see * <http://www.doctrine-project.org>. */ namespace Redking\ParseBundle; /** * Container for all ORM events. * * This class cannot be instantiated. * * @author Roman Borschel <roman@code-factory.org> * * @since 2.0 */ final class Events { /** * Private constructor. This class is not meant to be instantiated. */ private function __construct() { } /** * The preRemove event occurs for a given entity before the respective * EntityManager remove operation for that entity is executed. * * This is an entity lifecycle event. * * @var string */ const preRemove = 'preRemove'; /** * The postRemove event occurs for an entity after the entity has * been deleted. It will be invoked after the database delete operations. * * This is an entity lifecycle event. * * @var string */ const postRemove = 'postRemove'; /** * The prePersist event occurs for a given entity before the respective * EntityManager persist operation for that entity is executed. * * This is an entity lifecycle event. * * @var string */ const prePersist = 'prePersist'; /** * The postPersist event occurs for an entity after the entity has * been made persistent. It will be invoked after the database insert operations. * Generated primary key values are available in the postPersist event. * * This is an entity lifecycle event. * * @var string */ const postPersist = 'postPersist'; /** * The preUpdate event occurs before the database update operations to * entity data. * * This is an entity lifecycle event. * * @var string */ const preUpdate = 'preUpdate'; /** * The postUpdate event occurs after the database update operations to * entity data. * * This is an entity lifecycle event. * * @var string */ const postUpdate = 'postUpdate'; /** * The preLoad event occurs for a object before the object has been loaded * into the current DocumentManager from the database or before the refresh operation * has been applied to it. * * This is a object lifecycle event. * * @var string */ const preLoad = 'preLoad'; /** * The postLoad event occurs for an entity after the entity has been loaded * into the current EntityManager from the database or after the refresh operation * has been applied to it. * * Note that the postLoad event occurs for an entity before any associations have been * initialized. Therefore it is not safe to access associations in a postLoad callback * or event handler. * * This is an entity lifecycle event. * * @var string */ const postLoad = 'postLoad'; /** * The loadClassMetadata event occurs after the mapping metadata for a class * has been loaded from a mapping source (annotations/xml/yaml). * * @var string */ const loadClassMetadata = 'loadClassMetadata'; /** * The onClassMetadataNotFound event occurs whenever loading metadata for a class * failed. * * @var string */ const onClassMetadataNotFound = 'onClassMetadataNotFound'; /** * The preFlush event occurs when the EntityManager#flush() operation is invoked, * but before any changes to managed entities have been calculated. This event is * always raised right after EntityManager#flush() call. */ const preFlush = 'preFlush'; /** * The onFlush event occurs when the EntityManager#flush() operation is invoked, * after any changes to managed entities have been determined but before any * actual database operations are executed. The event is only raised if there is * actually something to do for the underlying UnitOfWork. If nothing needs to be done, * the onFlush event is not raised. * * @var string */ const onFlush = 'onFlush'; /** * The postFlush event occurs when the EntityManager#flush() operation is invoked and * after all actual database operations are executed successfully. The event is only raised if there is * actually something to do for the underlying UnitOfWork. If nothing needs to be done, * the postFlush event is not raised. The event won't be raised if an error occurs during the * flush operation. * * @var string */ const postFlush = 'postFlush'; /** * The onClear event occurs when the EntityManager#clear() operation is invoked, * after all references to entities have been removed from the unit of work. * * @var string */ const onClear = 'onClear'; /** * The preUpload event occurs when a ParseFile is bind to a ParseObject * * @var string */ const preUpload = 'preUpload'; }
zeliard91/DoctrineParseBundle
Events.php
PHP
mit
5,895
import { CustomError } from 'ts-custom-error'; export class IgClientError extends CustomError { constructor(message = 'Instagram API error was made.') { super(message); // Fix for ts-custom-error. Otherwise console.error will show JSON instead of just stack trace Object.defineProperty(this, 'name', { value: new.target.name, enumerable: false, }); } }
huttarichard/instagram-private-api
src/errors/ig-client.error.ts
TypeScript
mit
386
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="RenderingExtensions.cs" company="OxyPlot"> // Copyright (c) 2014 OxyPlot contributors // </copyright> // <summary> // Provides extension methods for <see cref="IRenderContext" />. // </summary> // -------------------------------------------------------------------------------------------------------------------- namespace OxyPlot { using System; using System.Collections.Generic; using System.Linq; /// <summary> /// Provides extension methods for <see cref="IRenderContext" />. /// </summary> public static class RenderingExtensions { /* Length constants used to draw triangles and stars ___ /\ | / \ | / \ | M2 / \ | / \ | / + \ --- / \ | / \ | M1 /________________\ _|_ |--------|-------| 1 1 | \ | / --- \ | / | M3 \ | / | ---------+-------- --- / | \ | M3 / | \ | / | \ --- | |-----|-----| M3 M3 */ /// <summary> /// The vertical distance to the bottom points of the triangles. /// </summary> private static readonly double M1 = Math.Tan(Math.PI / 6); /// <summary> /// The vertical distance to the top points of the triangles . /// </summary> private static readonly double M2 = Math.Sqrt(1 + (M1 * M1)); /// <summary> /// The horizontal/vertical distance to the end points of the stars. /// </summary> private static readonly double M3 = Math.Tan(Math.PI / 4); /// <summary> /// Draws a clipped polyline through the specified points. /// </summary> /// <param name="rc">The render context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="points">The points.</param> /// <param name="minDistSquared">The minimum line segment length (squared).</param> /// <param name="stroke">The stroke color.</param> /// <param name="strokeThickness">The stroke thickness.</param> /// <param name="dashArray">The dash array (in device independent units, 1/96 inch).</param> /// <param name="lineJoin">The line join.</param> /// <param name="aliased">Set to <c>true</c> to draw as an aliased line.</param> /// <param name="outputBuffer">The output buffer.</param> /// <param name="pointsRendered">The points rendered callback.</param> public static void DrawClippedLine( this IRenderContext rc, OxyRect clippingRectangle, IList<ScreenPoint> points, double minDistSquared, OxyColor stroke, double strokeThickness, double[] dashArray, OxyPenLineJoin lineJoin, bool aliased, List<ScreenPoint> outputBuffer = null, Action<IList<ScreenPoint>> pointsRendered = null) { var n = points.Count; if (n == 0) { return; } if (outputBuffer != null) { outputBuffer.Clear(); } else { outputBuffer = new List<ScreenPoint>(n); } // draws the points in the output buffer and calls the callback (if specified) Action drawLine = () => { EnsureNonEmptyLineIsVisible(outputBuffer); rc.DrawLine(outputBuffer, stroke, strokeThickness, dashArray, lineJoin, aliased); // Execute the 'callback' if (pointsRendered != null) { pointsRendered(outputBuffer); } }; var clipping = new CohenSutherlandClipping(clippingRectangle); if (n == 1 && clipping.IsInside(points[0])) { outputBuffer.Add(points[0]); } int lastPointIndex = 0; for (int i = 1; i < n; i++) { // Calculate the clipped version of previous and this point. var sc0 = points[i - 1]; var sc1 = points[i]; bool isInside = clipping.ClipLine(ref sc0, ref sc1); if (!isInside) { // the line segment is outside the clipping rectangle // keep the previous coordinate for minimum distance comparison continue; } // length calculation (inlined for performance) var dx = sc1.X - points[lastPointIndex].X; var dy = sc1.Y - points[lastPointIndex].Y; if ((dx * dx) + (dy * dy) > minDistSquared || outputBuffer.Count == 0 || i == n - 1) { // point comparison inlined for performance // ReSharper disable CompareOfFloatsByEqualityOperator if (sc0.X != points[lastPointIndex].X || sc0.Y != points[lastPointIndex].Y || outputBuffer.Count == 0) // ReSharper restore disable CompareOfFloatsByEqualityOperator { outputBuffer.Add(new ScreenPoint(sc0.X, sc0.Y)); } outputBuffer.Add(new ScreenPoint(sc1.X, sc1.Y)); lastPointIndex = i; } if (clipping.IsInside(points[i]) || outputBuffer.Count == 0) { continue; } // we are leaving the clipping region - render the line drawLine(); outputBuffer.Clear(); } if (outputBuffer.Count > 0) { drawLine(); } } /// <summary> /// Draws the clipped line segments. /// </summary> /// <param name="rc">The render context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="points">The points.</param> /// <param name="stroke">The stroke.</param> /// <param name="strokeThickness">The stroke thickness.</param> /// <param name="dashArray">The dash array (in device independent units, 1/96 inch).</param> /// <param name="lineJoin">The line join.</param> /// <param name="aliased">Set to <c>true</c> to draw as an aliased line.</param> public static void DrawClippedLineSegments( this IRenderContext rc, OxyRect clippingRectangle, IList<ScreenPoint> points, OxyColor stroke, double strokeThickness, double[] dashArray, OxyPenLineJoin lineJoin, bool aliased) { if (rc.SetClip(clippingRectangle)) { rc.DrawLineSegments(points, stroke, strokeThickness, dashArray, lineJoin, aliased); rc.ResetClip(); return; } var clipping = new CohenSutherlandClipping(clippingRectangle); var clippedPoints = new List<ScreenPoint>(points.Count); for (int i = 0; i + 1 < points.Count; i += 2) { var s0 = points[i]; var s1 = points[i + 1]; if (clipping.ClipLine(ref s0, ref s1)) { clippedPoints.Add(s0); clippedPoints.Add(s1); } } rc.DrawLineSegments(clippedPoints, stroke, strokeThickness, dashArray, lineJoin, aliased); } /// <summary> /// Draws the specified image. /// </summary> /// <param name="rc">The render context.</param> /// <param name="image">The image.</param> /// <param name="x">The destination X position.</param> /// <param name="y">The destination Y position.</param> /// <param name="w">The width.</param> /// <param name="h">The height.</param> /// <param name="opacity">The opacity.</param> /// <param name="interpolate">Interpolate the image if set to <c>true</c>.</param> public static void DrawImage( this IRenderContext rc, OxyImage image, double x, double y, double w, double h, double opacity, bool interpolate) { rc.DrawImage(image, 0, 0, image.Width, image.Height, x, y, w, h, opacity, interpolate); } /// <summary> /// Draws the clipped image. /// </summary> /// <param name="rc">The render context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="source">The source.</param> /// <param name="x">The destination X position.</param> /// <param name="y">The destination Y position.</param> /// <param name="w">The width.</param> /// <param name="h">The height.</param> /// <param name="opacity">The opacity.</param> /// <param name="interpolate">interpolate if set to <c>true</c>.</param> public static void DrawClippedImage( this IRenderContext rc, OxyRect clippingRectangle, OxyImage source, double x, double y, double w, double h, double opacity, bool interpolate) { if (x > clippingRectangle.Right || x + w < clippingRectangle.Left || y > clippingRectangle.Bottom || y + h < clippingRectangle.Top) { return; } if (rc.SetClip(clippingRectangle)) { // The render context supports clipping, then we can draw the whole image rc.DrawImage(source, x, y, w, h, opacity, interpolate); rc.ResetClip(); return; } // Fint the positions of the clipping rectangle normalized to image coordinates (0,1) var i0 = (clippingRectangle.Left - x) / w; var i1 = (clippingRectangle.Right - x) / w; var j0 = (clippingRectangle.Top - y) / h; var j1 = (clippingRectangle.Bottom - y) / h; // Find the origin of the clipped source rectangle var srcx = i0 < 0 ? 0u : i0 * source.Width; var srcy = j0 < 0 ? 0u : j0 * source.Height; srcx = (int)Math.Ceiling(srcx); srcy = (int)Math.Ceiling(srcy); // Find the size of the clipped source rectangle var srcw = i1 > 1 ? source.Width - srcx : (i1 * source.Width) - srcx; var srch = j1 > 1 ? source.Height - srcy : (j1 * source.Height) - srcy; srcw = (int)srcw; srch = (int)srch; if ((int)srcw <= 0 || (int)srch <= 0) { return; } // The clipped destination rectangle var destx = i0 < 0 ? x : x + (srcx / source.Width * w); var desty = j0 < 0 ? y : y + (srcy / source.Height * h); var destw = w * srcw / source.Width; var desth = h * srch / source.Height; rc.DrawImage(source, srcx, srcy, srcw, srch, destx, desty, destw, desth, opacity, interpolate); } /// <summary> /// Draws the polygon within the specified clipping rectangle. /// </summary> /// <param name="rc">The render context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="points">The points.</param> /// <param name="minDistSquared">The squared minimum distance between points.</param> /// <param name="fill">The fill.</param> /// <param name="stroke">The stroke.</param> /// <param name="strokeThickness">The stroke thickness.</param> /// <param name="lineStyle">The line style.</param> /// <param name="lineJoin">The line join.</param> /// <param name="aliased">The aliased.</param> public static void DrawClippedPolygon( this IRenderContext rc, OxyRect clippingRectangle, IList<ScreenPoint> points, double minDistSquared, OxyColor fill, OxyColor stroke, double strokeThickness = 1.0, LineStyle lineStyle = LineStyle.Solid, OxyPenLineJoin lineJoin = OxyPenLineJoin.Miter, bool aliased = false) { // TODO: minDistSquared should be implemented or removed if (rc.SetClip(clippingRectangle)) { rc.DrawPolygon(points, fill, stroke, strokeThickness, lineStyle.GetDashArray(), lineJoin, aliased); rc.ResetClip(); return; } var clippedPoints = SutherlandHodgmanClipping.ClipPolygon(clippingRectangle, points); rc.DrawPolygon(clippedPoints, fill, stroke, strokeThickness, lineStyle.GetDashArray(), lineJoin, aliased); } /// <summary> /// Draws the clipped rectangle. /// </summary> /// <param name="rc">The render context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="rect">The rectangle to draw.</param> /// <param name="fill">The fill color.</param> /// <param name="stroke">The stroke color.</param> /// <param name="thickness">The stroke thickness.</param> public static void DrawClippedRectangle( this IRenderContext rc, OxyRect clippingRectangle, OxyRect rect, OxyColor fill, OxyColor stroke, double thickness) { if (rc.SetClip(clippingRectangle)) { rc.DrawRectangle(rect, fill, stroke, thickness); rc.ResetClip(); return; } var clippedRect = ClipRect(rect, clippingRectangle); if (clippedRect == null) { return; } rc.DrawRectangle(clippedRect.Value, fill, stroke, thickness); } /// <summary> /// Draws the clipped rectangle as a polygon. /// </summary> /// <param name="rc">The render context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="rect">The rectangle to draw.</param> /// <param name="fill">The fill color.</param> /// <param name="stroke">The stroke color.</param> /// <param name="thickness">The stroke thickness.</param> public static void DrawClippedRectangleAsPolygon( this IRenderContext rc, OxyRect clippingRectangle, OxyRect rect, OxyColor fill, OxyColor stroke, double thickness) { if (rc.SetClip(clippingRectangle)) { rc.DrawRectangleAsPolygon(rect, fill, stroke, thickness); rc.ResetClip(); return; } var clippedRect = ClipRect(rect, clippingRectangle); if (clippedRect == null) { return; } rc.DrawRectangleAsPolygon(clippedRect.Value, fill, stroke, thickness); } /// <summary> /// Draws a clipped ellipse. /// </summary> /// <param name="rc">The render context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="rect">The rectangle.</param> /// <param name="fill">The fill color.</param> /// <param name="stroke">The stroke color.</param> /// <param name="thickness">The stroke thickness.</param> /// <param name="n">The number of points around the ellipse.</param> public static void DrawClippedEllipse( this IRenderContext rc, OxyRect clippingRectangle, OxyRect rect, OxyColor fill, OxyColor stroke, double thickness, int n = 100) { if (rc.SetClip(clippingRectangle)) { rc.DrawEllipse(rect, fill, stroke, thickness); rc.ResetClip(); return; } var points = new ScreenPoint[n]; double cx = (rect.Left + rect.Right) / 2; double cy = (rect.Top + rect.Bottom) / 2; double rx = (rect.Right - rect.Left) / 2; double ry = (rect.Bottom - rect.Top) / 2; for (int i = 0; i < n; i++) { double a = Math.PI * 2 * i / (n - 1); points[i] = new ScreenPoint(cx + (rx * Math.Cos(a)), cy + (ry * Math.Sin(a))); } rc.DrawClippedPolygon(clippingRectangle, points, 4, fill, stroke, thickness); } /// <summary> /// Draws the clipped text. /// </summary> /// <param name="rc">The rendering context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="p">The position.</param> /// <param name="text">The text.</param> /// <param name="fill">The fill color.</param> /// <param name="fontFamily">The font family.</param> /// <param name="fontSize">Size of the font.</param> /// <param name="fontWeight">The font weight.</param> /// <param name="rotate">The rotation angle.</param> /// <param name="horizontalAlignment">The horizontal align.</param> /// <param name="verticalAlignment">The vertical align.</param> /// <param name="maxSize">Size of the max.</param> public static void DrawClippedText( this IRenderContext rc, OxyRect clippingRectangle, ScreenPoint p, string text, OxyColor fill, string fontFamily = null, double fontSize = 10, double fontWeight = 500, double rotate = 0, HorizontalAlignment horizontalAlignment = HorizontalAlignment.Left, VerticalAlignment verticalAlignment = VerticalAlignment.Top, OxySize? maxSize = null) { if (rc.SetClip(clippingRectangle)) { rc.DrawText(p, text, fill, fontFamily, fontSize, fontWeight, rotate, horizontalAlignment, verticalAlignment, maxSize); rc.ResetClip(); return; } // fall back simply check position if (clippingRectangle.Contains(p.X, p.Y)) { rc.DrawText(p, text, fill, fontFamily, fontSize, fontWeight, rotate, horizontalAlignment, verticalAlignment, maxSize); } } /// <summary> /// Draws clipped math text. /// </summary> /// <param name="rc">The rendering context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="p">The position.</param> /// <param name="text">The text.</param> /// <param name="fill">The fill color.</param> /// <param name="fontFamily">The font family.</param> /// <param name="fontSize">Size of the font.</param> /// <param name="fontWeight">The font weight.</param> /// <param name="rotate">The rotation angle.</param> /// <param name="horizontalAlignment">The horizontal align.</param> /// <param name="verticalAlignment">The vertical align.</param> /// <param name="maxSize">Size of the max.</param> public static void DrawClippedMathText( this IRenderContext rc, OxyRect clippingRectangle, ScreenPoint p, string text, OxyColor fill, string fontFamily = null, double fontSize = 10, double fontWeight = 500, double rotate = 0, HorizontalAlignment horizontalAlignment = HorizontalAlignment.Left, VerticalAlignment verticalAlignment = VerticalAlignment.Top, OxySize? maxSize = null) { if (rc.SetClip(clippingRectangle)) { rc.DrawMathText(p, text, fill, fontFamily, fontSize, fontWeight, rotate, horizontalAlignment, verticalAlignment, maxSize); rc.ResetClip(); return; } // fall back simply check position if (clippingRectangle.Contains(p.X, p.Y)) { rc.DrawMathText(p, text, fill, fontFamily, fontSize, fontWeight, rotate, horizontalAlignment, verticalAlignment, maxSize); } } /// <summary> /// Draws multi-line text at the specified point. /// </summary> /// <param name="rc">The render context.</param> /// <param name="point">The point.</param> /// <param name="text">The text.</param> /// <param name="color">The text color.</param> /// <param name="fontFamily">The font family.</param> /// <param name="fontSize">The font size.</param> /// <param name="fontWeight">The font weight.</param> /// <param name="dy">The line spacing.</param> public static void DrawMultilineText(this IRenderContext rc, ScreenPoint point, string text, OxyColor color, string fontFamily = null, double fontSize = 10, double fontWeight = FontWeights.Normal, double dy = 12) { var lines = text.Split(new[] { "\r\n" }, StringSplitOptions.None); for (int i = 0; i < lines.Length; i++) { rc.DrawText( new ScreenPoint(point.X, point.Y + (i * dy)), lines[i], color, fontWeight: fontWeight, fontSize: fontSize); } } /// <summary> /// Draws a line specified by coordinates. /// </summary> /// <param name="rc">The render context.</param> /// <param name="x0">The x0.</param> /// <param name="y0">The y0.</param> /// <param name="x1">The x1.</param> /// <param name="y1">The y1.</param> /// <param name="pen">The pen.</param> /// <param name="aliased">Aliased line if set to <c>true</c>.</param> public static void DrawLine( this IRenderContext rc, double x0, double y0, double x1, double y1, OxyPen pen, bool aliased = true) { if (pen == null) { return; } rc.DrawLine( new[] { new ScreenPoint(x0, y0), new ScreenPoint(x1, y1) }, pen.Color, pen.Thickness, pen.ActualDashArray, pen.LineJoin, aliased); } /// <summary> /// Draws the line segments. /// </summary> /// <param name="rc">The render context.</param> /// <param name="points">The points.</param> /// <param name="pen">The pen.</param> /// <param name="aliased">if set to <c>true</c> [aliased].</param> public static void DrawLineSegments( this IRenderContext rc, IList<ScreenPoint> points, OxyPen pen, bool aliased = true) { if (pen == null) { return; } rc.DrawLineSegments(points, pen.Color, pen.Thickness, pen.ActualDashArray, pen.LineJoin, aliased); } /// <summary> /// Renders the marker. /// </summary> /// <param name="rc">The render context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="p">The center point of the marker.</param> /// <param name="type">The marker type.</param> /// <param name="outline">The outline.</param> /// <param name="size">The size of the marker.</param> /// <param name="fill">The fill color.</param> /// <param name="stroke">The stroke color.</param> /// <param name="strokeThickness">The stroke thickness.</param> public static void DrawMarker( this IRenderContext rc, OxyRect clippingRectangle, ScreenPoint p, MarkerType type, IList<ScreenPoint> outline, double size, OxyColor fill, OxyColor stroke, double strokeThickness) { rc.DrawMarkers(clippingRectangle, new[] { p }, type, outline, new[] { size }, fill, stroke, strokeThickness); } /// <summary> /// Draws a list of markers. /// </summary> /// <param name="rc">The render context.</param> /// <param name="markerPoints">The marker points.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="markerType">Type of the marker.</param> /// <param name="markerOutline">The marker outline.</param> /// <param name="markerSize">Size of the marker.</param> /// <param name="markerFill">The marker fill.</param> /// <param name="markerStroke">The marker stroke.</param> /// <param name="markerStrokeThickness">The marker stroke thickness.</param> /// <param name="resolution">The resolution.</param> /// <param name="binOffset">The bin Offset.</param> public static void DrawMarkers( this IRenderContext rc, IList<ScreenPoint> markerPoints, OxyRect clippingRectangle, MarkerType markerType, IList<ScreenPoint> markerOutline, double markerSize, OxyColor markerFill, OxyColor markerStroke, double markerStrokeThickness, int resolution = 0, ScreenPoint binOffset = new ScreenPoint()) { DrawMarkers( rc, clippingRectangle, markerPoints, markerType, markerOutline, new[] { markerSize }, markerFill, markerStroke, markerStrokeThickness, resolution, binOffset); } /// <summary> /// Draws a list of markers. /// </summary> /// <param name="rc">The render context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="markerPoints">The marker points.</param> /// <param name="markerType">Type of the marker.</param> /// <param name="markerOutline">The marker outline.</param> /// <param name="markerSize">Size of the markers.</param> /// <param name="markerFill">The marker fill.</param> /// <param name="markerStroke">The marker stroke.</param> /// <param name="markerStrokeThickness">The marker stroke thickness.</param> /// <param name="resolution">The resolution.</param> /// <param name="binOffset">The bin Offset.</param> public static void DrawMarkers( this IRenderContext rc, OxyRect clippingRectangle, IList<ScreenPoint> markerPoints, MarkerType markerType, IList<ScreenPoint> markerOutline, IList<double> markerSize, OxyColor markerFill, OxyColor markerStroke, double markerStrokeThickness, int resolution = 0, ScreenPoint binOffset = new ScreenPoint()) { if (markerType == MarkerType.None) { return; } int n = markerPoints.Count; var ellipses = new List<OxyRect>(n); var rects = new List<OxyRect>(n); var polygons = new List<IList<ScreenPoint>>(n); var lines = new List<ScreenPoint>(n); var hashset = new Dictionary<uint, bool>(); int i = 0; double minx = clippingRectangle.Left; double maxx = clippingRectangle.Right; double miny = clippingRectangle.Top; double maxy = clippingRectangle.Bottom; foreach (var p in markerPoints) { if (resolution > 1) { var x = (int)((p.X - binOffset.X) / resolution); var y = (int)((p.Y - binOffset.Y) / resolution); uint hash = (uint)(x << 16) + (uint)y; if (hashset.ContainsKey(hash)) { i++; continue; } hashset.Add(hash, true); } bool outside = p.x < minx || p.x > maxx || p.y < miny || p.y > maxy; if (!outside) { int j = i < markerSize.Count ? i : 0; AddMarkerGeometry(p, markerType, markerOutline, markerSize[j], ellipses, rects, polygons, lines); } i++; } if (ellipses.Count > 0) { rc.DrawEllipses(ellipses, markerFill, markerStroke, markerStrokeThickness); } if (rects.Count > 0) { rc.DrawRectangles(rects, markerFill, markerStroke, markerStrokeThickness); } if (polygons.Count > 0) { rc.DrawPolygons(polygons, markerFill, markerStroke, markerStrokeThickness); } if (lines.Count > 0) { rc.DrawLineSegments(lines, markerStroke, markerStrokeThickness); } } /// <summary> /// Draws the rectangle as an aliased polygon. /// (makes sure pixel alignment is the same as for lines) /// </summary> /// <param name="rc">The render context.</param> /// <param name="rect">The rectangle.</param> /// <param name="fill">The fill.</param> /// <param name="stroke">The stroke.</param> /// <param name="thickness">The thickness.</param> public static void DrawRectangleAsPolygon(this IRenderContext rc, OxyRect rect, OxyColor fill, OxyColor stroke, double thickness) { var sp0 = new ScreenPoint(rect.Left, rect.Top); var sp1 = new ScreenPoint(rect.Right, rect.Top); var sp2 = new ScreenPoint(rect.Right, rect.Bottom); var sp3 = new ScreenPoint(rect.Left, rect.Bottom); rc.DrawPolygon(new[] { sp0, sp1, sp2, sp3 }, fill, stroke, thickness, null, OxyPenLineJoin.Miter, true); } /// <summary> /// Draws a circle at the specified position. /// </summary> /// <param name="rc">The render context.</param> /// <param name="x">The center x-coordinate.</param> /// <param name="y">The center y-coordinate.</param> /// <param name="r">The radius.</param> /// <param name="fill">The fill color.</param> /// <param name="stroke">The stroke color.</param> /// <param name="thickness">The thickness.</param> public static void DrawCircle(this IRenderContext rc, double x, double y, double r, OxyColor fill, OxyColor stroke, double thickness = 1) { rc.DrawEllipse(new OxyRect(x - r, y - r, r * 2, r * 2), fill, stroke, thickness); } /// <summary> /// Draws a circle at the specified position. /// </summary> /// <param name="rc">The render context.</param> /// <param name="center">The center.</param> /// <param name="r">The radius.</param> /// <param name="fill">The fill color.</param> /// <param name="stroke">The stroke color.</param> /// <param name="thickness">The thickness.</param> public static void DrawCircle(this IRenderContext rc, ScreenPoint center, double r, OxyColor fill, OxyColor stroke, double thickness = 1) { DrawCircle(rc, center.X, center.Y, r, fill, stroke, thickness); } /// <summary> /// Fills a circle at the specified position. /// </summary> /// <param name="rc">The render context.</param> /// <param name="center">The center.</param> /// <param name="r">The radius.</param> /// <param name="fill">The fill color.</param> public static void FillCircle(this IRenderContext rc, ScreenPoint center, double r, OxyColor fill) { DrawCircle(rc, center.X, center.Y, r, fill, OxyColors.Undefined, 0d); } /// <summary> /// Fills a rectangle at the specified position. /// </summary> /// <param name="rc">The render context.</param> /// <param name="rectangle">The rectangle.</param> /// <param name="fill">The fill color.</param> public static void FillRectangle(this IRenderContext rc, OxyRect rectangle, OxyColor fill) { rc.DrawRectangle(rectangle, fill, OxyColors.Undefined, 0d); } /// <summary> /// Draws the rectangle as an aliased polygon. /// (makes sure pixel alignment is the same as for lines) /// </summary> /// <param name="rc">The render context.</param> /// <param name="rect">The rectangle.</param> /// <param name="fill">The fill.</param> /// <param name="stroke">The stroke.</param> /// <param name="thickness">The thickness.</param> public static void DrawRectangleAsPolygon(this IRenderContext rc, OxyRect rect, OxyColor fill, OxyColor stroke, OxyThickness thickness) { if (thickness.Left.Equals(thickness.Right) && thickness.Left.Equals(thickness.Top) && thickness.Left.Equals(thickness.Bottom)) { DrawRectangleAsPolygon(rc, rect, fill, stroke, thickness.Left); return; } var sp0 = new ScreenPoint(rect.Left, rect.Top); var sp1 = new ScreenPoint(rect.Right, rect.Top); var sp2 = new ScreenPoint(rect.Right, rect.Bottom); var sp3 = new ScreenPoint(rect.Left, rect.Bottom); rc.DrawPolygon(new[] { sp0, sp1, sp2, sp3 }, fill, OxyColors.Undefined, 0, null, OxyPenLineJoin.Miter, true); rc.DrawLine(new[] { sp0, sp1 }, stroke, thickness.Top, null, OxyPenLineJoin.Miter, true); rc.DrawLine(new[] { sp1, sp2 }, stroke, thickness.Right, null, OxyPenLineJoin.Miter, true); rc.DrawLine(new[] { sp2, sp3 }, stroke, thickness.Bottom, null, OxyPenLineJoin.Miter, true); rc.DrawLine(new[] { sp3, sp0 }, stroke, thickness.Left, null, OxyPenLineJoin.Miter, true); } /// <summary> /// Adds a marker geometry. /// </summary> /// <param name="p">The position of the marker.</param> /// <param name="type">The type.</param> /// <param name="outline">The outline.</param> /// <param name="size">The size.</param> /// <param name="ellipses">The ellipse collection.</param> /// <param name="rects">The rectangle collection.</param> /// <param name="polygons">The polygon collection.</param> /// <param name="lines">The line collection.</param> private static void AddMarkerGeometry( ScreenPoint p, MarkerType type, IEnumerable<ScreenPoint> outline, double size, IList<OxyRect> ellipses, IList<OxyRect> rects, IList<IList<ScreenPoint>> polygons, IList<ScreenPoint> lines) { if (type == MarkerType.Custom) { if (outline == null) { throw new ArgumentNullException("outline", "The outline should be set when MarkerType is 'Custom'."); } var poly = outline.Select(o => new ScreenPoint(p.X + (o.x * size), p.Y + (o.y * size))).ToList(); polygons.Add(poly); return; } switch (type) { case MarkerType.Circle: { ellipses.Add(new OxyRect(p.x - size, p.y - size, size * 2, size * 2)); break; } case MarkerType.Square: { rects.Add(new OxyRect(p.x - size, p.y - size, size * 2, size * 2)); break; } case MarkerType.Diamond: { polygons.Add( new[] { new ScreenPoint(p.x, p.y - (M2 * size)), new ScreenPoint(p.x + (M2 * size), p.y), new ScreenPoint(p.x, p.y + (M2 * size)), new ScreenPoint(p.x - (M2 * size), p.y) }); break; } case MarkerType.Triangle: { polygons.Add( new[] { new ScreenPoint(p.x - size, p.y + (M1 * size)), new ScreenPoint(p.x + size, p.y + (M1 * size)), new ScreenPoint(p.x, p.y - (M2 * size)) }); break; } case MarkerType.Plus: case MarkerType.Star: { lines.Add(new ScreenPoint(p.x - size, p.y)); lines.Add(new ScreenPoint(p.x + size, p.y)); lines.Add(new ScreenPoint(p.x, p.y - size)); lines.Add(new ScreenPoint(p.x, p.y + size)); break; } } switch (type) { case MarkerType.Cross: case MarkerType.Star: { lines.Add(new ScreenPoint(p.x - (size * M3), p.y - (size * M3))); lines.Add(new ScreenPoint(p.x + (size * M3), p.y + (size * M3))); lines.Add(new ScreenPoint(p.x - (size * M3), p.y + (size * M3))); lines.Add(new ScreenPoint(p.x + (size * M3), p.y - (size * M3))); break; } } } /// <summary> /// Calculates the clipped version of a rectangle. /// </summary> /// <param name="rect">The rectangle to clip.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <returns>The clipped rectangle, or <c>null</c> if the rectangle is outside the clipping area.</returns> private static OxyRect? ClipRect(OxyRect rect, OxyRect clippingRectangle) { if (rect.Right < clippingRectangle.Left) { return null; } if (rect.Left > clippingRectangle.Right) { return null; } if (rect.Top > clippingRectangle.Bottom) { return null; } if (rect.Bottom < clippingRectangle.Top) { return null; } if (rect.Right > clippingRectangle.Right) { rect.Right = clippingRectangle.Right; } if (rect.Left < clippingRectangle.Left) { rect.Width = rect.Right - clippingRectangle.Left; rect.Left = clippingRectangle.Left; } if (rect.Top < clippingRectangle.Top) { rect.Height = rect.Bottom - clippingRectangle.Top; rect.Top = clippingRectangle.Top; } if (rect.Bottom > clippingRectangle.Bottom) { rect.Bottom = clippingRectangle.Bottom; } if (rect.Width <= 0 || rect.Height <= 0) { return null; } return rect; } /// <summary> /// Makes sure that a non empty line is visible. /// </summary> /// <param name="pts">The points (screen coordinates).</param> /// <remarks>If the line contains one point, another point is added. /// If the line contains two points at the same position, the points are moved 2 pixels apart.</remarks> private static void EnsureNonEmptyLineIsVisible(IList<ScreenPoint> pts) { // Check if the line contains two points and they are at the same point if (pts.Count == 2) { if (pts[0].DistanceTo(pts[1]) < 1) { // Modify to a small horizontal line to make sure it is being rendered pts[1] = new ScreenPoint(pts[0].X + 1, pts[0].Y); pts[0] = new ScreenPoint(pts[0].X - 1, pts[0].Y); } } // Check if the line contains a single point if (pts.Count == 1) { // Add a second point to make sure the line is being rendered as a small dot pts.Add(new ScreenPoint(pts[0].X + 1, pts[0].Y)); pts[0] = new ScreenPoint(pts[0].X - 1, pts[0].Y); } } } }
rahulpatil2009/oxyplot2
Source/OxyPlot/Rendering/RenderContext/RenderingExtensions.cs
C#
mit
42,193
from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import List, Optional __version__ = "20.0.dev0" def main(args=None): # type: (Optional[List[str]]) -> int """This is an internal API only meant for use by pip's own console scripts. For additional details, see https://github.com/pypa/pip/issues/7498. """ from pip._internal.utils.entrypoints import _wrapper return _wrapper(args)
xavfernandez/pip
src/pip/__init__.py
Python
mit
458
require 'addressable/uri' class Projects::CompareController < Projects::ApplicationController # Authorize before_filter :require_non_empty_project before_filter :authorize_download_code! def index end def show base_ref = Addressable::URI.unescape(params[:from]) head_ref = Addressable::URI.unescape(params[:to]) compare_result = CompareService.new.execute( current_user, @project, head_ref, @project, base_ref ) @commits = compare_result.commits @diffs = compare_result.diffs @commit = @commits.last @line_notes = [] end def create redirect_to namespace_project_compare_path(@project.namespace, @project, params[:from], params[:to]) end end
cncodog/gitlab
app/controllers/projects/compare_controller.rb
Ruby
mit
778
<?php /** * This file is part of CaptainHook * * (c) Sebastian Feldmann <sf@sebastian-feldmann.info> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace CaptainHook\App\Runner\Hook; use CaptainHook\App\Hooks; use CaptainHook\App\Runner\Hook; /** * Hook * * @package CaptainHook * @author Sebastian Feldmann <sf@sebastian-feldmann.info> * @link https://github.com/captainhookphp/captainhook * @since Class available since Release 3.1.0 */ class PostMerge extends Hook { /** * Hook to execute * * @var string */ protected $hook = Hooks::POST_MERGE; }
sebastianfeldmann/captainhook
src/Runner/Hook/PostMerge.php
PHP
mit
690
using System; using System.Windows; using System.Windows.Controls; namespace System.Windows.Automation.Peers { /// public class MediaElementAutomationPeer : FrameworkElementAutomationPeer { /// public MediaElementAutomationPeer(MediaElement owner) : base(owner) { } /// override protected string GetClassNameCore() { return "MediaElement"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Custom; } } }
mind0n/hive
Cache/Libs/net46/wpf/src/Framework/System/Windows/Automation/Peers/MediaElementAutomationPeer.cs
C#
mit
608
// (C) 2011 Martin Wawrusch // // http://twitter.com/martin_sunset // http://about.me/martinw // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System.Web; using GeckoboardNet; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace GeckoboardNetTests { [TestClass] public class RequestParsingFixtures { [TestMethod] public void IsAValidApiRequestWithXmlAndType2() { var request = new HttpRequestBaseMock(FixtureConstants.Authorization_Test123, "xml", "2"); var t = new GeckoboardService(request, (a, b) => null, a => true); Assert.AreEqual(FixtureConstants.Authorization_Test123_Source, t.ApiKey); Assert.AreEqual(ResponseFormat.Xml, t.ResponseFormat); Assert.AreEqual(WidgetType.RagColumnAndNumbers, t.WidgetType); } [TestMethod] public void IsAValidApiRequestWithJsonAndType4() { var request = new HttpRequestBaseMock(FixtureConstants.Authorization_Test123, "json", "4"); var t = new GeckoboardService(request, (a, b) => null, a => true); Assert.AreEqual(FixtureConstants.Authorization_Test123_Source, t.ApiKey); Assert.AreEqual(ResponseFormat.Json, t.ResponseFormat); Assert.AreEqual(WidgetType.Text, t.WidgetType); } // for some reason the format passed is not what we expect. We therefore default to Json // which renders this test obsolete //[TestMethod] //[ExpectedException(typeof(HttpException))] //public void ThrowBecauseOfInvalidFormat() //{ // var request = new HttpRequestBaseMock(FixtureConstants.Authorization_Test123, "foobar", "4"); // var t = new GeckoboardService(request, (a, b) => null, a => true); //} [TestMethod] [ExpectedException(typeof(HttpException))] public void ThrowBecauseOfNoType() { var request = new HttpRequestBaseMock(FixtureConstants.Authorization_Test123, "xml", null); var t = new GeckoboardService(request, (a, b) => null, a => true); } [TestMethod] [ExpectedException(typeof(HttpException))] public void ThrowBecauseOfInvalidType() { var request = new HttpRequestBaseMock(FixtureConstants.Authorization_Test123, "xml", "bar"); var t = new GeckoboardService(request, (a, b) => null, a => true); } [TestMethod] [ExpectedException(typeof(HttpException))] public void ThrowBecauseOfOutOfRangeType() { var request = new HttpRequestBaseMock(FixtureConstants.Authorization_Test123, "xml", "0"); var t = new GeckoboardService(request, (a, b) => null, a => true); } } }
mwawrusch/GeckoboardNet
GeckoboardNetTests/RequestParsingFixtures.cs
C#
mit
3,819
from keras.models import Sequential, model_from_json from keras.layers import Dense, Dropout, Activation, Flatten, Convolution2D, MaxPooling2D, Lambda, ELU from keras.layers.normalization import BatchNormalization from keras.optimizers import Adam import cv2 import csv import numpy as np import os from random import random from sklearn.model_selection import train_test_split DATA_PATH = './data/t1/' def trans_image(image,steer,trans_range): # # Translate image # Ref: https://chatbotslife.com/using-augmentation-to-mimic-human-driving-496b569760a9#.s1pwczi3q # rows, cols, _ = image.shape tr_x = trans_range*np.random.uniform()-trans_range/2 steer_ang = steer + tr_x/trans_range*2*.2 tr_y = 40*np.random.uniform()-40/2 Trans_M = np.float32([[1,0,tr_x],[0,1,tr_y]]) image_tr = cv2.warpAffine(image,Trans_M,(cols,rows)) return image_tr, steer_ang def gen_data(X, y, batch_size=128, validation=False): # # Generate data for fit_generator # gen_start = 0 while True: features = [] labels = [] if gen_start >= len(y): gen_start = 0 ending = min(gen_start+batch_size, len(y)) for idx, row in enumerate(y[gen_start:ending]): center_img = cv2.imread(DATA_PATH + X[gen_start+idx][0].strip()) center_img = cv2.cvtColor(center_img, cv2.COLOR_BGR2HSV) center_label = float(row[0]) # Augmentation 1: Jitter image center_img, center_label = trans_image(center_img, center_label, 100) # Augmentation 2: Occasionally flip straight if random() > 0.5 and abs(center_label) > 0.1: center_img = cv2.flip(center_img, 1) labels.append(-center_label) else: labels.append(center_label) # Augmentation 3: Random brightness random_bright = .25 + np.random.uniform() center_img[:,:,2] = center_img[:,:,2]*random_bright features.append(center_img) if not validation: # Augmentation 4: +0.25 to Left Image left_img = cv2.imread(DATA_PATH + X[gen_start+idx][1].strip()) features.append(left_img) labels.append(float(row[0]) + 0.15) # Augmentation 5: -0.25 to Right Image right_img = cv2.imread(DATA_PATH + X[gen_start+idx][2].strip()) features.append(right_img) labels.append(float(row[0]) - 0.15) gen_start += batch_size features = np.array(features) labels = np.array(labels) yield features, labels def nvidia_model(row=66, col=200, ch=3, dropout=0.3, lr=0.0001): # # NVIDIA CNN model # Ref: https://arxiv.org/abs/1604.07316 # input_shape = (row, col, ch) model = Sequential() model.add(BatchNormalization(axis=1, input_shape=input_shape)) model.add(Convolution2D(24, 5, 5, border_mode='valid', subsample=(2, 2), activation='elu')) model.add(Dropout(dropout)) model.add(Convolution2D(36, 5, 5, border_mode='valid', subsample=(2, 2), activation='elu')) model.add(Dropout(dropout)) model.add(Convolution2D(48, 5, 5, border_mode='valid', subsample=(2, 2), activation='elu')) model.add(Dropout(dropout)) model.add(Convolution2D(64, 3, 3, border_mode='valid', subsample=(1, 1), activation='elu')) model.add(Dropout(dropout)) model.add(Convolution2D(64, 3, 3, border_mode='valid', subsample=(1, 1), activation='elu')) model.add(Dropout(dropout)) model.add(Flatten()) model.add(Dense(100)) model.add(Activation('elu')) model.add(Dropout(dropout)) model.add(Dense(50)) model.add(Activation('elu')) model.add(Dropout(dropout)) model.add(Dense(10)) model.add(Activation('elu')) model.add(Dropout(dropout)) model.add(Dense(1)) model.add(Activation('elu')) model.compile(optimizer=Adam(lr=lr), loss='mse', metrics=['accuracy']) print(model.summary()) return model def nvidialite_model(row=33, col=100, ch=3, dropout=0.3, lr=0.0001): # # Modified of NVIDIA CNN Model (Dysfunctional) # input_shape = (row, col, ch) model = Sequential() model.add(BatchNormalization(axis=1, input_shape=input_shape)) model.add(Convolution2D(24, 5, 5, border_mode='valid', subsample=(2, 2), activation='elu')) model.add(Convolution2D(36, 5, 5, border_mode='valid', subsample=(2, 2), activation='elu')) model.add(Convolution2D(48, 3, 3, border_mode='valid', subsample=(1, 1), activation='elu')) model.add(Flatten()) model.add(Dense(100)) model.add(Activation('elu')) model.add(Dropout(dropout)) model.add(Dense(50)) model.add(Activation('elu')) model.add(Dropout(dropout)) model.add(Dense(10)) model.add(Activation('elu')) model.add(Dropout(dropout)) model.add(Dense(1)) model.add(Activation('elu')) model.compile(optimizer=Adam(lr=lr), loss='mse', metrics=['accuracy']) print(model.summary()) return model def load_data(filter=True): # # Load and split data # CSV: center,left,right,steering,throttle,brake,speed # total = 0 with open(DATA_PATH + 'driving_log.csv', 'r') as f: reader = csv.reader(f) data = [row for row in reader] data = np.array(data) X = data[:,[0,1,2]] y = data[:,[3]] print('Total samples:', total) print('Total samples (after filter):', len(X)) return train_test_split(X, y, test_size=0.2, random_state=42) def load_model(lr=0.001): # # Load the existing model and weight # with open('model.json', 'r') as jfile: model = model_from_json(jfile.read()) model.compile(optimizer=Adam(lr=lr), loss='mse', metrics=['accuracy']) model.load_weights('model.h5') return model def main(): # Load data X_train, X_val, y_train, y_val = load_data() print('X_train shape:', X_train.shape) print('X_val shape:', X_val.shape) # Build model if 'model.json' in os.listdir(): model = load_model() else: model = nvidia_model() model.fit_generator(gen_data(X_train, y_train), samples_per_epoch=len(X_train)*3, nb_epoch=8, validation_data=gen_data(X_val, y_val, validation=True), nb_val_samples=len(X_val)) # Save model json = model.to_json() model.save_weights('model.h5') with open('model.json', 'w') as f: f.write(json) if __name__ == "__main__": main()
shernshiou/CarND
Term1/04-CarND-Behavioral-Cloning/model.py
Python
mit
6,595
package it.cavallium.warppi.teavm; import java.io.PrintWriter; import java.net.URL; import java.util.HashMap; import java.util.Map; import org.teavm.jso.browser.Window; import org.teavm.jso.dom.html.HTMLDocument; import it.cavallium.warppi.Platform; import it.cavallium.warppi.gui.graphicengine.GraphicEngine; import it.cavallium.warppi.gui.graphicengine.html.HtmlEngine; import it.cavallium.warppi.math.rules.RulesManager; import it.cavallium.warppi.util.Error; public class TeaVMPlatform implements Platform { private final TeaVMConsoleUtils cu; private final TeaVMGpio gi; private final TeaVMStorageUtils su; private final String on; private final Map<String, GraphicEngine> el; private final TeaVMImageUtils pu; private final TeaVMSettings settings; private Boolean runningOnRaspberryOverride = null; public TeaVMPlatform() { cu = new TeaVMConsoleUtils(); gi = new TeaVMGpio(); su = new TeaVMStorageUtils(); pu = new TeaVMImageUtils(); on = "JavaScript"; el = new HashMap<>(); el.put("HTML5 engine", new HtmlEngine()); settings = new TeaVMSettings(); } @Override public ConsoleUtils getConsoleUtils() { return cu; } @Override public Gpio getGpio() { return gi; } @Override public StorageUtils getStorageUtils() { return su; } @Override public ImageUtils getImageUtils() { return pu; } @Override public TeaVMSettings getSettings() { return settings; } @Override public void setThreadName(final Thread t, final String name) {} @Override public void setThreadDaemon(final Thread t) {} @Override public void setThreadDaemon(final Thread t, final boolean value) {} @Override public void exit(final int value) { System.err.println("====================PROGRAM END===================="); } @Override public void gc() { } @Override public boolean isJavascript() { return true; } @Override public String getOsName() { return on; } private boolean shift, alpha; @Override public void alphaChanged(final boolean alpha) { this.alpha = alpha; final HTMLDocument doc = Window.current().getDocument(); doc.getBody().setClassName((shift ? "shift " : "") + (alpha ? "alpha" : "")); } @Override public void shiftChanged(final boolean shift) { this.shift = shift; final HTMLDocument doc = Window.current().getDocument(); doc.getBody().setClassName((shift ? "shift " : "") + (alpha ? "alpha" : "")); } @Override public Semaphore newSemaphore() { return new TeaVMSemaphore(0); } @Override public Semaphore newSemaphore(final int i) { return new TeaVMSemaphore(i); } @Override public URLClassLoader newURLClassLoader(final URL[] urls) { return new TeaVMURLClassLoader(urls); } @Override public Map<String, GraphicEngine> getEnginesList() { return el; } @Override public GraphicEngine getEngine(final String string) throws NullPointerException { return el.get(string); } @Override public void throwNewExceptionInInitializerError(final String text) { throw new NullPointerException(); } @Override public String[] stacktraceToString(final Error e) { return e.getMessage().toUpperCase().replace("\r", "").split("\n"); } @Override public void loadPlatformRules() { RulesManager.addRule(new rules.functions.DivisionRule()); RulesManager.addRule(new rules.functions.EmptyNumberRule()); RulesManager.addRule(new rules.functions.ExpressionRule()); RulesManager.addRule(new rules.functions.JokeRule()); RulesManager.addRule(new rules.functions.MultiplicationRule()); RulesManager.addRule(new rules.functions.NegativeRule()); RulesManager.addRule(new rules.functions.NumberRule()); RulesManager.addRule(new rules.functions.PowerRule()); RulesManager.addRule(new rules.functions.RootRule()); RulesManager.addRule(new rules.functions.SubtractionRule()); RulesManager.addRule(new rules.functions.SumRule()); RulesManager.addRule(new rules.functions.SumSubtractionRule()); RulesManager.addRule(new rules.functions.VariableRule()); RulesManager.addRule(new rules.ExpandRule1()); RulesManager.addRule(new rules.ExpandRule2()); RulesManager.addRule(new rules.ExpandRule5()); RulesManager.addRule(new rules.ExponentRule1()); RulesManager.addRule(new rules.ExponentRule2()); RulesManager.addRule(new rules.ExponentRule3()); RulesManager.addRule(new rules.ExponentRule4()); RulesManager.addRule(new rules.ExponentRule8()); RulesManager.addRule(new rules.ExponentRule9()); RulesManager.addRule(new rules.ExponentRule15()); RulesManager.addRule(new rules.ExponentRule16()); RulesManager.addRule(new rules.ExponentRule17()); RulesManager.addRule(new rules.FractionsRule1()); RulesManager.addRule(new rules.FractionsRule2()); RulesManager.addRule(new rules.FractionsRule3()); RulesManager.addRule(new rules.FractionsRule4()); RulesManager.addRule(new rules.FractionsRule5()); RulesManager.addRule(new rules.FractionsRule6()); RulesManager.addRule(new rules.FractionsRule7()); RulesManager.addRule(new rules.FractionsRule8()); RulesManager.addRule(new rules.FractionsRule9()); RulesManager.addRule(new rules.FractionsRule10()); RulesManager.addRule(new rules.FractionsRule11()); RulesManager.addRule(new rules.FractionsRule12()); RulesManager.addRule(new rules.FractionsRule14()); RulesManager.addRule(new rules.NumberRule1()); RulesManager.addRule(new rules.NumberRule2()); RulesManager.addRule(new rules.NumberRule3()); RulesManager.addRule(new rules.NumberRule4()); RulesManager.addRule(new rules.NumberRule5()); RulesManager.addRule(new rules.NumberRule7()); RulesManager.addRule(new rules.UndefinedRule1()); RulesManager.addRule(new rules.UndefinedRule2()); RulesManager.addRule(new rules.VariableRule1()); RulesManager.addRule(new rules.VariableRule2()); RulesManager.addRule(new rules.VariableRule3()); } @Override public void zip(final String targetPath, final String destinationFilePath, final String password) { throw new java.lang.UnsupportedOperationException("Not implemented."); } @Override public void unzip(final String targetZipFilePath, final String destinationFolderPath, final String password) { throw new java.lang.UnsupportedOperationException("Not implemented."); } @Override public boolean compile(final String[] command, final PrintWriter printWriter, final PrintWriter errors) { throw new java.lang.UnsupportedOperationException("Not implemented."); } @Override public void setRunningOnRaspberry(boolean b) { } @Override public boolean isRunningOnRaspberry() { return false; } }
XDrake99/WarpPI
teavm/src/main/java/it/cavallium/warppi/teavm/TeaVMPlatform.java
Java
mit
6,772
package pool import ( "fmt" "net" ) const ( _net = "udp4" // ) func createUDPConnection(address string) (*net.UDPConn, error) { addr, err := net.ResolveUDPAddr(_net, address) if err != nil { return nil, err } conn, err := net.DialUDP(_net, nil, addr) if err != nil { return nil, err } return conn, nil } func worker(id int, address string, done chan bool, buffers <-chan []byte) { conn, err := createUDPConnection(address) if err != nil { return } defer func() { err := conn.Close() if err != nil { fmt.Println(err) } }() for buffer := range buffers { _, err := conn.Write(buffer) if err != nil { break } } done <- true } type UDPPool struct { buffers chan []byte done chan bool } //NewUDPPool create new UDP workers pool func NewUDPPool(address string, workerNumber int) *UDPPool { buffers := make(chan []byte, workerNumber) done := make(chan bool) for wid := 1; wid < workerNumber; wid++ { go worker(wid, address, done, buffers) } return &UDPPool{buffers, done} } func (p *UDPPool) Fire(buffer []byte) { p.buffers <- buffer } func (p *UDPPool) Close() { close(p.buffers) }
duythinht/gelf
pool/udp.go
GO
mit
1,146
<?php /** * @author Tomasz Jakub Rup <tomasz.rup@gmail.com> */ class sfGuardMessageQuery extends BasesfGuardMessageQuery { }
tomi77/sfGuardMessagesPlugin
lib/model/sfGuardMessageQuery.php
PHP
mit
128
<?php namespace Jac\ContactBundle\Entity; class Contact { protected $address; protected $comments; protected $companyName; protected $emailAddress; protected $faxNumber; protected $fullName; protected $phoneNumber; protected $position; protected $whereDidYouLearnAboutUs; /* Class getters */ public function getAddress() { return $this->address; } public function getComments() { return $this->comments; } public function getCompanyName() { return $this->companyName; } public function getEmailAddress() { return $this->emailAddress; } public function getFaxNumber() { return $this->faxNumber; } public function getFullName() { return $this->fullName; } public function getPhoneNumber() { return $this->phoneNumber; } public function getPosition() { return $this->position; } public function getWhereDidYouLearnAboutUs() { return $this->whereDidYouLearnAboutUs; } /* Class setters */ public function setAddress($address) { $this->address = $address; } public function setComments($comments) { $this->comments = $comments; } public function setCompanyName($company) { $this->companyName = $company; } public function setEmailAddress($address) { $this->emailAddress = $address; } public function setFaxNumber($number) { $this->faxNumber = $number; } public function setFullName($name) { $this->fullName = $name; } public function setPhoneNumber($number) { $this->phoneNumber = $number; } public function setPosition($position) { $this->position = $position; } public function setWhereDidYouLearnAboutUs($where) { $this->whereDidYouLearnAboutUs = $where; } }
cdelafuente/jac
src/Jac/ContactBundle/Entity/Contact.php
PHP
mit
1,999
<?php namespace SymphonyCms\Toolkit; use \SymphonyCms\Symphony; use \SymphonyCms\Toolkit\Section; use \SymphonyCms\Toolkit\EntryManager; use \SymphonyCms\Toolkit\FieldManager; /** * The `SectionManager` is responsible for managing all Sections in a Symphony * installation by exposing basic CRUD operations. Sections are stored in the * database in `tbl_sections`. */ class SectionManager { /** * An array of all the objects that the Manager is responsible for. * * @var array * Defaults to an empty array. */ protected static $_pool = array(); /** * Takes an associative array of Section settings and creates a new * entry in the `tbl_sections` table, returning the ID of the Section. * The ID of the section is generated using auto_increment and returned * as the Section ID. * * @param array $settings * An associative of settings for a section with the key being * a column name from `tbl_sections` * @return integer * The newly created Section's ID */ public static function add(array $settings) { if (!Symphony::get('Database')->insert($settings, 'tbl_sections')) { return false; } return Symphony::get('Database')->getInsertID(); } /** * Updates an existing Section given it's ID and an associative * array of settings. The array does not have to contain all the * settings for the Section as there is no deletion of settings * prior to updating the Section * * @param integer $section_id * The ID of the Section to edit * @param array $settings * An associative of settings for a section with the key being * a column name from `tbl_sections` * @return boolean */ public static function edit($section_id, array $settings) { if (!Symphony::get('Database')->update($settings, 'tbl_sections', " `id` = $section_id")) { return false; } return true; } /** * Deletes a Section by Section ID, removing all entries, fields, the * Section and any Section Associations in that order * * @param integer $section_id * The ID of the Section to delete * @return boolean * Returns true when completed */ public static function delete($section_id) { $details = Symphony::get('Database')->fetchRow(0, "SELECT `sortorder` FROM tbl_sections WHERE `id` = '$section_id'"); // Delete all the entries $entries = Symphony::get('Database')->fetchCol('id', "SELECT `id` FROM `tbl_entries` WHERE `section_id` = '$section_id'"); EntryManager::delete($entries); // Delete all the fields $fields = FieldManager::fetch(null, $section_id); if (is_array($fields) && !empty($fields)) { foreach ($fields as $field) { FieldManager::delete($field->get('id')); } } // Delete the section Symphony::get('Database')->delete('tbl_sections', " `id` = '$section_id'"); // Update the sort orders Symphony::get('Database')->query("UPDATE tbl_sections SET `sortorder` = (`sortorder` - 1) WHERE `sortorder` > '".$details['sortorder']."'"); // Delete the section associations Symphony::get('Database')->delete('tbl_sections_association', " `parent_section_id` = '$section_id'"); return true; } /** * Returns a Section object by ID, or returns an array of Sections * if the Section ID was omitted. If the Section ID is omitted, it is * possible to sort the Sections by providing a sort order and sort * field. By default, Sections will be order in ascending order by * their name * * @param integer|array $section_id * The ID of the section to return, or an array of ID's. Defaults to null * @param string $order * If `$section_id` is omitted, this is the sortorder of the returned * objects. Defaults to ASC, other options id DESC * @param string $sortfield * The name of the column in the `tbl_sections` table to sort * on. Defaults to name * @return Section|array * A Section object or an array of Section objects */ public static function fetch($section_id = null, $order = 'ASC', $sortfield = 'name') { $returnSingle = false; $section_ids = array(); if (!is_null($section_id)) { if (!is_array($section_id)) { $returnSingle = true; $section_ids = array((int)$section_id); } else { $section_ids = $section_id; } } if ($returnSingle && isset(self::$_pool[$section_id])) { return self::$_pool[$section_id]; } $sql = sprintf( "SELECT `s`.* FROM `tbl_sections` AS `s` %s %s", !empty($section_id) ? " WHERE `s`.`id` IN (" . implode(',', $section_ids) . ") " : "", empty($section_id) ? " ORDER BY `s`.`$sortfield` $order" : "" ); if (!$sections = Symphony::get('Database')->fetch($sql)) { return ($returnSingle ? false : array()); } $ret = array(); foreach ($sections as $s) { $obj = self::create(); foreach ($s as $name => $value) { $obj->set($name, $value); } self::$_pool[$obj->get('id')] = $obj; $ret[] = $obj; } return (count($ret) == 1 && $returnSingle ? $ret[0] : $ret); } /** * Return a Section ID by the handle * * @param string $handle * The handle of the section * @return integer * The Section ID */ public static function fetchIDFromHandle($handle) { return Symphony::get('Database')->fetchVar('id', 0, "SELECT `id` FROM `tbl_sections` WHERE `handle` = '$handle' LIMIT 1"); } /** * Work out the next available sort order for a new section * * @return integer * Returns the next sort order */ public static function fetchNextSortOrder() { $next = Symphony::get('Database')->fetchVar( "next", 0, "SELECT MAX(p.sortorder) + 1 AS `next` FROM `tbl_sections` AS p LIMIT 1" ); return ($next ? (int)$next : 1); } /** * Returns a new Section object, using the SectionManager * as the Section's $parent. * * @return Section */ public static function create() { $obj = new Section; return $obj; } /** * Create an association between a section and a field. * * @since Symphony 2.3 * @param integer $parent_section_id * The linked section id. * @param integer $child_field_id * The field ID of the field that is creating the association * @param integer $parent_field_id (optional) * The field ID of the linked field in the linked section * @param boolean $show_association (optional) * Whether of not the link should be shown on the entries table of the * linked section. This defaults to true. * @return boolean * true if the association was successfully made, false otherwise. */ public static function createSectionAssociation($parent_section_id = null, $child_field_id = null, $parent_field_id = null, $show_association = true) { if (is_null($parent_section_id) && (is_null($parent_field_id) || !$parent_field_id)) { return false; } if (is_null($parent_section_id)) { $parent_field = FieldManager::fetch($parent_field_id); $parent_section_id = $parent_field->get('parent_section'); } $child_field = FieldManager::fetch($child_field_id); $child_section_id = $child_field->get('parent_section'); $fields = array( 'parent_section_id' => $parent_section_id, 'parent_section_field_id' => $parent_field_id, 'child_section_id' => $child_section_id, 'child_section_field_id' => $child_field_id, 'hide_association' => ($show_association ? 'no' : 'yes') ); return Symphony::get('Database')->insert($fields, 'tbl_sections_association'); } /** * Permanently remove a section association for this field in the database. * * @since Symphony 2.3 * @param integer $field_id * the field ID of the linked section's linked field. * @return boolean */ public static function removeSectionAssociation($field_id) { return Symphony::get('Database')->delete( 'tbl_sections_association', sprintf( '`child_section_field_id` = %1$d OR `parent_section_field_id` = %1$d', $field_id ) ); } /** * Returns any section associations this section has with other sections * linked using fields. Has an optional parameter, `$respect_visibility` that * will only return associations that are deemed visible by a field that * created the association. eg. An articles section may link to the authors * section, but the field that links these sections has hidden this association * so an Articles column will not appear on the Author's Publish Index * * @since Symphony 2.3 * @param integer $section_id * The ID of the section * @param boolean $respect_visibility * Whether to return all the section associations regardless of if they * are deemed visible or not. Defaults to false, which will return all * associations. * @return array */ public static function fetchAssociatedSections($section_id, $respect_visibility = false) { self::fetchChildAssociations($section_id, $respect_visibility); } /** * Returns any section associations this section has with other sections * linked using fields, and where this section is the parent in the association. * Has an optional parameter, `$respect_visibility` that * will only return associations that are deemed visible by a field that * created the association. eg. An articles section may link to the authors * section, but the field that links these sections has hidden this association * so an Articles column will not appear on the Author's Publish Index * * @since Symphony 2.3.3 * @param integer $section_id * The ID of the section * @param boolean $respect_visibility * Whether to return all the section associations regardless of if they * are deemed visible or not. Defaults to false, which will return all * associations. * @return array */ public static function fetchChildAssociations($section_id, $respect_visibility = false) { return Symphony::get('Database')->fetch( sprintf( "SELECT * FROM `tbl_sections_association` AS `sa`, `tbl_sections` AS `s` WHERE `sa`.`parent_section_id` = %d AND `s`.`id` = `sa`.`child_section_id` %s ORDER BY `s`.`sortorder` ASC ", $section_id, ($respect_visibility) ? "AND `sa`.`hide_association` = 'no'" : "" ) ); } /** * Returns any section associations this section has with other sections * linked using fields, and where this section is the child in the association. * Has an optional parameter, `$respect_visibility` that * will only return associations that are deemed visible by a field that * created the association. eg. An articles section may link to the authors * section, but the field that links these sections has hidden this association * so an Articles column will not appear on the Author's Publish Index * * @since Symphony 2.3.3 * @param integer $section_id * The ID of the section * @param boolean $respect_visibility * Whether to return all the section associations regardless of if they * are deemed visible or not. Defaults to false, which will return all * associations. * @return array */ public static function fetchParentAssociations($section_id, $respect_visibility = false) { return Symphony::get('Database')->fetch( sprintf( "SELECT * FROM `tbl_sections_association` AS `sa`, `tbl_sections` AS `s` WHERE `sa`.`child_section_id` = %d AND `s`.`id` = `sa`.`parent_section_id` %s ORDER BY `s`.`sortorder` ASC", $section_id, ($respect_visibility) ? "AND `sa`.`hide_association` = 'no'" : "" ) ); } }
designermonkey/symphony-psr
symphony/lib/SymphonyCms/Toolkit/SectionManager.php
PHP
mit
12,980
#if FILESYSTEM using System; using RoaringDB.Storage; namespace RoaringDB.Operations.Storage { internal class WriteDataOp : WriteOp { public int BitmapIndex { get; } public WriteDataOp(DbFile file, int index, byte[] data, int offset, int count) : base(file, file.Containers[index].Start, GetData(data, offset, count)) { BitmapIndex = file.Containers[index].BitmapIndex; } private static byte[] GetData(byte[] buffer, int offset, int count) { if (offset == 0 && count == buffer.Length) return buffer; else { var newBuffer = new byte[count]; Buffer.BlockCopy(buffer, offset, newBuffer, 0, count); return newBuffer; } } public override string ToString() => $"Write {Data.Length} bytes to bitmap {BitmapIndex}"; } } #endif
RogueException/RoaringDB
src/RoaringDB/Operations/Storage/WriteDataOp.cs
C#
mit
936
<!DOCTYPE html> <html lang="es"> <head> <meta name="description" content="Free Web tutorials"> <meta name="keywords" content="HTML,CSS,XML,JavaScript"> <title>Jelly Color</title> <?php include("includes/head.php"); ?> <link rel="stylesheet" href="shared/css/productoBase.css"> </head> <body > <?php include("includes/header.php"); ?> <div id="skrollr-body"> <div id="fixHeader" data-0="height:154px" data-310="height:59px"></div> <section class="topBanner" id="productoImagen"> <div class="iw"> <figure> </figure> </div> </section> <section class="fichaS"> <div class="iw"> <div class="navegacionWrapp"> <div class="navegacion"> <a href="productos.php">Productos</a> > <a href="catalogoProductos.php">Todos los productos</a> > <a href="#">Jelly color</a> </div> </div> <div class="ficha"> <h1>Jelly Color</h1> <h2>Color en gel</h2> <h3>Descripción</h3> <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut possimus fugiat quibusdam maiores. Quidem a sequi molestiae aperiam eaque dignissimos repudiandae doloribus. Laboriosam error numquam nulla. Distinctio rem dignissimos nam natus corporis dolore, porro similique fugit odio exercitationem id laborum. Consequatur molestias quia, atque beatae quo placeat labore dicta aliquid! Et hic, consequatur unde illo voluptas natus eligendi modi voluptate consequuntur reiciendis magni soluta nihil fugit totam excepturi vero, aut eveniet dignissimos animi placeat labore esse repellat. Saepe quos corrupti perferendis aut ipsam laborum quam ab unde placeat? Numquam, voluptates! </p> <div class="redesWrapp"> <img src="shared/img/redesSprite.png" width="117" alt="Pdf"> </div> </div> <aside class="fichaAdicionales"> <h3>Modo de Uso y Dosis</h3> <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae quae quis magnam ipsam fuga error veniam voluptatem velit ut. Ut perferendis deserunt iure facere. Explicabo delectus, et. Ipsa, ipsam, cum. </p> <div class="videoModule"> <h4>« videotutoriales »</h4> <a href="#" id="btnVideoreceta">ver más</a> <div class="videosWrapp"> <div class="video"> <iframe width="100%" height="auto" src="https://www.youtube.com/embed/9jgKKgNAe20?rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe> </div> <div class="video"> <iframe width="100%" height="auto" src="https://www.youtube.com/embed/IMcVUts5CxM?rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe> </div> </div> </div> <div class="catalogoModule"> <h4>« Catálogo »</h4> <div class="pdfsWrapp"> <a href="shared/pdfs/transfer_para_chocolate_2014.pdf" target="_blank"><img src="shared/img/pdf-icon.png" width="100" alt="Pdf"></a> </div> </div> </aside> </div> </section> <?php include("includes/footer.php"); ?> <script> producto = "Test Jelly color"; prodInit(); </script> </div> <!-- skrollrBody --> </body> </html>
calamaris/mabaker15
producto.php
PHP
mit
3,141
var q = require("./quasi"); exports.ps = function (opt) { opt = opt || {}; var strokeWidth = opt.strokeWidth || "0.015"; if (opt.color) console.error("The ps module does not support the `color` option."); // PS header var ret = [ "%%!PS-Adobe-1.0 " , "%%%%BoundingBox: -1 -1 766.354 567.929 " , "%%%%EndComments " , "%%%%EndProlog " , "gsave " , " " , "/f {findfont exch scalefont setfont} bind def " , "/s {show} bind def " , "/ps {true charpath} bind def " , "/l {lineto} bind def " , "/m {newpath moveto} bind def " , "/sg {setgray} bind def" , "/a {stroke} bind def" , "/cp {closepath} bind def" , "/g {gsave} bind def" , "/h {grestore} bind def" , "matrix currentmatrix /originmat exch def " , "/umatrix {originmat matrix concatmatrix setmatrix} def " , " " , "%% Flipping coord system " , "[8.35928e-09 28.3465 -28.3465 8.35928e-09 609.449 28.6299] umatrix " , "[] 0 setdash " , "0 0 0 setrgbcolor " , "0 0 m " , strokeWidth + " setlinewidth " ]; q.quasi( opt , { newPath: function () {} , moveTo: function (x, y) { ret.push(x.toFixed(2) + " " + y.toFixed(2) + " m"); } , lineTo: function (x, y) { ret.push(x.toFixed(2) + " " + y.toFixed(2) + " l"); } , closePath: function () { ret.push("cp"); } , startGroup: function () { ret.push("g"); } , endGroup: function () { ret.push("h"); } , setFillGrey: function (colour) { ret.push(colour + " sg"); ret.push("fill"); } , setStrokeGrey: function (colour) { ret.push(colour + " sg"); ret.push("a"); } // we don't take these into account , boundaries: function () {} } ); // PS Footer ret.push("showpage grestore "); ret.push("%%%%Trailer"); return ret.join("\n"); };
darobin/quasi
lib/ps.js
JavaScript
mit
2,203
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { enableProdMode } from '@angular/core'; import { environment } from './environments/environment'; import { AppModule } from './app/app.module'; if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule).catch(err => console.log(err));
shusson/sgc
src/main.ts
TypeScript
mit
368
using System; using Melanchall.DryWetMidi.Common; namespace Melanchall.DryWetMidi.Devices { /// <summary> /// Holds settings for <see cref="MidiClock"/> used by a clock driven object. /// </summary> public sealed class MidiClockSettings { #region Fields private Func<TickGenerator> _createTickGeneratorCallback = () => new HighPrecisionTickGenerator(); #endregion #region Properties /// <summary> /// Gets or sets a callback used to create tick generator for MIDI clock. /// </summary> /// <exception cref="ArgumentNullException"><paramref name="value"/> is <c>null</c>.</exception> public Func<TickGenerator> CreateTickGeneratorCallback { get { return _createTickGeneratorCallback; } set { ThrowIfArgument.IsNull(nameof(value), value); _createTickGeneratorCallback = value; } } #endregion } }
melanchall/drymidi
DryWetMidi/Devices/Clock/MidiClockSettings.cs
C#
mit
1,004
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Welcome extends CI_Controller { public function index() { $this->load->view('welcome_message'); } public function sesi() { } }
ryandwi/Codeigniter-Project
application/controllers/Welcome.php
PHP
mit
218
package com.dodola.animview; import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.text.Html; import android.util.AttributeSet; import android.widget.TextView; import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; import com.nostra13.universalimageloader.cache.memory.impl.WeakMemoryCache; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.nostra13.universalimageloader.core.assist.QueueProcessingType; /** * Created by Yaoll * Time on 2015/10/23. * Description text里插入图片实现 */ public class ImageTextView extends TextView { public ImageTextView(Context context) { super(context); } public ImageTextView(Context context, AttributeSet attrs) { super(context, attrs); } public ImageTextView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } public void setImageText(CharSequence text, String... imageUrls) { StringBuffer stringBuffer = new StringBuffer(); if(imageUrls != null) { for(String imageUrl : imageUrls) { stringBuffer.append("<img src='"); stringBuffer.append(imageUrl); stringBuffer.append("'/>"); } } stringBuffer.append(text); new ImageAsyncTask().execute(stringBuffer.toString()); } private class ImageAsyncTask extends AsyncTask<String, Void, CharSequence> { @Override protected void onPreExecute() { super.onPreExecute(); } @Override protected CharSequence doInBackground(String... params) { Html.ImageGetter imageGetter = new Html.ImageGetter() { @Override public Drawable getDrawable(String source) { Bitmap bitmap = getImageLoader().loadImageSync(source); Drawable drawable = new BitmapDrawable(getResources(), bitmap); int width = drawable.getMinimumWidth(); int height = drawable.getMinimumHeight(); int outHeight = (int) (getPaint().descent() - getPaint().ascent()); int outWidth = (width * outHeight) / height; drawable.setBounds(0, 0, outWidth, outHeight); drawable.setLevel(1); return drawable; } }; CharSequence charSequence = Html.fromHtml(params[0].toString(), imageGetter, null); return charSequence; } @Override protected void onPostExecute(CharSequence charSequence) { super.onPostExecute(charSequence); ImageTextView.super.setText(charSequence); } } private ImageLoader mImageLoader; private ImageLoader getImageLoader() { if(mImageLoader == null) { ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getContext())// .threadPriority(Thread.NORM_PRIORITY - 2) .memoryCache(new WeakMemoryCache())// .diskCacheFileNameGenerator(new Md5FileNameGenerator())// .tasksProcessingOrder(QueueProcessingType.LIFO)// .build(); mImageLoader = ImageLoader.getInstance(); mImageLoader.init(config); } return mImageLoader; } }
andylyao/ImageTextView
app/src/main/java/com/dodola/animview/ImageTextView.java
Java
mit
3,082
package view; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.Graphics; import java.awt.Image; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.util.Observable; import java.util.Observer; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JPanel; import model.BouncingProjectile; import model.FriendlyShip; import model.Projectile; import controler.GameControler; @SuppressWarnings("serial") public class WelcomePanel extends JPanel implements Observer { //Panel used to show the title and sends you to the gamepanel after you pressed enter. private MainFrame mainFrame; private GameControler controler; private boolean loadingCompleted, reloading; private JLabel loadingLabel; private Image friendlyShipImage; public WelcomePanel(MainFrame newMainFrame, GameControler newControler){ mainFrame = newMainFrame; controler = newControler; loadingCompleted = false; reloading = false; setPreferredSize(new Dimension(500,630)); setLayout(new FlowLayout()); setBackground(Color.black); JLabel titleLabel = new JLabel("WELCOME TO SPACE WARS!", JLabel.CENTER); titleLabel.setPreferredSize(new Dimension(480,60)); titleLabel.setFont(new Font("Ariel", Font.BOLD, 33)); titleLabel.setForeground(Color.red); JLabel instructionsLabel = new JLabel("<html>Fight with your battleships against the battleships of the enemy! " + "Move your ship by selecting it and move it to a location by click with the left mouse button. If you get close enaugh to an enemy, " + "then it will automaticly fire a projectile towards him. If you press with your right mouse button, " + "then a bouncing projectile will be fired. It is twice as big, bounces 3 times against the walls " + "and will stay longer in the battlefield then a regular projectile. If a ship is above the moon and fires a projectile, " + "then 8 projectiles will be shot as a bonus. You can change the speed of the game by moving the slider, " + "and enable or disable the sounds with the checkbox. You win the level if you defeat the ships of the enemy " + "before they defeat yours. If you get defeated, then you can reset the level. If you make it through all the levels, " + "then you have completed the game.</html>", JLabel.CENTER); instructionsLabel.setPreferredSize(new Dimension(480,480)); instructionsLabel.setFont(new Font("Ariel", Font.BOLD, 20)); instructionsLabel.setForeground(Color.gray); loadingLabel = new JLabel("Loading the levels...", JLabel.CENTER); loadingLabel.setPreferredSize(new Dimension(480,50)); loadingLabel.setFont(new Font("Ariel", Font.BOLD, 30)); loadingLabel.setForeground(Color.green); add(titleLabel); add(instructionsLabel); add(loadingLabel); //load friendlyShipImage friendlyShipImage = new ImageIcon("resources/chaser.png").getImage(); //start the game when the player presses enter and the loading is completed. addKeyListener(new KeyAdapter(){ public void keyPressed(KeyEvent evt){ if(evt.getKeyCode() == KeyEvent.VK_ENTER && loadingCompleted){ mainFrame.startGame(); } } }); setFocusable(true); } /*Called from mainFrame after the welcomePanel is set to visible.*/ public void startLoading(){ controler.loadLevelData(); } /*To reload te levels, some changes are needed. the reloading is used so the gamePanel * doesn;t get re-intialized again, and a different text is nicer.*/ public void prepaireReloadingLevels(){ loadingCompleted = false; reloading = true; loadingLabel.setText("Reloading the levels..."); } /*Paint the background and the ship and bouncing projectiles.*/ public void paintComponent(Graphics g){ super.paintComponent(g); try{ Projectile moon = controler.getBackgroundMoonFromBattleField(); if(moon != null){ g.setColor(moon.getProjectileColor()); g.fillOval(moon.x, moon.y, moon.width, moon.height); } for(Projectile star:controler.getBackgroundStarsFromBattleField()){ g.setColor(star.getProjectileColor()); g.fillRect(star.x, star.y, star.width, star.height); } for(BouncingProjectile shot:controler.getWelcomeAnimationBouncingProjectiles()){ g.setColor(shot.getProjectileColor()); g.fillOval(shot.x, shot.y, shot.width, shot.height); } }catch(Exception e){} FriendlyShip friendlyShip = controler.getWelcomeAnimationFriendlyShip(); g.drawImage(friendlyShipImage, friendlyShip.getLocation().x, friendlyShip.getLocation().y, null); } /*Gets called in the welcomeanimationloop and backgroundloop to repaint after a changehappened. * Also used by the controler f the battlefield has loaded the levels so the player can press enter and begin.*/ @Override public void update(Observable arg0, Object arg1) { String command = (String) arg1; if(command!=null && command.equals("levelsLoaded")){ //this panel will be reloading if the user visits the panel for the 2nd time. if(!reloading){ mainFrame.setGamePanel(controler.getAndIntializeGamePanel()); } loadingCompleted = true; reloading = false; loadingLabel.setText("Press ENTER to start the game."); } repaint(); } }
darthsitthiander/DP2-Duckhunt
Assesment/src/view/WelcomePanel.java
Java
mit
5,249
#include "fUML/Semantics/Values/impl/LiteralBooleanEvaluationImpl.hpp" #ifdef NDEBUG #define DEBUG_MESSAGE(a) /**/ #else #define DEBUG_MESSAGE(a) a #endif #ifdef ACTIVITY_DEBUG_ON #define ACT_DEBUG(a) a #else #define ACT_DEBUG(a) /**/ #endif //#include "util/ProfileCallCount.hpp" #include <cassert> #include <iostream> #include <sstream> #include "abstractDataTypes/AnyEObject.hpp" #include "abstractDataTypes/AnyEObjectBag.hpp" #include "abstractDataTypes/SubsetUnion.hpp" #include "ecore/EAnnotation.hpp" #include "ecore/EClass.hpp" #include "ecore/EAttribute.hpp" #include "ecore/EStructuralFeature.hpp" #include "ecore/ecorePackage.hpp" //Includes from codegen annotation #include "fUML/Semantics/SimpleClassifiers/BooleanValue.hpp" #include "fUML/Semantics/SimpleClassifiers/SimpleClassifiersFactory.hpp" #include "uml/LiteralBoolean.hpp" #include "primitivetypesReflection/PrimitiveTypesPackage.hpp" //Forward declaration includes #include "persistence/interfaces/XLoadHandler.hpp" // used for Persistence #include "persistence/interfaces/XSaveHandler.hpp" // used for Persistence #include <exception> // used in Persistence #include "uml/umlFactory.hpp" #include "fUML/Semantics/Loci/LociFactory.hpp" #include "fUML/Semantics/Values/LiteralEvaluation.hpp" #include "fUML/Semantics/Loci/Locus.hpp" #include "fUML/Semantics/Values/Value.hpp" #include "uml/ValueSpecification.hpp" //Factories and Package includes #include "fUML/Semantics/SemanticsPackage.hpp" #include "fUML/fUMLPackage.hpp" #include "fUML/Semantics/Loci/LociPackage.hpp" #include "fUML/Semantics/Values/ValuesPackage.hpp" #include "uml/umlPackage.hpp" using namespace fUML::Semantics::Values; //********************************* // Constructor / Destructor //********************************* LiteralBooleanEvaluationImpl::LiteralBooleanEvaluationImpl() { /* NOTE: Due to virtual inheritance, base class constrcutors may not be called correctly */ } LiteralBooleanEvaluationImpl::~LiteralBooleanEvaluationImpl() { #ifdef SHOW_DELETION std::cout << "-------------------------------------------------------------------------------------------------\r\ndelete LiteralBooleanEvaluation "<< this << "\r\n------------------------------------------------------------------------ " << std::endl; #endif } LiteralBooleanEvaluationImpl::LiteralBooleanEvaluationImpl(const LiteralBooleanEvaluationImpl & obj): LiteralBooleanEvaluationImpl() { *this = obj; } LiteralBooleanEvaluationImpl& LiteralBooleanEvaluationImpl::operator=(const LiteralBooleanEvaluationImpl & obj) { //call overloaded =Operator for each base class LiteralEvaluationImpl::operator=(obj); /* TODO: Find out if this call is necessary * Currently, this causes an error because it calls an implicit assignment operator of LiteralBooleanEvaluation * which is generated by the compiler (as LiteralBooleanEvaluation is an abstract class and does not have a user-defined assignment operator). * Implicit compiler-generated assignment operators however only create shallow copies of members, * which implies, that not a real deep copy is created when using the copy()-method. * * NOTE: Since all members are deep-copied by this assignment-operator anyway, why is it even necessary to call this implicit assignment-operator? * This is only done for ecore-models, not for UML-models. */ //LiteralBooleanEvaluation::operator=(obj); //create copy of all Attributes #ifdef SHOW_COPIES std::cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\ncopy LiteralBooleanEvaluation "<< this << "\r\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ " << std::endl; #endif //Clone Attributes with (deep copy) //copy references with no containment (soft copy) //Clone references with containment (deep copy) return *this; } std::shared_ptr<ecore::EObject> LiteralBooleanEvaluationImpl::copy() const { std::shared_ptr<LiteralBooleanEvaluationImpl> element(new LiteralBooleanEvaluationImpl()); *element =(*this); element->setThisLiteralBooleanEvaluationPtr(element); return element; } //********************************* // Operations //********************************* std::shared_ptr<fUML::Semantics::Values::Value> LiteralBooleanEvaluationImpl::evaluate() { //ADD_COUNT(__PRETTY_FUNCTION__) //generated from body annotation std::shared_ptr<fUML::Semantics::SimpleClassifiers::BooleanValue> booleanValue(fUML::Semantics::SimpleClassifiers::SimpleClassifiersFactory::eInstance()->createBooleanValue()); booleanValue->setType(PrimitiveTypes::PrimitiveTypesPackage::eInstance()->get_PrimitiveTypes_Boolean()); booleanValue->setValue(getSpecification()->booleanValue()); return booleanValue; //end of body } //********************************* // Attribute Getters & Setters //********************************* //********************************* // Reference Getters & Setters //********************************* //********************************* // Union Getter //********************************* //********************************* // Container Getter //********************************* std::shared_ptr<ecore::EObject> LiteralBooleanEvaluationImpl::eContainer() const { return nullptr; } //********************************* // Persistence Functions //********************************* void LiteralBooleanEvaluationImpl::load(std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler) { std::map<std::string, std::string> attr_list = loadHandler->getAttributeList(); loadAttributes(loadHandler, attr_list); // // Create new objects (from references (containment == true)) // // get fUMLFactory int numNodes = loadHandler->getNumOfChildNodes(); for(int ii = 0; ii < numNodes; ii++) { loadNode(loadHandler->getNextNodeName(), loadHandler); } } void LiteralBooleanEvaluationImpl::loadAttributes(std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler, std::map<std::string, std::string> attr_list) { LiteralEvaluationImpl::loadAttributes(loadHandler, attr_list); } void LiteralBooleanEvaluationImpl::loadNode(std::string nodeName, std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler) { //load BasePackage Nodes LiteralEvaluationImpl::loadNode(nodeName, loadHandler); } void LiteralBooleanEvaluationImpl::resolveReferences(const int featureID, std::vector<std::shared_ptr<ecore::EObject> > references) { LiteralEvaluationImpl::resolveReferences(featureID, references); } void LiteralBooleanEvaluationImpl::save(std::shared_ptr<persistence::interfaces::XSaveHandler> saveHandler) const { saveContent(saveHandler); LiteralEvaluationImpl::saveContent(saveHandler); EvaluationImpl::saveContent(saveHandler); fUML::Semantics::Loci::SemanticVisitorImpl::saveContent(saveHandler); ecore::EObjectImpl::saveContent(saveHandler); } void LiteralBooleanEvaluationImpl::saveContent(std::shared_ptr<persistence::interfaces::XSaveHandler> saveHandler) const { try { std::shared_ptr<fUML::Semantics::Values::ValuesPackage> package = fUML::Semantics::Values::ValuesPackage::eInstance(); } catch (std::exception& e) { std::cout << "| ERROR | " << e.what() << std::endl; } } std::shared_ptr<ecore::EClass> LiteralBooleanEvaluationImpl::eStaticClass() const { return fUML::Semantics::Values::ValuesPackage::eInstance()->getLiteralBooleanEvaluation_Class(); } //********************************* // EStructuralFeature Get/Set/IsSet //********************************* Any LiteralBooleanEvaluationImpl::eGet(int featureID, bool resolve, bool coreType) const { switch(featureID) { } return LiteralEvaluationImpl::eGet(featureID, resolve, coreType); } bool LiteralBooleanEvaluationImpl::internalEIsSet(int featureID) const { switch(featureID) { } return LiteralEvaluationImpl::internalEIsSet(featureID); } bool LiteralBooleanEvaluationImpl::eSet(int featureID, Any newValue) { switch(featureID) { } return LiteralEvaluationImpl::eSet(featureID, newValue); } //********************************* // EOperation Invoke //********************************* Any LiteralBooleanEvaluationImpl::eInvoke(int operationID, std::shared_ptr<std::list<Any>> arguments) { Any result; switch(operationID) { // fUML::Semantics::Values::LiteralBooleanEvaluation::evaluate() : fUML::Semantics::Values::Value: 216489190 case ValuesPackage::LITERALBOOLEANEVALUATION_OPERATION_EVALUATE: { result = eAnyObject(this->evaluate(), fUML::Semantics::Values::ValuesPackage::VALUE_CLASS); break; } default: { // call superTypes result = LiteralEvaluationImpl::eInvoke(operationID, arguments); if (result && !result->isEmpty()) break; break; } } return result; } std::shared_ptr<fUML::Semantics::Values::LiteralBooleanEvaluation> LiteralBooleanEvaluationImpl::getThisLiteralBooleanEvaluationPtr() const { return m_thisLiteralBooleanEvaluationPtr.lock(); } void LiteralBooleanEvaluationImpl::setThisLiteralBooleanEvaluationPtr(std::weak_ptr<fUML::Semantics::Values::LiteralBooleanEvaluation> thisLiteralBooleanEvaluationPtr) { m_thisLiteralBooleanEvaluationPtr = thisLiteralBooleanEvaluationPtr; setThisLiteralEvaluationPtr(thisLiteralBooleanEvaluationPtr); }
MDE4CPP/MDE4CPP
src/fuml/src_gen/fUML/Semantics/Values/impl/LiteralBooleanEvaluationImpl.cpp
C++
mit
9,205
print('this is a'); print(__FILE__, __LINE__, __DIR__); load('./b.js'); // 不能简单的加载同目录的 b,因为 engine.get(FILENAME) 未变
inshua/d2js
test/load_test/a.js
JavaScript
mit
148
using Microsoft.Azure.Mobile.Server; namespace myshoppe_demoService.DataObjects { public class Store : EntityData { public string Name { get; set; } public string LocationHint { get; set; } public string StreetAddress { get; set; } public string City { get; set; } public string State { get; set; } public string ZipCode { get; set; } public string Image { get; set; } public double Latitude { get; set; } public double Longitude { get; set; } public string MondayOpen { get; set; } public string MondayClose { get; set; } public string TuesdayOpen { get; set; } public string TuesdayClose { get; set; } public string WednesdayOpen { get; set; } public string WednesdayClose { get; set; } public string ThursdayOpen { get; set; } public string ThursdayClose { get; set; } public string FridayOpen { get; set; } public string FridayClose { get; set; } public string SaturdayOpen { get; set; } public string SaturdayClose { get; set; } public string SundayOpen { get; set; } public string SundayClose { get; set; } public string PhoneNumber { get; set; } public string Country { get; set; } public string LocationCode { get; set; } } }
jamesmontemagno/MyShoppe
Backend/myshoppe_demoService/DataObjects/Store.cs
C#
mit
1,364
/* * Array2D.java Jul 14, 2004 * * Copyright (c) 2004 Stan Salvador * stansalvador@hotmail.com */ package com.tum.ident.fastdtw.matrix; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; public class Array2D { // PRIVATE DATA final private ArrayList<ArrayList<Object>> rows; // ArrayList of ArrayList (an array of rows in the array) private int numOfElements; // CONSTRUCTOR public Array2D() { rows = new ArrayList<ArrayList<Object>>(); numOfElements = 0; } public Array2D(Array2D array) { this.rows = new ArrayList<ArrayList<Object>>(array.rows); this.numOfElements = array.numOfElements; } // PUBLIC FU?NCTIONS public void clear() { rows.clear(); numOfElements = 0; } public int size() { return numOfElements; } public int numOfRows() { return rows.size(); } public int getSizeOfRow(int row) { return rows.get(row).size(); } public Object get(int row, int col) { return rows.get(row).get(col); } public void set(int row, int col, Object newVal) { rows.get(row).set(col, newVal); } public void addToEndOfRow(int row, Object value) { rows.get(row).add(value); numOfElements++; } public void addAllToEndOfRow(int row, Collection<?> objects) { final Iterator<?> i = objects.iterator(); while (i.hasNext()) { rows.get(row).add(i.next()); numOfElements++; } } public void addToNewFirstRow(Object value) { final ArrayList<Object> newFirstRow = new ArrayList<Object>(1); newFirstRow.add(value); rows.add(0, newFirstRow); numOfElements++; } public void addToNewLastRow(Object value) { final ArrayList<Object> newLastRow = new ArrayList<Object>(1); newLastRow.add(value); rows.add(newLastRow); numOfElements++; } public void addAllToNewLastRow(Collection<?> objects) { final Iterator<?> i = objects.iterator(); final ArrayList<Object> newLastRow = new ArrayList<Object>(1); while (i.hasNext()) { newLastRow.add(i.next()); numOfElements++; } rows.add(newLastRow); } public void removeFirstRow() { numOfElements -= rows.get(0).size(); rows.remove(0); } public void removeLastRow() { numOfElements -= rows.get(rows.size()-1).size(); rows.remove(rows.size()-1); } public String toString() { String outStr = ""; for (int r=0; r<rows.size(); r++) { final ArrayList<?> currentRow = rows.get(r); for (int c=0; c<currentRow.size(); c++) { outStr += currentRow.get(c); if (c == currentRow.size()-1) outStr += "\n"; else outStr += ","; } } // end for return outStr; } } // end class matrix.Array2D
androididentification/android
servlet/src/com/tum/ident/fastdtw/matrix/Array2D.java
Java
mit
3,000
class CreateBanksTable < ActiveRecord::Migration def change create_table :banks do |t| t.references :agendas t.references :users t.timestamps end end end
JupiterLikeThePlanet/Travel-Agenda-Thing
db/migrate/20151123162028_create_banks_table.rb
Ruby
mit
184
require 'spec_helper' ######################################### #Defines a model class which implements the status bar gem. class MyClass < ActiveRecord::Base # Helper which makes all the status_bar functions available. acts_as_status_bar MAX = 100 def save end #Initializes an object and its relative status bar passing its id as an options hash def initialize(*args) options = args.extract_options! status_bar_id = options.delete(:status_bar_id) if options[:status_bar_id] puts"\n\nstatus_bar_id = #{status_bar_id}" self.status_bar = ActsAsStatusBar::StatusBar.new(:id => @status_bar_id) # super end def destroy # status_bar_init(self) bar = status_bar_init(self) do self.delete end end # def clear_bar # status_bar.delete # end end ######################################### describe ActsAsStatusBar do it "should be valid" do ActsAsStatusBar.should be_a(Module) end end describe ActsAsStatusBar::StatusBar do let(:status_bar) { ActsAsStatusBar::StatusBar.new(:id => 1) } let(:object) { MyClass.new(:status_bar_id => status_bar.id) } it "should be valid" do ActsAsStatusBar::StatusBar.should be_a(Class) status_bar.should be_valid end it "should be assigned correctly" do #I'm incrementing the status bar 'current' attribute by the value of 10. status_bar.inc(10) #I'm assuring status_bar and object_status_bar both refer to the really same bar #checking that 'current' attribute was incremented. status_bar.current.should equal(object.status_bar.current) end it "should be deleted once the parent object is saved" do object.save object.status_bar.should be nil end it "should be deleted once the parent object is destroyed" do object.destroy object.status_bar.should be nil end # it "should assign the right id to #status_bar_id method" do # object.status_bar_id.should equal(object.status_bar.id) # end # it "should be destroyed by destroying the parent object" do # object.destroy!.should be_true, object.errors # object.status_bar.should be nil # end end
skylord73/acts_as_status_bar
spec/acts_as_status_bar_spec.rb
Ruby
mit
2,161
import PropTypes from 'prop-types'; export const validAxisType = PropTypes.oneOf([ 'category', 'linear', 'logarithmic', 'datetime' ]); export const validChartType = PropTypes.oneOf([ 'area', 'arearange', 'areaspline', 'areasplinerange', 'bar', 'boxplot', 'bubble', 'candlestick', 'column', 'columnrange', 'errorbar', 'flags', 'funnel', 'line', 'ohlc', 'pie', 'polygon', 'pyramid', 'scatter', 'solidgauge', 'spline', 'waterfall' ]);
govau/datavizkit
src/helpers/propsValidators.js
JavaScript
mit
486
require 'pry' require 'active_record' ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:" ActiveRecord::Schema.define do self.verbose = false create_table :orders, :force => true do |t| t.timestamps t.string :dummy end create_table :order_items, :force => true do |t| t.integer :order_id t.timestamps end end class Order < ActiveRecord::Base has_many :order_items end class OrderItem < ActiveRecord::Base belongs_to :order end
optoro/composable_fixtures
spec/support/active_record.rb
Ruby
mit
494
<div class="content"> <div class="categories"> <div class="container"> <?php foreach ($categories as $category):?> <div class="col-md-2 focus-grid"> <a href="<?php echo base_url()."index.php/middleware/categories/".$this->encrypt->encode($category->ProductCategoryID)?>"> <div class="focus-border"> <div class="focus-layout"> <div class="focus-image"><i class="<?php echo $category->Fa?>"></i></div> <h4 class="clrchg"><?php echo $category->Name?></h4> </div> </div> </a> </div> <?php endforeach;?> <div class="clearfix"></div> </div> </div>
Situma/okos
application/views/home/categories.php
PHP
mit
662
/** * Fixes/updates/deletes existing adapter objects, * so they don't have to be deleted manually */ export declare function fixAdapterObjects(): Promise<void>; export declare function ensureInstanceObjects(): Promise<void>;
AlCalzone/iobroker.tradfri
build/lib/fix-objects.d.ts
TypeScript
mit
228
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ var Line = require('./Line'); Line.Angle = require('./Angle'); Line.BresenhamPoints = require('./BresenhamPoints'); Line.CenterOn = require('./CenterOn'); Line.Clone = require('./Clone'); Line.CopyFrom = require('./CopyFrom'); Line.Equals = require('./Equals'); Line.Extend = require('./Extend'); Line.GetMidPoint = require('./GetMidPoint'); Line.GetNearestPoint = require('./GetNearestPoint'); Line.GetNormal = require('./GetNormal'); Line.GetPoint = require('./GetPoint'); Line.GetPoints = require('./GetPoints'); Line.GetShortestDistance = require('./GetShortestDistance'); Line.Height = require('./Height'); Line.Length = require('./Length'); Line.NormalAngle = require('./NormalAngle'); Line.NormalX = require('./NormalX'); Line.NormalY = require('./NormalY'); Line.Offset = require('./Offset'); Line.PerpSlope = require('./PerpSlope'); Line.Random = require('./Random'); Line.ReflectAngle = require('./ReflectAngle'); Line.Rotate = require('./Rotate'); Line.RotateAroundPoint = require('./RotateAroundPoint'); Line.RotateAroundXY = require('./RotateAroundXY'); Line.SetToAngle = require('./SetToAngle'); Line.Slope = require('./Slope'); Line.Width = require('./Width'); module.exports = Line;
englercj/phaser
src/geom/line/index.js
JavaScript
mit
1,403
'use strict'; // User routes use users controller var users = require('../controllers/users'); module.exports = function(app, passport) { app.route('/logout') .get(users.signout); app.route('/users/me') .get(users.me); // Setting up the users api app.route('/register') .post(users.create); // Setting up the userId param app.param('userId', users.user); // AngularJS route to check for authentication app.route('/loggedin') .get(function(req, res) { res.send(req.isAuthenticated() ? req.user : '0'); }); // Setting the local strategy route app.route('/login') .post(passport.authenticate('local', { failureFlash: true }), function(req, res) { res.send({ user: req.user, redirect: (req.user.roles.indexOf('admin') !== -1) ? req.get('referer') : false }); }); };
dflynn15/flomo
server/routes/users.js
JavaScript
mit
953